:root {
  color-scheme: light;
  --ink: #17231d;
  --ink-soft: #46564d;
  --muted: #718078;
  --line: #dfe7e1;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --green: #277454;
  --green-dark: #172c22;
  --green-soft: #e8f3ec;
  --amber: #a85e27;
  --amber-soft: #fff1e4;
  --red: #a43e3e;
  --red-soft: #fff0ee;
  --teal: #2d7174;
  --teal-soft: #e7f3f2;
  --shadow: 0 8px 28px rgba(25, 47, 34, 0.06);
}
* { box-sizing: border-box; }
/* 关键：auth-layout / app-shell 显式写了 display:grid，会盖掉浏览器给 [hidden] 的
   display:none，导致登录页和控制台同时显示。这里统一兜底。 */
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
/* 控制台改成「整页不滚、内容区自己滚」：
   之前整页滚动 + 顶栏 backdrop-filter 毛玻璃 + 筛选栏 sticky 叠加，
   Chrome 滚动时会出现「内容在视口里但整屏画不出来」的空白。
   现在 html/body 固定高度，滚动交给 .main-content，规避这类绘制故障。 */
html, body { height: 100%; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.app-shell { height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar {
  height: 100vh;
  overflow-y: auto;
  background: var(--green-dark);
  color: #eef6f0;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 3px 10px 28px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  background: #c9e6d1; color: #173424; font-size: 19px; font-weight: 800;
}
.brand strong { display: block; font-size: 15px; line-height: 1.2; }
.brand small { display: block; margin-top: 4px; color: #9cb9a5; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.workspace-label { padding: 0 12px 9px; color: #91a99a; font-size: 11px; font-weight: 700; }
.primary-nav { display: grid; gap: 4px; }
.nav-item {
  height: 40px; border: 0; border-radius: 6px; background: transparent; color: #c6d4ca;
  display: flex; align-items: center; gap: 12px; padding: 0 12px; text-align: left; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: #294536; color: #fff; font-weight: 650; }
.nav-indicator { width: 7px; height: 7px; border: 1px solid #82a590; border-radius: 2px; }
.nav-item.active .nav-indicator { background: #c8e6d1; border-color: #c8e6d1; }
.sidebar-bottom { margin-top: auto; }
.sidebar-download { margin-bottom: 8px; }
.sidebar-download .novel-dot { background: #5aa9d6; }
.sidebar-download:hover strong { color: #fff; }
.novel-link {
  display: grid; grid-template-columns: 10px minmax(0,1fr) 14px; align-items: center; gap: 10px;
  padding: 12px 10px; border: 1px solid #3a5845; border-radius: 7px; background: #20372a;
}
.novel-link:hover { background: #294536; border-color: #668772; }
.novel-dot { width: 8px; height: 8px; border-radius: 50%; background: #e5a55d; }
.novel-link strong { display: block; font-size: 12px; }
.novel-link small { display: block; color: #b2c4b7; font-size: 10px; line-height: 1.5; margin-top: 4px; overflow-wrap: anywhere; }
.external-mark { color: #cfe2d4; font-size: 16px; }
.demo-note { display: flex; align-items: center; gap: 8px; padding: 16px 10px 0; color: #9cb1a2; font-size: 11px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d2934e; flex: 0 0 auto; }
.main-shell { min-width: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 58px; flex: 0 0 58px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 34px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.breadcrumbs strong { color: var(--ink); font-weight: 650; }
.crumb-divider { color: #b2beb6; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.local-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 11px; }
.local-badge .status-dot { background: #3c9a68; }
.novel-shortcut { color: var(--green); font-size: 12px; font-weight: 650; }
.novel-shortcut:hover { text-decoration: underline; }
.main-content {
  width: min(100%, 1440px); flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 auto; padding: 30px 34px 36px;
}
.page-footer {
  display: flex; justify-content: space-between; gap: 16px; padding: 14px 34px 18px;
  color: #7d8a81; font-size: 10px; border-top: 1px solid var(--line);
}
.loading-state { color: var(--muted); padding: 24px 0; }
.page-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 23px; }
.page-heading h1 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 700; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 750; letter-spacing: .7px; margin: 0 0 7px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px;
  border-radius: 6px; padding: 0 13px; border: 1px solid transparent; cursor: pointer;
  font-size: 12px; font-weight: 650; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.button:focus-visible, .nav-item:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid #66a982; outline-offset: 2px;
}
.button-primary { background: var(--green); color: #fff; }
.button-primary:hover { background: #1d6244; }
.button-quiet { background: #fff; color: var(--ink-soft); border-color: var(--line); }
.button-quiet:hover { background: #f7faf8; border-color: #b7c8bd; }
.button-danger { background: #fff; color: var(--red); border-color: #e6c5c1; }
.button-danger:hover { background: var(--red-soft); }
.button-small { min-height: 30px; padding: 0 9px; font-size: 11px; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.kpi {
  min-height: 112px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px;
  padding: 16px 17px;
}
.kpi-label { color: var(--muted); font-size: 11px; }
.kpi-value { margin-top: 11px; font-size: 24px; line-height: 1.1; font-weight: 700; }
.kpi-foot { margin-top: 9px; color: #849188; font-size: 10px; }
.kpi-unit { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 5px; }
.kpi-accent { color: var(--green); }
.section { margin-top: 23px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 11px; }
.section-head h2 { margin: 0; font-size: 14px; font-weight: 700; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.section-link { color: var(--green); font-size: 11px; font-weight: 650; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 600px; text-align: left; }
th { padding: 11px 14px; background: #f8faf8; color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
td { padding: 12px 14px; border-top: 1px solid #edf1ee; color: var(--ink-soft); font-size: 11px; vertical-align: middle; }
td strong { color: var(--ink); font-weight: 650; }
.model-id { font-weight: 650; color: var(--ink); }
.model-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.pill { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 20px; font-size: 10px; font-weight: 650; white-space: nowrap; }
.pill-demo { background: var(--amber-soft); color: var(--amber); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-off { background: #eef1ef; color: #69776e; }
.content-split { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(260px,.8fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 17px; }
.panel h2, .panel h3 { margin: 0; font-size: 13px; }
.panel-copy { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.quick-code {
  margin-top: 13px; padding: 13px; background: #17231d; color: #d6e6db; border-radius: 6px;
  font: 11px/1.65 Consolas, "SFMono-Regular", monospace; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.inline-callout { display: flex; gap: 10px; border-left: 3px solid #d2934e; background: #fff7ef; padding: 12px 13px; color: #7a4b25; font-size: 11px; line-height: 1.55; border-radius: 0 6px 6px 0; }
.inline-callout strong { color: #633d1d; }
.key-list { display: grid; gap: 10px; }
.key-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid #edf1ee; padding: 11px 0; }
.key-row:last-child { border-bottom: 0; padding-bottom: 0; }
.key-row:first-child { padding-top: 0; }
.key-title { color: var(--ink); font-size: 11px; font-weight: 650; }
.key-meta { margin-top: 4px; color: var(--muted); font: 10px Consolas, monospace; overflow-wrap: anywhere; }
.empty-state { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.7; }
.form-grid { display: grid; gap: 14px; }
.field-label { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 38px; padding: 9px 11px; border: 1px solid #cfd9d2;
  border-radius: 6px; color: var(--ink); background: #fff; font-size: 12px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: #9aa69e; }
.form-help { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.playground-result { min-height: 80px; white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f9f7; border: 1px solid var(--line); border-radius: 6px; padding: 12px; color: var(--ink-soft); font: 11px/1.6 Consolas, monospace; }
.price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; min-width: 210px; }
.price-fields label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.price-fields input { min-height: 30px; width: 74px; padding: 5px 7px; font-size: 11px; }
.key-prefix { font: 11px Consolas, monospace; color: var(--ink-soft); }
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filter-bar input { width: min(270px,100%); }
.dialog {
  width: min(440px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 8px; padding: 22px;
  box-shadow: var(--shadow); color: var(--ink); background: #fff;
}
.dialog::backdrop { background: rgba(18, 33, 24, .42); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.dialog-heading h2 { margin: 0; font-size: 18px; }
.icon-close { width: 30px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: #718078; cursor: pointer; font-size: 21px; }
.icon-close:hover { background: #f0f4f1; }
.dialog input { margin-top: 6px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.secret-box { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: #f8faf8; padding: 9px; }
.secret-box code { font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; color: var(--green-dark); }
.toast { position: fixed; right: 18px; bottom: 18px; padding: 11px 14px; border-radius: 6px; background: #17231d; color: #fff; font-size: 11px; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px); pointer-events: none; transition: .18s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
@media (max-width: 920px) {
  .app-shell { grid-template-columns: 204px minmax(0,1fr); }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .main-content { padding-left: 22px; padding-right: 22px; }
  .topbar { padding-left: 22px; padding-right: 22px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 650px) {

  /* 窄屏改成整页滚动（桌面端的内部滚动布局在窄屏反而难用） */
  html, body { height: auto; overflow: auto; }
  .app-shell { display: block; height: auto; }
  .sidebar { height: auto; overflow: visible; padding: 12px; }
  .main-shell { height: auto; overflow: visible; }
  .main-content { overflow: visible; min-height: 0; }
  .topbar { flex: 0 0 48px; }
  .brand { padding: 0 2px 11px; }
  .workspace-label, .sidebar-bottom { display: none; }
  .primary-nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 1px; }
  .nav-item { flex: 0 0 auto; height: 34px; padding: 0 9px; font-size: 11px; }
  .nav-indicator { display: none; }
  .topbar { height: 48px; padding: 0 14px; }
  .topbar-actions { gap: 10px; }
  .local-badge { font-size: 0; }
  .local-badge .status-dot { width: 8px; height: 8px; }
  .novel-shortcut { font-size: 11px; }
  .main-content { padding: 21px 14px 28px; }
  .page-footer { display: block; padding: 12px 14px 16px; line-height: 1.6; }
  .page-footer span { display: block; }
  .page-heading { align-items: center; margin-bottom: 18px; }
  .page-heading h1 { font-size: 20px; }
  .page-heading p { max-width: 280px; }
  .content-split { grid-template-columns: 1fr; }
  .kpi { padding: 13px; min-height: 102px; }
  .kpi-value { font-size: 20px; }
  .section-head { align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
}

/* ===== v2: 账户、购买与管理 ===== */
.auth-layout {
  height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: minmax(0, 1fr); background: var(--canvas);
}
.auth-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-col { position: relative; display: grid; min-height: 100vh; min-width: 0; }
.auth-brand {
  position: absolute; top: 26px; left: 30px; display: flex; gap: 11px; align-items: center;
  color: var(--ink); z-index: 2;
}
.auth-brand .brand-mark { background: var(--green); color: #fff; }
.auth-brand strong { display: block; font-size: 15px; line-height: 1.2; }
.auth-brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.auth-card {
  margin: auto; width: min(420px, calc(100vw - 40px)); padding: 34px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0; font-size: 24px; line-height: 1.25; }
.auth-subtitle { margin: 9px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.auth-switch { margin: 16px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.link-button { border: 0; background: none; padding: 0; color: var(--green); font-size: 11px; font-weight: 650; cursor: pointer; text-decoration: underline; }
.link-button:hover { color: #1d6244; }
.auth-note { margin: 20px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: #8b978f; font-size: 10px; line-height: 1.6; }
.auth-side {
  background: var(--green-dark); color: #e8f2eb; padding: 96px 52px 48px;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-side h2 { margin: 0; font-size: 22px; line-height: 1.4; font-weight: 700; }
.auth-points { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.auth-points li { position: relative; padding-left: 20px; color: #b9cdc0; font-size: 12px; line-height: 1.6; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: 7px; width: 7px; height: 7px; border-radius: 2px; background: #d2934e; }
/* 登录页右上角的客户端下载入口（用户要求放在品牌区右侧空白处） */
.auth-download-top {
  position: absolute; top: 24px; right: 28px; z-index: 2;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 34px; padding: 0 14px;
  border: 1px solid #c1d6c8; border-radius: 7px; background: #fff;
  color: var(--green); font-size: 12px; font-weight: 650;
}
.auth-download-top span { font-size: 13px; line-height: 1; }
.auth-download-top:hover { border-color: var(--green); background: #f1f8f3; text-decoration: none; }
@media (max-width: 520px) { .auth-download-top { display: none; } }
.auth-download-line { margin: 12px 0 0; font-size: 11px; color: #7d8a82; }
.auth-download-line a { color: var(--green); font-weight: 650; text-decoration: underline; }
.button-block { width: 100%; }

/* 订单表操作列：主操作 + 取消订单 并排 */
.order-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 14px; }
.package-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 20px;
  display: flex; flex-direction: column;
}
.package-eyebrow { margin: 0; color: var(--green); font-size: 10px; font-weight: 750; letter-spacing: .7px; }
.package-card h3 { margin: 9px 0 0; font-size: 17px; }
.package-desc { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; min-height: 34px; }
.package-price { margin: 18px 0 0; color: var(--ink); font-size: 30px; font-weight: 700; line-height: 1.1; }
.package-price .currency { font-size: 17px; margin-right: 2px; }
.package-credit { margin: 10px 0 18px; color: var(--ink-soft); font-size: 11px; }
.package-bonus { display: inline-block; margin-left: 6px; padding: 3px 7px; border-radius: 20px; background: var(--amber-soft); color: var(--amber); font-size: 10px; font-weight: 650; }
.package-card .button { margin-top: auto; }
.payment-details { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; margin-bottom: 14px; }
.payment-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid #edf1ee; font-size: 11px; }
.payment-row:last-child { border-bottom: 0; }
.payment-row span { color: var(--muted); }
.payment-row strong { color: var(--ink); font-weight: 650; }
.sidebar-account {
  display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: center;
  margin-top: 12px; padding: 10px; border: 1px solid #3a5845; border-radius: 7px; background: #20372a;
}
.account-avatar { width: 30px; height: 30px; border-radius: 50%; background: #c9e6d1; color: #173424; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.account-details { min-width: 0; }
.account-details strong { display: block; color: #eef6f0; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-details small { display: block; margin-top: 3px; color: #9cb1a2; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { border: 1px solid #4c6b59; background: transparent; color: #cfe2d4; border-radius: 5px; padding: 4px 8px; font-size: 10px; cursor: pointer; }
.logout-button:hover { background: #294536; }
.balance-top { color: var(--ink-soft); font-size: 11px; }
.balance-top strong { color: var(--green); font-size: 13px; font-weight: 700; margin-left: 3px; }
.admin-nav { margin-top: 22px; padding-top: 14px; border-top: 1px solid #2c4436; }
.inline-callout-warn { border-left-color: #c2554f; background: #fdf0ef; color: #8c3a35; }
.inline-callout-warn strong { color: #6f2b27; }
.inline-callout a { color: inherit; font-weight: 650; text-decoration: underline; }
.compact-empty { padding: 16px; margin-bottom: 10px; text-align: left; }
@media (max-width: 860px) {

.dev-code-banner strong { color: #633d1d; font-size: 15px; letter-spacing: 3px; font-family: Consolas, monospace; }
.auth-card .dev-code-banner { margin-bottom: 4px; }

  .auth-panel { grid-template-columns: 1fr; }
  .auth-side { padding: 84px 26px 40px; }
  .auth-brand { top: 20px; left: 22px; }
}

/* ===== v3: 邮箱验证码与找回密码 ===== */
.dev-code-banner {
  border: 1px dashed #d2934e; background: #fff7ef; border-radius: 6px; padding: 10px 12px;
  color: #7a4b25; font-size: 11px; line-height: 1.6;
}

/* ==========================================================================
   财务系统：支付方式选择 / 收款码 / 财务中心
   ========================================================================== */
.channel-field { margin: 14px 0; }
.channel-field-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.channel-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.channel-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.channel-item:hover { border-color: var(--green); }
.channel-item.is-active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(39, 116, 84, 0.14);
  background: #f2f9f5;
}
.channel-item.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f6f7f5;
}
.channel-name { font-size: 14px; font-weight: 600; }
.channel-tag {
  font-size: 11px;
  color: var(--muted);
  background: #eef1ee;
  border-radius: 999px;
  padding: 2px 8px;
}
.channel-tag-live { color: #1d6b4c; background: #dff0e6; }

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px;  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  margin: 6px 0 14px;
}
.qr-box img { background: #fff; border-radius: 6px; }
.qr-hint { font-size: 12px; color: var(--muted); margin: 0; }
.qr-status { font-size: 12px; color: var(--green); margin: 0; font-weight: 600; }

.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}
.channel-state-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.channel-state-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

@media (max-width: 860px) {
  .finance-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ===== 会员制 ===== */
.member-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--green-soft);
  background: var(--green-soft);
  color: var(--green);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 650;
}
.member-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }

.member-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--green-soft);
  border-radius: 9px;
  background: linear-gradient(120deg, var(--green-soft) 0%, #ffffff 70%);
}
.member-banner-plain { border-color: var(--line); background: var(--surface); }
.member-banner-text strong { display: block; font-size: 14px; }
.member-banner-text span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }

.member-status {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 20px;
}
.member-status-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.member-status-head h3 { margin: 8px 0 0; font-size: 18px; }

.quota-row { margin-bottom: 16px; }
.quota-row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; }
.quota-row-head span { color: var(--muted); }
.quota-row-head strong { font-weight: 700; }
.quota-track {
  margin-top: 8px;
  height: 8px;
  border-radius: 6px;
  background: #eef1ef;
  overflow: hidden;
}
.quota-fill { width: 0; height: 100%; border-radius: 6px; background: var(--green); transition: width .25s ease; }
.quota-foot { margin: 7px 0 0; color: #849188; font-size: 10px; }

.member-plan-card.is-current { border-color: var(--green); box-shadow: 0 0 0 1px var(--green-soft); }
.quota-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  font-size: 11px;
  color: var(--muted);
}
.quota-line strong { color: var(--ink); font-size: 12px; font-weight: 650; }
.member-plan-card .package-price { margin-bottom: 12px; }

/* ==========================================================================
   顶栏 / 导航：高级化（毛玻璃顶栏、图标导航、角标、全局搜索）
   ========================================================================== */
.topbar {
  position: relative; z-index: 30; flex: 0 0 58px;
  box-shadow: 0 1px 0 rgba(23, 35, 29, .05), 0 12px 34px rgba(25, 47, 34, .06);
  background: #ffffff;
}
.top-search { position: relative; width: min(340px, 32vw); margin-left: 22px; }
.top-search span { position: absolute; left: 12px; top: 7px; color: var(--muted); font-size: 15px; pointer-events: none; }
.top-search input {
  min-height: 34px; padding: 5px 12px 5px 32px; border-radius: 10px; font-size: 12px;
  background: #f5f8f6; border-color: #e6ece8;
}
.top-search input:focus { background: #fff; border-color: #b9d3c2; box-shadow: 0 0 0 3px rgba(39, 116, 84, .10); }
.nav-icon { width: 16px; height: 16px; flex: none; opacity: .75; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-item { gap: 10px; }
.nav-badge {
  margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 20px;
  background: rgba(255, 255, 255, .12); color: #cfe2d4; font-size: 10px; font-weight: 700; text-align: center;
}
.nav-item.active .nav-badge { background: rgba(201, 230, 209, .22); color: #eaf6ee; }
.nav-item[data-view="models"] { position: relative; }
.nav-item[data-view="models"]:hover { background: rgba(255, 255, 255, .12); }

/* ==========================================================================
   模型广场：卡片网格 + 筛选栏 + 顶部搜索
   ========================================================================== */
.plaza { margin-top: -4px; }
.plaza-hero { text-align: center; padding: 20px 0 26px; }
.plaza-hero .eyebrow { letter-spacing: 2.2px; margin-bottom: 10px; }
.plaza-hero h1 {
  margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.6px;
  background: linear-gradient(115deg, #17231d 18%, #2f7d58 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.plaza-sub { margin: 11px 0 0; color: var(--muted); font-size: 12px; }
.plaza-sub strong { color: var(--ink); }
.plaza-search { position: relative; max-width: 560px; margin: 20px auto 0; }
.plaza-search input {
  min-height: 46px; padding: 10px 54px 10px 42px; border-radius: 13px; font-size: 13px;
  background: #fff; border-color: #e2eae4; box-shadow: 0 10px 30px rgba(25, 47, 34, .08);
}
.plaza-search input:focus { border-color: #b9d3c2; box-shadow: 0 10px 30px rgba(25, 47, 34, .12), 0 0 0 3px rgba(39, 116, 84, .10); }
.plaza-search-icon { position: absolute; left: 16px; top: 12px; color: var(--muted); font-size: 17px; pointer-events: none; }
.plaza-search kbd {
  position: absolute; right: 14px; top: 14px; padding: 2px 7px; border-radius: 6px;
  border: 1px solid var(--line); background: #f6f9f7; color: var(--muted); font: 10px Consolas, monospace;
}
.plaza-layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 22px; align-items: start; }
.plaza-filters {
  position: sticky; top: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 13px; padding: 16px 15px; box-shadow: var(--shadow);
}
.filter-group + .filter-group { margin-top: 17px; padding-top: 15px; border-top: 1px solid #edf1ee; }
.filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.filter-head h3 { margin: 0; font-size: 12px; font-weight: 700; }
.filter-head button { border: 0; background: none; color: var(--muted); font-size: 10px; cursor: pointer; padding: 0; }
.filter-head button:hover { color: var(--green); text-decoration: underline; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft); border-radius: 20px;
  padding: 5px 10px; font-size: 11px; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.filter-chip span { margin-left: 4px; color: var(--muted); font-size: 10px; }
.filter-chip:hover { border-color: #b7c8bd; }
.filter-chip.is-active { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.filter-chip.is-active span { color: #a9c7b4; }
.filter-note { margin-top: 17px; padding-top: 14px; border-top: 1px solid #edf1ee; color: var(--muted); font-size: 10px; line-height: 1.65; }
.plaza-main { min-width: 0; }
.plaza-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.plaza-count { color: var(--muted); font-size: 12px; }
.plaza-count strong { color: var(--ink); font-size: 15px; font-weight: 700; }
.plaza-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plaza-toolbar { justify-content: flex-start; }
.plaza-quick-filters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.plaza-quick-group { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.plaza-quick-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .3px; }
.plaza-quick-group .filter-chip { padding: 4px 9px; font-size: 10.5px; }
.plaza-tools { margin-left: auto; }
.tool-select { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.tool-select select { width: auto; min-height: 30px; padding: 4px 26px 4px 9px; font-size: 11px; border-radius: 8px; }
.tool-segment { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.tool-segment button { border: 0; background: transparent; padding: 6px 11px; font-size: 11px; color: var(--ink-soft); cursor: pointer; }
.tool-segment button + button { border-left: 1px solid var(--line); }
.tool-segment button.is-active { background: var(--green-soft); color: var(--green); font-weight: 650; }
.plaza-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 14px; }
.model-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 15px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.model-card:hover { border-color: #b9d3c2; box-shadow: 0 14px 32px rgba(25, 47, 34, .10); transform: translateY(-2px); }
.model-card-head { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.model-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; }
.avatar-gpt { background: linear-gradient(135deg, #12a982, #0a6f57); }
.avatar-claude { background: linear-gradient(135deg, #d97757, #ad4c33); }
.avatar-aggregate { background: linear-gradient(135deg, #7c5cf0, #4b2fb3); }
.avatar-google { background: linear-gradient(135deg, #4b8df8, #1a73e8); }
.avatar-other { background: linear-gradient(135deg, #7d8a81, #57635b); }
.model-card-name { min-width: 0; }
.model-card-name h3 { margin: 0; font-size: 13px; font-weight: 700; font-family: Consolas, "SFMono-Regular", monospace; letter-spacing: -.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-card-name p { margin: 4px 0 0; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-apiname { font-family: Consolas, "SFMono-Regular", monospace; color: var(--ink-soft); }
.model-price-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 11px 0; border-top: 1px solid #eef2ef; border-bottom: 1px solid #eef2ef; }
.model-price-cell span { display: block; color: var(--muted); font-size: 10px; }
.model-price-cell strong { display: block; margin-top: 4px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.model-price-cell em { display: block; margin-top: 3px; color: #9aa69e; font-size: 9px; font-style: normal; }
.model-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border-radius: 7px; padding: 3px 8px; font-size: 10px; background: #f1f4f2; color: var(--ink-soft); }
.chip-group { background: #eef1ef; color: #5d6b62; }
.chip-company { background: #eef2fb; color: #3a5ba8; }
.chip-modality { background: #f4eefb; color: #6b46a8; }
.chip-balance { background: var(--amber-soft); color: var(--amber); }
.chip-quota { background: var(--green-soft); color: var(--green); }
.chip-tier { background: #eef2fb; color: #3a5ba8; }
.model-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.link-more { border: 0; background: none; color: var(--green); font-size: 11px; font-weight: 650; cursor: pointer; padding: 0; }
.link-more:hover { text-decoration: underline; }
.model-detail { border-top: 1px dashed var(--line); padding-top: 12px; }
.model-detail dl { margin: 0; display: grid; gap: 7px; }
.model-detail dl > div { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
.model-detail dt { color: var(--muted); flex: none; }
.model-detail dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }
.model-edit { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.model-edit .price-fields { min-width: 0; margin-bottom: 10px; }
.model-edit .price-fields input { width: 100%; min-width: 0; }
.model-edit .field-label { margin-bottom: 5px; }
.model-edit-actions { display: flex; gap: 8px; margin-top: 11px; }

@media (max-width: 1080px) {
  .plaza-layout { grid-template-columns: 1fr; }
  .plaza-filters { position: static; }
  .top-search { width: min(240px, 26vw); margin-left: 12px; }
}
@media (max-width: 860px) {
  .top-search { display: none; }
  .plaza-hero h1 { font-size: 27px; }
  .plaza-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* ===== 管理后台：运营总览 / 用户明细 ===== */
.dialog-wide { width: min(980px, calc(100vw - 32px)); }
.dialog-wide .table-wrap { max-height: 320px; overflow-y: auto; }
.dialog-wide .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) {
  .dialog-wide .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== 联系客服：侧栏入口 + 悬浮按钮 + 二维码弹窗 ===== */
.service-entry { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.service-entry .service-dot { background: #4fae7d; }
.service-entry .external-mark { color: #cfe2d4; font-size: 16px; text-align: right; }
.service-float {
  position: fixed; right: 18px; bottom: 74px; z-index: 40;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 13px; border: 1px solid var(--line); border-radius: 22px;
  background: #fff; color: var(--ink); font-size: 12px; font-weight: 650;
  box-shadow: 0 6px 18px rgba(23, 35, 29, .14); cursor: pointer;
}
.service-float:hover { border-color: var(--green); color: var(--green); }
.service-float-icon { color: var(--green); flex: 0 0 auto; }
.service-dialog { width: min(420px, calc(100vw - 32px)); text-align: center; }
.service-dialog .dialog-heading { text-align: left; }
.service-qr { display: flex; justify-content: center; padding: 4px 0 10px; }

/* 待付款凭证：客户一键复制后发给客服 */
.voucher-card { margin: 14px 0 12px; padding: 13px 16px; border: 1px dashed var(--line); border-radius: 8px; background: #fbfdfc; }
.voucher-title { margin: 0 0 8px; font-size: 12px; font-weight: 700; color: var(--green); letter-spacing: .08em; }
.voucher-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed #e8efea; font-size: 12px; }
.voucher-row:last-child { border-bottom: 0; }
.voucher-row span { color: var(--muted); }
.voucher-row strong { color: var(--ink); font-weight: 650; text-align: right; word-break: break-all; }
.voucher-actions { display: flex; gap: 10px; margin-bottom: 2px; }
.service-qr img {
  width: 240px; height: 240px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; object-fit: contain;
}
.service-hint { margin: 0 0 6px; color: var(--ink); font-size: 13px; font-weight: 650; }
.service-dialog .form-help { margin: 0; text-align: left; }
.trial-apply-dialog { width: min(640px, calc(100vw - 32px)); }
.trial-apply-notice { margin-bottom: 12px; }
.trial-apply-qr img { width: 200px; height: 200px; }
.guide-steps { margin: 14px 0; padding-left: 20px; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.guide-steps li { margin-bottom: 4px; }
.guide-steps strong { color: var(--ink); }
@media (max-width: 650px) {
  .service-float { right: 12px; bottom: 66px; padding: 8px 11px; }
  .service-float-text { display: none; }
}

.topup-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.topup-form .field { flex: 1 1 220px; min-width: 0; }
.topup-form .field > span { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.topup-form .button { flex: 0 0 auto; }
@media (max-width: 650px) {
  .topup-form { flex-direction: column; align-items: stretch; }
  .topup-form .button { width: 100%; }
}

/* ===== 会员专属 API 卡片（会员中心） ===== */
.member-key-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
#member-key-value { word-break: break-all; }

/* ===== 公开页：模型与定价 / 接入文档（未登录也能读） ===== */
.public-page {
  height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--canvas);
}
.public-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; background: var(--green-dark); color: #eef6f0;
}
.public-brand { padding: 0; }
.public-brand small { color: #9cb9a5; }
.public-nav { display: flex; gap: 18px; }
.public-nav a { color: #c6d4ca; font-size: 12.5px; font-weight: 650; }
.public-nav a:hover { color: #ffffff; }
.public-actions { display: flex; align-items: center; gap: 14px; }
.public-note { color: #b9cec0; font-size: 11px; }
.public-content { max-width: 1240px; margin: 0 auto; padding: 28px 28px 40px; }
@media (max-width: 650px) {
  .public-bar { flex-direction: column; align-items: flex-start; gap: 10px; padding: 12px 16px; }
  .public-actions { width: 100%; justify-content: space-between; }
  .public-content { padding: 20px 16px 32px; }
}

/* ===== 重点模型（笔问聚合AI）的特点说明块 ===== */
.model-spotlight {
  border: 1px solid var(--green-soft);
  background: linear-gradient(180deg, #f4faf6 0%, #ffffff 100%);
  border-radius: 10px;
  padding: 12px 13px;
}
.model-spotlight-lead { margin: 0; color: var(--ink); font-size: 11.5px; font-weight: 650; line-height: 1.65; }
.model-spotlight-list { margin: 8px 0 0; padding-left: 16px; color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.model-spotlight-list li { margin-bottom: 3px; }
