/* ============================================================
   砚迹 InsightPen · 统一设计系统
   风格：Paper-White 极简 / 专业大气 / 细边框 / 微阴影
   约束：无渐变、无重阴影、无大圆角、无玻璃拟态、无点阵背景
   ============================================================ */

:root {
  /* —— 中性色 —— */
  --bg:            #F5F6F8;
  --surface:       #FFFFFF;
  --surface-2:     #FAFBFC;
  --surface-3:     #F0F2F5;
  --border:        #E5E8EC;
  --border-2:      #D8DCE2;
  --text:          #171A1F;
  --text-2:        #59616D;
  --text-3:        #8A929E;
  --text-4:        #AEB5BF;

  /* —— 品牌色（深靛蓝 · 专业理性） —— */
  --brand:         #1A4B8F;
  --brand-2:       #2C6BC4;
  --brand-soft:    #EAF1FA;
  --brand-line:    #C7DBF2;

  /* —— 五维画像维度色（低饱和，克制） —— */
  --d-cognition:   #2E6FBF;  /* 认知力 */
  --d-behavior:    #2E9E8F;  /* 行为力 */
  --d-mentality:   #7A5EA8;  /* 心力 */
  --d-personality: #C98A31;  /* 性格 */
  --d-potential:   #C0574C;  /* 潜质 */

  /* —— 语义色 —— */
  --ok:            #1F8A5B;
  --ok-soft:       #E8F4EE;
  --info:          #2E6FBF;
  --info-soft:     #EAF1FA;
  --warn:          #C0872C;
  --warn-soft:     #FBF2E3;
  --risk:          #C0574C;
  --risk-soft:     #FAECEA;
  --neutral-soft:  #F0F2F5;

  /* —— 几何 —— */
  --r-xs: 4px;
  --r-sm: 6px;
  --r:    8px;
  --r-lg: 12px;
  --shadow:  0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03);
  --shadow-2: 0 2px 6px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);

  /* —— 字体 —— */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, h5, p, figure { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D5DAE1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #BFC6D0; }
::-webkit-scrollbar-track { background: transparent; }

/* ================= 图标 ================= */
.i { width: 16px; height: 16px; stroke: currentColor; fill: none;
     stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
     flex: none; display: inline-block; vertical-align: -3px; }
.i-18 { width: 18px; height: 18px; }
.i-20 { width: 20px; height: 20px; }
.i-24 { width: 24px; height: 24px; }
.i-32 { width: 32px; height: 32px; stroke-width: 1.4; }

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

.sidebar {
  width: 236px; flex: none; background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
.sb-brand {
  height: 60px; display: flex; align-items: center; gap: 10px;
  padding: 0 18px; border-bottom: 1px solid var(--border); flex: none;
}
.sb-logo {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.sb-logo .i { width: 17px; height: 17px; stroke-width: 1.8; }
.sb-name { font-size: 15px; font-weight: 650; letter-spacing: .2px; line-height: 1.2; }
.sb-sub { font-size: 10.5px; color: var(--text-3); letter-spacing: .6px; text-transform: uppercase; }

.sb-nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.sb-group { padding: 14px 10px 6px; font-size: 11px; color: var(--text-4);
            letter-spacing: .8px; font-weight: 600; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 1px;
  border-radius: var(--r-sm); color: var(--text-2);
  font-size: 13.5px; cursor: pointer;
  transition: background .12s, color .12s;
}
.sb-item:hover { background: var(--surface-3); color: var(--text); }
.sb-item.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sb-item .i { color: var(--text-3); }
.sb-item.on .i { color: var(--brand); }
.sb-item:hover .i { color: var(--text-2); }
.sb-item.on:hover .i { color: var(--brand); }
.sb-badge { margin-left: auto; font-size: 11px; padding: 1px 6px;
            border-radius: 10px; background: var(--risk-soft); color: var(--risk); font-weight: 600; }
.sb-foot { padding: 12px 14px; border-top: 1px solid var(--border); flex: none; }
.sb-user { display: flex; align-items: center; gap: 9px; }
.sb-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft);
             color: var(--brand); display: flex; align-items: center; justify-content: center;
             font-size: 12px; font-weight: 600; flex: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px; flex: none; background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  position: sticky; top: 0; z-index: 30;
}
.tb-title { font-size: 16px; font-weight: 650; }
.tb-crumb { font-size: 12.5px; color: var(--text-3); }
.tb-crumb span { margin: 0 6px; color: var(--text-4); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.content { padding: 22px 24px 48px; flex: 1; }
.page { display: none; }
.page.on { display: block; animation: fadeUp .22s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ================= 通用组件 ================= */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow);
}
.card-hd {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card-hd h3 { font-size: 14px; font-weight: 650; }
.card-hd .i { color: var(--text-3); }
.card-hd .more { margin-left: auto; }
.card-bd { padding: 18px; }
.card-bd.tight { padding: 12px 14px; }
.card-bd.flush { padding: 0; }
.card-sub { font-size: 12px; color: var(--text-3); font-weight: 400; }

.grid { display: grid; gap: 16px; }
.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)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.row2-1 { grid-template-columns: 2fr 1fr; }
.row1-2 { grid-template-columns: 1fr 2fr; }
.row3-2 { grid-template-columns: 3fr 2fr; }
.row2-3 { grid-template-columns: 2fr 3fr; }

@media (max-width: 1380px) {
  .g5, .g6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row2-1, .row1-2, .row3-2, .row2-3 { grid-template-columns: 1fr; }
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: var(--r-sm);
  border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 500;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-3); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.pri:hover { background: #16406F; }
.btn.sm { height: 27px; padding: 0 10px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn .i { width: 14px; height: 14px; }

.input {
  height: 32px; padding: 0 11px; border: 1px solid var(--border-2);
  border-radius: var(--r-sm); background: var(--surface);
  font-size: 13px; font-family: inherit; color: var(--text); outline: none;
}
.input:focus { border-color: var(--brand-2); }
.input::placeholder { color: var(--text-4); }
select.input { cursor: pointer; }

.search { position: relative; }
.search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
             color: var(--text-4); width: 14px; height: 14px; }
.search .input { padding-left: 30px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--r-xs);
  font-size: 11.5px; font-weight: 600; letter-spacing: .2px;
  background: var(--neutral-soft); color: var(--text-2);
}
.chip.brand { background: var(--brand-soft); color: var(--brand); }
.chip.ok    { background: var(--ok-soft);    color: var(--ok); }
.chip.info  { background: var(--info-soft);  color: var(--info); }
.chip.warn  { background: var(--warn-soft);  color: var(--warn); }
.chip.risk  { background: var(--risk-soft);  color: var(--risk); }
.chip.out   { background: transparent; border: 1px solid var(--border-2); color: var(--text-2); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* 数据块 */
.stat { padding: 16px 18px; }
.stat-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.stat-ic { width: 28px; height: 28px; border-radius: var(--r-sm); display: flex;
           align-items: center; justify-content: center; flex: none;
           background: var(--brand-soft); color: var(--brand); }
.stat-ic .i { width: 15px; height: 15px; }
.stat-lb { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.stat-num { font-size: 26px; font-weight: 660; letter-spacing: -.5px;
            line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-num small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat-ft { margin-top: 8px; font-size: 12px; color: var(--text-3);
           display: flex; align-items: center; gap: 5px; }
.up { color: var(--ok); } .down { color: var(--risk); }

/* 表格 */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--text-3); font-size: 12px;
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .primary { font-weight: 600; }

.cell-user { display: flex; align-items: center; gap: 9px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none;
          display: flex; align-items: center; justify-content: center;
          font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.c1 { background: #E7EEF8; color: #2E6FBF; }
.avatar.c2 { background: #E6F3F0; color: #2E9E8F; }
.avatar.c3 { background: #F0EBF7; color: #7A5EA8; }
.avatar.c4 { background: #FBF1E1; color: #C98A31; }
.avatar.c5 { background: #FAEBE9; color: #C0574C; }

/* 进度 / 条形 */
.bar { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--brand-2); }
.bar.thin { height: 4px; }

/* 分段控件 */
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-sm); padding: 2px; }
.seg button { border: none; background: transparent; padding: 5px 12px; border-radius: var(--r-xs);
              font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

/* 列表项 */
.list-item { display: flex; align-items: center; gap: 11px; padding: 11px 0;
             border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.list-item .body { min-width: 0; flex: 1; }
.list-item .t { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .s { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.list-item .end { flex: none; text-align: right; }

/* 时间线 */
.tl { position: relative; padding-left: 20px; }
.tl::before { content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px;
              width: 1px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ''; position: absolute; left: -19px; top: 5px;
                   width: 9px; height: 9px; border-radius: 50%;
                   background: var(--surface); border: 2px solid var(--border-2); }
.tl-item.ok::before { border-color: var(--ok); }
.tl-item.warn::before { border-color: var(--warn); }
.tl-item.risk::before { border-color: var(--risk); }
.tl-item.now::before { border-color: var(--brand); }
.tl-t { font-size: 13px; font-weight: 500; }
.tl-s { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tl-time { font-size: 11.5px; color: var(--text-4); font-variant-numeric: tabular-nums; }

/* 标签页 */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { border: none; background: none; padding: 9px 14px; font-size: 13.5px;
               color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px;
               font-weight: 500; display: flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--brand); font-weight: 650; border-bottom-color: var(--brand); }
.tabs button .i { width: 15px; height: 15px; }

/* 空态 / 提示 */
.note { display: flex; gap: 10px; padding: 11px 13px; border-radius: var(--r-sm);
        background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.note.info { background: var(--info-soft); border-color: #D5E3F5; color: #1E5590; }
.note.warn { background: var(--warn-soft); border-color: #F0DFBE; color: #8E6220; }
.note .i { flex: none; margin-top: 2px; }

/* 图例 */
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-2); }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }

/* 指标行 */
.kv { display: flex; align-items: baseline; justify-content: space-between;
      padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.tiny { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.sec-title { font-size: 13px; font-weight: 650; color: var(--text); margin-bottom: 10px;
             display: flex; align-items: center; gap: 7px; }
.sec-title .i { color: var(--text-3); width: 15px; height: 15px; }
