/* ==========================================================================
   AI 原生跨境电商经营管理系统 — 设计系统
   浅色主题 · 深海军蓝侧边栏 · 蓝紫强调色
   ========================================================================== */

:root {
  --bg: #f2f5fa;
  --surface: #ffffff;
  --surface-2: #f8fafd;
  --surface-3: #eef2f8;
  --border: #e2e8f1;
  --border-strong: #cfd8e6;

  --text: #16202f;
  --text-2: #48566d;
  --text-3: #8290a6;

  --brand: #2f6df6;
  --brand-dark: #1f52cc;
  --brand-soft: #e8f0ff;
  --success: #0e9f6e;
  --success-soft: #e3f7ef;
  --warn: #e08b00;
  --warn-soft: #fdf3e2;
  --danger: #dc3b40;
  --danger-soft: #fdebeb;
  --purple: #7c5cf0;
  --purple-soft: #f0ebff;
  --teal: #0c8fc4;
  --teal-soft: #e2f4fb;

  --nav: linear-gradient(180deg, #0d1a2e 0%, #12243d 100%);
  --nav-bg: #0d1a2e;
  --nav-bg-2: #12243d;
  --nav-text: #a7b6cd;
  --nav-text-active: #ffffff;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 30, 54, .06);
  --shadow: 0 2px 10px rgba(16, 30, 54, .07);
  --shadow-lg: 0 12px 34px rgba(16, 30, 54, .13);

  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c8d2e2; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #aab8cd; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 中文对照块（英文内容下方直接附中文，免去复制外部翻译） ---------- */
.zh-block {
  margin-top: 8px; padding: 9px 12px; border-radius: 8px;
  background: #f5f8fc; border-left: 3px solid var(--brand);
  font-size: 12.5px; line-height: 1.95; color: #33475b;
}
.zh-block .tag { margin-right: 8px; }
.zh-block .zh-text { display: inline; white-space: pre-wrap; }

/* ---------- 图标（统一内联 SVG，不依赖任何符号/emoji 字体） ---------- */
.ico {
  width: 1em; height: 1em; display: inline-block; flex: none;
  vertical-align: -0.14em; overflow: visible;
}
.kpi-ic .ico, .li-ic .ico, .mi .ico { width: 1.05em; height: 1.05em; vertical-align: -0.16em; }
.badge .ico, .dot-badge .ico { display: none; }

/* ---------- 启动屏 ---------- */
.boot {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; background: var(--nav-bg); color: #fff;
}
.boot-logo { font-size: 46px; color: var(--brand); animation: pulse 1.4s ease-in-out infinite; }
.boot-text { font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.boot-sub { font-size: 12.5px; color: #7f92ad; }
@keyframes pulse { 0%,100% { opacity: .35; transform: scale(.94); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- 应用根容器 ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
/* 登录态根容器：必须重置为块级，否则会被 .app 的两列栅格挤到 236px 的第一列 */
.login-host { display: block; min-height: 100vh; }

.sidebar {
  background: var(--nav-bg);
  color: var(--nav-text);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.side-brand .mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--brand), #6f9bff);
  display: grid; place-items: center; font-size: 17px; color: #fff; font-weight: 700;
}
.side-brand .t { min-width: 0; }
.side-brand .t b { display: block; color: #fff; font-size: 13.5px; letter-spacing: .2px; white-space: nowrap; }
.side-brand .t span { font-size: 10.5px; color: #6f82a0; }

.side-scroll { flex: 1; overflow-y: auto; padding: 10px 8px 20px; }
.side-scroll::-webkit-scrollbar-thumb { background: #25395a; }
.nav-group { margin: 12px 0 4px; }
.nav-group > label {
  display: block; padding: 0 10px 6px; font-size: 10.5px; letter-spacing: 1.1px;
  text-transform: uppercase; color: #5b6d88; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 2px 0;
  border-radius: 9px; cursor: pointer; font-size: 13px; color: var(--nav-text);
  transition: background .13s, color .13s; border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #dfe7f3; }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(47,109,246,.35); }
.nav-item .ic { width: 17px; text-align: center; flex: none; font-size: 14px; opacity: .95; }
.nav-item .badge {
  margin-left: auto; background: var(--danger); color: #fff; font-size: 10.5px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; font-weight: 700;
}
.nav-item.active .badge { background: rgba(255,255,255,.28); }

.side-foot { padding: 10px 12px 14px; border-top: 1px solid rgba(255,255,255,.07); font-size: 11px; color: #5b6d88; }
.engine-pill {
  display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 9px;
  background: rgba(47,109,246,.13); color: #a8c2ff; font-size: 11.5px; margin-bottom: 8px;
}
.engine-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #38d39f; flex: none; box-shadow: 0 0 0 3px rgba(56,211,159,.18); }
.engine-pill.real { background: rgba(124,92,240,.16); color: #c9b8ff; }
.engine-pill.real .dot { background: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,.2); }

/* ---------- 主区 ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 58px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 15.5px; margin: 0; font-weight: 650; letter-spacing: .1px; }
.topbar .sub { font-size: 12px; color: var(--text-3); border-left: 1px solid var(--border); padding-left: 12px; }
.topbar .spacer { flex: 1; }

.searchbox {
  display: flex; align-items: center; gap: 7px; background: var(--surface-3);
  border-radius: 9px; padding: 6px 11px; width: 230px; color: var(--text-3); font-size: 12.5px;
}
.searchbox input { border: none; background: none; outline: none; font: inherit; color: var(--text); width: 100%; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; display: grid; place-items: center; font-size: 15px;
  color: var(--text-2); transition: .13s; position: relative;
}
.icon-btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.icon-btn .dot-badge {
  position: absolute; top: -5px; right: -5px; background: var(--danger); color: #fff;
  font-size: 10px; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 700; border: 2px solid #fff;
}

.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px;
  border-radius: 22px; border: 1px solid var(--border); cursor: pointer; background: var(--surface);
}
.user-chip:hover { background: var(--surface-3); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #7c5cf0);
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.user-chip .nm { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.user-chip .rl { font-size: 10.5px; color: var(--text-3); line-height: 1.2; }

.content { padding: 20px; flex: 1; max-width: 1560px; width: 100%; }

/* ---------- 卡片 / 网格 ---------- */
.grid { display: grid; gap: 15px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.g-3-2 { grid-template-columns: 3fr 2fr; }
@media (max-width: 1280px) { .g5, .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-2-1, .g-1-2, .g-3-2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .g2, .g3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-h {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.card-h h3 { margin: 0; font-size: 13.5px; font-weight: 650; }
.card-h .hint { font-size: 11.5px; color: var(--text-3); }
.card-h .spacer { flex: 1; }
.card-b { padding: 16px; }
.card-b.tight { padding: 10px 12px; }
.card-b.flush { padding: 0; }

/* KPI */
.kpi { padding: 15px 16px; }
.kpi .lbl { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; font-weight: 550; }
.kpi .val { font-size: 25px; font-weight: 700; letter-spacing: -.6px; margin: 5px 0 2px; line-height: 1.15; }
.kpi .val small { font-size: 13px; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.kpi .foot { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.kpi .val.blue { color: var(--brand); }
.kpi .val.green { color: var(--success); }
.kpi .val.red { color: var(--danger); }
.kpi .val.orange { color: var(--warn); }
.kpi .val.purple { color: var(--purple); }
.up { color: var(--success); font-weight: 650; }
.down { color: var(--danger); font-weight: 650; }

/* ---------- 通用元素 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .13s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: #b9c6d9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 10px rgba(47,109,246,.28); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #c22f34; }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.success:hover { background: #0b8558; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.sm { padding: 4px 10px; font-size: 11.5px; border-radius: 7px; }
.btn.xs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }
.btn.block { width: 100%; justify-content: center; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.tag.blue { background: var(--brand-soft); color: var(--brand-dark); }
.tag.green { background: var(--success-soft); color: #0a7d55; }
.tag.orange { background: var(--warn-soft); color: #a86400; }
.tag.red { background: var(--danger-soft); color: #b32a2f; }
.tag.purple { background: var(--purple-soft); color: #5b3fc4; }
.tag.teal { background: var(--teal-soft); color: #0a6d95; }
.tag.gray { background: var(--surface-3); color: var(--text-3); }
.tag.lg { padding: 4px 11px; font-size: 12px; border-radius: 8px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: 13px; background: var(--surface); color: var(--text); outline: none; transition: .13s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,109,246,.13); }
textarea.input { resize: vertical; min-height: 76px; line-height: 1.6; }
.input::placeholder { color: var(--text-3); }
select.input { cursor: pointer; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12.5px; }
.switch input { display: none; }
.switch .track {
  width: 38px; height: 21px; border-radius: 11px; background: #cdd8e6; position: relative; transition: .18s; flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(17px); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th {
  text-align: left; padding: 10px 14px; font-weight: 650; color: var(--text-3); font-size: 11.5px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0;
}
table.tbl td { padding: 10px 14px; border-bottom: 1px solid #eff3f8; vertical-align: top; }
table.tbl tbody tr:hover { background: #fafcff; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td.mono { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl.compact td, table.tbl.compact th { padding: 7px 10px; }

.empty { text-align: center; padding: 42px 20px; color: var(--text-3); font-size: 13px; }
.empty .big { font-size: 30px; opacity: .3; display: block; margin-bottom: 8px; }

/* ---------- 进度条 ---------- */
.bar { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); transition: width .4s; }
.bar > i.green { background: var(--success); }
.bar > i.orange { background: var(--warn); }
.bar > i.red { background: var(--danger); }

/* ---------- 图表 ---------- */
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 11.5px; color: var(--text-2); }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; }
.axis-label { font-size: 10.5px; fill: #94a3b8; }
.grid-line { stroke: #edf1f7; stroke-width: 1; }

/* ---------- 词云 ---------- */
.wordcloud { display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: baseline; padding: 4px 0; }
.wordcloud span { line-height: 1.35; transition: .13s; cursor: default; }
.wordcloud span:hover { filter: brightness(.85); }

/* ---------- 列表条目 ---------- */
.list-item {
  display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid #eff3f8; align-items: flex-start;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #fafcff; }
.list-item .li-ic {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 14px;
}
.list-item .li-body { min-width: 0; flex: 1; }
.list-item .li-title { font-size: 13px; font-weight: 620; margin-bottom: 3px; }
.list-item .li-desc { font-size: 12.2px; color: var(--text-2); line-height: 1.55; }
.list-item .li-meta { font-size: 11px; color: var(--text-3); margin-top: 5px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 告警 / 提示条 ---------- */
.alertrow { display: flex; gap: 11px; padding: 12px 15px; border-bottom: 1px solid #eff3f8; align-items: flex-start; }
.alertrow:last-child { border-bottom: none; }
.lvl-bar { width: 3px; border-radius: 2px; align-self: stretch; flex: none; min-height: 34px; }
.lvl-bar.urgent { background: var(--danger); }
.lvl-bar.important { background: var(--warn); }
.lvl-bar.normal { background: var(--teal); }

.notice {
  display: flex; gap: 9px; padding: 10px 13px; border-radius: var(--radius-sm); font-size: 12.2px;
  line-height: 1.6; border: 1px solid;
}
.notice.info { background: var(--brand-soft); border-color: #c9dcff; color: #1d4fb5; }
.notice.warn { background: var(--warn-soft); border-color: #f6dfae; color: #8a5600; }
.notice.danger { background: var(--danger-soft); border-color: #f8c9cb; color: #a92a2f; }
.notice.ok { background: var(--success-soft); border-color: #b6e8d3; color: #0a7d55; }
.notice.purple { background: var(--purple-soft); border-color: #d9cfff; color: #5b3fc4; }
.notice b { font-weight: 700; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 9px 15px; font-size: 12.8px; font-weight: 600; color: var(--text-3); cursor: pointer;
  border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .13s;
  border-radius: 7px 7px 0 0;
}
.tab:hover { color: var(--text-2); background: var(--surface-2); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab .cnt { font-size: 10.5px; background: var(--surface-3); padding: 1px 6px; border-radius: 8px; margin-left: 5px; }
.tab.active .cnt { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- 分段控件 ---------- */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: none; background: none; padding: 5px 12px; font-size: 12px; font-weight: 600;
  color: var(--text-3); border-radius: 7px; cursor: pointer; transition: .13s;
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- 代码 / 文案预览 ---------- */
.code {
  font-family: var(--mono); font-size: 12px; line-height: 1.75; background: #f7f9fc;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px;
  white-space: pre-wrap; word-break: break-word; color: #2b3a4f; max-height: 420px; overflow: auto;
}
.copy-block { position: relative; }
.copy-block .copy-btn { position: absolute; top: 8px; right: 8px; }

/* ---------- 步骤 / 流程 ---------- */
.steps { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.step .n {
  width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
  font-weight: 700; background: var(--surface-3); color: var(--text-3); flex: none;
}
.step.done .n { background: var(--success); color: #fff; }
.step.active .n { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(47,109,246,.15); }
.step.reject .n { background: var(--danger); color: #fff; }
.step.done, .step.active { color: var(--text); font-weight: 600; }
.step-line { flex: 1; height: 2px; background: var(--border); margin: 0 10px; min-width: 22px; }
.step-line.done { background: var(--success); }

/* ---------- Toast ---------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand);
  border-radius: 10px; box-shadow: var(--shadow-lg); padding: 11px 15px; font-size: 12.8px;
  min-width: 260px; max-width: 400px; animation: slidein .22s ease; display: flex; gap: 9px; align-items: flex-start;
}
.toast.ok { border-left-color: var(--success); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
.toast b { display: block; margin-bottom: 2px; font-size: 12.8px; }
.toast .d { color: var(--text-2); line-height: 1.5; }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ---------- 模态 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(13,26,46,.5); backdrop-filter: blur(3px);
  z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadein .16s;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; animation: pop .2s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(8px); } to { opacity: 1; transform: none; } }
.modal.wide { max-width: 940px; }
.modal.xwide { max-width: 1240px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal-h h3 { margin: 0; font-size: 15px; font-weight: 660; }
.modal-b { padding: 20px; overflow-y: auto; flex: 1; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 9px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr;
  background: var(--nav-bg); color: #fff;
}
@media (max-width: 980px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { display: none; } }
.login-hero { padding: 56px 60px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.login-hero::before {
  content: ''; position: absolute; width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(47,109,246,.28), transparent 68%); top: -180px; right: -160px;
}
.login-hero::after {
  content: ''; position: absolute; width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,92,240,.2), transparent 70%); bottom: -200px; left: -120px;
}
.login-hero .inner { position: relative; z-index: 1; max-width: 520px; }
.login-hero h1 { font-size: 33px; line-height: 1.3; margin: 22px 0 14px; letter-spacing: -.6px; }
.login-hero h1 em { font-style: normal; color: #7fa6ff; }
.login-hero p { color: #9db0cb; font-size: 14px; line-height: 1.85; margin: 0 0 26px; }
.hero-points { display: grid; gap: 13px; }
.hero-point { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: #c3d1e6; }
.hero-point .ic {
  width: 27px; height: 27px; border-radius: 8px; background: rgba(47,109,246,.2);
  display: grid; place-items: center; flex: none; font-size: 13px;
}
.login-panel { background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 372px; }
.login-card h2 { font-size: 22px; margin: 0 0 6px; font-weight: 700; letter-spacing: -.3px; }
.login-card .lead { font-size: 13px; color: var(--text-3); margin-bottom: 24px; }

/* ---------- 详情 key-value ---------- */
.kv { display: grid; grid-template-columns: 118px 1fr; gap: 8px 14px; font-size: 12.6px; }
.kv dt { color: var(--text-3); font-weight: 550; }
.kv dd { margin: 0; color: var(--text); }

/* ---------- 折叠 ---------- */
details.acc { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 9px; overflow: hidden; }
details.acc > summary {
  padding: 10px 14px; cursor: pointer; font-size: 12.8px; font-weight: 620; background: var(--surface-2);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc[open] > summary { border-bottom: 1px solid var(--border); }
details.acc .acc-b { padding: 13px 15px; font-size: 12.6px; }

/* ---------- 滚动容器 ---------- */
.scroll-y { max-height: 460px; overflow-y: auto; }
.scroll-y-sm { max-height: 320px; overflow-y: auto; }

/* ---------- 富文本（AI 回复） ---------- */
.md { font-size: 13px; line-height: 1.78; color: var(--text); }
.md h1, .md h2, .md h3 { margin: 14px 0 7px; font-size: 14px; font-weight: 700; }
.md p { margin: 0 0 9px; }
.md ul { margin: 0 0 9px; padding-left: 20px; }
.md li { margin-bottom: 3px; }
.md strong { font-weight: 700; }
.md code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 12px; }
.md blockquote { border-left: 3px solid var(--border-strong); margin: 9px 0; padding: 2px 0 2px 12px; color: var(--text-3); font-size: 12.2px; }
.md table { border-collapse: collapse; margin: 9px 0; font-size: 12.3px; width: 100%; }
.md table th { background: var(--surface-2); text-align: left; padding: 7px 11px; border: 1px solid var(--border); font-weight: 650; }
.md table td { padding: 7px 11px; border: 1px solid var(--border); }
.md hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ---------- 聊天 ---------- */
.chat-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 15px; height: calc(100vh - 118px); }
@media (max-width: 1000px) { .chat-wrap { grid-template-columns: 1fr; height: auto; } }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 15px; }
.msg { display: flex; gap: 11px; max-width: 100%; }
.msg .av {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none;
  font-size: 13px; font-weight: 700;
}
.msg.user { flex-direction: row-reverse; }
.msg.user .av { background: var(--surface-3); color: var(--text-2); }
.msg.ai .av { background: linear-gradient(135deg, var(--brand), var(--purple)); color: #fff; }
.msg .bubble {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 15px; max-width: min(780px, 86%);
}
.msg.user .bubble { background: var(--brand-soft); border-color: #c9dcff; }
.chat-input { border-top: 1px solid var(--border); padding: 13px 16px; background: var(--surface); }
.chat-input .row { display: flex; gap: 9px; align-items: flex-end; }
.chat-input textarea {
  flex: 1; border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 12px; font: inherit;
  font-size: 13px; resize: none; min-height: 42px; max-height: 140px; outline: none;
}
.chat-input textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,109,246,.13); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 9px; }
.chip {
  padding: 5px 11px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 11.8px; cursor: pointer; color: var(--text-2); transition: .13s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---------- 会话列表 ---------- */
.sess {
  padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px;
  border: 1px solid transparent; margin-bottom: 4px;
}
.sess:hover { background: var(--surface-3); }
.sess.active { background: var(--brand-soft); border-color: #c9dcff; color: var(--brand-dark); font-weight: 600; }
.sess .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess .m { font-size: 10.5px; color: var(--text-3); }

/* ---------- 评分星 ---------- */
.stars { color: #f0a500; letter-spacing: -1px; font-size: 12px; }
.muted { color: var(--text-3); }
.small { font-size: 11.5px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.mb0 { margin-bottom: 0; }
.mt6 { margin-top: 6px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-center { display: flex; align-items: center; gap: 8px; }
.gap6 { gap: 6px; }
.gap10 { gap: 10px; }
.wrap { flex-wrap: wrap; }
.right { margin-left: auto; }
.tr { text-align: right; }
.tc { text-align: center; }
.full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ---------- 骨架 ---------- */
.skel { background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 50%, #eef2f7 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 7px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
.spinner.dark { border-color: rgba(47,109,246,.25); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 打印 ---------- */
@media print {
  .sidebar, .topbar, .toasts, .no-print { display: none !important; }
  .app { grid-template-columns: 1fr; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
