:root {
  --bg: #070b12;
  --bg-elev: #111827;
  --bg-soft: #1a2332;
  --line: rgba(245, 208, 96, 0.18);
  --line-strong: rgba(245, 196, 0, 0.32);
  --text: #f7f9fc;
  --muted: #c5cedb;
  --copper: #f5c400;
  --copper-2: #ffe27a;
  --mint: #5eead4;
  --danger: #fb7185;
  --warn: #fbbf24;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: Georgia, "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: 0.01em;
}
a { color: var(--copper); text-decoration: none; }
a:hover { color: var(--copper-2); }
img, video { max-width: 100%; }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
.glow {
  position: fixed; width: 48vw; height: 48vw; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,196,0,.20), transparent 62%);
  top: -18vw; right: -10vw; pointer-events: none; z-index: 0;
}

.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mbar { display: none; }
.nav-mask { display: none; }
.side {
  width: 248px; flex-shrink: 0;
  background: linear-gradient(180deg, #0e1522 0%, #0a1018 100%);
  border-right: 1px solid var(--line);
  padding: 28px 18px; display: flex; flex-direction: column;
}
.brand {
  display: flex; flex-direction: column; gap: 4px;
  padding: 0 10px 28px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.brand .mark {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  color: var(--copper-2); letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 10px;
}
.brand .mark i { font-size: 18px; }
.brand .sub { font-size: 11px; color: var(--muted); letter-spacing: 0.18em; text-transform: uppercase; }
.brand.with-logo {
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 0 8px 24px;
  color: inherit;
}
.brand.with-logo:hover { color: inherit; }
.brand.with-logo .brand-logo {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.brand.with-logo .brand-slogan {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-align: center;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 10px; color: var(--muted);
  font-size: 14px; margin-bottom: 4px;
}
.nav a i { width: 18px; text-align: center; opacity: .8; }
.nav a.active, .nav a:hover { background: var(--bg-soft); color: var(--text); }
.nav a.active { box-shadow: inset 0 0 0 1px var(--line); color: var(--copper-2); }
.nav a.active i, .nav a:hover i { opacity: 1; color: var(--copper); }
.side-foot {
  margin-top: auto; padding: 16px 10px 0; font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.side-foot a { display: inline-flex; align-items: center; gap: 5px; }
.main { flex: 1; padding: 28px 36px 48px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; }
.topbar h1 { font-family: var(--serif); font-size: 32px; font-weight: 500; margin: 0; }
.topbar p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.topbar-extra { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }
.balance-chip {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 8px 8px 16px; display: flex; gap: 10px; align-items: center; flex-shrink: 0;
}
.balance-chip b { color: var(--mint); font-size: 18px; font-weight: 600; }
.balance-chip span { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.balance-chip .user-in-chip { color: var(--text); font-weight: 600; }
.balance-chip .logout-in-chip {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--muted); width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.balance-chip .logout-in-chip:hover { color: var(--copper); background: var(--bg-soft); }
.balance-chip .chip-split {
  width: 1px; height: 18px; background: var(--line); padding: 0; margin: 0 2px;
}
.balance-chip .recharge-in-chip {
  margin-left: 4px; padding: 6px 12px; border-radius: 999px; font-size: 12px;
}
.mint { color: var(--mint); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-6 .kpi .val { font-size: 24px; }
.grid-2 { grid-template-columns: 1.2fr .8fr; }
.usage-layout.grid-2 { grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr); }
.usage-summary .table { width: auto; min-width: 0; max-width: 100%; }
.usage-summary .table th:nth-child(n+2),
.usage-summary .table td:nth-child(n+2) { width: 1%; white-space: nowrap; padding-right: 16px; }
.usage-summary .table .mono { word-break: break-all; }
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.kpi .label {
  color: var(--muted); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.kpi .label i { color: var(--copper); letter-spacing: 0; }
.kpi .val { font-family: var(--serif); font-size: 28px; margin-top: 8px; }
.kpi .val.mint { color: var(--mint); }
.kpi .val.copper { color: var(--copper); }
.kpi .val.bad { color: var(--danger); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.table tr:hover td { background: rgba(255,255,255,0.015); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.bill-model { max-width: 220px; word-break: break-all; }

.btn, button.btn {
  appearance: none; border: 0; cursor: pointer; font-family: inherit;
  background: var(--copper); color: #041018; font-weight: 600;
  padding: 10px 16px; border-radius: 10px; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn.danger { background: #6d3c36; color: #f6d6d0; }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.input, select, textarea {
  width: 100%; background: #0c121c; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-family: inherit; font-size: 14px; outline: none;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.input:focus, select:focus, textarea:focus { border-color: var(--copper); }
.model-pick {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.model-pick .field { margin-bottom: 0; flex: 1 1 280px; min-width: 220px; }
.chat-toolbar .model-pick { flex: 1; margin-bottom: 0; }
label.field { display: block; margin-bottom: 14px; }
.field-gap { margin-top: 22px; }
label.field > span {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.lbl {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.lbl i { width: 14px; text-align: center; opacity: .9; }
.ico-ratio {
  display: inline-block;
  width: 14px;
  height: 14px;
  position: relative;
  flex-shrink: 0;
  opacity: .9;
}
.ico-ratio::before,
.ico-ratio::after {
  content: "";
  position: absolute;
  border: 1.5px solid currentColor;
  border-radius: 1px;
  box-sizing: border-box;
}
.ico-ratio::before {
  width: 12px;
  height: 8px;
  left: 0;
  bottom: 1px;
}
.ico-ratio::after {
  width: 7px;
  height: 12px;
  right: 0;
  top: 0;
  background: var(--bg-elev);
}
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.5; }
.upload-row { display: flex; gap: 8px; margin-top: 8px; }
.upload-label {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  cursor: pointer;
}
.upload-label .upload-face { pointer-events: none; }
.upload-file {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0.01;
  font-size: 16px;
  cursor: pointer;
  background: transparent;
  color: transparent;
}
.upload-file::-webkit-file-upload-button {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 16px;
  cursor: pointer;
}
html.is-wx-ios .upload-label {
  display: block;
  width: 100%;
  min-height: 44px;
}
html.is-wx-ios .upload-file {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  height: 44px;
  opacity: 1;
  z-index: 3;
}
html.is-wx-ios .upload-face {
  position: absolute;
  inset: 0;
  z-index: 1;
}
html.is-wx-ios .upload-file::-webkit-file-upload-button {
  width: 100%;
  height: 44px;
  opacity: 0.02;
}
.opt-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.opt-panel .field { margin-bottom: 0; }
.opt-panel .pills { gap: 6px; }
.opt-panel .pill { padding: 6px 11px; }
.opt-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 28px;
}
.opt-dur { width: 112px; flex-shrink: 0; }
.opt-dur .input { padding: 8px 10px; }
.check-row {
  display: flex; align-items: center; gap: 8px;
  min-height: 38px;
  padding: 0 2px 2px;
}
.check-row span { margin: 0 !important; display: inline-flex !important; align-items: center; gap: 7px; color: var(--text); font-size: 13px; }
.check-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #0c121c;
  cursor: pointer;
}
.check-row input[type="checkbox"]:checked {
  background: var(--copper);
  border-color: var(--copper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23041018' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-6'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}
.submit-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line);
}
.est { color: var(--muted); font-size: 13px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.est b { color: var(--copper); font-size: 18px; }
.est small { color: var(--muted); font-size: 11px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; }
.preview-title { font-family: var(--serif); font-size: 22px; display: flex; align-items: center; gap: 8px; }
.preview-st { color: var(--muted); font-size: 13px; margin-top: 4px; }
.preview-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted);
}
.preview-empty i { font-size: 28px; opacity: .55; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  padding: 7px 12px; border-radius: 999px; cursor: pointer; font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px;
}
.pill.on { border-color: var(--copper); color: var(--copper-2); background: rgba(245,196,0,.14); }
.pill .ico { width: 16px; height: 16px; display: block; flex-shrink: 0; }
.pill i { font-size: 13px; width: 14px; text-align: center; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; letter-spacing: .04em;
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line);
}
.badge.ok { color: var(--mint); border-color: rgba(134,203,179,.3); }
.badge.run { color: var(--warn); border-color: rgba(224,179,106,.3); }
.badge.bad { color: var(--danger); border-color: rgba(224,138,122,.3); }
.badge.feat { color: var(--copper); border-color: rgba(245,196,0,.35); margin-left: 6px; }

.pager { display: flex; gap: 8px; margin-top: 18px; align-items: center; color: var(--muted); font-size: 13px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; }
.filters .input, .filters select { width: auto; min-width: 160px; }
.filters input[type="date"] { min-width: 150px; color-scheme: dark; }
.filter-date { display: flex; flex-direction: column; gap: 4px; }
.filter-date span { font-size: 12px; color: var(--muted); line-height: 1; }

.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; position: relative; z-index: 1;
  padding: 24px;
}
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-family: var(--serif); font-weight: 500; margin: 0 0 8px; }
.auth-card .sub { display: flex; align-items: center; gap: 8px; }
.hero {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; position: relative; z-index: 1;
}
.hero-copy { padding: 8vh 8vw; display: flex; flex-direction: column; justify-content: center; }
.hero-copy h1 { font-family: var(--serif); font-size: clamp(40px, 6vw, 72px); line-height: 1.05; margin: 0 0 18px; font-weight: 500; }
.hero-copy p { color: var(--muted); font-size: 16px; max-width: 520px; line-height: 1.7; }
.hero-panel { display: grid; place-items: center; padding: 8vh 6vw; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.meta-row {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-top: 36px; max-width: 540px;
}
.meta-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-elev);
}
.meta-item i {
  width: 32px; height: 32px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px; background: rgba(245,196,0,.16);
  color: var(--copper); font-size: 14px; margin: 0;
}
.meta-item span {
  display: block; color: var(--muted); font-size: 12px; line-height: 1.3; margin-bottom: 4px;
}
.meta-item b {
  display: block; color: var(--text); font-size: 16px; font-weight: 600; line-height: 1.2;
}

.studio { display: grid; grid-template-columns: 1.05fr .95fr; gap: 20px; align-items: start; }
.preview-card .preview-box { margin-top: 14px; }
.preview-box {
  min-height: 360px; border-radius: 14px; border: 1px dashed var(--line-strong);
  display: grid; place-items: center; color: var(--muted); overflow: hidden; background: #0c121c;
}
.preview-box video, .preview-box img { width: 100%; display: block; }
.preview-box img { cursor: zoom-in; }
.refs { display: flex; gap: 8px; flex-wrap: wrap; }
.ref-item {
  width: 72px; height: 72px; border-radius: 10px; overflow: hidden; position: relative;
  border: 1px solid var(--line);
}
.ref-item img { width: 100%; height: 100%; object-fit: cover; }
.ref-item button {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0;
  border-radius: 50%; background: #000a; color: #fff; cursor: pointer;
}
.toast {
  position: fixed; right: 20px; bottom: 20px; background: #1b1e26; color: var(--text);
  border: 1px solid var(--line); padding: 12px 16px; border-radius: 12px; z-index: 80;
  display: none; max-width: min(420px, calc(100vw - 40px)); line-height: 1.55;
}
.mask-loading {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(8, 9, 12, 0.72);
  backdrop-filter: blur(8px);
  display: none; place-items: center;
}
.mask-loading.show { display: grid; }
.mask-card {
  width: min(360px, calc(100vw - 40px));
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.spinner, .mask-spin {
  width: 36px; height: 36px; margin: 0 auto 16px;
  border: 3px solid rgba(245, 196, 0, 0.22);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.mask-spin {
  display: block; width: auto; height: auto; border: 0; font-size: 28px;
  color: var(--copper); animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.mask-card h3 { font-family: var(--serif); font-weight: 500; margin: 0 0 8px; font-size: 22px; }
.mask-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.alert-mask {
  position: fixed; inset: 0; z-index: 75;
  background: rgba(8, 9, 12, 0.62);
  display: none; place-items: center; padding: 20px;
}
.alert-mask.show { display: grid; }
.alert-card {
  width: min(440px, 100%);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.alert-card h3 { font-family: var(--serif); font-weight: 500; margin: 0 0 10px; }
.alert-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.7; font-size: 14px; }
.alert-card .btn { width: 100%; }
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40;
  display: none; place-items: center; padding: 16px; overflow: auto;
}
.card.modal {
  padding: 16px 18px 14px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  margin: auto;
}
.recharge-bal {
  display: flex; align-items: baseline; gap: 8px;
  margin: 0 0 14px; color: var(--muted); font-size: 13px;
}
.recharge-bal b { color: var(--mint); font-size: 20px; font-family: var(--serif); }
.recharge-modal { width: min(420px, 100%); }
.recharge-amts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 4px 0 16px;
}
.recharge-amt {
  appearance: none; border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--text); border-radius: 12px; padding: 12px 8px; cursor: pointer;
  font-family: var(--serif); font-size: 18px; font-weight: 500;
}
.recharge-amt.on {
  border-color: var(--copper); color: var(--copper); background: rgba(245,196,0,.12);
}
.recharge-pay-amt {
  text-align: center; font-size: 28px; font-family: var(--serif);
  color: var(--mint); margin: 4px 0 8px;
}
.recharge-qr-wrap { display: flex; justify-content: center; padding: 8px 0 4px; }
.recharge-qr-wrap img {
  width: 240px; height: 240px; background: #fff; border-radius: 12px; padding: 8px;
}
.recharge-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.code {
  background: #0c121c; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; overflow: auto; font-size: 12px; line-height: 1.55; color: #d9d2c5;
  max-width: 100%; -webkit-overflow-scrolling: touch;
}
.key-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.key-actions { display: flex; align-items: center; gap: 2px; }
.copy-ico {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.copy-ico:hover { color: var(--copper); background: var(--bg-soft); }
.copy-ico:focus { outline: none; color: var(--copper); }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: stretch; }
.task-card {
  padding: 12px; display: flex; flex-direction: column; min-height: 100%;
}
.task-media, .task-card .ph {
  width: 100%; min-width: 100%; aspect-ratio: 16/9;
  background: #152033; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; flex-shrink: 0;
}
.task-media {
  display: flex; align-items: center; justify-content: center;
}
.task-media.is-zoom { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(8, 9, 12, 0.88);
  display: none; place-items: center;
  padding: 36px 20px 20px; cursor: zoom-out;
}
.lightbox.show { display: grid; }
body.lightbox-open { overflow: hidden; }
.lightbox img {
  max-width: min(96vw, 1280px);
  max-height: calc(100dvh - 56px);
  width: auto; height: auto; object-fit: contain;
  border-radius: 12px; box-shadow: var(--shadow); cursor: default;
  background: #152033;
}
.lightbox-close {
  appearance: none; position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-elev); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.lightbox-close:hover { color: var(--copper); }
.task-media img, .task-media video {
  width: 100%; height: 100%; object-fit: contain; object-position: center;
  background: #152033;
}
.task-card .ph {
  color: var(--muted); font-size: 12px;
}
.ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; text-align: center; }
.ph i { font-size: 22px; opacity: .55; }
.ph-chat {
  align-items: flex-start; justify-content: flex-start; text-align: left;
}
.ph-chat span { width: 100%; line-height: 1.55; }
.task-prompt {
  margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.5;
  flex: 1 1 auto;
}
.task-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line);
}
.chat-card { display: flex; flex-direction: column; min-height: calc(100vh - 180px); }
.chat-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px;
}
.chat-log {
  flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 10px;
  min-height: 360px; padding: 4px 2px 12px;
}
.chat-empty {
  margin: auto; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.chat-empty i { font-size: 28px; opacity: .5; color: var(--copper); }
.chat-msg {
  max-width: 78%; padding: 10px 14px; border-radius: 14px; line-height: 1.65; font-size: 14px;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.user {
  align-self: flex-end; background: rgba(245,196,0,.18); color: var(--text);
}
.chat-msg.assistant {
  align-self: flex-start; background: var(--bg-soft); border: 1px solid var(--line);
}
.chat-composer { display: flex; gap: 10px; align-items: flex-end; padding-top: 12px; border-top: 1px solid var(--line); }
.chat-composer .input { min-height: 48px; resize: none; }
.chat-composer .btn { height: 42px; flex-shrink: 0; }
.page-empty {
  grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 36px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.page-empty i { font-size: 28px; opacity: .5; color: var(--copper); }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.card-head {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 12px; margin-bottom: 10px; letter-spacing: .08em;
}
.card-head i { color: var(--copper); }
.dash-split {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-top: 16px; align-items: start;
}
.trend-card { width: 100%; margin-top: 16px; }
.trend-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.trend-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.trend-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.trend-legend .dot-consume { background: var(--mint); }
.trend-legend .dot-profit { background: var(--copper); }
.trend-canvas-wrap { position: relative; height: 320px; margin-top: 8px; width: 100%; }
.trend-canvas { width: 100%; height: 100%; display: block; }
.trend-tip {
  position: absolute; pointer-events: none; display: none;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: 12px; color: var(--text); white-space: nowrap;
  box-shadow: var(--shadow); z-index: 2;
}
.trend-tip b { color: var(--mint); }
.trend-tip .p { color: var(--copper); }

@media (max-width: 1280px) {
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  html { overflow-x: auto; }
  .grid-4, .grid-2, .studio, .hero, .dash-split { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 .kpi .val { font-size: 22px; }
  .input, select, textarea { font-size: 16px; }
  .main { padding: 16px 14px 36px; }

  .app-shell:not(.has-drawer) { flex-direction: column; }
  .app-shell:not(.has-drawer) .side { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 8px; padding: 16px; }
  .app-shell:not(.has-drawer) .brand { border: 0; margin: 0; padding: 0 8px 0 0; }
  .app-shell:not(.has-drawer) .nav { display: flex; gap: 6px; flex-wrap: wrap; }
  .app-shell:not(.has-drawer) .side-foot { display: none; }

  .has-drawer .mbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 30;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    background: #0e1522; border-bottom: 1px solid var(--line);
  }
  .mbar-btn {
    appearance: none; border: 1px solid var(--line); background: var(--bg-soft);
    color: var(--text); width: 40px; height: 40px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; flex-shrink: 0;
  }
  .mbar-btn:hover { color: var(--copper); border-color: var(--line-strong); }
  .mbar-brand {
    font-family: var(--serif); font-size: 18px; color: var(--copper-2);
    display: inline-flex; align-items: center; gap: 8px;
  }
  .mbar-brand:hover { color: var(--copper-2); }
  .mbar-brand .mbar-logo {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
  }
  .has-drawer .nav-mask {
    display: block; position: fixed; inset: 0; z-index: 32;
    background: rgba(8, 9, 12, 0.58); opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  .has-drawer .nav-mask[hidden] { display: none; }
  body.nav-open { overflow: hidden; }
  body.nav-open .has-drawer .nav-mask {
    display: block; opacity: 1; pointer-events: auto;
  }
  .has-drawer .side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 36;
    width: min(280px, 86vw); height: 100dvh;
    transform: translateX(-105%);
    transition: transform .22s ease;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: none;
  }
  body.nav-open .has-drawer .side {
    transform: translateX(0);
    box-shadow: var(--shadow);
    pointer-events: auto;
  }
  .has-drawer .nav a { padding: 13px 12px; }

  .topbar { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 18px; }
  .topbar h1 { font-size: 24px; }
  .topbar-extra { width: 100%; }
  .topbar-extra > .btn { width: 100%; }
  .balance-chip {
    width: 100%; flex-wrap: wrap; justify-content: flex-start;
    border-radius: 14px; padding: 10px 12px; row-gap: 8px;
  }
  .balance-chip .chip-split {
    flex-basis: 100%; width: 100%; height: 1px; margin: 2px 0;
  }
  .balance-chip .recharge-in-chip { margin-left: auto; }

  .card:has(> .table), .card:has(> table.table) {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .table { min-width: 560px; }
  .usage-summary .table { min-width: 0; width: 100%; }
  .filters { flex-direction: column; align-items: stretch; }
  .filters .input, .filters select, .filters input[type="date"] { width: 100%; min-width: 0; }
  .chat-card { min-height: calc(100dvh - 210px); }
  .chat-toolbar { flex-direction: column; align-items: stretch; }
  .chat-toolbar .field { min-width: 0 !important; }
  .chat-log { min-height: 240px; }
  .chat-composer { flex-direction: column; align-items: stretch; }
  .chat-composer .btn { width: 100%; height: 44px; }
  .chat-msg { max-width: 92%; }
  .submit-row { flex-direction: column; align-items: stretch; }
  .submit-row .btn { width: 100%; }
  .upload-row, .upload-label { width: 100%; }
  .upload-label .upload-face { width: 100%; min-height: 44px; }
  .preview-box { min-height: 220px; }
  .task-meta { flex-wrap: wrap; }
  .trend-head { flex-direction: column; }
  .trend-canvas-wrap { height: 240px; }
  .preview-title { font-size: 18px; }
  .pager { flex-wrap: wrap; }
  .opt-dur { width: 100%; }
  .modal { width: min(460px, calc(100vw - 28px)); }
  .toast { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}

/* —— 公开站 —— */
.site { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.site-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 6vw; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 34;
  background: rgba(10, 11, 14, 0.92);
  backdrop-filter: blur(12px);
}
.site-nav .logo {
  display: flex; align-items: center; flex-shrink: 0; line-height: 0;
}
.site-nav .site-logo {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
}
.site-nav-toggle { display: none; }
.site-links { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.site-links a { color: var(--muted); font-size: 14px; }
.site-links a:hover, .site-links a.on { color: var(--text); }
.site-links a.site-cta,
.btn.site-cta {
  position: relative;
  background: var(--copper);
  color: #111111;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 8px;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: none;
  transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.site-links a.site-cta i,
.btn.site-cta i { color: inherit; }
.site-links a.site-cta:hover,
.site-links a.site-cta.on,
.btn.site-cta:hover {
  background: var(--copper-2);
  color: #111111;
  filter: none;
  transform: scale(1.05);
  box-shadow: 0 0 18px rgba(245, 196, 0, 0.35);
}
.site-links a.site-cta:active,
.btn.site-cta:active { transform: scale(0.95); }
.site-hero {
  padding: 1vh 6vw 8vh;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center;
}
.site-hero h1 {
  font-family: var(--serif); font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.08; font-weight: 500; margin: 0 0 18px;
}
.site-hero p.lead { color: var(--muted); font-size: 17px; line-height: 1.75; max-width: 540px; margin: 0 0 28px; }
.term {
  background: #0f1d34;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55), 0 0 40px rgba(245, 196, 0, 0.06);
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #070e1a;
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.term-dot.r { background: rgba(239, 68, 68, 0.8); }
.term-dot.y { background: rgba(234, 179, 8, 0.8); }
.term-dot.g { background: rgba(34, 197, 94, 0.8); }
.term-name {
  margin-left: 8px; font-size: 12px; color: #6b7280;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.term-body {
  margin: 0; padding: 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 14px; line-height: 1.625;
  overflow: auto; white-space: pre; -webkit-overflow-scrolling: touch;
}
.term-body .c { color: #6b7280; }
.term-body .cmd { color: var(--copper-2); }
.term-body .ln { color: #d1d5db; }
.term-body .str { color: #4ade80; }
.term-body .brace { color: #fde047; }
.term-body .key { color: #60a5fa; }
.term-body .dim { color: #4b5563; }
.term-cursor {
  display: inline-block; width: 8px; height: 16px; vertical-align: -2px;
  background: var(--copper-2); animation: term-blink 1s step-end infinite;
}
@keyframes term-blink { 50% { opacity: 0; } }
.pill-tag {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; color: var(--copper-2); font-size: 12px; letter-spacing: .08em;
  margin-bottom: 18px;
}
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding: 0 6vw 72px;
}
.feature-grid .card h3 { font-family: var(--serif); font-weight: 500; margin: 10px 0 8px; }
.feature-grid .card p { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0; }
.section { padding: 0 6vw 72px; }
.section h2 { font-family: var(--serif); font-size: 32px; font-weight: 500; margin: 0 0 8px; }
.section .sec-sub { color: var(--muted); margin: 0 0 24px; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.model-card { display: flex; flex-direction: column; gap: 10px; min-height: 180px; }
.model-card h3 { font-family: var(--serif); font-size: 20px; margin: 0; font-weight: 500; }
.model-card .mid { color: var(--muted); font-size: 13px; line-height: 1.6; flex: 1; }
.price-row { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.price-row b { color: var(--copper-2); font-size: 14px; }
.ctx-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 8px;
  background: rgba(245, 196, 0, 0.08);
  border: 1px solid rgba(245, 196, 0, 0.16);
  color: var(--copper-2); font-size: 12px; font-weight: 600;
}
.ctx-chip i { font-size: 11px; opacity: .8; }
.site-footer {
  margin-top: auto; padding: 28px 6vw; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.docs-grid { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.docs-toc a { display: block; color: var(--muted); padding: 8px 0; font-size: 14px; }
.docs-toc a:hover { color: var(--text); }
.docs-body h2 { font-family: var(--serif); font-weight: 500; margin: 28px 0 10px; }
.docs-body h3 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; color: var(--text); }
.docs-body p { color: var(--muted); line-height: 1.75; }
.docs-label {
  margin: 16px 0 6px; font-size: 12px; color: var(--copper); letter-spacing: .04em;
}
.docs-body .code + .docs-label { margin-top: 16px; }
.docs-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0 16px; }
.docs-table { width: 100%; min-width: 420px; border-collapse: collapse; font-size: 13px; }
.docs-table th, .docs-table td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
  vertical-align: top; line-height: 1.55;
}
.docs-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.docs-table code { font-size: 12px; }
.page-hero { padding: 48px 6vw 28px; }
.page-hero h1 { font-family: var(--serif); font-size: 42px; font-weight: 500; margin: 0 0 10px; }
.page-hero p { color: var(--muted); margin: 0; }
.masked-key { letter-spacing: .04em; }
.modal { width: min(560px, 100%); }
.model-form label.field { margin-bottom: 8px; }
.model-form label.field > span { margin-bottom: 4px; }
.model-form .input, .model-form select { padding: 8px 10px; }
.model-form h3 { margin: 0 0 10px; }
.model-form .hint { margin: 0 0 8px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.model-form .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.mono-clip { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 980px) {
  .site-hero, .docs-grid, .feature-grid { grid-template-columns: 1fr; }
  .site-hero { padding: 28px 5vw 40px; gap: 24px; }
  .site-hero h1 { font-size: clamp(32px, 10vw, 44px); }
  .site-hero p.lead { font-size: 15px; }
  .hero-actions { margin-top: 20px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .meta-row { grid-template-columns: 1fr; max-width: none; margin-top: 22px; }
  .feature-grid, .section { padding-left: 5vw; padding-right: 5vw; }
  .feature-grid { padding-bottom: 40px; }
  .section { padding-bottom: 48px; }
  .section h2 { font-size: 26px; }
  .page-hero { padding: 28px 5vw 18px; }
  .page-hero h1 { font-size: 30px; }
  .model-grid { grid-template-columns: 1fr; }
  .price-row { flex-wrap: wrap; gap: 8px 14px; }
  .site-footer { padding: 20px 5vw; flex-direction: column; }
  .auth-wrap {
    min-height: auto; padding: 28px 16px 40px;
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }
  .docs-toc { display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .docs-toc a { padding: 6px 0; }

  .site-nav {
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    z-index: 40;
  }
  .site-nav .site-logo { height: 32px; }
  .site-nav-toggle { display: inline-flex; }
  .site-links {
    display: flex; position: fixed; z-index: 36;
    top: 0; right: 0; bottom: 0;
    width: min(300px, 86vw); height: 100dvh;
    flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 4px;
    padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, #243044 0%, #1a2433 100%);
    border-left: 1px solid var(--line-strong);
    transform: translateX(105%);
    transition: transform .22s ease;
    pointer-events: none;
  }
  body.nav-open .site-links {
    transform: translateX(0);
    box-shadow: var(--shadow);
    pointer-events: auto;
  }
  .site-links a {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 12px; border-radius: 10px; color: var(--text); font-size: 15px;
  }
  .site-links a.on, .site-links a:hover { background: rgba(245, 196, 0, 0.14); color: var(--copper-2); }
  .site-links a.site-cta,
  .site-links a.site-cta:hover,
  .site-links a.site-cta.on {
    width: 100%; justify-content: center; margin-top: 8px;
    background: var(--copper); color: #111111;
    transform: none; box-shadow: none;
  }
  .site-links a.site-cta:hover { background: var(--copper-2); }
  .site-links .btn { width: 100%; justify-content: center; margin-top: 8px; }
  .nav-mask {
    display: block; position: fixed; inset: 0; z-index: 32;
    background: rgba(8, 9, 12, 0.35); opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  .nav-mask[hidden] { display: none; }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav-mask { display: block; opacity: 1; pointer-events: auto; }
}
