/* The console stylesheet. Hand-written, no framework.
   The brand colour arrives from the generated inline block (--brand-primary), everything
   else is neutral on purpose: a white-label channel changes one file and gets their colour.
   No CJK and no brand name belong in this file - the gate scans it. */

:root {
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --surface-3: #eef1f7;
  --line: #e2e6ef;
  --line-strong: #d4dae6;
  --text: #1a2235;
  --text-soft: #394157;
  --muted: #6b7490;
  --muted-soft: #8a93a8;
  --ok: #0f766e;
  --ok-bg: #e6f7f3;
  --ok-line: #b5e2d7;
  --warn: #92400e;
  --warn-bg: #fef3c7;
  --warn-line: #fcd34d;
  --err: #b91c1c;
  --err-bg: #fef2f2;
  --err-line: #fecaca;
  --info-bg: #eff6ff;
  --info-line: #bfdbfe;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --gap: 20px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 60, 0.04), 0 1px 3px rgba(20, 30, 60, 0.04);
  --shadow: 0 1px 2px rgba(20, 30, 60, 0.04), 0 4px 16px rgba(20, 30, 60, 0.06);
  --shadow-lg: 0 8px 24px rgba(20, 30, 60, 0.08), 0 24px 60px rgba(20, 30, 60, 0.08);
  --transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  background: var(--surface-2);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

a { color: var(--brand-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---- top bar ---- */

.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .wrap { display: flex; align-items: center; gap: 28px; min-height: 64px; flex-wrap: wrap; }
.wordmark {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.015em;
  text-decoration: none;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: opacity var(--transition);
}
.wordmark:hover { opacity: 0.85; color: var(--text); }
.wordmark::before {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 4px;
  background: var(--brand-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary) 15%, transparent);
}
.topbar nav { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.topbar nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 6px;
  transition: all var(--transition);
}
.topbar nav a:hover { color: var(--text); background: var(--surface-2); }
.topbar nav a[aria-current="page"] {
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
}
.topbar form { margin: 0; }

/* ---- page ---- */

main { padding: 36px 0 72px; min-height: calc(100vh - 64px - 120px); }

/* ---- app shell: left menu + top account bar (signed-in) ---- */

body.app-body { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px;
  flex: 0 0 224px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
}
.sidebar .wordmark { margin: 0 8px 18px; }
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-nav a {
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-nav a::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background var(--transition);
}
.side-nav a:hover { background: var(--surface-2); }
.side-nav a[aria-current="page"] {
  color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
}
.side-nav a[aria-current="page"]::before { background: var(--brand-primary); }

.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.accountbar-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
  min-height: 56px;
}
.accountbar {
  display: flex;
  align-items: center;
  gap: 16px;
}
.accountbar a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all var(--transition);
}
.accountbar a:hover { color: var(--text); background: var(--surface-2); }
.accountbar a[aria-current="page"] { color: var(--brand-primary); }
.accountbar form { margin: 0; }
.langs { display: flex; gap: 4px; font-size: 13px; }
.langs a {
  text-decoration: none;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  transition: all var(--transition);
}
.langs a:hover { color: var(--text); border-color: var(--line-strong); }

/* product cards */
.grid-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--gap);
}
.product-card { text-decoration: none; color: var(--text); display: block; }
.product-card:hover { text-decoration: none; color: var(--text); }
.product-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.product-card h3 { margin: 0; font-size: 16px; }
.announcement + .announcement {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  font-weight: 700;
}
h2 {
  font-size: 18px;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
  font-weight: 650;
}
h3 {
  font-size: 16px;
  margin: 0 0 10px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.lede { color: var(--muted); margin: 0 0 24px; max-width: 64ch; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card + .card { margin-top: var(--gap); }

/* Auth pages: center the card vertically and horizontally */
.auth-shell {
  min-height: calc(100vh - 64px - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.auth-shell .card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.auth-shell h1 { font-size: 24px; margin-bottom: 4px; }
.auth-shell .lede { margin-bottom: 24px; }
.auth-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.section { margin-top: 32px; }
.section > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}
.section > h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--brand-primary);
}

.grid { display: grid; gap: var(--gap); }
.grid-plans { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ---- forms ---- */

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-soft);
}
.field .help { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 10px 13px;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.55;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted-soft); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 12%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--muted-soft); opacity: 0.8; }

.row { display: flex; gap: var(--gap); flex-wrap: wrap; }
.row > * { flex: 1 1 220px; }

