/* AMZQuick design system for every subscription portal: tokens, light/dark, responsive shell (H5), components,
   motion, and the markup used by the operator modules. No text may overflow its box: every flex/grid child
   can shrink, long tokens wrap, and tables turn into labelled cards on phones.
   AMZQuick 订阅门户设计系统：色彩令牌、浅色/深色、响应式外壳（H5）、组件、动效，以及运营模块的既有结构。
   所有文字不得越界：弹性子项允许收缩、长串自动换行、手机端表格变为带字段名的卡片。 */

:root {
  --font: "Amazon Ember", Inter, "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans", "Microsoft YaHei", "Noto Sans CJK SC", "Malgun Gothic", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --grad: linear-gradient(135deg, #7c5cff 0%, #4f7bff 48%, #19c3e6 100%);
  --grad-soft: linear-gradient(135deg, rgba(124,92,255,.14), rgba(25,195,230,.12));
  --brand: #5b5bff; --brand-2: #19c3e6; --brand-ink: #fff; --aws: #ff9900;
  --ok: #10b981; --warn: #f59e0b; --bad: #ef4444; --info: #3b82f6; --hot: #ff4d6d;
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side: 248px; --top: 60px;
  --bg: #f6f7fb; --bg-2: #eef0f8; --surface: #ffffff; --surface-2: #f8f9fc; --raise: #ffffff;
  --line: rgba(15, 23, 42, .09); --line-2: rgba(15, 23, 42, .16);
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --faint: #94a3b8;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px -12px rgba(15,23,42,.14);
  --shadow-lg: 0 24px 60px -24px rgba(30,27,75,.35);
  --focus: 0 0 0 3px rgba(91,91,255,.28);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0e1a; --bg-2: #0e1322; --surface: #121829; --surface-2: #161d31; --raise: #1a2238;
  --line: rgba(148, 163, 184, .13); --line-2: rgba(148, 163, 184, .24);
  --ink: #e8ecf6; --ink-2: #c3cbe0; --muted: #8b95b0; --faint: #5f6a86;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 30px 70px -28px rgba(0,0,0,.8);
  --brand: #8b8bff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.6 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; min-height: 100dvh; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: clamp(18px, 1.8vw, 21px); line-height: 1.3; }
h3 { font-size: 17px; line-height: 1.35; }
h4 { font-size: 15px; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; line-height: 1.5; }
.mono, code { font-family: var(--mono); font-size: .92em; word-break: break-all; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pos { color: var(--ok); font-weight: 600; } .neg { color: var(--bad); font-weight: 600; } .warn-text { color: var(--warn); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; } .row > * { min-width: 0; } .row.end { justify-content: flex-end; }
.stack { display: grid; gap: 16px; } .stack > * { min-width: 0; } .stack.narrow { max-width: 460px; }
.home, .plans-page { display: grid; gap: 18px; } .home > *, .plans-page > * { min-width: 0; }
p:has(> .ic:first-child), .muted:has(> .ic:first-child) { display: flex; gap: 6px; align-items: flex-start; } p > .ic:first-child { margin-top: 3px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* ---------- Boot ---------- */
.boot { min-height: 100dvh; display: grid; place-content: center; gap: 18px; justify-items: center; }
.boot-mark { width: 44px; height: 44px; border-radius: 14px; background: var(--grad); animation: pulse 1.4s var(--ease) infinite; }
.boot-bar { width: 140px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.boot-bar i { display: block; width: 40%; height: 100%; background: var(--grad); animation: slide 1.1s var(--ease) infinite; }
.boot-error { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px; text-align: center; }

/* ---------- Aurora backdrop ---------- */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora.fixed { position: fixed; }
.aurora i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .45; animation: drift 22s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { background: #7c5cff; top: -18vmax; left: -10vmax; }
.aurora i:nth-child(2) { background: #19c3e6; bottom: -22vmax; right: -12vmax; animation-delay: -7s; opacity: .32; }
.aurora i:nth-child(3) { background: #4f7bff; top: 30%; left: 40%; width: 30vmax; height: 30vmax; animation-delay: -12s; opacity: .22; }
:root[data-theme="light"] .aurora.fixed i { opacity: .16; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { border-radius: 8px; flex: none; }
.brand-text { display: grid; line-height: 1.15; min-width: 0; }
.brand-text b { font-size: 15px; letter-spacing: .01em; }
.brand-text small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-link { color: inherit; } .brand-link:hover { text-decoration: none; }

/* ---------- Buttons ---------- */
.btn { --b: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--b); color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1.25; text-align: center; white-space: normal; cursor: pointer; transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s, opacity .2s; text-decoration: none !important; position: relative; max-width: 100%; }
.btn > * { min-width: 0; }
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--grad); background-size: 140% 140%; color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px rgba(79,123,255,.8); }
.btn.primary:hover { background-position: 100% 0; box-shadow: 0 12px 26px -10px rgba(79,123,255,.9); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.outline { background: transparent; }
.btn.glass { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; backdrop-filter: blur(8px); }
.btn.danger, .btn.danger-solid { background: var(--bad); color: #fff; border-color: transparent; }
.btn.sm { min-height: 32px; padding: 5px 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { min-height: 48px; font-size: 15.5px; border-radius: 13px; }
.btn.block { width: 100%; }
.btn.icon-only, .btn.icon { width: 38px; min-height: 38px; padding: 0; flex: none; }
.btn.icon-only.sm, .btn.icon.sm { width: 32px; min-height: 32px; }
.btn.copy.copied { color: var(--ok); border-color: var(--ok); }
.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; animation: spin .7s linear infinite; }
.btn.primary[aria-busy="true"]::after { border-color: #fff transparent #fff transparent; }
.spinner { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--brand); border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; flex: none; }

/* ---------- Inputs ---------- */
.field { display: grid; gap: 6px; min-width: 0; position: relative; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.control { position: relative; display: flex; align-items: center; min-width: 0; }
.input, select.input, textarea.input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 13px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; font-size: 15px; }
textarea.input { min-height: 96px; resize: vertical; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input[readonly] { background: var(--surface-2); color: var(--muted); }
.control .input[type="password"], .control .input.pw, .control .input.pw-mask { padding-right: 46px; }
.reveal { position: absolute; right: 6px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; }
.reveal:hover { color: var(--ink); background: var(--surface-2); }
.field:has(.reveal) .input { padding-right: 46px; }
.field-msg { min-height: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.field-msg:empty { display: none; }
/* The aside groups the error, the field rule, password strength and caps lock; elsewhere it adds no box. */
/* 侧栏容器包含错误、字段规则、密码强度与大写提示；在其他页面不产生额外盒子。 */
.field-aside { display: contents; }
.field-hint { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.field:has(> .field-aside > .field-msg:not(:empty)) .field-hint { display: none; }
/* A password field turned into masked text (autofill.js) still shows dots until revealed. */
/* 由 autofill.js 改为遮罩文本的密码框，在点击显示前仍显示圆点。 */
.input.pw-mask:not(.pw-shown) { -webkit-text-security: disc; }
/* An invalid field gets a soft red edge and a faint red wash rather than a hard red line; focus deepens it a little. */
/* 未通过校验的字段使用柔和的红色描边与极淡的红色底，而不是生硬的红线；获得焦点时略微加深。 */
.field.invalid .input { border-color: color-mix(in srgb, var(--bad) 45%, var(--line-2)); background: color-mix(in srgb, var(--bad) 3%, var(--surface)); }
.field.invalid .input:hover { border-color: color-mix(in srgb, var(--bad) 60%, var(--line-2)); }
.field.invalid .input:focus { border-color: color-mix(in srgb, var(--bad) 75%, var(--line-2)); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 18%, transparent); }
.field.invalid .field-msg, .field-msg[data-tone="bad"] { color: var(--bad); }
.field.valid .input { border-color: color-mix(in srgb, var(--ok) 60%, var(--line-2)); }
.caps { font-size: 12.5px; color: var(--warn); display: flex; gap: 6px; align-items: center; }
.caps::before { content: "⇪"; font-weight: 700; }
.suggest { justify-self: start; border: 0; background: var(--grad-soft); color: var(--brand); font-size: 12.5px; padding: 4px 10px; border-radius: 99px; cursor: pointer; text-align: left; }
.strength { display: grid; gap: 8px; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .3s var(--ease), opacity .2s; }
.strength.active { max-height: 220px; opacity: 1; }
.meter-row { display: flex; align-items: center; gap: 10px; }
.meter { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.meter i { height: 4px; border-radius: 4px; background: var(--line-2); transition: background .25s; }
.strength[data-score="1"] .meter i:nth-child(-n+1) { background: var(--bad); }
.strength[data-score="2"] .meter i:nth-child(-n+2) { background: var(--warn); }
.strength[data-score="3"] .meter i:nth-child(-n+3) { background: #84cc16; }
.strength[data-score="4"] .meter i { background: var(--ok); }
.meter-label { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 4em; text-align: right; }
.rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.rules li { display: flex; gap: 6px; align-items: flex-start; } .rules .ic { width: 14px; height: 14px; margin-top: 3px; opacity: .35; }
.rules li.ok { color: var(--ok); } .rules li.ok .ic { opacity: 1; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

/* OTP */
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 52px)); gap: clamp(6px, 1.6vw, 10px); }
.otp-box { width: 100%; aspect-ratio: 1 / 1.15; text-align: center; font: 600 clamp(18px, 4vw, 24px) var(--mono); border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.otp-box:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); transform: translateY(-1px); }
.otp.filled .otp-box { border-color: var(--ok); }
.otp-area { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.otp-status { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.otp-status .ic { color: var(--ok); }

/* ---------- Turnstile area ---------- */
.ts { position: relative; display: grid; gap: 6px; }
.ts-widget { width: 100%; min-height: 65px; display: block; }
.ts-widget > div, .ts-widget iframe { width: 100% !important; max-width: 100%; display: block; }
.ts-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.ts-status { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.ts-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.ts:not([data-state="error"]):not([data-state="expired"]):not([data-state="loading"]) .ts-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ts[data-state="loading"] .ts-head { display: none; }
.ts[data-state="error"] .ts-head, .ts[data-state="expired"] .ts-head { color: var(--bad); }
.ts[data-state="error"] .ts-dot, .ts[data-state="expired"] .ts-dot { background: var(--bad); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; z-index: 90; right: 16px; bottom: 16px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 14px; border-radius: 13px; background: var(--raise); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 14px; animation: rise .3s var(--ease); }
.toast > span { flex: 1; min-width: 0; }
.toast > .ic { margin-top: 2px; } .toast.ok > .ic { color: var(--ok); } .toast.bad > .ic { color: var(--bad); } .toast.warn > .ic { color: var(--warn); } .toast.info > .ic { color: var(--info); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: .2s; }
.toast-x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 6px; }

/* ---------- Popovers ---------- */
.lang { position: relative; }
.lang-btn .lang-name { white-space: nowrap; }
.lang-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 180px; padding: 6px; border-radius: 14px; background: var(--raise); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: grid; animation: pop .16s var(--ease); }
.lang-opt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 10px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; }
.lang-opt:hover, .lang-opt:focus-visible { background: var(--surface-2); box-shadow: none; }
.lang-opt .ic { opacity: 0; color: var(--brand); } .lang-opt[aria-selected="true"] { font-weight: 600; } .lang-opt[aria-selected="true"] .ic { opacity: 1; }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { position: relative; overflow: hidden; color: #fff; background: #0b1020; padding: 36px clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; }
.auth-art .aurora i { opacity: .55; }
.auth-art > *:not(.aurora) { position: relative; z-index: 1; }
.auth-art .brand-text small { color: rgba(255,255,255,.65); }
.auth-art-copy { display: grid; gap: 18px; max-width: 520px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.7); }
.auth-art h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.2; letter-spacing: -.02em; }
.bubble { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(10px); }
.bubble-avatar { width: 30px; height: 30px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; flex: none; }
.auth-pitch { min-height: 3.2em; color: rgba(255,255,255,.88); }
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: rgba(255,255,255,.85); }
.auth-points li { display: flex; gap: 10px; } .auth-points .ic { color: #6ee7f9; margin-top: 3px; }
.auth-env { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: rgba(255,255,255,.6); }
.auth-panel { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 72px 24px 32px; gap: 20px; }
.auth-tools { position: absolute; top: 16px; right: 16px; display: flex; gap: 6px; }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: 22px; animation: rise .45s var(--ease); }
.auth-card.wide { max-width: 520px; }
.auth-mobile-brand { display: none; }
.auth-head { display: grid; gap: 6px; } .auth-head p { color: var(--muted); }
.auth-body { display: grid; gap: 16px; }
.auth-alt, .reg-alt { text-align: center; }
.auth-legal { font-size: 12px; color: var(--faint); text-align: center; max-width: 420px; }
/* The card stays centred; the policy footer sits at the bottom of the form panel. */
/* 表单卡片保持居中，政策页脚位于表单栏底部。 */
.auth-panel > .auth-card { margin-block: auto; }
.auth-foot .storefront-links { justify-content: center; text-align: center; }
.auth-foot { width: 100%; max-width: 440px; padding-top: 14px; border-top: 1px solid var(--line); }
/* Sign-in and registration forms: label and input share one row, hints float in while typing, */
/* and every control below the fields starts at the input column (--lo). */
/* 登录与注册表单：标签与输入框同行，提示在输入时浮出；字段下方的控件统一从输入框列（--lo）开始对齐。 */
.auth { --lw: 68px; --lg: 12px; --lo: calc(var(--lw) + var(--lg)); }
:root[lang^="ko"] .auth { --lw: 84px; }
:root:not([lang^="zh"]):not([lang^="ja"]):not([lang^="ko"]) .auth { --lw: 104px; }
.auth .auth-card { max-width: 440px; gap: 18px; }
.auth .auth-head { gap: 4px; }
.auth .auth-head h1 { font-size: 22px; }
.auth .auth-head p { font-size: 13.5px; }
.auth .auth-body, .auth .auth-body form.stack, .auth .auth-body form .stack { gap: 12px; }
.auth .field { grid-template-columns: var(--lw) minmax(0, 1fr); column-gap: var(--lg); row-gap: 4px; align-items: center; }
.auth .field > .field-label { grid-row: 1; grid-column: 1; font-size: 13px; line-height: 1.3; }
.auth .field > .control { grid-row: 1; grid-column: 2; }
.auth .field > :not(.field-label):not(.control) { grid-column: 2; }
.auth .input { min-height: 38px; padding: 7px 11px; border-radius: 10px; font-size: 14px; }
.auth .control .input[type="password"], .auth .control .input.pw, .auth .control .input.pw-mask { padding-right: 40px; }
.auth .reveal { right: 4px; width: 30px; height: 30px; }
.auth .reg-email-control { gap: 8px; }
.auth .reg-email-control .btn { min-height: 38px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.auth .btn.lg { min-height: 40px; font-size: 14.5px; border-radius: 11px; }
/* Tips, on every screen: only the focused field shows them, as plain text. Submitting marks the failed fields with */
/* their soft red edge and focuses the first one; the focused field tells its rule in grey (or, for a field without */
/* a rule, its message), plus strength or caps lock. A pinned answer such as "name taken" is shown in red with the */
/* rule. Narrow screens place the tips under the input; wide screens move them into a lane beside the card. */
/* 提示（所有屏宽）：只有获得焦点的字段显示提示，且为纯文字。提交时未通过的字段显示柔和红框，并聚焦第一个；获得焦点的字段 */
/* 以灰字说明规则（没有规则的字段显示其提示语），并附带密码强度或大写提示。固定显示的错误（如用户名已被占用）以红字与规则 */
/* 一同显示。窄屏提示位于输入框下方，宽屏移到卡片右侧的提示栏。 */
.auth .field { row-gap: 0; }
.auth .field-aside { display: grid; gap: 4px; min-width: 0; }
.auth .field:not(:focus-within) > .field-aside { display: none; }
.auth .field-msg, .auth .field-hint { margin: 0; font-size: 12px; line-height: 1.55; }
.auth .field-hint { color: var(--muted); }
.auth .field-aside > .field-msg { color: var(--muted); }
.auth .field-aside > .field-msg[data-pinned] { color: var(--bad); }
.auth .field-aside:has(> .field-hint, > .strength.active) > .field-msg:not([data-pinned]) { display: none; }
.auth .field-aside > .strength { display: none; }
.auth .field:focus-within > .field-aside > .field-hint { display: block; }
.auth .field:focus-within > .field-aside > .strength.active { display: grid; max-height: none; opacity: 1; overflow: visible; }
.auth .agree .field-msg { color: var(--muted); }
.auth .agree:not(:focus-within) .field-msg { display: none; }
@media (max-width: 1279.98px) {
  .auth .field:focus-within > .field-aside:has(> .field-hint, > .field-msg:not(:empty), > .strength.active, > .caps:not([hidden])) { padding-top: 5px; }
}
/* Family and given names share one row: the second label sizes to its text. */
/* 姓与名同处一行，第二个标签按文字宽度排列。 */
.auth .name-row { position: relative; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--lg); align-items: start; }
.auth .name-row > .field + .field { grid-template-columns: auto minmax(0, 1fr); }
/* Wide screens: the tips sit in a lane to the right of the card. The form panel widens and reserves the lane so the */
/* card keeps its width. 宽屏：提示位于卡片右侧的提示栏；表单栏加宽并预留提示栏，卡片保持原宽度。 */
@media (min-width: 1280px) {
  .auth { --lane: 240px; --lane-gap: 14px; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .auth .auth-panel { padding-right: calc(var(--lane) + var(--lane-gap) + 24px); }
  .auth .field-aside { position: absolute; z-index: 8; top: 0; left: calc(100% + var(--lane-gap)); width: var(--lane); gap: 2px; padding: 9px 0 8px; background: var(--bg); }
  .auth .field-aside .rules { grid-template-columns: minmax(0, 1fr); }
  /* Name fields hang their tips off the row. 姓名字段的提示以整行为参照。 */
  .auth .name-row > .field { position: static; }
  .auth .agree .field-msg { position: absolute; top: 0; left: calc(100% + var(--lane-gap)); width: var(--lane); margin: 0; }
}
/* Everything after the fields aligns with the input column. */
/* 字段之后的复选框、按钮、分隔线与链接都对齐到输入框列。 */
.auth .auth-body > :not(form), .auth .auth-body :where(form > :not(.field, .name-row, .stack), form > .stack > :not(.field)) { margin-left: var(--lo); width: auto; }
.auth .auth-alt { text-align: left; }
.auth .agree { padding-left: 24px; }
/* Turnstile needs at least 300px; on phones the verification rows use the full card width. */
/* 人机验证组件至少 300px，手机端验证行使用整张卡片宽度。 */
@media (max-width: 560px) { .auth .auth-body form > .ts, .auth .auth-body form .reg-check { margin-left: 0; } }
/* Required agreement checkbox above the create-account button. */
/* 创建账号按钮上方的必勾协议复选框。 */
.agree { position: relative; padding-left: 24px; font-size: 13px; line-height: 1.65; color: var(--ink-2); }
.agree-label { cursor: pointer; margin-right: .3em; white-space: nowrap; }
.agree-label input { position: absolute; left: 0; top: .2em; width: 16px; height: 16px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.agree .agree-links { display: inline; font-size: inherit; color: inherit; }
.agree .agree-links a { color: var(--brand); white-space: nowrap; }
.agree .agree-links a:not(:last-child)::after { content: "、"; display: inline; margin: 0; color: var(--ink-2); }
:root:not([lang^="zh"]):not([lang^="ja"]) .agree .agree-links a:not(:last-child)::after { content: ","; margin-right: .3em; }
.agree .field-msg { margin: 2px 0 0; color: var(--bad); }
.agree.invalid .agree-label input { outline: 1.5px solid color-mix(in srgb, var(--bad) 50%, transparent); outline-offset: 2px; border-radius: 4px; }
.agree.invalid .agree-label input:focus-visible { outline-color: color-mix(in srgb, var(--bad) 70%, transparent); box-shadow: 0 0 0 5px color-mix(in srgb, var(--bad) 12%, transparent); }
/* Google's standard sign-in button: white (dark: #131314) surface, grey outline, multicolour G, Roboto medium. */
/* Google 标准登录按钮：白底（深色为 #131314）、灰色描边、彩色 G 标志、Roboto 中粗体。 */
.btn.google { min-height: 40px; padding: 0 12px; gap: 10px; border-radius: 20px; border: 1px solid #747775; background: #fff; color: #1f1f1f; font: 500 14px/20px Roboto, "Google Sans", Arial, var(--font); letter-spacing: .25px; box-shadow: none; }
.btn.google:hover { border-color: #747775; background: #f8f9fa; box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); }
.btn.google:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(66,133,244,.35); }
.google-mark { width: 18px; height: 18px; flex: none; }
:root[data-theme="dark"] .btn.google { background: #131314; border-color: #8e918f; color: #e3e3e3; }
:root[data-theme="dark"] .btn.google:hover { background: #1e1f20; box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px 1px rgba(0,0,0,.15); }

/* Public disclosure is shared by authentication, policy pages and checkout. */
/* 登录注册、政策页和结账共用公开披露样式。 */
/* Policy links read as quiet fine print: muted, spaced apart, underlined only on hover. */
/* 政策链接作为次要说明：弱化颜色、以间距分隔、悬停时才显示下划线。 */
.storefront-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.storefront-links a { color: inherit; text-decoration: none; }
.storefront-links a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: .2em; }
/* Checkout: the renewal notice stays prominent; seller, law and policy links sit as one compact block. */
/* 结账：续费提示保持醒目，收款主体、管辖法律与政策链接合并为紧凑的一块。 */
.checkout-disclosure { display: grid; gap: 10px; min-width: 0; }
.checkout-disclosure > .note { font-size: 13px; padding: 10px 12px; }
.checkout-legal { display: grid; gap: 2px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.checkout-legal p { margin: 0; }
.checkout-legal .storefront-links { margin-top: 2px; }
/* Standalone policy pages: article with a policy index (sidebar on wide screens, grid below on phones). */
/* 独立政策页：正文加政策目录，宽屏放在左侧，手机放在正文下方。 */
.storefront-body { min-height: 100dvh; display: flex; flex-direction: column; }
.storefront-top .brand b { white-space: nowrap; }
.storefront-document { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; width: min(72rem, calc(100% - 2rem)); margin: clamp(16px, 4vw, 40px) auto; }
.storefront-document p { margin: 0; }
.storefront-article { display: grid; gap: 24px; min-width: 0; padding: clamp(20px, 4.5vw, 48px); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.storefront-head { display: grid; gap: 6px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.storefront-eyebrow { font-size: 12.5px; font-weight: 650; letter-spacing: .04em; color: var(--brand); }
.storefront-head h1 { font-size: clamp(26px, 3.6vw, 36px); line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.storefront-subtitle { font-size: clamp(14px, 1.5vw, 16px); color: var(--muted); }
.storefront-contact { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 14px 24px; margin: 0; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.storefront-contact > div { display: grid; gap: 2px; min-width: 0; }
.storefront-contact > .wide { grid-column: 1 / -1; }
.storefront-contact dt { font-size: 12px; color: var(--muted); }
.storefront-contact dd { margin: 0; color: var(--ink); }
.storefront-markdown { display: grid; gap: 14px; max-width: 70ch; font-size: 15.5px; line-height: 1.8; color: var(--ink-2); }
.storefront-markdown h2 { margin-top: 12px; padding-left: 12px; border-left: 3px solid var(--brand); font-size: 18px; line-height: 1.4; color: var(--ink); }
.storefront-markdown h3 { margin-top: 6px; font-size: 16px; color: var(--ink); }
.storefront-markdown > :first-child { margin-top: 0; }
.storefront-markdown ul, .storefront-markdown ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.storefront-markdown a, .storefront-contact a { color: var(--brand); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); text-underline-offset: .2em; }
.storefront-markdown a:hover, .storefront-contact a:hover { text-decoration-color: currentColor; }
.storefront-markdown pre { overflow: auto; }
.storefront-law { max-width: none; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.storefront-law h2 { margin-top: 0; }
.storefront-toc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.storefront-toc-title { grid-column: 1 / -1; padding: 4px 10px 6px; font-size: 12px; font-weight: 650; letter-spacing: .04em; color: var(--muted); }
.storefront-toc a { display: grid; gap: 1px; align-content: start; min-width: 0; padding: 8px 10px; border-radius: var(--r); font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.storefront-toc a small { font-size: 11.5px; color: var(--faint); }
.storefront-toc a:hover { background: var(--surface-2); text-decoration: none; }
.storefront-toc a[aria-current="page"] { background: var(--grad-soft); color: var(--brand); font-weight: 650; }
.storefront-toc a[aria-current="page"] small { color: color-mix(in srgb, var(--brand) 70%, var(--muted)); font-weight: 400; }
.storefront-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; width: min(72rem, calc(100% - 2rem)); margin: 0 auto; padding: 20px 0 32px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }
@media (min-width: 900px) {
  .storefront-document { grid-template-columns: 15.5rem minmax(0, 1fr); gap: 28px; }
  .storefront-toc { grid-template-columns: minmax(0, 1fr); grid-column: 1; grid-row: 1; position: sticky; top: 84px; }
  .storefront-article { grid-column: 2; }
}
@media (max-width: 560px) {
  .storefront-top .storefront-pricing { display: none; }
  .storefront-markdown { font-size: 15px; line-height: 1.75; }
}
.addr-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.addr-row > span { flex: 1; min-width: 0; }

/* ---------- Public registration ---------- */
.pub-top { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px clamp(16px, 4vw, 40px); backdrop-filter: saturate(1.4) blur(14px); background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid var(--line); }
.pub-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.reg-email-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 10px; }
.reg-email-control .btn { white-space: nowrap; }
.reg-check { display: grid; gap: 8px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.reg-check-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
@media (max-width: 620px) {
  .reg-email-control { grid-template-columns: minmax(0, 1fr); }
}
.reg-done { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 28px 8px; }
.done-ring { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 0 0 10px var(--grad-soft); animation: pop .5s var(--ease); }
.done-ring .ic { width: 34px; height: 34px; stroke-width: 2.6; }
.done-bar { width: 220px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.done-bar i { display: block; height: 100%; background: var(--grad); animation: fill 1.6s linear forwards; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
.shell.folded { --side: 76px; }
.side { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 8px; padding: 14px 12px; background: var(--surface); border-right: 1px solid var(--line); z-index: 40; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 4px 10px; min-width: 0; }
.side-nav { display: grid; gap: 2px; overflow-y: auto; flex: 1; align-content: start; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--ink-2); font-weight: 500; font-size: 14px; border: 0; background: none; cursor: pointer; text-decoration: none !important; min-width: 0; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item[aria-current] { background: var(--grad-soft); color: var(--ink); font-weight: 650; }
.nav-item[aria-current]::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--grad); }
.nav-item[aria-current] .ic { color: var(--brand); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 99px; background: var(--hot); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side-foot { padding: 6px 4px 0; }
.env-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: 12px; background: var(--surface-2); color: var(--muted); max-width: 100%; }
.env-chip.aws { color: var(--aws); background: color-mix(in srgb, var(--aws) 12%, transparent); }
.shell.folded .nav-label, .shell.folded .brand-text, .shell.folded .env-chip span, .shell.folded .badge { display: none; }
.shell.folded .nav-item { justify-content: center; } .shell.folded .side-head { flex-direction: column; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 clamp(12px, 2.4vw, 28px); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.5) blur(14px); border-bottom: 1px solid var(--line); }
.top-menu { display: none; }
.top-title { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--muted); }
.top-title .crumb { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.user-menu { display: flex; align-items: center; gap: 8px; padding-left: 8px; margin-left: 4px; border-left: 1px solid var(--line); min-width: 0; }
/* Match the clickable administrator identity with the shared header layout. */
/* 管理员身份入口沿用现有顶栏布局。 */
.user-account { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); border-radius: 10px; text-decoration: none; }
.avatar { width: 30px; height: 30px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user-name { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; font-weight: 600; }
.view { flex: 1; padding: clamp(16px, 2.6vw, 32px); width: 100%; max-width: 1280px; margin: 0 auto; }
.page { display: grid; gap: 18px; align-content: start; }
.page > * { min-width: 0; }
.page.enter > * { animation: rise .42s var(--ease) both; }
.page.enter > *:nth-child(2) { animation-delay: .04s; } .page.enter > *:nth-child(3) { animation-delay: .08s; } .page.enter > *:nth-child(4) { animation-delay: .12s; } .page.enter > *:nth-child(n+5) { animation-delay: .16s; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.scrim { display: none; }
.tabbar { display: none; }

/* ---------- Cards ---------- */
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.card-head, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 16px 20px 0; }
.card-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); color: var(--brand); flex: none; }
.card-actions, .panel-head > :not(h2) { display: flex; gap: 6px; flex-wrap: wrap; }
.card-body, .panel-body { padding: 16px 20px 20px; display: grid; gap: 14px; min-width: 0; }
.panel-head h2 { font-size: 17px; }
.hero-card { position: relative; overflow: hidden; display: grid; gap: 20px; padding: clamp(20px, 3vw, 30px); border-radius: var(--r-xl); color: #fff; background: radial-gradient(120% 140% at 100% 0%, #19c3e6 0%, transparent 46%), radial-gradient(120% 120% at 0% 100%, #7c5cff 0%, transparent 55%), #1b1f4b; box-shadow: var(--shadow-lg); }
.hero-card::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M0 0h24v24' fill='none' stroke='white' stroke-opacity='.06'/%3E%3C/svg%3E"); pointer-events: none; }
.hero-card > * { position: relative; z-index: 1; min-width: 0; }
.hero-text { display: grid; gap: 6px; max-width: 640px; } .hero-text p, .hero-summary { color: rgba(255,255,255,.82); }
.hero-balance { display: grid; justify-items: end; gap: 6px; text-align: right; } .hero-balance small { color: rgba(255,255,255,.7); }
.hero-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 20px; flex-wrap: wrap; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
/* Seat summary is part of the welcome card itself: no inner box or cell backgrounds, only a hairline above the row */
/* and thin dividers between items, directly on the card's gradient. Auto-renewal takes the wider last item. */
/* 席位摘要直接融入欢迎卡片：不再有内层框和格子底色，只在整行上方加一条细线、各项之间用细竖线分隔，自动续费占最后较宽的一项。 */
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.55fr); row-gap: 16px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.16); }
.hero-stat { display: grid; gap: 3px; align-content: start; min-width: 0; padding: 0 20px; border-left: 1px solid rgba(255,255,255,.14); }
.hero-stat:first-child { padding-left: 0; border-left: 0; }
.hero-stat-label { font-size: 12px; color: rgba(255,255,255,.62); }
.hero-stat-value { display: flex; align-items: center; min-height: 28px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: #fff; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hero-stat-sub { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.5; color: rgba(255,255,255,.66); }
.hero-stat-sub.warn { color: #fcd34d; }
.hero-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.22); flex: none; }
.hero-dot.warn { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251,191,36,.22); }
.hero-renewal { display: inline-flex; align-items: center; gap: 10px; }
.hero-stat-state { font-size: 15px; font-weight: 650; }
.hero-card .renewal-switch { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.32); }
.hero-card .renewal-switch[aria-checked="true"] { background: #34d399; border-color: #34d399; }
.hero-card .renewal-thumb { background: #fff; border-color: transparent; }
/* Active seat: one compact card. Greeting and lead on one line with the actions at the right; balance, plan, end */
/* date, limits and renewal as six equal summary items below. */
/* 已开通：紧凑的单张卡片。问候语与说明同一行，操作按钮在右；余额、套餐、到期、两项上限与续费为下方六个等宽摘要项。 */
.hero-dash { gap: 14px; padding: 18px 22px; }
.hero-dash .hero-top { align-items: center; gap: 10px 16px; }
.hero-dash .hero-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; max-width: none; }
.hero-dash .hero-text h2 { font-size: 19px; }
.hero-dash .hero-text p { font-size: 13.5px; }
.hero-dash .hero-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); padding-top: 14px; row-gap: 14px; }
.hero-dash .hero-stat { padding: 0 16px; }
.hero-dash .hero-stat:first-child { padding-left: 0; }
.hero-dash .hero-stat-value { font-size: 17px; min-height: 26px; }
.hero-dash .hero-stats { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.25fr); }
.hero-stat-state { white-space: nowrap; }
/* Four shared fields fill the enterprise card. Narrow screens use the same two-column rules as personal seats. */
/* 企业卡片用四项共用信息铺满整行，窄屏沿用个人卡片的双列布局。 */
@media (min-width: 641px) {
  .hero-dash .hero-stats.enterprise-seat { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero-dash .enterprise-seat .hero-stat:nth-child(4) { padding-left: 16px; border-left: 1px solid rgba(255,255,255,.14); }
}
/* Login details: the facts on the left, the first-login steps beside them on wide screens, instead of a half-empty */
/* facts column above a full-width step list. Inside the first-login stage the stage heading already introduces them. */
/* 登录凭证：宽屏时左侧为账号信息，右侧为首次登录步骤，避免左列半空、步骤单独占满一行。首次登录区块已有标题，不再重复凭证标题条。 */
.stage .cred-card > .cred-head { display: none; }
@media (min-width: 1200px) {
  .cred-card { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); column-gap: 28px; align-items: start; }
  .cred-card > .cred-head { grid-column: 1 / -1; }
  .cred-card > .facts, .cred-card > .cred-actions { grid-column: 1; }
  .cred-card > .howto { grid-column: 2; grid-row: 2 / span 2; align-self: start; }
  .stage .cred-card > .howto { grid-row: 1 / span 2; }
}
@media (max-width: 1100px) {
  .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-stat:nth-child(n) { padding-left: 20px; border-left: 1px solid rgba(255,255,255,.14); }
  .hero-stat:nth-child(3n+1) { padding-left: 0; border-left: 0; }
  .hero-stat-renewal { grid-column: span 2; }
  .hero-dash .hero-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-dash .hero-stat-renewal { grid-column: auto; }
}
@media (max-width: 640px) {
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; padding-top: 16px; }
  .hero-stat:nth-child(n) { padding: 0 0 0 14px; border-left: 1px solid rgba(255,255,255,.14); }
  .hero-stat:nth-child(2n+1) { padding-left: 0; border-left: 0; }
  .hero-stat-value { font-size: 16px; min-height: 24px; }
  .hero-stat-renewal { grid-column: 1 / -1; }
  .hero-dash { padding: 16px; }
  .hero-dash .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-dash .hero-stat:nth-child(n) { padding: 0 0 0 14px; }
  .hero-dash .hero-stat:nth-child(2n+1) { padding-left: 0; }
  .hero-dash .hero-top { align-items: flex-start; }
  .hero-dash .hero-stat-renewal { grid-column: auto; }
  .hero-actions { justify-content: flex-start; }
}
.hero-amount { font-size: clamp(26px, 3.4vw, 36px); font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 14px; }
.stat { display: grid; gap: 6px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; transition: transform .2s var(--ease), border-color .2s; }
.stat-top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 13px; }
.stat-top .ic { color: var(--brand); }
.stat-value { font-size: clamp(20px, 2.2vw, 24px); font-weight: 720; letter-spacing: -.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat.accent { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.stat-link { color: inherit; text-decoration: none !important; } .stat-link:hover .stat { transform: translateY(-2px); border-color: var(--brand); }

/* ---------- Tags, notes, facts ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 11%, transparent); border-color: transparent; }
.tag.warn { color: #b45309; background: color-mix(in srgb, var(--warn) 15%, transparent); border-color: transparent; }
:root[data-theme="dark"] .tag.warn { color: #fbbf24; }
.tag.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 11%, transparent); border-color: transparent; }
.tag.info { color: var(--info); background: color-mix(in srgb, var(--info) 11%, transparent); border-color: transparent; }
.tag.accent { color: #fff; background: var(--grad); border-color: transparent; }
.tag.hot { color: #fff; background: linear-gradient(135deg, #ff4d6d, #ff9900); border-color: transparent; }
.tag.promo { color: var(--aws); background: color-mix(in srgb, var(--aws) 12%, transparent); border-color: transparent; white-space: normal; }
.tag .ic { width: 13px; height: 13px; }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); flex-wrap: wrap; }
.note > .ic, .note > .spinner { margin-top: 2px; }
/* Preserve the spinner's square shape when the note gives its text the remaining width. */
/* 提示栏将剩余空间留给文字，并保持加载图标为正方形。 */
.note > :not(.ic, .spinner) { flex: 1 1 200px; min-width: 0; }
.note > .spinner + span { flex-basis: 0; }
.note.info { background: color-mix(in srgb, var(--info) 8%, var(--surface)); border-color: color-mix(in srgb, var(--info) 25%, transparent); } .note.info > .ic { color: var(--info); }
.note.warn { background: color-mix(in srgb, var(--warn) 9%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 30%, transparent); } .note.warn > .ic { color: var(--warn); }
.note.bad { background: color-mix(in srgb, var(--bad) 8%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 28%, transparent); color: var(--bad); }
.facts { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 10px 16px; margin: 0; align-items: center; }
.facts dt { color: var(--muted); font-size: 13px; } .facts dd { margin: 0; min-width: 0; }
/* Keep company names and published contacts within the shared layout at narrow widths. */
/* 窄屏下将企业名称与公开联系方式限制在共用布局内。 */
.enterprise-text { min-width: 0; overflow-wrap: anywhere; }
.code { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 4px 3px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.code code { flex: 1; min-width: 0; font-size: 13.5px; }
.code .btn.icon-only { width: 28px; min-height: 28px; border: 0; background: transparent; }
.region { display: inline-flex; align-items: center; gap: 6px; } .region .ic { color: var(--aws); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.rtable, .sub-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rtable th, .sub-table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.rtable td, .sub-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; min-width: 80px; }
.rtable tr:last-child td { border-bottom: 0; }
.rtable tbody tr { transition: background .15s; } .rtable tbody tr:hover { background: var(--surface-2); }
.td-label { display: none; }
.sub-empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 32px 16px; color: var(--muted); }
.empty-art { width: 54px; height: 54px; border-radius: 16px; background: var(--grad-soft); color: var(--brand); display: grid; place-items: center; }
.empty-art .ic { width: 26px; height: 26px; } .empty strong { color: var(--ink); }
.pager, .desk-pager, .sub-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.sk { display: grid; gap: 10px; padding: 6px 0; }
.sk-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk-line.w90 { width: 90%; } .sk-line.w70 { width: 70%; } .sk-line.w50 { width: 50%; } .sk-line.w80 { width: 80%; }

/* ---------- Segmented, chips, tabs ---------- */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); max-width: 100%; }
.seg button { border: 0; background: none; padding: 7px 13px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 6px 14px; font-weight: 600; cursor: pointer; font-size: 14px; }
.chip[aria-pressed], .chip:hover { border-color: var(--brand); color: var(--brand); background: var(--grad-soft); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.tab-body { display: grid; gap: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters > .field { flex: 1 1 160px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; flex: 1 1 240px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface); }
.search .input { border: 0; padding-left: 0; box-shadow: none !important; background: transparent; }
.search .ic { color: var(--muted); }

/* ---------- Journey ---------- */
.journey { display: grid; gap: 14px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.journey-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.j-count { font-size: 13px; color: var(--muted); }
.j-progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.j-progress i { display: block; height: 100%; background: var(--grad); border-radius: 4px; transition: width .6s var(--ease); }
.journey-rail { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.j-step { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; font-size: 13px; color: var(--muted); min-width: 0; }
.j-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-2); flex: none; font-size: 12px; background: var(--surface); }
.j-dot .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.j-label { min-width: 0; line-height: 1.3; }
.j-step.done { color: var(--ink-2); } .j-step.done .j-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.j-step.current { background: var(--grad-soft); color: var(--ink); font-weight: 650; }
.j-step.current .j-dot { border-color: transparent; background: var(--grad); color: #fff; box-shadow: 0 0 0 4px rgba(91,91,255,.18); animation: halo 2s ease-in-out infinite; }
.j-step.blocked .j-dot { border-color: var(--bad); color: var(--bad); }
.stage { display: grid; gap: 18px; padding: clamp(18px, 3vw, 28px); border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.stage.enter { animation: rise .45s var(--ease); }
.stage.success { border-color: var(--ok); }
.stage.celebrate { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.stage-head { display: flex; gap: 14px; align-items: flex-start; }
.stage-head > div { display: grid; gap: 4px; min-width: 0; } .stage-head p { color: var(--muted); }
.stage-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 10px 24px -12px rgba(79,123,255,.9); }
.stage-icon .ic { width: 22px; height: 22px; }
/* Inside the first-login stage the credentials sit flat under the stage heading instead of as a second card. */
/* 首次登录区块内，登录凭证直接排在区块标题下，不再嵌套一层卡片。 */
.stage .cred-card { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.stage .cred-card > .cred-head { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); align-items: center; }
.stage .cred-card > .cred-head .cred-badge { width: 32px; height: 32px; border-radius: 10px; }
.stage-foot { display: flex; justify-content: flex-end; padding-top: 14px; border-top: 1px solid var(--line); }
/* Status tags under a stat value keep their own width. 统计数值下的状态标签保持自身宽度。 */
.stat > .tag { justify-self: start; }

/* ---------- Plans ---------- */
.term-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.term-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; }
.term-toolbar .seg button { white-space: nowrap; }
.term-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.term-custom select.term-months { width: auto; min-width: 7rem; max-width: 100%; }
.renewal-switch { display: inline-flex; align-items: center; width: 48px; height: 28px; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); cursor: pointer; }
.renewal-switch[aria-checked="true"] { background: var(--brand); border-color: var(--brand); }
.renewal-switch:disabled { cursor: not-allowed; }
.renewal-switch[aria-busy="true"] { cursor: wait; }
.renewal-thumb { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); transition: transform .18s var(--ease); }
.renewal-switch[aria-checked="true"] .renewal-thumb { transform: translateX(20px); }
.renewal-switch .spinner { display: none; width: 12px; height: 12px; }
.renewal-switch[aria-busy="true"] .spinner { display: block; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.plan { position: relative; display: grid; gap: 12px; align-content: start; text-align: left; padding: 18px; border-radius: var(--r-lg); border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; min-width: 0; color: inherit; }
.plan:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.plan.featured { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 6%, var(--surface)), var(--surface)); }
.plan.selected { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; box-shadow: 0 0 0 4px rgba(91,91,255,.12), var(--shadow-lg); }
.plan.selected::after { content: "✓"; position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; animation: pop .3s var(--ease); }
.plan:disabled { opacity: .55; cursor: not-allowed; }
.plan-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-right: 26px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.plan-price .price { font-size: clamp(24px, 3vw, 30px); font-weight: 760; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-price small { color: var(--muted); } .plan-price s { color: var(--faint); font-size: 13.5px; }
.plan-pricing { display: grid; gap: 4px; }
.plan-monthly { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; min-height: 1.25em; font-size: 13px; color: var(--muted); }
.plan-monthly s { color: var(--faint); }
.plan-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 0; }
.plan-tags:empty { display: none; }
.countdown { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--hot); font-weight: 600; font-variant-numeric: tabular-nums; }
.countdown .ic { width: 13px; height: 13px; }
.plan-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.plan-feats li { display: flex; gap: 8px; } .plan-feats .ic { width: 15px; height: 15px; color: var(--ok); margin-top: 3px; }
.receipt { display: grid; gap: 10px; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.r-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.r-lines { display: grid; gap: 6px; }
.r-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.r-line > :last-child { font-variant-numeric: tabular-nums; text-align: right; }
.r-line.credit { color: var(--ok); }
.r-total { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding-top: 10px; border-top: 1px dashed var(--line-2); font-weight: 700; }
.r-total > :last-child { font-size: 22px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.topup-inline > div { display: grid; gap: 8px; justify-items: start; }
/* Receipt: amounts in one column, notices and the pay button in another; side by side when there is room. */
/* 报价回执：金额明细一栏，提示与付款按钮一栏；宽度足够时左右并排。 */
.r-main, .r-side { display: grid; gap: 10px; align-content: start; min-width: 0; }
@media (min-width: 960px) {
  .receipt:has(> .r-side) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; }
  .receipt > .r-side { padding-left: 28px; border-left: 1px dashed var(--line-2); }
  .receipt > .r-side .checkout-legal:first-child { padding-top: 0; border-top: 0; }
}
/* Plan cards: tighter padding and price; on phones the lower tier that cannot be bought hides its feature list. */
/* 套餐卡片：收紧内边距与价格字号；手机端不可购买的低档套餐隐藏功能列表。 */
.plan-grid .plan { padding: 16px; gap: 10px; }
.plan-grid .plan .plan-price .price { font-size: clamp(22px, 2.4vw, 26px); }
@media (max-width: 640px) {
  .plan-grid { gap: 10px; }
  .plan-grid .plan { padding: 14px; gap: 8px; }
  .plan-grid .plan .plan-feats { gap: 4px; font-size: 13px; }
  .plan-grid .plan:disabled .plan-feats { display: none; }
}
/* Hour packs: compact cards in one row on wide screens; on phones one row per pack (hours, price, buy). */
/* 小时包：宽屏为一排紧凑卡片；手机端每个小时包一行（时长、价格、购买）。 */
.pack-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1180px) { .pack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pack { display: grid; gap: 6px; align-content: start; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); min-width: 0; transition: border-color .15s; }
.pack:not(.locked):hover { border-color: var(--brand); }
.pack.locked { opacity: .65; }
.pack-hours { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; } .pack-hours strong { font-size: 22px; font-weight: 780; line-height: 1.2; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; } .pack-hours small { color: var(--muted); font-size: 12px; }
.pack-price { display: grid; gap: 1px; min-width: 0; }
.pack-price .price { font-size: 17px; font-weight: 720; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pack-sub { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 12px; color: var(--muted); } .pack-sub s { color: var(--faint); }
.pack > .btn { width: 100%; margin-top: 2px; }
.pack-locked { font-size: 12px; }
@media (max-width: 640px) {
  .pack-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .pack { grid-template-columns: minmax(84px, max-content) minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding: 10px 12px; }
  .pack > .tag, .pack > .countdown { grid-column: 1 / -1; justify-self: start; }
  .pack > .btn { width: auto; margin: 0; min-width: 64px; }
  .pack-locked { text-align: right; }
}

/* ---------- Live delivery ---------- */
.live { display: grid; gap: 12px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.live-head { display: flex; align-items: center; gap: 10px; }
.live-head strong { flex: 1; min-width: 0; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: ping 1.6s infinite; }
.live.done .live-dot, .live.warn .live-dot { animation: none; } .live.warn .live-dot { background: var(--warn); }
.live.done { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.orbit { width: 26px; height: 26px; position: relative; flex: none; }
.orbit i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: #7c5cff; animation: spin 1.1s linear infinite; }
.orbit i:nth-child(2) { inset: 4px; border-top-color: #4f7bff; animation-duration: .9s; animation-direction: reverse; }
.orbit i:nth-child(3) { inset: 8px; border-top-color: #19c3e6; animation-duration: .7s; }
.live.done .orbit i { animation: none; border-color: var(--ok); }
.trace { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 8px; border-left: 2px solid var(--line); }
.trace-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding-left: 12px; position: relative; font-size: 14px; animation: rise .3s var(--ease); }
.trace-item::before { content: ""; position: absolute; left: -6px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.trace-time { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; }
.caret::after { content: ""; display: inline-block; width: 7px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--brand); animation: blink 1s steps(2) infinite; }

/* ---------- Credentials ---------- */
.cred-card { display: grid; gap: 16px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.cred-head { display: flex; gap: 12px; align-items: flex-start; } .cred-head > div { display: grid; gap: 2px; min-width: 0; } .cred-head p { color: var(--muted); font-size: 13.5px; }
.cred-badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--aws) 16%, transparent); color: var(--aws); flex: none; }
.cred-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.howto { list-style: none; margin: 0; padding: 14px; display: grid; gap: 10px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); }
.howto li { display: flex; gap: 10px; } .howto b { width: 22px; height: 22px; flex: none; border-radius: 7px; background: var(--grad-soft); color: var(--brand); display: grid; place-items: center; font-size: 12px; }

/* ---------- Mail ---------- */
.mailbox { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); min-height: 560px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.mail-col { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; }
.mail-tools { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.mail-address { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.mail-address .mono { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.mail-address .btn.icon-only { width: 28px; min-height: 28px; }
.mail-list { flex: 1; overflow-y: auto; display: grid; align-content: start; }
.mail-item { position: relative; display: grid; gap: 3px; padding: 12px 14px 12px 26px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; min-width: 0; transition: background .15s; }
.mail-item:hover { background: var(--surface-2); } .mail-item.active { background: var(--grad-soft); }
.mail-dot { position: absolute; left: 11px; top: 19px; width: 7px; height: 7px; border-radius: 50%; }
.mail-item.unread .mail-dot { background: var(--brand); } .mail-item.unread .mail-sender, .mail-item.unread .mail-title { font-weight: 700; color: var(--ink); }
.mail-line { display: flex; justify-content: space-between; gap: 8px; min-width: 0; }
.mail-sender { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.mail-when { color: var(--faint); font-size: 12px; white-space: nowrap; flex: none; }
.mail-title { font-size: 13.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-chip { justify-self: start; display: inline-flex; align-items: center; gap: 4px; font: 600 12px var(--mono); color: var(--brand); background: var(--grad-soft); padding: 1px 8px; border-radius: 99px; }
.mail-chip .ic { width: 12px; height: 12px; }
.mail-more { padding: 10px; display: flex; justify-content: center; }
.mail-pane { min-width: 0; display: flex; flex-direction: column; }
.mail-back { display: none; padding: 8px; border-bottom: 1px solid var(--line); }
.mail-view { flex: 1; overflow-y: auto; padding: clamp(16px, 2.4vw, 26px); }
.mail-view > .empty { height: 100%; align-content: center; }
.mail-reader { display: grid; gap: 16px; animation: rise .3s var(--ease); }
.mail-head { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.mail-subject { font-size: 19px; }
.mail-meta { display: flex; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); }
.mail-from { display: inline-flex; gap: 6px; align-items: center; min-width: 0; }
.mail-date { color: var(--muted); font-size: 12.5px; }
.mail-to { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
/* The message keeps its own layout on a light paper; the portal's styles stop at the frame. */
/* 邮件在浅色信纸上按自身排版显示，入口页面的样式止于框架边界。 */
.mail-paper { border-radius: var(--r); border: 1px solid var(--line-2); background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.mail-frame { display: block; width: 100%; height: 360px; border: 0; background: #fff; color-scheme: light; }
.mail-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mail-head-top .mail-actions { flex: none; }
.mail-assist { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px; align-items: start; }
.mail-assist .otp-found { padding: 12px 14px; }
.mail-assist .link-card { padding: 10px 12px; }
.more-links summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.mail-blocked { display: flex; align-items: center; gap: 6px; margin: -4px 0 0; font-size: 12.5px; color: var(--muted); }
.mail-blocked .ic { width: 14px; height: 14px; color: var(--ok); }
.mail-rcpt { display: flex; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); }
.mail-rcpt .mono { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
/* Wide screens: the mailbox has a bounded height so the list and the reader scroll on their own. */
/* 宽屏：邮箱高度有上限，邮件列表与阅读区各自滚动。 */
@media (min-width: 901px) {
  .mailbox { height: clamp(520px, calc(100dvh - 200px), 920px); }
  .mailbox > * { min-height: 0; }
}
.mail-files { display: flex; gap: 8px; flex-wrap: wrap; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 13px; max-width: 100%; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mail-actions { display: flex; justify-content: flex-end; gap: 8px; }
.links { display: grid; gap: 10px; }
.more-links { display: grid; gap: 8px; } .more-links[open] { gap: 10px; } .more-links > .link-card { margin-top: 8px; }
.link-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.link-card.lead { border: 1.5px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; }
.link-meta { display: grid; gap: 3px; min-width: 0; flex: 1 1 220px; }
.link-host { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .link-host b { overflow-wrap: anywhere; }
.link-path { font: 12.5px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-actions { display: flex; gap: 6px; align-items: center; }
.otp-found { display: grid; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--grad-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
.otp-found-head { display: flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 600; color: var(--brand); }
.otp-found-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.otp-code { font: 700 clamp(22px, 4vw, 28px) var(--mono); letter-spacing: .08em; flex: 1 1 auto; color: var(--ink); }
.mail-live { display: grid; gap: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px dashed var(--line-2); }
.mail-live-head { display: flex; align-items: center; gap: 8px; } .mail-live-head .ic { color: var(--brand); }
.mail-live-list { display: grid; gap: 12px; }
.mail-live-item { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.mail-live-item.enter { animation: rise .4s var(--ease); }
.detected:empty { display: none; }

/* ---------- Wallet, notices ---------- */
/* Wallet: one compact card. Balance on the left; title, note and a single top-up row on the right. */
/* 钱包：单张紧凑卡片。左侧余额；右侧标题、说明与一行充值操作。 */
.wallet-hero { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: 20px; align-items: stretch; padding: 16px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.wallet-balance { display: grid; align-content: center; gap: 2px; padding: 14px 18px; border-radius: var(--r-lg); color: #fff; background: radial-gradient(130% 130% at 100% 0%, #19c3e6, transparent 52%), #23246b; }
.wallet-balance small { color: rgba(255,255,255,.72); font-size: 12.5px; }
.wallet-balance-value { display: flex; align-items: baseline; gap: 6px; }
.wallet-balance .hero-amount { font-size: 30px; }
.wallet-topup { display: grid; gap: 12px; align-content: center; min-width: 0; padding: 4px 4px 4px 0; }
.wallet-topup-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.wallet-topup-head h3 { font-size: 16px; }
.wallet-pay-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wallet-pay-row .chips { gap: 6px; }
.wallet-pay-row .chip { padding: 6px 12px; font-size: 13.5px; }
.wallet-pay { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 0; }
.wallet-amount { flex: 1 1 auto; min-width: 0; }
.wallet-amount > .field-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wallet-amount .input { min-height: 38px; padding: 7px 11px; }
.wallet-pay > .btn { flex: none; min-height: 38px; }
/* Ledger: the tabs head the card; on phones they share the width equally. */
/* 账单：标签栏作为卡片开头；手机端四个标签等分宽度。 */
.wallet-ledger > .card-body { padding-top: 8px; }
@media (max-width: 760px) {
  .wallet-hero { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px; }
  .wallet-balance { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 16px; }
  .wallet-balance .hero-amount { font-size: 26px; }
  .wallet-topup { padding: 0; }
  .wallet-pay-row .chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
  .wallet-pay-row .chip { padding: 6px 2px; font-size: 13px; text-align: center; }
  .wallet-pay { flex-basis: 100%; }
  .wallet-ledger .tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
  .wallet-ledger .tab { padding: 10px 2px; font-size: 13.5px; text-align: center; }
  .wallet-ledger .rtable tr { padding: 4px 12px; margin-bottom: 8px; }
  .wallet-ledger .rtable td { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; padding: 5px 0; align-items: center; }
  .wallet-ledger .rtable td > .btn, .wallet-ledger .rtable td > .row, .wallet-ledger .rtable td > .tag { justify-self: start; }
}
.notice-list { display: grid; gap: 10px; }
.notice { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); flex-wrap: wrap; }
.notice.unread { border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.notice-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--grad-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.notice-body { flex: 1 1 200px; display: grid; gap: 2px; min-width: 0; }
.notice-actions { display: flex; gap: 6px; align-items: center; }
.drawer-block { display: grid; gap: 10px; }

/* ---------- Agent ---------- */
.site-list { display: grid; gap: 8px; }
.site-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.site-row a { flex: 1 1 220px; min-width: 0; }
.chart { margin: 0; display: grid; gap: 8px; }
.chart-scroll { overflow-x: auto; } .chart svg { width: 100%; min-width: 320px; height: 170px; display: block; }
.bar.a { fill: #4f7bff; } .bar.b { fill: #19c3e6; }
.chart-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.key { display: inline-flex; align-items: center; gap: 6px; } .key::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.key.a::before { background: #4f7bff; } .key.b::before { background: #19c3e6; }
.chart-axis, .analytics-axis { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--faint); }

/* ---------- Dialogs & drawer (shared with operator modules) ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(8, 10, 24, .5); backdrop-filter: blur(4px); animation: fade .2s; }
.dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--raise); box-shadow: var(--shadow-lg); animation: pop .22s var(--ease); overflow: auto; }
.dialog.wide { width: min(860px, calc(100vw - 24px)); }
.dialog.closing, .drawer.closing { opacity: 0; transform: scale(.98); transition: .18s; }
.dialog-form { display: grid; }
.dialog-head { display: flex; gap: 12px; align-items: flex-start; padding: 20px 20px 4px; }
.dialog-head > div { flex: 1; min-width: 0; display: grid; gap: 4px; } .dialog-head p { color: var(--muted); font-size: 14px; }
.dialog-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--grad-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.dialog-icon.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.dialog-body { padding: 14px 20px; display: grid; gap: 14px; min-width: 0; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 20px; flex-wrap: wrap; }
.form-error { margin: 0 20px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--bad) 10%, transparent); color: var(--bad); font-size: 13.5px; }
.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--raise); box-shadow: var(--shadow-lg); animation: slidein .28s var(--ease); }
.drawer-sheet { display: flex; flex-direction: column; height: 100%; }
.drawer-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-title { flex: 1; min-width: 0; display: grid; gap: 2px; } .drawer-title p { color: var(--muted); font-size: 13.5px; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 28px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.drawer-section { display: grid; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.drawer-section h3 { font-size: 15px; }
.palette { width: min(620px, calc(100vw - 24px)); margin-top: 10vh; padding: 0; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--raise); box-shadow: var(--shadow-lg); }

/* ---------- Operator modules (existing markup) ---------- */
.sub-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; align-items: end; }
.sub-form > .btn { justify-self: start; }
.select-wrap { display: block; }
/* Subscription selects draw their own arrow, so suppress the shared component's extra SVG. */
/* 订阅页的下拉框由样式绘制箭头，因此隐藏共享组件额外输出的 SVG。 */
.select-wrap > select.input + svg { display: none; }
.field small { color: var(--muted); font-size: 12.5px; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; }
.choice-item { display: flex; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); cursor: pointer; }
.choice-item:has(input:checked) { border-color: var(--brand); background: var(--grad-soft); }
.choice-item span { display: grid; gap: 2px; min-width: 0; } .choice-item small { color: var(--muted); }
/* Keep permission checkboxes readable on desktop and narrow screens. */
/* 保持桌面和窄屏上的权限选项清晰可读。 */
.admin-permission-field { display: grid; gap: 8px; min-width: 0; padding: 0; border: 0; }
.admin-permission-field legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
/* Keep the authenticator QR square and scannable inside small dialogs.
   在小尺寸弹窗中保持动态令牌二维码方正可扫。 */
.admin-mfa-qr { width: min(224px, 100%); height: auto; margin-inline: auto; background: #fff; border-radius: 10px; }
.admin-permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; }
.admin-permission-choice { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; }
.admin-permission-choice:has(input:checked) { border-color: var(--brand); background: var(--grad-soft); }
.admin-permission-choice input { accent-color: var(--brand); flex: none; }
.catalog-actions, .desk-tools, .catalog-tabs, .command-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.catalog-tabs .btn[aria-pressed="true"] { background: var(--grad-soft); border-color: var(--brand); color: var(--brand); }
.desk-tools .input { flex: 1 1 200px; width: auto; }
.desk-cell { display: grid; gap: 2px; min-width: 0; } .desk-cell small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* Keep enterprise list values on their assigned lines and preserve room for the complete amount. */
/* 企业列表字段各居其行，并为完整金额保留空间。 */
.enterprise-directory-table th:first-child { width: 30%; }
.enterprise-directory-table .desk-cell { grid-template-columns: minmax(0, 1fr); }
.enterprise-table-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.enterprise-table-text { display: block; max-width: clamp(9rem, 22vw, 22rem); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enterprise-table-rate { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; max-width: 10rem; white-space: nowrap; }
.enterprise-table-funds { justify-items: start; white-space: nowrap; font-variant-numeric: tabular-nums; }
.enterprise-table-funds > span:first-child { font-weight: 600; }
.enterprise-table-actions { display: grid; gap: 4px; justify-items: start; }
.enterprise-table-actions .catalog-actions { gap: 6px; }
/* Fit multiple independent token permissions and long one-time secrets inside the existing dialog. */
/* 独立令牌权限及较长的一次性凭证均适配现有弹窗宽度。 */
.enterprise-api-scopes { border: 0; padding: 0; margin: 0; min-width: 0; grid-column: 1 / -1; }
.enterprise-api-scopes legend { margin-bottom: 8px; font-weight: 600; }
.enterprise-api-secret .code { width: 100%; justify-content: space-between; overflow-wrap: anywhere; }
.desk-facts { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 8px 14px; margin: 0; } .desk-facts dt { color: var(--muted); font-size: 13px; } .desk-facts dd { margin: 0; min-width: 0; }
.desk-note, .desk-feedback { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; color: var(--ink-2); }
.desk-entry { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.catalog-panels, .catalog-pane, .catalog-fields, .analytics-content, .admin-detail-content, .enroll-lookup, .enroll-group-options, .enroll-custom-groups { display: grid; gap: 14px; min-width: 0; }
.admin-fields-grid, .catalog-rates { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.catalog-event, .catalog-window { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.enroll-heading { font-weight: 700; }
.field-tip { position: relative; display: inline-flex; } .field-tip-trigger { border: 0; background: var(--surface-2); color: var(--muted); width: 20px; height: 20px; border-radius: 50%; cursor: help; font-size: 12px; }
.field-tip-panel { max-width: min(340px, 90vw); padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--raise); box-shadow: var(--shadow-lg); font-size: 13px; }
.audit-note { display: inline-block; max-width: 36ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.analytics-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.analytics-figure { margin: 0; display: grid; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.analytics-figure figcaption { font-weight: 650; font-size: 14px; }
.analytics-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.analytics-key::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: #4f7bff; }
.analytics-key[data-series="1"]::before { background: #19c3e6; } .analytics-key[data-series="2"]::before { background: #7c5cff; }
.analytics-scroll { overflow-x: auto; }
.analytics-plot { position: relative; height: 150px; display: flex; gap: 3px; align-items: stretch; }
.analytics-plot::after { content: ""; position: absolute; left: 0; right: 0; top: var(--chart-zero, 100%); height: 1px; background: var(--line-2); }
.analytics-day { position: relative; flex: 1 0 9px; display: flex; gap: 1px; }
.analytics-day span { position: relative; flex: 1; border-radius: 2px; background: #4f7bff; }
.analytics-day span[data-series="1"] { background: #19c3e6; } .analytics-day span[data-series="2"] { background: #7c5cff; }
.analytics-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.kpi { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); color: inherit; }
.kpi-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; } .kpi-value { font-size: 22px; font-weight: 720; }
.workspace-access-details { white-space: pre-wrap; font-family: var(--mono); font-size: 13px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.trace p { margin: 0; }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.92); } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(16,185,129,0); } 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); } }
@keyframes halo { 50% { box-shadow: 0 0 0 7px rgba(91,91,255,.08); } }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.08); } }
@keyframes fill { from { width: 0; } to { width: 100%; } }
@keyframes shakeX { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.shake { animation: shakeX .4s; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
}
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-mobile-brand { display: flex; justify-content: center; }
  .auth-panel { justify-content: flex-start; padding-top: 72px; }
  .mailbox { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .mail-col { border-right: 0; }
  .mail-pane { display: none; }
  .mailbox.reading .mail-col { display: none; }
  .mailbox.reading .mail-pane { display: flex; }
  .mail-back { display: block; }
  .mail-list { max-height: none; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell, .shell.folded { grid-template-columns: minmax(0, 1fr); --side: 280px; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); transform: translateX(-102%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
  .shell.folded .nav-label, .shell.folded .brand-text, .shell.folded .env-chip span { display: initial; }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(8,10,24,.45); animation: fade .2s; }
  .side-fold { display: none; }
  .top-menu { display: inline-flex; }
  .top-role, .top-title .sep, .user-name, .lang-btn .lang-name { display: none; }
  .topbar { height: 54px; }
  .view { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.5) blur(16px); border-top: 1px solid var(--line); }
  .tabbar .nav-item { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 11px; justify-content: center; text-align: center; }
  .tabbar .nav-item[aria-current]::before { display: none; }
  .tabbar .nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
  .tabbar .badge { position: absolute; top: 2px; left: 55%; min-width: 16px; height: 16px; font-size: 10px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .hero-top { align-items: stretch; flex-direction: column; }
  .hero-balance { justify-items: start; text-align: left; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .card-head, .panel-head { padding: 14px 14px 0; } .card-body, .panel-body { padding: 12px 14px 16px; }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .journey-rail { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(62px, 1fr); overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .j-step { flex-direction: column; text-align: center; padding: 6px 4px; font-size: 12px; gap: 4px; }
  .facts, .desk-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd, .desk-facts dd { margin-bottom: 10px; }
  /* Tables collapse into labelled cards so no column is ever cut off. */
  /* 表格折叠为带字段名的卡片，任何列都不会被截断。 */
  .table-wrap { border: 0; overflow: visible; }
  .rtable thead, .sub-table thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px; margin-bottom: 10px; background: var(--surface); }
  .rtable td { display: grid; grid-template-columns: minmax(84px, 38%) minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); min-width: 0; }
  .rtable td:last-child { border-bottom: 0; }
  .enterprise-table-text { max-width: 100%; }
  .enterprise-table-rate { white-space: normal; }
  .td-label { display: block; color: var(--muted); font-size: 12.5px; }
  .dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; animation: sheet .3s var(--ease); }
  .drawer { width: 100vw; border-left: 0; }
  .dialog-foot .btn { flex: 1 1 auto; }
  #toasts { left: 12px; right: 12px; width: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .otp { grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; }
  .pub-actions .btn.ghost .btn-label, .pub-actions > a.btn > span { display: none; }
}
@media (max-width: 380px) {
  .stats { grid-template-columns: minmax(0, 1fr); }

}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
