:root {
  --ink: #262328;
  --muted: #737078;
  --line: #e7e4eb;
  --paper: #fbfafc;
  --card: #ffffff;
  --green: #7257f5;
  --green-dark: #563bd6;
  --green-soft: #eeebff;
  --amber: #8a6410;
  --amber-soft: #fff4cf;
  --red: #b54861;
  --red-soft: #ffe9ef;
  --blue-soft: #e9f3ff;
  --pink-soft: #ffeef4;
  --button: #333133;
  --shadow: 0 18px 50px rgba(39, 31, 54, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 88% 2%, #eee9ff 0, transparent 28%), radial-gradient(circle at 8% 28%, #fff0f6 0, transparent 24%), var(--paper); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.sim-banner { min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 8px 18px; background: #eeeaff; color: #4d3ca0; border-bottom: 1px solid #ded6ff; font-size: 13px; font-weight: 600; letter-spacing: .01em; text-align: center; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #7257f5; box-shadow: 0 0 0 5px rgba(114, 87, 245, .13); }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; border-bottom: 1px solid rgba(231,228,235,.9); background: rgba(255,255,255,.9); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #8d79ff, #6548e8); color: #fff; font-weight: 800; font-size: 19px; box-shadow: inset 0 1px rgba(255,255,255,.35), 0 6px 16px rgba(91,65,210,.2); transform: rotate(-3deg); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 19px; letter-spacing: .06em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.top-actions, .page-actions { display: flex; align-items: center; gap: 10px; }

.auth-shell { max-width: 1160px; margin: 42px auto 70px; padding: 0 24px; display: grid; grid-template-columns: 1.12fr .88fr; gap: 26px; }
.auth-hero { min-height: 540px; }
.auth-card { padding: 42px; display: flex; flex-direction: column; justify-content: center; }
.auth-tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.auth-tabs .text-button { padding: 10px 4px; border-bottom: 3px solid transparent; }
.auth-tabs .text-button.active { border-bottom-color: var(--green); }
.auth-card h2 { margin: 2px 0 20px; }
.auth-card label, #contactForm label, #securityView label { display: block; font-size: 13px; font-weight: 700; margin: 16px 0; }
.muted { color: var(--muted); }
.small-copy { font-size: 12px; line-height: 1.6; margin-top: 22px; }

.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 150px); }
.sidebar { border-right: 1px solid var(--line); padding: 24px 14px; background: rgba(247,245,252,.88); }
.nav { width: 100%; border: 0; border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; background: transparent; color: #56615c; font-weight: 650; margin-bottom: 6px; text-align: left; }
.nav span { width: 22px; text-align: center; }
.nav span { height: 22px; display: grid; place-items: center; }
.nav span svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav:hover { background: #f0edf8; color: #4b4550; }
.nav.active { background: #fff; color: #5e46d6; box-shadow: 0 1px 3px rgba(54,45,66,.08), 0 0 0 1px rgba(222,217,230,.7); }
.sidebar-note { margin-top: 30px; padding: 16px; border: 1px solid #ead5b4; background: #fff8ed; border-radius: 14px; }
.sidebar-note strong { display: block; margin-bottom: 10px; }
.sidebar-note p { color: #725f42; font-size: 12px; line-height: 1.6; margin-bottom: 0; }
.danger-dot { color: var(--red); font-weight: 750; font-size: 13px; }
.danger-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--red); margin-right: 7px; }
.ready-dot { color: var(--green); font-weight: 750; font-size: 13px; }
.ready-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--green); margin-right: 7px; }
.real-banner { background: #eeeaff; }
.admin-link { text-decoration: none; }

.content { padding: 34px clamp(22px, 4vw, 58px) 60px; min-width: 0; }
.pairing-layout { max-width: 1160px; margin: 26px auto; display: grid; grid-template-columns: 1.12fr .88fr; gap: 26px; align-items: stretch; }
.hero-card { min-height: 520px; border: 1px solid #ded7fa; border-radius: 28px; padding: 58px; color: var(--ink); background: radial-gradient(circle at 82% 18%, rgba(255,255,255,.75) 0 8%, transparent 9%), radial-gradient(circle at 90% 76%, #ffddec 0 12%, transparent 13%), linear-gradient(145deg, #eae4ff 0%, #f7f3ff 52%, #e8f4ff 100%); box-shadow: 0 24px 60px rgba(68,48,110,.11); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.hero-card h1 { font-size: clamp(38px, 4.2vw, 58px); line-height: 1.08; margin: 12px 0 24px; letter-spacing: -.04em; }
.lead { max-width: 620px; color: #625d68; line-height: 1.75; font-size: 16px; }
.security-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.security-row span { border: 1px solid rgba(99,76,196,.14); background: rgba(255,255,255,.65); border-radius: 999px; padding: 8px 11px; font-size: 12px; }
.card { background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: 0 6px 22px rgba(47,39,58,.045); }
.pairing-card { display: flex; flex-direction: column; justify-content: center; padding: 42px; }
.pairing-card h2 { font-size: 30px; margin: 8px 0 14px; }
.pairing-card p { color: var(--muted); line-height: 1.7; }
.step-label, .eyebrow { color: var(--green); letter-spacing: .14em; font-weight: 800; font-size: 11px; text-transform: uppercase; }
.button { width: 148px; height: 42px; border: 0; border-radius: 9px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; white-space: nowrap; font-size: 14px; font-weight: 650; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--button); color: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.75), 0 1px 3px rgba(0,0,0,.35), 1px 4px 8px rgba(0,0,0,.12); }
.button.primary:hover { background: #1f1d20; }
.button.secondary { background: var(--green-soft); color: var(--green-dark); }
.button.success { background: #7257f5; color: #fff; box-shadow: 0 6px 14px rgba(114,87,245,.2); }
.button.ghost { background: transparent; border: 1px solid var(--line); color: #58635e; }
.button.danger { background: var(--red-soft); color: var(--red); }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.auth-card form > .button, .pairing-card > .button, .fingerprint > .button { margin-top: 16px; }
.pairing-code { margin-top: 24px; background: #f0f6f2; border-radius: 16px; padding: 20px; text-align: center; }
.pairing-code small, .pairing-code span { display: block; color: var(--muted); }
.pairing-code strong { display: block; letter-spacing: .2em; font-size: 32px; margin: 8px 0; }
.fingerprint { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.fingerprint code { display: block; background: #17231e; color: #e9fff3; padding: 16px; border-radius: 12px; text-align: center; letter-spacing: .13em; font-size: 15px; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; }
.page-heading h1 { font-size: 34px; margin: 6px 0 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.metric-card { min-height: 150px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 3px 14px rgba(42,34,53,.035); }
.metric-card strong { font-size: 26px; }
.metric-card small, .metric-label { color: var(--muted); }
.metric-label { font-size: 13px; font-weight: 700; }
.status-card { background: linear-gradient(145deg, #755cf1, #5f45d6); color: #fff; border-color: #674ce0; }
.status-card.offline { background:linear-gradient(145deg,#d94b4b,#a91f2b); border-color:#a91f2b; }
.status-card .metric-label, .status-card small { color: #e6e0ff; }
.danger-text { color: var(--red); }
.two-column { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; margin-top: 16px; }
.card-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.card-header h2 { margin: 4px 0 0; }
.text-button { border: 0; background: transparent; color: var(--green); font-weight: 750; padding: 6px; }
.pill { border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.pill.muted { background: #eef1ef; color: #66716c; }
.pill.good { background: var(--green-soft); color: var(--green-dark); }
.pill.warning { background: var(--amber-soft); color: var(--amber); }
.pill.bad { background: var(--red-soft); color: var(--red); }
.message-list { display: grid; gap: 10px; }
.history-toolbar { min-height: 58px; margin: -4px 0 12px; padding: 8px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.history-toolbar label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.history-toolbar input, .history-select input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.history-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: center; }
.history-select { min-height: 42px; display: grid; place-items: center; cursor: pointer; }
.history-row .message-item { min-width: 0; }
.message-item { padding: 14px 0; border-bottom: 1px solid #edf0ee; display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: start; }
.message-item:last-child { border-bottom: 0; }
.message-clickable { width: 100%; color: inherit; background: transparent; border-left: 0; border-right: 0; border-top: 0; text-align: left; cursor: pointer; }
.message-clickable:hover, .message-clickable:focus-visible { background: #f7f4ff; outline: 2px solid #bdb0ff; outline-offset: 2px; border-radius: 12px; }
.message-item.outbound .avatar { color: #fff; background: var(--green); }
.message-status { color: var(--green-dark) !important; font-size: 12px; font-weight: 700; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--green-dark); background: var(--green-soft); font-weight: 800; }
.message-main strong, .message-main span { display: block; }
.message-main span { color: #55605b; margin-top: 4px; line-height: 1.5; word-break: break-word; }
.message-item time { color: var(--muted); font-size: 11px; }
.empty-state { color: var(--muted); padding: 28px 0; text-align: center; }
.status-list { margin: 0; }
.status-list div { display: flex; justify-content: space-between; gap: 24px; padding: 11px 0; border-bottom: 1px solid #edf0ee; }
.status-list div:last-child { border: 0; }
.status-list dt { color: var(--muted); }
.status-list dd { margin: 0; font-weight: 650; text-align: right; }
.message-workspace { grid-template-columns: 1.1fr .9fr; }
.reply-card label { display: block; font-size: 13px; font-weight: 700; margin: 18px 0; }
input, textarea, select { width: 100%; border: 1px solid #dedbe2; border-radius: 9px; padding: 11px 12px; margin-top: 7px; color: var(--ink); background: #fff; box-shadow: inset 0 1px 2px rgba(27,23,31,.03); }
.confirm-row { display: flex !important; gap: 9px; align-items: flex-start; color: #725f42; line-height: 1.45; }
.confirm-row input { width: auto; margin-top: 2px; accent-color: var(--green); }
.send-action { margin-top: 14px; }
input:focus, textarea:focus, select:focus { outline: 3px solid #e4deff; border-color: #8c76f5; }
.reply-card p { color: var(--muted); line-height: 1.6; }
.command-result { margin-top: 14px; background: #f3f5f3; border-radius: 10px; padding: 12px; color: #5e6964; font-size: 13px; }
.offline-alert { margin:0 0 18px; padding:16px 18px; color:#8d1d1d; background:#fff0f0; border:1px solid #efb3b3; border-left:5px solid #d83b3b; border-radius:12px; font-weight:700; line-height:1.55; box-shadow:0 5px 18px rgba(151,32,32,.08); }
.security-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.device-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.device-grid div { background: #fff; padding: 16px; min-height: 88px; }
.device-grid dt { color: var(--muted); font-size: 12px; }
.device-grid dd { margin: 8px 0 0; font-weight: 750; word-break: break-word; }
.boundary-note { margin-top: 22px; padding: 18px; border-left: 4px solid var(--amber); background: #fff7eb; border-radius: 8px 14px 14px 8px; }
.boundary-note p { color: #725f42; margin-bottom: 0; line-height: 1.7; }
.timeline { display: grid; gap: 0; }
.timeline-item { padding: 15px 0 15px 24px; border-left: 2px solid var(--line); position: relative; }
.timeline-item::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 3px solid white; box-shadow: 0 0 0 1px var(--green); position: absolute; left: -6px; top: 20px; }
.timeline-item strong { display: block; }
.timeline-item span { color: var(--muted); font-size: 12px; }
.test-payment-banner { margin-bottom: 16px; padding: 14px 18px; display: flex; align-items: center; gap: 12px; border: 1px solid #e9c98e; border-radius: 14px; color: #704b12; background: #fff6e5; }
.test-payment-banner strong { flex: 0 0 auto; }
.test-payment-banner span { font-size: 13px; }
.billing-workspace { align-items: stretch; }
.billing-records { grid-template-columns: 1fr 1fr; }
.recharge-card h2 { margin: 4px 0 6px; }
.recharge-card form > label { display: block; margin: 18px 0; font-size: 13px; font-weight: 700; }
.recharge-card fieldset { margin: 20px 0 0; padding: 0; border: 0; }
.recharge-card legend { margin-bottom: 10px; font-size: 13px; font-weight: 700; }
.amount-presets { display: flex; flex-wrap: wrap; gap: 10px; }
.amount-option { width: 148px; height: 42px; border: 1px solid var(--line); border-radius: 12px; color: var(--green-dark); background: #fff; font-weight: 800; }
.amount-option:hover, .amount-option.active { color: #fff; border-color: var(--green); background: var(--green); }
.payment-method { margin: 18px 0; padding: 15px; display: grid; grid-template-columns: 1fr auto; gap: 5px 16px; border: 1px solid var(--line); border-radius: 13px; background: #f8faf8; }
.payment-method span, .payment-method small { color: var(--muted); font-size: 12px; }
.payment-method small { grid-column: 1 / -1; }
.checkout-card { display: flex; flex-direction: column; }
.checkout-empty { min-height: 145px; display: grid; place-items: center; padding: 25px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.order-summary { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.order-summary div { padding: 12px 14px; display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid #edf0ee; }
.order-summary div:last-child { border: 0; }
.order-summary span { color: var(--muted); font-size: 12px; }
.order-summary strong, .order-summary code { text-align: right; word-break: break-all; }
.checkout-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.timeline-item .record-meta { margin-top: 5px; display: block; line-height: 1.65; }
.timeline-item code { color: var(--green-dark); font-size: 11px; word-break: break-all; }
.billing-order-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.billing-order-row > div { min-width: 0; }
.record-label { margin-left: 6px; padding: 2px 6px; border-radius: 999px; color: #76500f; background: #fff1d4; font-size: 10px; }
.record-label.real { color: var(--green-dark); background: var(--green-soft); }
.contact-list { display: grid; gap: 10px; }
.contact-item { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf0ee; }
.contact-item:last-child { border: 0; }
.contact-item strong, .contact-item small { display: block; }
.contact-item small { color: var(--muted); margin-top: 4px; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; right: 26px; top: 122px; z-index: 20; max-width: 420px; padding: 13px 16px; color: #fff; background: #333133; border-radius: 10px; box-shadow: 0 16px 40px rgba(34,29,38,.2); opacity: 0; transform: translateY(-8px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: none; }
footer { border-top: 1px solid var(--line); padding: 20px; color: var(--muted); text-align: center; font-size: 12px; background: #fff; }

@media (max-width: 1020px) {
  .shell { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { padding: 24px 10px; }
  .nav { justify-content: center; padding: 12px 8px; font-size: 0; }
  .nav span { font-size: 18px; }
  .sidebar-note { display: none; }
  .pairing-layout { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .hero-card { min-height: 360px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .top-actions .button { display: none; }
  .top-actions #logoutButton { display: inline-block; padding: 9px 11px; }
  .top-actions #accountEmail { display: none; }
  .shell { display: block; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 15; border: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(8,1fr); background: #fff; padding: 8px 4px; }
  .nav { margin: 0; flex-direction: column; gap: 3px; font-size: 10px; }
  .nav span { font-size: 17px; }
  .content { padding: 22px 16px 100px; }
  .auth-shell { margin: 22px auto 50px; padding: 0 16px; }
  .auth-card { padding: 28px 22px; }
  .pairing-layout { margin: 0; }
  .hero-card { padding: 34px 26px; min-height: 330px; }
  .hero-card h1 { font-size: 38px; }
  .pairing-card { padding: 28px 22px; }
  .page-heading { display: block; }
  .page-actions { margin-top: 16px; }
  .metric-grid, .two-column, .message-workspace { grid-template-columns: 1fr; }
  .billing-records { grid-template-columns: 1fr; }
  .test-payment-banner { align-items: flex-start; flex-direction: column; }
  .history-toolbar { align-items: flex-start; flex-direction: column; }
  .contact-item { grid-template-columns: 1fr; }
  .contact-actions { justify-content: flex-start; }
  .device-grid { grid-template-columns: repeat(2, 1fr); }
  footer { padding-bottom: 90px; }
}

/* 2026-08 蓝色城市展示体系：客户端 */
:root { --green:#1597d1; --green-dark:#0879ad; --green-soft:#e2f5fd; --paper:#f6fbfd; --line:#dce7ec; --amber:#8a6200; --amber-soft:#fff4ce; }
body { background: radial-gradient(circle at 90% 0, #dff4fc 0, transparent 30%), var(--paper); }
.sim-banner, .real-banner { color:#145a78; background:#dff3fb; border-color:#c8e8f5; }
.pulse { background:#1597d1; box-shadow:0 0 0 5px rgba(21,151,209,.13); }
.brand-mark { color:#26272a; background:#ffcb3f; box-shadow:inset 0 1px rgba(255,255,255,.5),0 6px 16px rgba(185,133,0,.18); }
.auth-hero, .hero-card { background:linear-gradient(rgba(28,161,220,.76),rgba(25,154,211,.72)),url("./official/assets/hero-china-anime-v2.png") center/cover no-repeat; color:#fff; border-color:#9bd6ef; }
.hero-card .eyebrow, .hero-card .lead, .auth-hero .eyebrow, .auth-hero .lead { color:#fff; text-shadow:0 1px 8px rgba(0,72,110,.2); }
.security-row span { color:#25343b; border-color:rgba(255,255,255,.65); background:rgba(255,255,255,.74); }
.sidebar { background:rgba(238,248,252,.94); }
.nav:hover { color:#185a76; background:#e4f4fa; }
.nav.active { color:#0879ad; }
.status-card { color:#fff; border-color:#0986bd; background:linear-gradient(145deg,#1ca7df,#087faf); }
.status-card.offline { color:#fff; border-color:#a91f2b; background:linear-gradient(145deg,#d94b4b,#a91f2b); }
.status-card .metric-label,.status-card small { color:#dff5ff; }
.button.secondary { color:#252527; background:#ffcb3f; }
.button.success { background:#1597d1; box-shadow:0 6px 14px rgba(21,151,209,.2); }
input:focus,textarea:focus,select:focus { outline-color:#d9f2fc; border-color:#1597d1; }
.message-clickable:hover,.message-clickable:focus-visible { background:#eef9fd; outline-color:#80cae9; }
