:root {
  --primary: #2b4fff;
  --primary-light: #eef1ff;
  --primary-dark: #1d3ad6;
  --sidebar: #101528;
  --sidebar-hover: #1a2140;
  --sidebar-active: #1d2745;
  --bg: #f5f6fa;
  --card: #ffffff;
  --text: #1a1f36;
  --text-2: #5a6080;
  --text-3: #8b91a8;
  --line: #e6e8f0;
  --line-2: #f0f1f6;
  --good: #0d9f6e;
  --good-light: #e6f7f0;
  --warn: #d97706;
  --warn-light: #fdf1e2;
  --bad: #dc2626;
  --bad-light: #fdeaea;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 6px 24px rgba(16, 21, 40, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; }
a { color: var(--primary); text-decoration: none; }

/* ============ 布局 ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px; background: var(--sidebar); color: #c9cede;
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
}

.logo { padding: 22px 20px 16px; display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #4f6bff, #2b4fff);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.logo-name { color: #fff; font-weight: 600; font-size: 15px; letter-spacing: .3px; }
.logo-sub { font-size: 11px; color: #7c86a5; margin-top: 2px; }

.nav { flex: 1; padding: 8px 10px; overflow-y: auto; }
.nav-group { font-size: 10.5px; color: #5b6482; padding: 12px 14px 6px; letter-spacing: .6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  border-radius: 9px; cursor: pointer; margin-bottom: 2px; font-size: 13px;
  transition: background .15s; user-select: none;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-icon { width: 18px; text-align: center; opacity: .85; font-size: 13px; }

.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .07); }
.me { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: #2b3763; color: #cfd6ff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.me-name { color: #e8eaf2; font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.me-role { font-size: 11px; color: #7c86a5; }
.logout {
  width: 100%; background: transparent; border: 1px solid rgba(255, 255, 255, .12);
  color: #9aa2bd; font-size: 12px; padding: 6px; border-radius: 7px; cursor: pointer;
}
.logout:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.foot-actions { display: flex; gap: 6px; }

.main { flex: 1; margin-left: 224px; padding: 24px 30px 72px; min-width: 0; }
.wrap { max-width: 1180px; margin: 0 auto; }

/* ============ 页头 ============ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-title { font-size: 21px; font-weight: 700; letter-spacing: -.2px; }
.page-desc { color: var(--text-2); font-size: 12.5px; margin-top: 5px; line-height: 1.65; }
.head-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ============ 卡片 ============ */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.card.tight { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-sub { font-size: 12px; color: var(--text-3); font-weight: 400; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.split { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }

/* ============ KPI ============ */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi-label { color: var(--text-2); font-size: 12px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }
.kpi-unit { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.kpi-foot { font-size: 11.5px; color: var(--text-3); margin-top: 8px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 600; padding: 9px 16px; border-radius: 9px;
  transition: background .15s, opacity .15s; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: #fff; color: var(--primary); border: 1px solid #c9d2ff; }
.btn.ghost:hover { background: var(--primary-light); }
.btn.plain { background: #fff; color: var(--text-2); border: 1px solid var(--line); }
.btn.plain:hover { background: #fafbff; color: var(--text); }
.btn.danger { background: var(--bad); }
.btn.danger:hover { background: #b91c1c; }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn.xs { padding: 3px 9px; font-size: 11.5px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  border: none; background: transparent; cursor: pointer; color: var(--text-3);
  font-size: 14px; width: 28px; height: 28px; border-radius: 7px;
}
.icon-btn:hover { background: var(--line-2); color: var(--text); }

/* ============ 表单 ============ */
.field { margin-bottom: 13px; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field-hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.6; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 12px; font-size: 13px; outline: none; background: #fff; color: var(--text);
  transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); }
.textarea { resize: vertical; line-height: 1.7; min-height: 90px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline .field { margin-bottom: 0; }

/* ============ 标签 ============ */
.tag {
  display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 20px;
  background: var(--primary-light); color: var(--primary); font-weight: 600; margin-right: 6px;
  white-space: nowrap;
}
.tag.gray { background: #f1f2f7; color: var(--text-2); }
.tag.green { background: var(--good-light); color: var(--good); }
.tag.orange { background: var(--warn-light); color: var(--warn); }
.tag.red { background: var(--bad-light); color: var(--bad); }
.tag.purple { background: #f3efff; color: #6d28d9; }

/* ============ 表格 ============ */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-3);
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfe;
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fbfcff; }
.table-scroll { overflow-x: auto; }

/* ============ 空态 ============ */
.empty { text-align: center; padding: 46px 20px; color: var(--text-3); }
.empty-ico { font-size: 26px; opacity: .45; margin-bottom: 10px; }
.empty-t { font-size: 13px; font-weight: 500; color: var(--text-2); }
.empty-s { font-size: 12px; margin-top: 6px; line-height: 1.6; }

/* ============ 弹层 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 21, 40, .42); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px 40px;
  overflow-y: auto;
}
.modal { background: #fff; border-radius: 14px; width: 100%; box-shadow: var(--shadow); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.modal-title { font-size: 15.5px; font-weight: 600; }
.modal-body { padding: 4px 20px 18px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--line); background: #fcfcfe;
  border-radius: 0 0 14px 14px;
}

/* ============ 提示 ============ */
.toast {
  position: fixed; left: 50%; top: 22px; transform: translateX(-50%);
  background: #1a1f36; color: #fff; font-size: 13px; padding: 10px 18px;
  border-radius: 10px; z-index: 200; box-shadow: var(--shadow); max-width: 80vw;
}
.toast.ok { background: #0d7d59; }
.toast.err { background: #b91c1c; }
.toast.warn { background: #b45309; }

/* ============ 五维条 ============ */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 116px 1fr 34px; align-items: center; gap: 10px; }
.bar-label { font-size: 11.5px; color: var(--text-2); }
.bar-track { height: 7px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width .4s; }
.bar-val { font-size: 12px; font-weight: 600; text-align: right; }
.radar { width: 100%; height: auto; max-width: 300px; display: block; margin: 0 auto; }

/* ============ 列表 ============ */
.list-item {
  padding: 13px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer;
  transition: background .12s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #fbfcff; }
.list-item.active { background: var(--primary-light); border-left: 2px solid var(--primary); padding-left: 14px; }
.li-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.li-meta { font-size: 11.5px; color: var(--text-3); display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ 分栏 ============ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  padding: 9px 16px; font-size: 13px; color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* ============ 登录 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% -10%, #e8edff 0%, #f5f6fa 55%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 16px;
  border: 1px solid var(--line); box-shadow: 0 12px 48px rgba(16, 21, 40, .1);
  padding: 32px 30px 26px;
}
.login-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-title { font-size: 18px; font-weight: 700; }
.login-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.login-tip { font-size: 12px; color: var(--text-2); line-height: 1.7; margin-top: 16px; }
.login-foot { text-align: center; font-size: 11px; color: var(--text-3); margin-top: 20px; line-height: 1.8; }
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; }
.err-text { color: var(--bad); font-size: 12px; margin-top: 8px; }
.login-links {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 14px; font-size: 12.5px;
}
.login-links a { color: var(--accent); text-decoration: none; }
.login-links a:hover { text-decoration: underline; }

/* ============ 内容块 ============ */
.quote {
  background: #fafbff; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; font-size: 13px; line-height: 1.85; white-space: pre-wrap;
  word-break: break-word; color: var(--text);
}
.section-label {
  font-size: 11.5px; font-weight: 600; color: var(--text-3); letter-spacing: .4px;
  margin: 16px 0 8px; text-transform: uppercase;
}
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.hint-box {
  background: #f7f9ff; border: 1px solid #e2e8ff; border-radius: 10px;
  padding: 12px 14px; font-size: 12px; color: var(--text-2); line-height: 1.75;
}
.warn-box {
  background: var(--warn-light); border: 1px solid #f8ddb8; border-radius: 10px;
  padding: 12px 14px; font-size: 12px; color: #92400e; line-height: 1.75;
}
.stage-line { display: flex; gap: 0; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.stage-node { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.stage-node b { font-weight: 600; }
.stage-node.on { color: var(--primary); }
.stage-node.on b { color: var(--primary); }
.stage-sep { width: 18px; height: 1px; background: var(--line); margin: 0 6px; }

.spin {
  display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite;
}
.spin.dark { border-color: rgba(43, 79, 255, .25); border-top-color: var(--primary); }
@keyframes sp { to { transform: rotate(360deg); } }

.loading-line { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 8px; padding: 6px 0; }

@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px 14px 84px; }
  .grid-2, .row-3, .row-2 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .modal-mask { padding: 20px 10px; }
}

/* ============ 移动端底部导航 ============ */
.mobile-nav { display: none; }
@media (max-width: 720px) {
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: #fff; border-top: 1px solid var(--line);
    padding: 5px 2px calc(5px + env(safe-area-inset-bottom));
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    box-shadow: 0 -4px 16px rgba(16, 21, 40, .06);
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mn-item {
    flex: 0 0 auto; min-width: 62px; text-align: center; padding: 5px 4px;
    font-size: 10.5px; color: var(--text-3); border-radius: 8px;
  }
  .mn-item.active { color: var(--primary); background: var(--primary-light); }
  .mn-icon { display: block; font-size: 16px; line-height: 1.4; }
}

/* ============ 录音界面 ============ */
.rec-stage { text-align: center; padding: 10px 0 4px; }
.rec-timer {
  font-size: 40px; font-weight: 300; letter-spacing: 1px; color: var(--text);
  font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.rec-timer.live { color: var(--bad); }
.rec-wave {
  height: 56px; display: flex; align-items: center; justify-content: center; gap: 3px;
  margin: 10px 0 4px;
}
.rec-bar {
  width: 3px; border-radius: 2px; background: var(--primary); transition: height .12s linear;
}
.rec-wave.idle { color: var(--text-3); }
.rec-hint { font-size: 12.5px; color: var(--text-3); }
.rec-actions { margin: 14px 0 6px; }

.rec-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-width: 178px; padding: 13px 26px; border: none; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 14.5px; font-weight: 600;
  cursor: pointer; box-shadow: 0 6px 18px rgba(43, 79, 255, .28);
  transition: transform .12s, box-shadow .12s;
}
.rec-btn:hover { transform: translateY(-1px); }
.rec-btn.stop { background: var(--bad); box-shadow: 0 6px 18px rgba(220, 38, 38, .26); }
.rec-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.rec-dot {
  width: 11px; height: 11px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .6); animation: recPulse 1.6s infinite;
}
@keyframes recPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); }
  70% { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.rec-square { width: 10px; height: 10px; border-radius: 2px; background: #fff; }
.rec-tip { font-size: 11.5px; color: var(--text-3); line-height: 1.7; margin-top: 10px; }

.live-quote {
  max-height: 190px; overflow-y: auto;
  border-color: #dbe3ff; background: #fbfcff;
}
.audio-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding: 9px 12px; border-radius: 9px;
  background: var(--good-light); color: #0a7a55; font-size: 12px;
}

/* ============ 文件导入 ============ */
.drop-zone {
  border: 1.5px dashed #c9d2ff; border-radius: 12px; background: #fbfcff;
  padding: 34px 20px; text-align: center; cursor: pointer; transition: .15s;
}
.drop-zone:hover { border-color: var(--primary); background: var(--primary-light); }
.drop-ico { font-size: 26px; color: var(--primary); margin-bottom: 8px; }
.drop-t { font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
.drop-s { font-size: 11.5px; color: var(--text-3); }
.file-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcff;
}
.file-ico {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.file-name { font-size: 13px; font-weight: 500; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.progress-wrap { margin-top: 14px; }
.progress-track { height: 6px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }

.link-btn {
  background: none; border: none; padding: 0; color: var(--primary);
  font-size: 11.5px; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

