* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f7f7fa;
  --border: #e6e6eb;
  --border-strong: #d8d8e0;
  --text: #1a1a1a;
  --text-2: #5f5f68;
  --text-3: #9898a3;
  --accent: #6b3ff2;
  --accent-strong: #5a2fd8;
  --accent-soft: #f0ebff;
  --green: #16a34a;
  --green-soft: #e7f6ec;
  --red: #e0554a;
  --red-soft: #fdecea;
  --yellow: #b8860b;
  --yellow-soft: #fff8e6;
  --blue: #2563eb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 20, 35, 0.04), 0 6px 20px rgba(20, 20, 35, 0.04);
  --mono: "SF Mono", "Fira Code", ui-monospace, "Menlo", monospace;
}
html { height: 100%; }
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d6d6de; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 232px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid #ececec;
  z-index: 50;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}
.brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #fff;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
}
.brand span { font-weight: 700; font-size: 16px; letter-spacing: 0; }
.nav-section {
  padding: 18px 18px 6px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  margin: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #45454d;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: #f5f2ff; color: var(--accent); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-dot { width: 7px; height: 7px; border-radius: 50%; background: #cfcfd6; flex-shrink: 0; }
.nav-item.active .nav-dot { background: var(--accent); }
.nav-spacer { flex: 1; }
.sidebar-foot { padding: 14px; border-top: 1px solid #ececec; }
.foot-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 10px;
}
.foot-user .avatar { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.foot-user .u { min-width: 0; }
.foot-user .u .mail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; color: var(--text); }
.foot-user .u .bal { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.foot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.foot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.foot-btn:hover { border-color: var(--accent); color: var(--accent); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid #ececec;
}
.topbar h1 { font-size: 18px; font-weight: 700; letter-spacing: 0; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}
.status-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
}
.user-chip:hover { border-color: var(--accent); color: var(--text); }
.user-chip .avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.user-chip .balance { font-family: var(--mono); color: var(--text); font-weight: 600; }
.menu-btn { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font-size: 17px; cursor: pointer; }

.content { flex: 1; padding: 24px; min-width: 0; }
.content.wide { max-width: 1320px; width: 100%; margin: 0 auto; }
.content.narrow { max-width: 920px; width: 100%; margin: 0 auto; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.btn:hover { border-color: var(--border-strong); color: var(--text); }
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary.block { width: 100%; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { background: var(--surface-2); }

.card {
  background: var(--surface);
  border: 1px solid #ececec;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 15px; font-weight: 700; }
.section-head .sub { font-size: 12px; color: var(--text-3); }

.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.summary-item { background: var(--surface); border: 1px solid #ececec; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.summary-item .label { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.summary-item .value { font-size: 22px; font-weight: 700; letter-spacing: 0; }
.summary-item .hint { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.quick-access { background: var(--surface); border: 1px solid #ececec; border-radius: var(--radius); padding: 18px; margin-bottom: 18px; box-shadow: var(--shadow); }
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; min-width: 0; }
.qa-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.12s;
}
.qa-item:hover { border-color: var(--accent); }
.qa-item .lbl { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.qa-item .val { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-item .copy { color: var(--text-3); font-size: 12px; flex-shrink: 0; }

.search-row { display: flex; gap: 12px; margin-bottom: 16px; }
.search-row input, .search-row select {
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.search-row input { flex: 1; min-width: 0; }
.search-row input:focus, .search-row select:focus { border-color: var(--accent); }
.filter-btn { width: 118px; }
.filter-panel {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid #ececec;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.filter-panel.show { display: grid; }
.filter-panel select, .filter-panel input {
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.filter-panel select:focus { border-color: var(--accent); }

.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.model-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--surface);
  border: 1px solid #ececec;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.12s, transform 0.12s;
  color: var(--text);
}
.model-card:hover { border-color: #cfc3f5; transform: translateY(-1px); }
.model-card .badge { position: absolute; top: 14px; right: 14px; padding: 3px 9px; border-radius: 12px; background: var(--red); color: #fff; font-size: 11px; }
.model-card .badge.online { background: var(--green); }
.model-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-width: 0; padding-right: 48px; }
.model-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.model-head strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-head small { display: block; color: var(--text-3); font-size: 12px; }
.model-desc { flex: 1; min-height: 56px; font-size: 12px; color: #6f6f78; line-height: 1.6; margin-bottom: 12px; overflow: hidden; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { padding: 3px 8px; border-radius: 6px; background: #f5f5f7; color: #66666f; font-size: 11px; }
.model-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.model-foot .price { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--accent); }
.model-foot .meta { font-size: 11px; color: var(--text-3); }
.model-open { display: inline-flex; align-items: center; justify-content: center; height: 30px; padding: 0 10px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }

.playground { display: flex; gap: 20px; align-items: stretch; }
.params { width: 300px; flex-shrink: 0; padding: 18px; background: var(--surface); border: 1px solid #ececec; border-radius: var(--radius); box-shadow: var(--shadow); }
.params h3 { font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.field { margin-bottom: 16px; }
.field label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 7px; }
.field label .val { color: var(--accent); font-family: var(--mono); font-weight: 600; }
.field select, .field input[type="text"], .field input[type="number"] {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.field select:focus, .field input[type="text"]:focus, .field input[type="number"]:focus { border-color: var(--accent); }
.field textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 10px; font-size: 12px; background: var(--surface); color: var(--text); outline: none; resize: vertical; }
.field textarea:focus { border-color: var(--accent); }
.field input[type="range"] { width: 100%; accent-color: var(--accent); }
.size-row { display: flex; gap: 8px; }
.size-opt { flex: 1; padding: 8px 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 11px; color: var(--text-3); text-align: center; cursor: pointer; }
.size-opt.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.conv-list { max-height: 250px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.conv-item {
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.conv-item:hover { background: var(--surface-2); }
.conv-item.active { background: var(--accent-soft); border-color: #d7c8fb; }
.conv-item .t { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item .m { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; font-size: 10px; color: var(--text-3); }
.conv-empty { padding: 16px 4px; color: var(--text-3); font-size: 12px; text-align: center; }

.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 20px; background: var(--surface); border: 1px solid #ececec; border-radius: var(--radius); box-shadow: var(--shadow); }
.stage-banner { padding: 8px 12px; margin-bottom: 14px; border-radius: var(--radius-sm); background: var(--yellow-soft); color: var(--yellow); font-size: 12px; }
.stage-empty { flex: 1; min-height: 320px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: var(--text-3); font-size: 13px; }
.stage-empty .ic { width: 58px; height: 58px; border-radius: 50%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.messages { display: none; flex: 1; min-height: 320px; max-height: 560px; overflow-y: auto; padding: 4px 2px 14px; flex-direction: column; gap: 14px; }
.messages.show { display: flex; }
.msg { display: flex; gap: 10px; max-width: 86%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .av { width: 28px; height: 28px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.msg.user .av { background: var(--accent); color: #fff; }
.msg.ai .av { background: var(--surface-2); border: 1px solid var(--border); }
.msg .bubble { padding: 10px 13px; border-radius: 11px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.msg.user .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai .bubble { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; color: var(--text-2); }
.msg .meta { margin-top: 4px; font-size: 10px; color: var(--text-3); }
.msg.user .meta { text-align: right; }
.typing { display: flex; gap: 4px; padding: 4px 0; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
.prompt-box { display: flex; gap: 10px; margin-top: 16px; }
.prompt-box textarea { flex: 1; min-height: 46px; max-height: 140px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 11px 12px; font-size: 13px; resize: none; outline: none; line-height: 1.5; }
.prompt-box textarea:focus { border-color: var(--accent); }
.send-btn { width: 46px; height: 46px; border: none; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-size: 16px; cursor: pointer; flex-shrink: 0; transition: background 0.12s; }
.send-btn:hover { background: var(--accent-strong); }
.send-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.auth-wrap { max-width: 860px; width: 100%; margin: 0 auto; }
.auth-card, .account-card { background: var(--surface); border: 1px solid #ececec; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 16px; }
.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 22px; background: var(--surface-2); border-radius: 10px; }
.tab { flex: 1; height: 40px; border: none; border-radius: 8px; background: transparent; color: var(--text-3); font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.12s, color 0.12s; }
.tab.active { background: var(--accent); color: #fff; }
.form h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.form .tip { font-size: 12px; color: var(--text-3); margin-bottom: 18px; }
.field label { margin-bottom: 6px; }
.field input { width: 100%; height: 42px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 12px; font-size: 13px; background: var(--surface); color: var(--text); outline: none; }
.field input:focus { border-color: var(--accent); }
.bonus-banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin-bottom: 16px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text-2); font-size: 13px; }
.bonus-banner strong { color: var(--accent); }
.submit { width: 100%; height: 44px; border: none; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.12s; }
.submit:hover { background: var(--accent-strong); }
.err { display: none; padding: 10px 12px; margin-bottom: 14px; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red); font-size: 12px; }
.err.show { display: block; }
.code-box { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; transition: border-color 0.12s; }
.code-box:hover { border-color: var(--accent); }
.code-box .code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; word-break: break-all; color: var(--text); }
.code-box .cp { flex-shrink: 0; font-size: 11px; color: var(--text-3); }
.code-snip { position: relative; padding: 14px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #14141c; color: #d7d7e2; font-family: var(--mono); font-size: 12px; line-height: 1.7; overflow-x: auto; }
.code-snip .copy { position: absolute; top: 8px; right: 8px; padding: 3px 8px; border: 1px solid #33333f; border-radius: 6px; background: #1d1d28; color: #9a9aa8; font-size: 11px; cursor: pointer; }
.code-snip .copy:hover { color: #fff; }
.code-snip .c { color: #7d7d8c; }
.code-snip .k { color: #b7a6ff; }
.code-snip .s { color: #58d68d; }
.ref-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.ref-stat { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; }
.ref-stat .v { font-size: 20px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.ref-stat .l { margin-top: 2px; font-size: 11px; color: var(--text-3); }
.invite-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.invite-row:last-child { border-bottom: none; }
.invite-row .who { color: var(--text-2); }
.invite-row .when { display: block; font-size: 11px; color: var(--text-3); }
.invite-row .reward { color: var(--green); font-weight: 700; font-family: var(--mono); }
.empty { padding: 22px; color: var(--text-3); font-size: 13px; text-align: center; }

.balance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.balance-card { padding: 18px; background: var(--surface); border: 1px solid #ececec; border-radius: var(--radius); box-shadow: var(--shadow); }
.balance-card .label { margin-bottom: 8px; color: var(--text-3); font-size: 12px; }
.balance-card .value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.balance-card .hint { margin-top: 5px; color: var(--text-3); font-size: 11px; }
.recharge-layout { display: grid; grid-template-columns: 1.35fr 0.65fr; gap: 16px; margin-bottom: 18px; }
.recharge-card { padding: 20px; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 12px; }
.preset { padding: 12px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2); font-size: 16px; font-weight: 700; cursor: pointer; transition: border-color 0.12s, background 0.12s, color 0.12s; }
.preset:hover { border-color: var(--accent); }
.preset.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.preset .unit { display: block; margin-top: 2px; font-size: 10px; font-weight: 400; color: var(--text-3); }
.custom-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.custom-row .pre { color: var(--text-3); font-size: 14px; }
.custom-row input { flex: 1; height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 12px; font-size: 14px; font-family: var(--mono); color: var(--text); outline: none; }
.custom-row input:focus { border-color: var(--accent); }
.payments { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 18px; }
.pay { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.pay:hover { border-color: var(--accent); }
.pay.active { border-color: var(--accent); background: var(--accent-soft); }
.pay .ico { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.pay .nm { font-size: 13px; font-weight: 600; }
.pay .ds { font-size: 10px; color: var(--text-3); }
.auto-card { padding: 20px; }
.auto-card h2 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.auto-card .tip { margin-bottom: 16px; font-size: 12px; color: var(--text-3); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toggle-row .status { color: var(--green); font-size: 13px; font-weight: 600; }
.toggle { position: relative; width: 44px; height: 24px; border-radius: 12px; background: #d5d5dc; cursor: pointer; transition: background 0.15s; flex-shrink: 0; }
.toggle.on { background: var(--accent); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.toggle.on::after { transform: translateX(20px); }
.upload-box { display: flex; align-items: center; justify-content: center; min-height: 64px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); color: var(--text-3); font-size: 12px; cursor: pointer; }
.confirm-btn { width: 100%; height: 46px; border: none; border-radius: var(--radius-sm); background: var(--accent); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: background 0.12s; }
.confirm-btn:hover { background: var(--accent-strong); }
.confirm-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.note { margin-top: 10px; color: var(--text-3); font-size: 11px; text-align: center; }

.filter-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filter-row select, .filter-row input { height: 38px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 11px; font-size: 12px; background: var(--surface); color: var(--text); outline: none; }
.filter-row select:focus, .filter-row input:focus { border-color: var(--accent); }
.summary-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid #ececec; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 22px; font-weight: 700; }
.summary-row .op { color: var(--text-3); font-weight: 400; font-size: 17px; }
.summary-row .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.table-card { overflow: hidden; background: var(--surface); border: 1px solid #ececec; border-radius: var(--radius); box-shadow: var(--shadow); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid #ececec; }
.table-toolbar h2 { font-size: 15px; font-weight: 700; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 16px; border-bottom: 1px solid #ececec; background: var(--surface-2); color: var(--text-3); font-size: 11px; font-weight: 600; text-align: left; white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid #ececec; color: var(--text-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fbfaff; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cost { color: var(--accent); font-weight: 700; }
.green { color: var(--green); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 12px; font-size: 11px; }
.status-pill.on { background: var(--green-soft); color: var(--green); }
.status-pill.bz { background: var(--yellow-soft); color: var(--yellow); }
.bar-cell { min-width: 140px; }
.bar { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.bar .f { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #8b5cf6, #6b3ff2); }
.bar .f.green { background: linear-gradient(90deg, #16a34a, #22c55e); }
.bar .f.yellow { background: linear-gradient(90deg, #ca8a04, #eab308); }
.bar .f.orange { background: linear-gradient(90deg, #ea580c, #f97316); }
.bar-note { margin-top: 3px; font-size: 10px; color: var(--text-3); }
.empty-row td { text-align: center; padding: 48px 0; color: var(--text-3); font-size: 13px; }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  z-index: 300;
  padding: 10px 18px;
  border-radius: 10px;
  background: #22222a;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transition: all 0.22s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1100px) {
  .model-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .playground { flex-direction: column; }
  .params { width: 100%; }
  .stage { min-height: 520px; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    transition: transform 0.2s;
    box-shadow: 12px 0 40px rgba(20, 20, 35, 0.14);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .main { min-width: 0; }
  .content { padding: 18px; }
  .topbar { padding: 0 16px; }
  .topbar h1 { font-size: 16px; }
  .status-chip { display: none; }
}

@media (max-width: 640px) {
  .content { padding: 14px; }
  .summary-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .summary-item { padding: 12px; }
  .summary-item .value { font-size: 18px; }
  .model-grid { grid-template-columns: 1fr; }
  .qa-grid { grid-template-columns: 1fr; }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .balance-grid { grid-template-columns: 1fr; }
  .recharge-layout { grid-template-columns: 1fr; }
  .presets { grid-template-columns: repeat(2, 1fr); }
  .payments { grid-template-columns: 1fr; }
  .ref-stats { grid-template-columns: 1fr; }
  .auth-card, .account-card { padding: 18px; }
  .msg { max-width: 96%; }
}
