/* OncoAgent · ChatGPT-style interface */

@font-face { font-family: "Inter"; src: url("/vendor/fonts/inter-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/vendor/fonts/inter-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/vendor/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/vendor/fonts/inter-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/vendor/fonts/inter-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #ffffff;
  --side-bg: #f9f9f9;
  --ink: #0d0d0d;
  --ink-2: #35383d;
  --muted: #8f8f8f;
  --line: #ececec;
  --line-soft: #f1f1f1;
  --hover: #ececec;
  --soft: #f4f4f4;
  --warn: #9a6700;
  --warn-bg: #faf5e8;
  --danger: #cf1f1f;
  --radius: 14px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.04);
  --shadow-2: 0 4px 18px rgba(0,0,0,.07);
  --ease: cubic-bezier(.22, 1, .36, 1);
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Inter", -apple-system, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(13,13,13,.12); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #bdbdbd; }
::-webkit-scrollbar-track { background: transparent; }

@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pulseDot { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.75); } }
@keyframes blink { 50% { opacity: 0; } }

/* ============ 布局 ============ */
.app { display: flex; height: 100%; overflow: hidden; }

/* ============ 侧栏 ============ */
.sidebar {
  width: 264px; flex: none; background: var(--side-bg);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 12px 10px;
  transition: margin-left .3s var(--ease);
}
.app.side-hidden .sidebar { margin-left: -264px; }
.sb-brand { display: flex; align-items: center; gap: 9px; padding: 4px 8px 12px; }
.sb-logo {
  width: 28px; height: 28px; border-radius: 8px; background: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.sb-logo svg { width: 16px; height: 16px; }
.sb-name { font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.sb-new {
  display: flex; align-items: center; gap: 8px; width: 100%;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 500; cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: background .15s, transform .15s var(--ease);
}
.sb-new:hover { background: var(--soft); transform: translateY(-1px); }
.sb-section {
  font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .5px;
  padding: 16px 10px 6px; text-transform: uppercase;
}
.sb-nav { display: flex; flex-direction: column; gap: 1px; }
.sb-nav a {
  color: var(--ink-2); text-decoration: none; font-size: 13.5px;
  padding: 7px 10px; border-radius: 8px;
  transition: background .13s;
}
.sb-nav a:hover { background: var(--hover); }
.sb-nav a.active { background: var(--hover); font-weight: 600; color: var(--ink); }
.sb-history { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; min-height: 60px; }
.sb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 8px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; border: none; background: none; text-align: left; width: 100%;
  transition: background .13s;
}
.sb-item:hover { background: var(--hover); }
.sb-item.active { background: var(--hover); font-weight: 600; color: var(--ink); }
.sb-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.sb-item .del {
  margin-left: auto; opacity: 0; color: var(--muted); flex: none;
  width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.sb-item:hover .del { opacity: 1; }
.sb-item .del:hover { background: #ddd; color: var(--danger); }
.sb-empty { color: var(--muted); font-size: 12px; padding: 6px 10px; }
.sb-bottom { border-top: 1px solid var(--line); padding: 10px 8px 4px; display: flex; flex-direction: column; gap: 3px; }
.sb-tier { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.sb-ver { font-size: 11px; color: var(--muted); }
.sidebar-mask { display: none; }

/* ============ 主区 ============ */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100%; }

.chatbar {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 52px; flex: none;
}
.icon-btn {
  width: 34px; height: 34px; border: none; background: none; border-radius: 8px;
  color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .13s;
}
.icon-btn:hover { background: var(--soft); }
.chatbar-title { font-size: 14.5px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-chip {
  font-size: 12.5px; color: var(--ink-2); border: 1px solid var(--line);
  padding: 4px 12px; border-radius: 99px; background: #fff;
}
.model-chip b { font-weight: 700; margin-left: 3px; }

.view { display: none; flex: 1; min-height: 0; }
.view.active { display: flex; animation: viewIn .32s var(--ease); }
.module-view { flex-direction: column; overflow-y: auto; }
.module-inner { max-width: 900px; margin: 0 auto; padding: 26px 22px 56px; width: 100%; }
.kicker { font-size: 10.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.module-title { font-size: 23px; font-weight: 700; letter-spacing: -.4px; margin: 0 0 5px; }
.module-sub { color: var(--muted); margin: 0 0 20px; font-size: 13px; line-height: 1.6; }

/* ============ ChatGPT 式对话 ============ */
#view-chat { flex-direction: column; }
.chat-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.chat-col { max-width: 760px; margin: 0 auto; padding: 24px 20px 10px; }

.gpt-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; animation: viewIn .4s var(--ease); }
.gpt-logo {
  width: 52px; height: 52px; border-radius: 14px; background: var(--ink);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  box-shadow: 0 6px 22px rgba(0,0,0,.16);
}
.gpt-empty h1 { font-size: 26px; font-weight: 700; letter-spacing: -.4px; margin: 0 0 26px; }
.sugg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 560px; }
.sugg {
  border: 1px solid var(--line); background: #fff; border-radius: 12px;
  padding: 12px 15px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px;
  transition: background .15s, transform .2s var(--ease), border-color .15s;
}
.sugg:hover { background: var(--soft); border-color: #ddd; transform: translateY(-1px); }
.sugg b { font-size: 13px; font-weight: 600; }
.sugg span { font-size: 12px; color: var(--muted); }

.msg { margin: 0; padding: 14px 0; display: flex; animation: cardIn .35s var(--ease) both; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: 76%; padding: 11px 17px; border-radius: 20px; line-height: 1.65; font-size: 14.5px; white-space: pre-wrap; }
.msg.user .bubble { background: var(--soft); color: var(--ink); }
.msg.bot { display: block; }
.msg.bot .who { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.msg.bot .ava {
  width: 26px; height: 26px; border-radius: 8px; background: var(--ink); flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.msg.bot .ava svg { width: 15px; height: 15px; }
.msg.bot .who .nm { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.msg.bot .body { font-size: 14.5px; line-height: 1.78; }
.msg.bot .body .plain { white-space: pre-wrap; }
.msg-actions { display: flex; gap: 4px; margin-top: 8px; opacity: 0; transition: opacity .18s; }
.msg.bot:hover .msg-actions { opacity: 1; }
.msg-actions .act {
  border: none; background: none; color: var(--muted); font-size: 11.5px;
  padding: 4px 8px; border-radius: 6px; cursor: pointer;
}
.msg-actions .act:hover { background: var(--soft); color: var(--ink); }

/* 时间线 */
.thinking { margin: 2px 0 4px; }
.think-item { display: flex; gap: 10px; font-size: 13px; color: var(--ink-2); padding: 3px 0; align-items: baseline; line-height: 1.55; }
.think-item .ico { flex: none; width: 15px; text-align: center; }
.think-item.done .ico::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--success); vertical-align: 1px; }
.think-item.running .ico::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 99px; background: var(--ink); vertical-align: 1px; animation: pulseDot 1.1s ease-in-out infinite; }
.think-item.fail .ico::after { content: "×"; color: var(--danger); font-weight: 800; }
.think-item .sub { color: var(--muted); }
.plan-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; background: #fafafa; }
.plan-box h4 { margin: 2px 0 8px; font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.plan-step { font-size: 13px; padding: 4px 0; color: var(--ink-2); }
.plan-step .no {
  display: inline-flex; width: 19px; height: 19px; border-radius: 6px; margin-right: 8px;
  background: #ececec; color: var(--ink-2); align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; vertical-align: -4px; transition: all .3s var(--ease);
}
.plan-step.done .no { background: var(--ink); color: #fff; }
.plan-step.done { color: var(--ink); }

/* 结果卡片 */
.result-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); margin: 12px 0; overflow: hidden;
  animation: cardIn .45s var(--ease) both;
}
.result-head { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.result-head .badge { background: var(--soft); color: var(--ink-2); font-size: 11px; font-weight: 600; padding: 3px 11px; border-radius: 99px; }
.result-head .badge.blue { background: #eef6f9; color: #0e7490; }
.result-head .badge.violet { background: #f2effc; color: #6d28d9; }
.result-head .badge.warn { background: var(--warn-bg); color: var(--warn); }
.result-head h3 { font-size: 14px; margin: 0; flex: 1; font-weight: 700; }
.result-body { padding: 14px 16px; }
.chart { width: 100%; height: 370px; }
.chart.small { height: 300px; }
.result-foot { display: flex; gap: 8px; padding: 9px 16px; border-top: 1px solid var(--line-soft); background: #fafafa; flex-wrap: wrap; align-items: center; }
.result-foot .spacer { flex: 1; }
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.controls label { font-size: 12px; color: var(--muted); }
select, input[type=text] {
  border: 1px solid #d9d9d9; border-radius: 9px; padding: 6px 11px;
  font: inherit; font-size: 13px; background: #fff; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
select:focus, input[type=text]:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.07); }
.btn {
  border: 1px solid #d9d9d9; background: #fff; color: var(--ink-2);
  padding: 6px 14px; border-radius: 9px; font-size: 12.5px; font-weight: 500; cursor: pointer;
  text-decoration: none; display: inline-block; transition: all .18s var(--ease);
}
.btn:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2d2d2d; }
.btn.small { padding: 4px 10px; font-size: 12px; border-radius: 7px; }

.stat-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; margin-top: 10px; }
.stat-table th, .stat-table td { padding: 7px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.stat-table th { background: #fafafa; font-weight: 600; color: var(--muted); font-size: 10.5px; letter-spacing: .7px; text-transform: uppercase; }
.stat-table tr:last-child td { border-bottom: none; }
.stat-table tbody tr:hover { background: #fafafa; }
.stat-table td.num { font-variant-numeric: tabular-nums; }
.sig-yes { color: var(--success); font-weight: 700; }
.sig-no { color: var(--muted); }

.warn-box { background: var(--warn-bg); border: 1px solid #f0e4bd; color: var(--warn); border-radius: 10px; padding: 9px 14px; font-size: 12.5px; margin-top: 12px; line-height: 1.65; }
.risk-table { display: flex; justify-content: center; gap: 7px; margin-top: 6px; font-size: 12px; }
.risk-table .cell { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.risk-table .lab { color: var(--muted); min-width: 46px; text-align: right; padding-right: 6px; font-weight: 600; }
.risk-table .low { color: #2563eb; }
.risk-table .high { color: #d97706; }

/* 叙述 */
.narrative { font-size: 14.5px; line-height: 1.8; }
.narrative .ntext p { margin: 7px 0; }
.narrative .ntext b { font-weight: 650; }
.narrative .cursor { display: inline-block; width: 7px; height: 15px; background: var(--ink); border-radius: 2px; vertical-align: -2px; animation: blink 1s steps(1) infinite; margin-left: 2px; }
.narrative .sub { color: var(--muted); font-size: 11.5px; margin-top: 8px; }

.suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; animation: viewIn .35s var(--ease); }
.suggestions .chip {
  border: 1px solid #d9d9d9; background: #fff; color: var(--ink-2);
  padding: 6px 14px; border-radius: 99px; font-size: 12.5px; cursor: pointer;
  transition: all .18s var(--ease);
}
.chip:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }

/* 2×2 */
.verdict { display: grid; grid-template-columns: auto 1fr 1fr; gap: 7px; margin: 12px 0; font-size: 12.5px; }
.verdict .hd { display: flex; align-items: center; color: var(--muted); font-weight: 600; font-size: 11.5px; }
.verdict .cell { padding: 13px 12px; border-radius: 12px; font-weight: 600; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.verdict .cell small { font-weight: 400; }
.verdict .hit { outline: 3px solid rgba(13,13,13,.55); outline-offset: -3px; }
.v-chance { background: #e9f7f0; color: #0b7a55; }
.v-red { background: #fdeeee; color: #b91c1c; }
.v-fake { background: var(--warn-bg); color: var(--warn); }
.v-nonexpr { background: #eef1f8; color: #374785; }

/* 模块页 */
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 14px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-1); margin-bottom: 16px;
}
.form-grid .field { display: flex; flex-direction: column; gap: 6px; }
.form-grid label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.form-grid input, .form-grid select { width: 100%; }
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; z-index: 30; top: calc(100% + 5px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-2);
  max-height: 240px; overflow-y: auto; display: none;
  animation: viewIn .2s var(--ease);
}
.ac-list .ac-item { padding: 8px 13px; font-size: 13px; cursor: pointer; }
.ac-item:hover { background: var(--soft); }
.ac-item .tag { color: var(--muted); font-size: 11px; margin-left: 7px; }

.module-result { min-height: 110px; }
.empty-note {
  color: var(--muted); text-align: center; padding: 46px 0; font-size: 12.5px;
  border: 1.5px dashed #e0e0e0; border-radius: var(--radius);
}
.skeleton { border-radius: var(--radius); background: #fff; border: 1px solid var(--line); padding: 18px; }
.skeleton .sk { position: relative; overflow: hidden; background: #efefef; border-radius: 8px; }
.skeleton .sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.9) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

/* 数据页 */
.cohort-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); font-size: 12.5px; border: 1px solid var(--line); }
.cohort-table th, .cohort-table td { border-bottom: 1px solid var(--line-soft); padding: 10px 13px; text-align: left; }
.cohort-table th { background: #fafafa; font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: .8px; text-transform: uppercase; }
.cohort-table tbody tr:hover td { background: #fafafa; }
.cohort-table tr:last-child td { border-bottom: none; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 600; margin-right: 4px; }
.pill.on { background: #eef1f8; color: #374785; }
.pill.off { background: #f2f2f2; color: #ababab; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 13px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 19px; box-shadow: var(--shadow-1); transition: transform .25s var(--ease); }
.kpi:hover { transform: translateY(-2px); }
.kpi .v { font-size: 27px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi .k { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

.sig-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); font-size: 12.5px; border: 1px solid var(--line); }
.sig-table th, .sig-table td { border-bottom: 1px solid var(--line-soft); padding: 8px 11px; text-align: left; }
.sig-table th { background: #fafafa; font-size: 10.5px; color: var(--muted); cursor: pointer; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.sig-table tbody tr:hover { background: #fafafa; }
.sig-genes { color: var(--muted); font-size: 11px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.about-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow-1); line-height: 1.85; font-size: 13.5px; }
.about-card h3 { margin: 20px 0 7px; font-size: 14.5px; }
.about-card ul { margin: 6px 0; padding-left: 20px; }
.about-card li { margin: 3px 0; }
.about-card code { background: var(--soft); border-radius: 6px; padding: 1px 7px; font-size: 12px; }

/* 输入区（ChatGPT 式） */
.composer { flex: none; padding: 6px 20px 12px; }
.composer-box {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: flex-end; gap: 10px;
  border: 1px solid #d9d9d9; border-radius: 24px;
  background: #fff; padding: 11px 12px 11px 18px;
  box-shadow: var(--shadow-1);
  transition: border-color .2s, box-shadow .2s;
}
.composer-box:focus-within { border-color: #a6a6a6; box-shadow: 0 4px 18px rgba(0,0,0,.08); }
.composer-box textarea {
  flex: 1; border: none; outline: none; resize: none;
  font: inherit; font-size: 15px; line-height: 1.55; max-height: 180px; background: transparent;
}
.send-btn {
  width: 34px; height: 34px; flex: none; border: none; border-radius: 99px;
  background: var(--ink); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .2s var(--ease), opacity .2s, background .2s;
}
.send-btn:hover:not(:disabled) { transform: scale(1.07); }
.send-btn:disabled { background: #d9d9d9; cursor: not-allowed; }
.chat-foot { text-align: center; color: var(--muted); font-size: 11px; padding: 9px 0 2px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(70px);
  background: #1a1a1a; color: #fff; padding: 10px 18px; border-radius: 99px;
  font-size: 12.5px; opacity: 0; transition: .3s var(--ease); z-index: 99; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 60; height: 100%; }
  .sidebar-mask.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 55; }
  .sugg-grid { grid-template-columns: 1fr; }
}

/* ============ 登录页 ============ */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-2); padding: 30px 32px 26px; animation: viewIn .4s var(--ease);
}
.login-card .lc-logo {
  width: 46px; height: 46px; border-radius: 12px; background: var(--ink);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.login-card h2 { text-align: center; font-size: 19px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.3px; }
.login-card .lc-sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.lc-tabs { display: flex; background: var(--soft); border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.lc-tabs button {
  flex: 1; border: none; background: none; padding: 7px 0; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: all .2s var(--ease);
}
.lc-tabs button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-1); }
.login-card input {
  width: 100%; border: 1px solid #d9d9d9; border-radius: 10px; padding: 10px 13px;
  font: inherit; font-size: 14px; margin-bottom: 10px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-card input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.07); }
.lc-submit {
  width: 100%; border: none; background: var(--ink); color: #fff; border-radius: 10px;
  padding: 11px 0; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 4px;
  transition: background .18s, transform .15s var(--ease);
}
.lc-submit:hover { background: #2d2d2d; transform: translateY(-1px); }
.lc-demo { text-align: center; font-size: 12px; color: var(--muted); margin-top: 14px; }
.lc-demo a { color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: underline; }
.lc-err { color: var(--danger); font-size: 12px; text-align: center; min-height: 16px; margin-bottom: 6px; }

/* ============ 图像编辑器 ============ */
.ed-wrap { display: grid; grid-template-columns: 230px 1fr 270px; gap: 14px; align-items: start; }
.ed-runs, .ed-opts {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); overflow: hidden; max-height: 640px; overflow-y: auto;
}
.ed-panel-title {
  font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: 1px;
  text-transform: uppercase; padding: 11px 14px 7px; border-bottom: 1px solid var(--line-soft);
}
.ed-run {
  display: block; width: 100%; border: none; background: none; text-align: left;
  padding: 9px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer;
  transition: background .13s;
}
.ed-run:hover { background: var(--soft); }
.ed-run.on { background: var(--soft); box-shadow: inset 3px 0 0 var(--ink); }
.ed-run .g { font-size: 13px; font-weight: 600; }
.ed-run .m { font-size: 11px; color: var(--muted); margin-top: 1px; }
.ed-preview {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 14px;
}
.ed-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.ed-actions .sub { color: var(--muted); font-size: 11.5px; }
.ed-opts .opt { padding: 8px 14px; border-bottom: 1px solid var(--line-soft); }
.ed-opts .opt label { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.ed-opts .opt input[type=text], .ed-opts .opt input[type=number] {
  width: 100%; border: 1px solid #d9d9d9; border-radius: 8px; padding: 6px 10px;
  font: inherit; font-size: 12.5px; outline: none;
}
.ed-opts .opt input[type=color] { width: 44px; height: 28px; border: 1px solid #d9d9d9; border-radius: 7px; padding: 1px; background: #fff; cursor: pointer; }
.ed-opts .opt input[type=range] { width: 100%; }
.ed-opts .opt.row2 { display: flex; gap: 10px; }
.ed-opts .opt.row2 > div { flex: 1; }
.ed-opts .chk { display: flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; }
.ed-opts .color-row { display: flex; align-items: center; gap: 8px; }
.ed-opts .color-row span { font-size: 12px; color: var(--ink-2); }
.ed-opts .opt select.ed-sel {
  width: 100%; border: 1px solid #d9d9d9; border-radius: 8px; padding: 6px 10px;
  font: inherit; font-size: 12.5px; outline: none; background: #fff; cursor: pointer;
}
.ed-opts .opt select.ed-sel:focus { border-color: var(--ink); }
.ed-opts .opt .row2 label { margin-bottom: 3px; font-size: 10.5px; font-weight: 400; }
.ed-opts .opt input[type=range] { width: 100%; accent-color: var(--ink); }
.sb-user { font-size: 13px; font-weight: 600; padding: 2px 8px; }
.sb-logout {
  border: none; background: none; color: var(--muted); font-size: 12px;
  padding: 4px 8px; text-align: left; cursor: pointer; border-radius: 6px; width: 100%;
}
.sb-logout:hover { background: var(--hover); color: var(--danger); }

/* --- 思考条 (Claude 式: 扁平 + 流式斜体) --- */
.thinkbar {
  max-width: 720px; margin: 2px 0 6px;
  border: none; background: none; border-radius: 0; overflow: visible;
  animation: viewIn .3s var(--ease);
}
.tb-head { display: inline-flex; align-items: center; gap: 6px; border: none;
  background: none; padding: 2px 6px 2px 0; cursor: pointer;
  font-family: inherit; font-size: 13px; color: #8e8ea0; }
.tb-head:hover .tb-label { color: #6b6b80; }
.tb-chev { flex: none; transition: transform .18s ease; color: #a6a6b3; }
.thinkbar.open .tb-chev { transform: rotate(90deg); }
.tb-label { font-weight: 500; letter-spacing: .1px; color: #8e8ea0; }
.tb-label.shimmer {
  background: linear-gradient(90deg, #8f8f9d 25%, #d9d9e2 50%, #8f8f9d 75%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: tbShimmer 2.2s linear infinite;
}
@keyframes tbShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.tb-body { margin: 5px 0 2px 6px; padding: 4px 8px 4px 13px;
  font-size: 13px; font-style: italic; line-height: 1.75; color: #8e8ea0;
  white-space: pre-wrap; word-break: break-word;
  max-height: 300px; overflow-y: auto; }
.tb-body:empty { display: none; }

/* ============ 用户资料 / 头像 / 模型切换 ============ */
.sb-userrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 9px; cursor: pointer; }
.sb-userrow:hover { background: var(--hover, #f2f2f2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 700; overflow: hidden;
  user-select: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.big { width: 56px; height: 56px; font-size: 22px; }
.sb-userinfo { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sb-user { font-size: 13px; font-weight: 600; padding: 0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.sb-tier { font-size: 11px; color: var(--muted); }
.sb-edit-ico { flex: none; color: var(--muted); opacity: 0; transition: opacity .15s; }
.sb-userrow:hover .sb-edit-ico { opacity: 1; }
.sb-model { display: flex; align-items: center; gap: 7px; padding: 4px 8px 2px; }
.sb-model-label { font-size: 11.5px; color: var(--muted); flex: none; }
.sb-model-select { flex: 1; min-width: 0; font-size: 12px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px;
  background: #fff; font-family: inherit; }
.sb-model-select:disabled { color: var(--muted); background: var(--soft, #f7f7f7); }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .42);
  display: flex; align-items: center; justify-content: center; z-index: 200;
  animation: fadeIn .15s ease; }
.modal { width: min(420px, calc(100vw - 40px)); max-height: 86vh; overflow-y: auto;
  background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 15px; }
.modal-x { border: none; background: none; font-size: 20px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.modal-x:hover { color: var(--ink); background: var(--soft, #f2f2f2); }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.modal-body input { width: 100%; box-sizing: border-box; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: inherit; }
.modal-body input:focus { outline: none; border-color: var(--ink); }
.pf-avrow { display: flex; align-items: center; gap: 14px; }
.pf-avbtns { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pf-label { font-size: 12px; color: var(--muted); margin-top: 6px; }
.pf-colors { display: flex; gap: 7px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.pf-err { color: var(--danger, #dc2626); font-size: 12.5px; min-height: 16px; }

/* 管理后台表单行 */
.ad-add-row { display: flex; gap: 8px; margin: 10px 0 12px; flex-wrap: wrap; }
.ad-add-row input, .ad-add-row select { border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; font-size: 12.5px; font-family: inherit; }
.ad-add-row input { flex: 1; min-width: 140px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.btn.danger { color: var(--danger, #dc2626); border-color: #f3c1c1; }
.btn.danger:hover { border-color: var(--danger, #dc2626); color: var(--danger, #dc2626); }
.ad-model-ops { display: flex; gap: 6px; flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
