/* ============================================================
   小红书热点跟踪分析平台 - 设计系统 v2
   F 型视线 / 12 列网格 / 单一强调色 / 1px 边框 + 极轻柔阴影
   ============================================================ */
:root {
  /* 中性面 */
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #e8eaee;
  --line2: #f1f3f6;

  /* 文字两级 */
  --ink: #15181f;
  --sub: #69707d;
  --muted: #9aa1ae;

  /* 单一强调色（小红书品牌红） */
  --accent: #ff2e4d;
  --accent-soft: rgba(255, 46, 77, .08);
  --accent-weak: rgba(255, 46, 77, .14);

  /* 语义色 */
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;

  /* 图表色板 */
  --c1: #ff2e4d;
  --c2: #3b82f6;
  --c3: #10b981;
  --c4: #f59e0b;
  --c5: #8b5cf6;
  --c6: #06b6d4;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 23, 31, .04), 0 4px 16px rgba(20, 23, 31, .04);
  --fs: 13.5px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
button, input, select { font-family: inherit; font-size: var(--fs); }
a { text-decoration: none; }
.hidden { display: none !important; }
.num, .data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.k-value, .rk-val, .nc-stats b, .data-table td.num, .mini-row span {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
}

.app { display: flex; height: 100vh; overflow: hidden; }

/* ===================== 侧边栏 232px ===================== */
.sidebar {
  width: 232px; flex-shrink: 0;
  background: #181c27; color: #fff;
  display: flex; flex-direction: column;
}
.logo { display: flex; align-items: center; gap: 11px; padding: 20px 18px 18px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #ff4d66, #ff2e4d);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff;
  box-shadow: 0 4px 12px rgba(255, 46, 77, .35);
}
.logo-txt .lt1 { font-size: 14.5px; font-weight: 600; letter-spacing: .2px; }
.logo-txt .lt2 { font-size: 11px; color: #8089a0; margin-top: 2px; }

.nav { flex: 1; padding: 6px 12px; overflow-y: auto; }
.nav-group {
  font-size: 10px; color: #5f677c; letter-spacing: 1.3px;
  padding: 16px 10px 7px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px; cursor: pointer;
  color: #9aa2b4; font-size: 13px; margin-bottom: 2px;
  transition: background .14s, color .14s; position: relative;
}
.nav-item svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.nav-item:hover { background: rgba(255, 255, 255, .05); color: #e4e8ef; }
.nav-item.active { background: var(--accent-weak); color: #fff; font-weight: 500; }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-tree { margin-bottom: 2px; }
.nav-tree > .nav-item { margin-bottom: 0; }
.nav-caret { margin-left: auto; color: #687188; font-size: 14px; line-height: 1; }
.nav-submenu { padding: 1px 0 4px 29px; }
.nav-subitem {
  display: block; padding: 6px 10px; border-radius: 7px; cursor: pointer;
  color: #7f899f; font-size: 12px; text-decoration: none; transition: background .14s, color .14s;
}
.nav-subitem::before { content: "·"; margin-right: 7px; color: #667086; }
.nav-subitem .nav-caret { margin-left: auto; color: #667086; font-size: 12px; }
.nav-subparent { display: flex; align-items: center; }
.nav-tree-nested { margin-top: 1px; }
.nav-tree-nested > .nav-submenu { padding-left: 18px; }
.nav-tree-nested > .nav-subitem { color: #b8c0cf; }
.nav-tree-nested > .nav-subitem::before { content: "▸"; font-size: 9px; }
.nav-tree-nested.has-active > .nav-subparent { color: #fff; background: rgba(255, 46, 77, .10); }
.nav-subitem:hover { background: rgba(255, 255, 255, .05); color: #e4e8ef; }
.nav-subitem.active { background: rgba(255, 46, 77, .13); color: #fff; }
.nav-tree.has-active > .nav-item { background: var(--accent-weak); color: #fff; font-weight: 500; }
.nav-tree.has-active > .nav-item::before {
  content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}

.side-foot { padding: 13px 18px 17px; border-top: 1px solid rgba(255, 255, 255, .06); }
.sf-row { display: flex; justify-content: space-between; font-size: 11px; color: #767e93; padding: 3px 0; }
.sf-row b { color: #cfd4de; font-weight: 500; }

/* ===================== 主区域 ===================== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 26px 14px; flex-shrink: 0;
  border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .7);
  backdrop-filter: saturate(180%) blur(8px);
}
.topbar h1 { font-size: 18px; font-weight: 650; letter-spacing: -.2px; }
.topbar p { font-size: 12px; color: var(--sub); margin-top: 3px; }
.top-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 12px; font-size: 11.5px; color: var(--sub);
  box-shadow: var(--shadow);
}
.chip b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.content { flex: 1; overflow-y: auto; padding: 18px 26px 44px; }

/* ===================== 卡片 ===================== */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 17px 18px; box-shadow: var(--shadow);
}
.card-hd {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px; gap: 10px;
}
.card-hd h3 { font-size: 13.5px; font-weight: 640; letter-spacing: -.1px; }
.card-sub { font-size: 11px; color: var(--muted); }

/* 12 列网格 */
.chart-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 15px; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; }
.c6 { grid-column: span 6; } .c8 { grid-column: span 8; }
.c12 { grid-column: span 12; }

.chart-box { height: 224px; }
.chart-box svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; text-align: center; line-height: 1.7;
}

/* ===================== KPI ===================== */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 15px; }
.kpi {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--accent), #ff7a45); opacity: .85;
}
.kpi .k-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi .k-label { font-size: 12px; color: var(--sub); }
.k-delta { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.k-delta.up { color: var(--ok); }
.k-delta.down { color: var(--danger); }
.k-delta.flat { color: var(--muted); }
.kpi .k-value {
  font-size: 27px; font-weight: 680; margin-top: 8px;
  letter-spacing: -.6px; line-height: 1.1;
}
.kpi .k-foot { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ===================== 筛选栏 ===================== */
.filter-bar {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; display: flex; gap: 13px; align-items: flex-end;
  flex-wrap: wrap; margin-bottom: 15px; box-shadow: var(--shadow);
}
.f-item { display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.f-item.grow { flex: 1; min-width: 240px; }
.f-item label { font-size: 11px; color: var(--sub); font-weight: 500; }
.f-item select, .f-item input {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px;
  background: #fff; color: var(--ink); outline: none; width: 100%; height: 36px;
  transition: border-color .12s, box-shadow .12s;
}
.f-item select:focus, .f-item input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.f-hint { font-size: 11px; color: var(--muted); margin-left: auto; align-self: center; }
.f-actions { display: flex; gap: 8px; }

.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 8px 16px; cursor: pointer; height: 36px;
  font-size: 13px; font-weight: 500; transition: .12s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(255, 46, 77, .25); }
.btn.primary:hover { background: #e81f3d; color: #fff; }
.btn.block { width: 100%; margin-top: 8px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.chip-select { display: flex; gap: 7px; flex-wrap: wrap; padding-top: 2px; }
.cs-chip {
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 13px;
  font-size: 12.5px; cursor: pointer; color: var(--sub); background: #fff;
  transition: .12s; user-select: none;
}
.cs-chip:hover { border-color: var(--accent); color: var(--accent); }
.cs-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }

/* ===================== 列表工具条 ===================== */
.list-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.result-meta { font-size: 12px; color: var(--sub); }
.result-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.lb-right { display: flex; align-items: center; gap: 9px; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg-b { border: none; background: #fff; padding: 7px 14px; cursor: pointer; font-size: 12.5px; color: var(--sub); transition: .12s; }
.seg-b.active { background: var(--accent); color: #fff; }

/* ===================== 笔记卡片 ===================== */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 13px; }
.note-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: border-color .14s, box-shadow .14s, transform .14s;
  box-shadow: var(--shadow);
}
.note-card:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(20, 23, 31, .08); transform: translateY(-2px); }
.nc-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line2); display: block; }
.nc-body { padding: 11px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.nc-rank {
  display: inline-block; font-size: 10px; font-weight: 700; color: #fff;
  background: var(--accent); border-radius: 5px; padding: 2px 6px; margin-bottom: 7px; width: fit-content;
}
.nc-title {
  font-size: 12.5px; font-weight: 560; line-height: 1.45; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px;
}
.nc-author { font-size: 11px; color: var(--sub); margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 3px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line2);
}
.nc-stats div { font-size: 10px; color: var(--muted); }
.nc-stats b { display: block; font-size: 12px; color: var(--ink); font-weight: 640; margin-top: 1px; }
.nc-actions { display: flex; gap: 6px; margin-top: 10px; }
.nc-btn {
  flex: 1; text-align: center; padding: 6px 0; border-radius: 7px; cursor: pointer;
  font-size: 11px; border: 1px solid var(--line); color: var(--sub); background: #fff; transition: .12s;
}
.nc-btn:hover { border-color: var(--accent); color: var(--accent); }
.nc-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ===================== 表格 ===================== */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.data-table th {
  text-align: left; padding: 10px 13px; font-size: 11px; font-weight: 600;
  color: var(--sub); background: #fafbfc; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.data-table td { padding: 8px 13px; border-bottom: 1px solid var(--line2); color: var(--ink); height: 40px; }
.data-table tbody tr:hover { background: #fafbfc; }
.data-table .t-title { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { color: var(--accent); cursor: pointer; font-size: 11.5px; margin-right: 10px; white-space: nowrap; }
.link-btn.gray { color: var(--sub); }
.link-btn.red { color: var(--danger); margin-right: 0; }
.advice-line { padding: 0 15px 15px; color: var(--sub); font-size: 13px; line-height: 1.7; }
.chip-tag small { color: inherit; opacity: .72; font-size: 10px; margin-left: 2px; }

/* ===================== TOP100 明细 ===================== */
#t100Table .t-rank { width: 46px; text-align: center; }
#t100Table .t-cover { width: 66px; }
#t100Table .t-title { max-width: 320px; }
#t100Table .th-sort { cursor: pointer; user-select: none; transition: color .12s; }
#t100Table .th-sort:hover { color: var(--accent); }
#t100Table .th-sort::after { content: "⇅"; font-size: 10px; color: var(--muted); margin-left: 4px; }
#t100Table .th-sort.asc::after { content: "▲"; color: var(--accent); }
#t100Table .th-sort.desc::after { content: "▼"; color: var(--accent); }
.rk-cell {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 7px; font-size: 11px; font-weight: 700;
  background: var(--line2); color: var(--sub); font-variant-numeric: tabular-nums;
}
.rk-cell.top1 { background: #fff0f2; color: var(--accent); }
.rk-cell.top2 { background: #fff4ea; color: #f0820a; }
.rk-cell.top3 { background: #fef6e7; color: #c98a00; }
.t100-cover {
  width: 54px; height: 54px; border-radius: 9px; object-fit: cover;
  background: var(--line2); display: block; border: 1px solid var(--line);
}
.t100-author { display: flex; flex-direction: column; gap: 1px; }
.t100-author b { font-weight: 600; color: var(--ink); }
.t100-author span { font-size: 11px; color: var(--muted); }

/* ===================== 排行榜 ===================== */
.rank-list { display: flex; flex-direction: column; }
.rank-item { display: flex; align-items: center; gap: 11px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.rank-item:last-child { border-bottom: none; }
.rk-no {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; background: var(--line2); color: var(--sub);
}
.rank-item:nth-child(1) .rk-no { background: var(--accent); color: #fff; }
.rank-item:nth-child(2) .rk-no { background: #ff7a45; color: #fff; }
.rank-item:nth-child(3) .rk-no { background: #ffa940; color: #fff; }
.rk-main { flex: 1; min-width: 0; }
.rk-title { font-size: 12.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.rk-val { font-size: 12.5px; font-weight: 640; color: var(--accent); flex-shrink: 0; }

/* ===================== 历史 ===================== */
.hist-layout { display: grid; grid-template-columns: 262px 1fr; gap: 15px; align-items: start; }
.date-list { display: flex; flex-direction: column; gap: 5px; max-height: 560px; overflow-y: auto; }
.date-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 11px; border-radius: 8px; cursor: pointer; border: 1px solid transparent;
  transition: background .12s, border-color .12s;
}
.date-item:hover { background: var(--line2); }
.date-item.active { background: var(--accent-soft); border-color: rgba(255, 46, 77, .3); }
.date-item .d1 { font-size: 12.5px; font-weight: 560; font-variant-numeric: tabular-nums; }
.date-item .d2 { font-size: 11px; color: var(--muted); }

/* ===================== 表单 ===================== */
.two-col { display: grid; grid-template-columns: 1fr 360px; gap: 15px; align-items: start; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; color: var(--sub); font-weight: 500; }
.field input, .field select { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; outline: none; width: 100%; transition: border-color .12s, box-shadow .12s; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.tip { font-size: 11px; color: var(--muted); line-height: 1.6; }

.key-list, .sched-list { display: flex; flex-direction: column; gap: 10px; }
.krow, .srow { border: 1px solid var(--line); border-radius: 9px; padding: 12px 13px; background: #fcfcfd; }
.krow .k-top, .srow .s-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.krow .k-name, .srow .s-cat { font-size: 13px; font-weight: 600; }
.tag { font-size: 10px; padding: 2px 7px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tag.gray { background: var(--line2); color: var(--sub); }
.krow .k-val { font-size: 11.5px; color: var(--ink); font-family: ui-monospace, Consolas, monospace; margin-bottom: 3px; word-break: break-all; }
.krow .k-meta, .srow .s-meta { font-size: 10.5px; color: var(--muted); }
.row-btns { display: flex; gap: 12px; margin-top: 8px; }
.lnk { font-size: 11.5px; color: var(--accent); cursor: pointer; }
.lnk.gray { color: var(--sub); }
.lnk.red { color: var(--danger); }
.switch { position: relative; display: inline-block; width: 34px; height: 19px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #cfd4dc; border-radius: 999px; cursor: pointer; transition: .2s; }
.slider::before { content: ""; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(15px); }

/* ===================== 弹窗 ===================== */
.overlay { position: fixed; inset: 0; background: rgba(14, 18, 28, .42); opacity: 0; pointer-events: none; transition: .18s; z-index: 50; }
.overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -46%);
  width: min(680px, 92vw); max-height: 86vh; overflow-y: auto;
  background: #fff; border-radius: 14px; z-index: 60;
  opacity: 0; pointer-events: none; transition: .2s; box-shadow: 0 20px 60px rgba(14, 18, 28, .25);
}
.modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal-hd { display: flex; justify-content: space-between; align-items: flex-start; padding: 17px 19px 12px; border-bottom: 1px solid var(--line); }
.modal-hd h3 { font-size: 14.5px; font-weight: 640; }
.modal-hd p { font-size: 11.5px; color: var(--sub); margin-top: 3px; }
.modal-x { font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--ink); }
.modal-bd { padding: 15px 19px 19px; }
.mini-table { margin-top: 12px; font-size: 12px; }
.mini-row { display: grid; grid-template-columns: 88px repeat(4, 1fr); gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line2); }
.mini-row.head { font-weight: 600; color: var(--sub); font-size: 11px; }

/* ===================== Toast ===================== */
#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(14px);
  background: #15181f; color: #fff; padding: 10px 19px; border-radius: 8px;
  font-size: 12.5px; opacity: 0; pointer-events: none; transition: .2s; z-index: 90;
  box-shadow: 0 8px 24px rgba(14, 18, 28, .25);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); }

.empty { text-align: center; color: var(--muted); padding: 44px 20px; font-size: 12.5px; }

/* ===================== 列表可跳转 / 缩略图 ===================== */
.data-table .t-cover { width: 66px; padding: 6px 8px; }
.data-table .t-title { min-width: 220px; max-width: 340px; }
.t-cover-img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; background: var(--line2); display: block; }
.cell-jump { cursor: pointer; line-height: 0; }
.cell-jump:hover .t-cover-img { box-shadow: 0 0 0 2px var(--accent); }
.t-link { color: var(--ink); cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.t-link:hover { color: var(--accent); text-decoration: underline; }
.ops { display: flex; gap: 9px; white-space: nowrap; }

/* ===================== 手动新增弹窗表单 ===================== */
.two-col-form { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 13px; }
.two-col-form .col-2 { grid-column: span 2; }
.field label i { color: var(--accent); font-style: normal; margin-left: 2px; }
.form-err { color: var(--danger); font-size: 12px; min-height: 16px; margin-top: 4px; }
.modal-ft { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }

/* 站内笔记预览弹窗 */
#noteModal .modal-bd { max-width: 560px; }
.nm-cover-box { width: 100%; border-radius: 10px; overflow: hidden; background: var(--subtle); margin-bottom: 13px; max-height: 340px; display: flex; align-items: center; justify-content: center; }
.nm-cover { max-width: 100%; max-height: 340px; display: block; }
.nm-no-cover { color: var(--muted); font-size: 12px; padding: 40px 0; }
.nm-title { font-size: 15px; line-height: 1.5; color: var(--ink); margin: 0 0 6px; }
.nm-meta { font-size: 12px; color: var(--sub); margin-bottom: 11px; }
.nm-body { font-size: 13px; line-height: 1.75; color: var(--ink); white-space: pre-wrap; word-break: break-word; background: var(--subtle); border-radius: 8px; padding: 12px 14px; margin: 0 0 13px; }
.nm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.nm-stat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; text-align: center; }
.nm-stat span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.nm-stat b { font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }

/* 所有可点击进原文/预览的标题 */
.rk-title[data-key], .t-link[data-key] { cursor: pointer; }
.rk-title[data-key]:hover, .t-link[data-key]:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 1180px) {
  .chart-grid { grid-template-columns: repeat(6, 1fr); }
  .c8, .c12 { grid-column: span 6; }
  .c4 { grid-column: span 3; }
  .c3 { grid-column: span 3; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .hist-layout { grid-template-columns: 1fr; }
}

/* ============ 技能中心专用样式 ============ */
.c5 { grid-column: span 5; }
.c7 { grid-column: span 7; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

/* 笔记自检 textarea */
.ta {
  width: 100%; min-height: 200px; resize: vertical;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); line-height: 1.6; font-size: 13.5px;
}
.ta:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 爆款参考卡片网格 */
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ref-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel);
  padding: 10px 11px; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.ref-card:hover { border-color: var(--accent-weak); box-shadow: var(--shadow); }
.rc-cover { width: 100%; height: 96px; object-fit: cover; border-radius: 6px; background: var(--line2); }
.rc-title { font-weight: 600; color: var(--ink); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-sub { color: var(--sub); font-size: 11.5px; }

/* 标签 chips */
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-tag {
  display: inline-block; padding: 5px 11px; font-size: 12.5px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-weak);
}

/* 起草助手 */
.draft-box { margin-top: 12px; border: 1px dashed var(--accent-weak); border-radius: var(--radius-sm); background: var(--accent-soft); padding: 14px 16px; line-height: 1.75; font-size: 13.5px; }
.db-h { font-weight: 700; color: var(--accent); margin: 10px 0 6px; font-size: 13px; }
.db-h:first-child { margin-top: 0; }
.db-body { color: var(--ink); }

/* 维度占比条 */
.dim-bar { position: relative; height: 10px; border-radius: 999px; background: var(--line2); overflow: hidden; }
.dim-bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--accent), #ff7088); border-radius: 999px; }

/* 自检 tips */
.tips-list { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.tips-list li { position: relative; padding-left: 18px; color: var(--sub); font-size: 12.5px; }
.tips-list li::before { content: "•"; position: absolute; left: 4px; color: var(--accent); font-weight: 700; }

/* 榜单筛选小输入 */
.mini-input {
  height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); font-size: 12.5px; min-width: 96px;
}
.mini-input.num { width: 96px; min-width: 0; }
.mini-input:focus { outline: none; border-color: var(--accent); }
.mini-label { font-size: 12px; color: var(--sub); display: inline-flex; align-items: center; gap: 5px; }
.mini-label .mini-input { margin-left: 0; }

/* 可排序表头 */
.data-table th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.data-table th[data-sort]:hover { color: var(--accent); }
.data-table th[data-sort]::after { content: " ⇅"; opacity: .35; font-size: 11px; }
.data-table th.sorted-asc::after { content: " ▲"; opacity: 1; color: var(--accent); }
.data-table th.sorted-desc::after { content: " ▼"; opacity: 1; color: var(--accent); }

/* 历史删除按钮 */
.link-btn.danger { color: var(--danger); margin-right: 0; }

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .c5, .c7 { grid-column: span 12; }
}

/* ===================== 数据拉取结果弹窗 ===================== */
#pullModal { width: min(1120px, 95vw); }
.pm-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.pm-chip {
  flex: 1 1 150px; min-width: 140px; border: 1px solid var(--line);
  background: var(--panel); border-radius: var(--radius-sm); padding: 9px 13px;
}
.pm-chip span { font-size: 11.5px; color: var(--sub); }
.pm-chip em { display: block; font-style: normal; font-size: 11px; color: var(--muted); margin-top: 1px; }
.pm-chip b { display: block; font-size: 18px; line-height: 1.35; color: var(--accent); font-weight: 700; }
.pm-chip.ok b { color: #10b981; }
.pm-chip.bad b { color: var(--danger); }
.pm-fail {
  margin: 0 0 11px; padding: 8px 12px; font-size: 12px; color: var(--danger);
  background: rgba(229, 57, 53, .07); border: 1px solid rgba(229, 57, 53, .25);
  border-radius: var(--radius-sm); line-height: 1.6;
}
.pm-note {
  margin: 0 0 11px; padding: 8px 12px; font-size: 12px; color: var(--warn);
  background: rgba(245, 158, 11, .09); border: 1px solid rgba(245, 158, 11, .35);
  border-radius: var(--radius-sm); line-height: 1.6;
}
.pm-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 2px 0 10px; }
.pm-tab {
  padding: 7px 15px 8px; font-size: 12.5px; color: var(--sub); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; user-select: none;
}
.pm-tab.active { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.pm-pane {
  max-height: 46vh; overflow: auto; border: 1px solid var(--line2);
  border-radius: var(--radius-sm); background: var(--panel);
}
.pm-pane .data-table { font-size: 12px; }
.pm-pane .data-table th { background: var(--panel); }
.pm-pane .empty { padding: 30px 16px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 9px; padding: 12px; }
.cat-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; padding: 8px 11px; font-size: 12.5px;
}
.cat-item b { color: var(--accent); font-size: 15px; }
.cat-item span { color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-pager { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 10px; font-size: 12px; color: var(--sub); }
.pm-pager .btn { padding: 4px 13px; font-size: 12px; }

/* ===================== 登录首页 ===================== */
.login-mask {
  position: fixed; inset: 0; z-index: 999; display: flex;
  align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(255, 77, 79, .16), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(255, 140, 0, .12), transparent 55%),
    linear-gradient(160deg, #faf6f1, #f3f5f9);
}
.login-card {
  width: min(380px, calc(100vw - 40px)); background: #fff; border-radius: 18px;
  padding: 34px 34px 26px; box-shadow: 0 18px 60px rgba(31, 41, 55, .16);
  border: 1px solid var(--line);
}
.lc-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.lc-mark {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, #ff5c5c, #ff2244);
  color: #fff; font-size: 21px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(255, 34, 68, .3);
}
.lc-txt b { display: block; font-size: 17px; letter-spacing: .2px; }
.lc-txt span { font-size: 11px; color: var(--sub); letter-spacing: .6px; text-transform: uppercase; }
.lc-sub { font-size: 13px; color: var(--sub); margin: 18px 0 16px; line-height: 1.6; }
.lc-label { display: block; font-size: 12px; color: var(--ink); font-weight: 600; margin: 12px 0 6px; }
.lc-input {
  width: 100%; box-sizing: border-box; padding: 11px 13px; font-size: 14px;
  border: 1px solid var(--line2); border-radius: 10px; background: #fff;
  color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.lc-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 34, 68, .1); }
.lc-err {
  margin: 10px 0 0; font-size: 12.5px; color: var(--danger);
  background: rgba(229, 57, 53, .08); border: 1px solid rgba(229, 57, 53, .22);
  padding: 7px 11px; border-radius: 8px;
}
.lc-btn {
  width: 100%; margin-top: 18px; padding: 12px 0; font-size: 15px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, #ff5c5c, #ff2244);
  border: none; border-radius: 10px; cursor: pointer; letter-spacing: 4px;
  box-shadow: 0 8px 20px rgba(255, 34, 68, .28);
  transition: filter .15s, transform .05s;
}
.lc-btn:hover { filter: brightness(1.06); }
.lc-btn:active { transform: translateY(1px); }
.lc-btn:disabled { opacity: .6; cursor: not-allowed; }
.lc-tip { font-size: 11.5px; color: var(--sub2, #9aa3b2); text-align: center; margin: 16px 0 0; }

/* 顶栏用户区 */
.tb-user { display: flex; align-items: center; gap: 8px; margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line); }
.tb-u-ico { font-size: 13px; }
.tb-u-name { font-size: 12.5px; font-weight: 600; color: var(--ink); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-logout {
  border: 1px solid var(--line2); background: #fff; color: var(--sub);
  font-size: 11.5px; border-radius: 7px; padding: 4px 10px; cursor: pointer;
}
.tb-logout:hover { color: var(--danger); border-color: var(--danger); }
@media (max-width: 720px) { .tb-user { display: none; } }
