
:root {
  --ti-red: #cc0000;
  --ti-red-dark: #a30000;
  --ti-red-light: #fbeaea;
  --ink: #1a1a1a;
  --ink-2: #4d4d4d;
  --ink-3: #8a8a8a;
  --line: #e5e5e5;
  --bg: #f7f7f8;
  --card: #ffffff;
  --green: #1a7f37;
  --green-bg: #e6f4ea;
  --yellow: #9a6700;
  --yellow-bg: #fff8e0;
  --red: #cc0000;
  --red-bg: #fdecec;
  --gray: #6e7781;
  --gray-bg: #eff1f3;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 14px rgba(0,0,0,.05);
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.6; }
a { color: var(--ti-red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
code, .mono { font-family: Consolas, "Courier New", monospace; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }


.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font);
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap; user-select: none; line-height: 1.4;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--ti-red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--ti-red-dark); }
.btn-outline { background: #fff; color: var(--ti-red); border-color: var(--ti-red); }
.btn-outline:hover:not(:disabled) { background: var(--ti-red-light); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink); }
.btn-danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-bg); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 13px 30px; font-size: 16px; border-radius: 10px; }
.btn-block { width: 100%; }


.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }


.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field label .req { color: var(--ti-red); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: var(--font); color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ti-red); box-shadow: 0 0 0 3px rgba(204,0,0,.10); }
.input::placeholder, .textarea::placeholder { color: #b5b5b5; }
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.form-row { display: grid; gap: 12px; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.phone-group { display: flex; gap: 8px; }
.phone-group .phone-code { flex: 0 0 96px; text-align: center; background: var(--bg); color: var(--ink-2); font-weight: 600; }
.phone-group .input { flex: 1; }


.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cbd0d6; border-radius: 22px; cursor: pointer; transition: background .2s; }
.switch .slider::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--ti-red); }
.switch input:checked + .slider::before { transform: translateX(18px); }


.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.dot.green { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.dot.yellow { background: #e3a008; box-shadow: 0 0 0 3px var(--yellow-bg); }
.dot.red { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.dot.gray, .dot.unknown { background: #9aa1a9; box-shadow: 0 0 0 3px var(--gray-bg); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.7; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.gray { background: var(--gray-bg); color: var(--gray); }
.badge.red-solid { background: var(--ti-red); color: #fff; }


.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 11px 14px; background: #fafafa; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fafbfc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }


.toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 20px; border-radius: 8px; color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.18); animation: toastIn .25s ease; max-width: 90vw; }
.toast.ok { background: #24292f; }
.toast.err { background: var(--ti-red); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert.err { background: var(--red-bg); color: var(--red); border: 1px solid #f3c2c2; }
.alert.info { background: #eef4ff; color: #1d4ed8; border: 1px solid #cfdefc; }


.modal-mask { position: fixed; inset: 0; background: rgba(20,20,20,.45); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .15s ease; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; box-shadow: 0 18px 50px rgba(0,0,0,.25); animation: popIn .18s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 16px 22px 22px; }
.modal-x { background: none; border: none; font-size: 22px; color: var(--ink-3); cursor: pointer; line-height: 1; padding: 4px; }
.modal-x:hover { color: var(--ink); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.97) translateY(6px); } }


.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo .lg-sub { font-size: 12px; color: var(--ink-3); font-weight: 600; letter-spacing: .12em; }


.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty .big { font-size: 34px; margin-bottom: 8px; }

.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
.spin.dark { border-color: rgba(0,0,0,.15); border-top-color: var(--ti-red); }
@keyframes rot { to { transform: rotate(360deg); } }


.card-list { display: grid; gap: 12px; }
.li-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 18px; }
.li-head { display: flex; align-items: flex-start; gap: 12px; }
.li-head-main { flex: 1; min-width: 0; }
.li-title { font-weight: 700; font-size: 15px; line-height: 1.35; word-break: break-all; }
.li-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.li-sub b { color: var(--ink-2); }
.li-badges { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.li-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; font-size: 12px; color: var(--ink-3); }
.chip b { color: var(--ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chip-edit { display: inline-flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px 4px 10px; font-size: 12px; color: var(--ink-3); }
.chip-edit .input { width: 78px; padding: 3px 8px; font-size: 13px; border-radius: 6px; }
.li-line { margin-top: 10px; font-size: 13px; color: var(--ink-2); word-break: break-all; }
.li-line .lab { color: var(--ink-3); }
.li-note { margin-top: 10px; padding: 7px 12px; border-radius: 8px; font-size: 12.5px; }
.li-note.err { background: var(--red-bg); color: #c23030; border: 1px solid #f3c2c2; }
.li-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.li-meta { font-size: 12px; color: var(--ink-3); }
.li-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.li-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: 0 0 auto; display: block; }
.li-noimg { width: 52px; height: 52px; border-radius: 8px; background: var(--gray-bg); display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 11px; flex: 0 0 auto; }
.badge.blue { background: #e8f1fd; color: #1d4ed8; }

@media (max-width: 640px) {
  .li-card { padding: 12px 14px; }
  .li-foot { flex-direction: column-reverse; align-items: stretch; }
  .li-foot .li-actions { justify-content: flex-end; }
  .li-badges { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .wrap { padding: 0 14px; }
}