.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-soft);
}
.form-row .help { font-size: 12px; color: var(--muted); margin-top: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--brand-primary);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-primary) 30%, transparent);
}
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-ghost {
  background: var(--surface);
  color: var(--text-soft);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--muted-soft);
  color: var(--text);
  box-shadow: none;
  transform: none;
}
.btn-danger {
  background: var(--surface);
  color: var(--err);
  border-color: var(--err-line);
}
.btn-danger:hover {
  background: var(--err-bg);
  border-color: var(--err);
  box-shadow: none;
  transform: none;
}
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand-primary);
  cursor: pointer;
  font: inherit;
  font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---- flash ---- */

.flash {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: flashIn 240ms ease-out;
}
@keyframes flashIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.flash::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
  position: relative;
}
.flash-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.flash-err { background: var(--err-bg); border-color: var(--err-line); color: var(--err); }
.flash-info { background: var(--info-bg); border-color: var(--info-line); color: #1e40af; }
.flash-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }

/* ---- tables ---- */

table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}
th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
}
thead th:first-child { border-top-left-radius: var(--radius-sm); }
thead th:last-child { border-top-right-radius: var(--radius-sm); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr {
  transition: background var(--transition);
}
tbody tr:hover { background: var(--surface-2); }
td form { margin: 0; }

/* ---- badges ---- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.badge-danger { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }
.badge-muted { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

/* ---- key/value list (service overview) ---- */

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; }
.kv > div {
  border-left: 3px solid var(--line);
  padding-left: 14px;
  transition: border-color var(--transition);
}
.kv > div:hover { border-left-color: var(--brand-primary); }
.kv dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.kv dd { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }

/* ---- pairing code ---- */

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 36px;
  letter-spacing: 0.2em;
  font-weight: 700;
  margin: 8px 0 6px;
  padding: 16px 24px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  display: inline-block;
  color: var(--brand-primary);
  user-select: all;
}

/* 服务器用户名/密码等短凭据：配对码那种 36px 大字太大，用小号等宽。 */
.code-sm {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin: 0;
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 4px;
  border: 1px solid var(--line);
  display: inline-block;
  word-break: break-all;
}

/* ---- support: ticket replies & announcements ---- */

.reply {
  border-left: 3px solid var(--line-strong);
  padding: 6px 0 6px 14px;
  margin: 10px 0;
}
.reply:first-of-type { margin-top: 4px; }
.announcement {
  list-style: none;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.announcement:last-child { border-bottom: 0; }

.ticket-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ticket-attachment-image {
  display: inline-block;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 0;
}
.ticket-attachment-image img {
  max-width: 220px;
  max-height: 160px;
  object-fit: cover;
  display: block;
}
.ticket-attachment-image:hover img { opacity: 0.92; }
.ticket-attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--brand-primary);
  text-decoration: none;
}
.ticket-attachment-link:hover { border-color: var(--brand-primary); }

/* ---- cart ---- */

table .inline { margin-right: 0; }
.cart-total { font-weight: 700; font-size: 18px; }

/* ---- plans ---- */

.plan { display: flex; flex-direction: column; position: relative; overflow: hidden; }
.plan::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--line);
  transition: background var(--transition);
}
.plan:hover::before { background: var(--brand-primary); }
.plan .price {
  font-size: 26px;
  font-weight: 700;
  margin: 10px 0 4px;
  letter-spacing: -0.02em;
  color: var(--text);
}
.plan .price-pending { font-size: 15px; font-weight: 600; color: var(--warn); }
.plan .price-was {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted-soft);
  text-decoration: line-through;
}
.plan .tag-promo {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft, var(--surface-2));
  border: 1px solid var(--accent-line, var(--line));
  border-radius: 999px;
  vertical-align: middle;
}
.plan .badge { margin-bottom: 8px; align-self: flex-start; }
.plan ul { margin: 14px 0 20px; padding-left: 0; color: var(--muted); font-size: 14px; list-style: none; }
.plan ul li { padding: 4px 0; position: relative; padding-left: 20px; }
.plan ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brand-primary);
  opacity: 0.5;
}
.plan .actions { margin-top: auto; }

.empty { color: var(--muted); padding: 18px 0; }

/* Billing: prepaid balance, top-up amount pills, section subheadings */
.balance-amount { font-size: 30px; font-weight: 700; line-height: 1.2; margin: 0; }
/* 多币种余额：竖排，一行一种货币（充了什么币就显示什么币） */
.balance-list { display: flex; flex-direction: column; gap: 6px; }
.balance-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  max-width: 320px; padding-bottom: 6px; border-bottom: 1px dashed var(--line-strong);
}
.balance-line:last-child { border-bottom: 0; }
.balance-line .muted { font-size: 13px; }
.balance-value { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
/* 充值码输入框：比普通输入框长一些，字母间距拉开方便核对（码是每四位一组的） */
.code-input {
  max-width: 420px;
  letter-spacing: 0.14em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
}
.subsection { margin: 0 0 8px; font-size: 15px; }

/* ---- top-up methods: one card per method ---- */

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: var(--gap);
  align-items: start;
}
/* Cards in the grid are siblings; the generic ".card + .card" margin would knock them off the grid rows. */
.method-grid .card + .card { margin-top: 0; }
.method-card { display: flex; flex-direction: column; }
.method-card .lede { margin: 0 0 18px; font-size: 14px; max-width: none; }
.method-card form { margin-top: auto; }
.method-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.method-head h3 { margin: 0; font-size: 16px; }
.section-hint { color: var(--muted); font-size: 13px; margin: -8px 0 16px; max-width: 72ch; }

/* 收款账户（银行转账）：账户没配全时用 .is-missing —— 不摆空壳，只说去哪儿问。 */
.bank-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 0 0 18px;
  font-size: 14px;
}
.bank-box dl { display: grid; gap: 8px; margin: 0; }
.bank-row { display: grid; grid-template-columns: 8.5em 1fr; gap: 10px; align-items: baseline; }
.bank-row dt { color: var(--muted); font-size: 13px; }
.bank-row dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.bank-box.is-missing { border-style: dashed; color: var(--text-soft); }
.bank-box.is-missing a { font-weight: 600; }
.ref-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
  overflow-wrap: anywhere;
}

/* 金额档位：.form-row label 会把这些 pill 打成块级，所以选择器要更具体，否则换行位置全乱。 */
.amount-picker { margin-bottom: 18px; }
.amount-picker .field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-soft);
}
.amount-picker .help { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.radio-pill:hover { border-color: var(--line-strong); }
.radio-pill:has(input:checked) {
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 7%, var(--surface));
}
.radio-pill:has(input:focus-visible) { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 12%, transparent); }
.radio-pill input[type="radio"] { margin: 0; accent-color: var(--brand-primary); }
.radio-pill.is-custom { gap: 8px; }
.radio-pill input[type="number"] { width: 120px; padding: 6px 8px; font-size: 14px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }

/* inline forms (used in team table for role change / remove) */
form.inline { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
form.inline select { width: auto; padding: 6px 8px; font-size: 13px; }
form.inline .btn { padding: 6px 12px; font-size: 13px; }

ul.plain { list-style: none; padding: 0; margin: 12px 0 0; }
ul.plain li {
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 14px;
}

.voucher h1 { margin-bottom: 4px; }
.voucher .kv { margin: 24px 0; }

footer.site {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
}
footer.site .wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--brand-primary); }

@media (max-width: 720px) {
  body.app-body { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: none;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .sidebar .wordmark { margin: 0 14px 0 0; flex: none; font-size: 15px; }
  .side-nav { flex-direction: row; gap: 2px; }
  .side-nav a { padding: 7px 10px; font-size: 13px; white-space: nowrap; }
  .side-nav a::before { display: none; }
  .topbar .wrap { min-height: 0; padding-top: 12px; padding-bottom: 12px; }
  .accountbar-wrap { min-height: 0; padding-top: 8px; padding-bottom: 8px; justify-content: space-between; }
  .topbar nav { margin-left: 0; gap: 4px; width: 100%; }
  .topbar nav a { padding: 6px 10px; font-size: 13px; }
  .grid-products { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  h2 { font-size: 17px; }
  .code { font-size: 22px; padding: 12px 16px; letter-spacing: 0.12em; }
  th, td { padding: 10px 8px; font-size: 13px; }
  .card { padding: 18px; border-radius: var(--radius-sm); }
  .auth-shell .card { padding: 24px; }
  main { padding: 24px 0 48px; }
  .section { margin-top: 24px; }
  .wrap { padding: 0 16px; }
  .kv { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
  .kv dd { font-size: 16px; }
}

/* Vouchers print as PDF: no nav, flash or buttons on paper. */
@media print {
  .topbar, footer.site, .flash, .actions, .no-print, .sidebar, .accountbar-wrap { display: none !important; }
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .kv dt { color: #444; }
}

/* 后台弹窗（console.js 的 data-dialog 机制）：居中、遮罩高亮、卡片内表单。 */
dialog {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  padding: 0;
  width: min(680px, 94vw);
  max-height: 88vh;
  overflow: auto;
  background: var(--surface);
  color: var(--text);
}
dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
}
.dialog-card { padding: 24px; }
.dialog-card h3 { margin: 0 0 8px; }
.dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* 开通引导链（2026-10-01）：自动提交期间的加载状态——纯 CSS spinner，文案来自服务端。 */
.autosubmit-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted, #667085);
}
.autosubmit-progress .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(102, 112, 133, 0.25);
  border-top-color: var(--accent, #2563eb);
  border-radius: 50%;
  animation: autospin 0.8s linear infinite;
  flex: none;
}
@keyframes autospin {
  to { transform: rotate(360deg); }
}
