/* =====================================================================
 * 东华大学专利竞争力分析与高价值专利筛选智能体 — 原型样式
 * 视觉：藏青主色 + 金色/橙色强调，浅色背景，面向高校科技管理场景
 * ===================================================================== */
:root {
  --navy: #0d2b52;
  --navy-2: #14355c;
  --navy-3: #1d4a80;
  --navy-deep: #081c36;
  --gold: #c8a02a;
  --gold-2: #e0b640;
  --orange: #e0862a;
  --bg: #f2f5fa;
  --card: #ffffff;
  --text: #1b2a3c;
  --muted: #64748b;
  --line: #e4eaf2;
  --green: #1f9d6b;
  --red: #d64545;
  --blue: #2f6fd6;
  --shadow: 0 1px 3px rgba(13, 43, 82, .06), 0 6px 18px rgba(13, 43, 82, .05);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--blue); text-decoration: none; }

/* ---------- 通用图标 ---------- */
svg.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; flex: none; }
svg.ic.sm { width: 15px; height: 15px; }
svg.ic.lg { width: 22px; height: 22px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.card-title .dot { width: 8px; height: 8px; border-radius: 2px; background: linear-gradient(135deg, var(--gold), var(--orange)); flex: none; }
.card-title .sub { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: auto; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: var(--font); transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--navy-3); color: var(--navy); background: #f8fafd; }
.btn.primary {
  background: linear-gradient(135deg, var(--navy-2), var(--navy-3));
  border-color: var(--navy-3); color: #fff;
}
.btn.primary:hover { background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.btn.gold {
  background: linear-gradient(135deg, var(--gold), #d9ab2e);
  border-color: var(--gold); color: #fff;
}
.btn.gold:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--navy); background: #f2f5fa; }
.btn.danger { color: var(--red); border-color: #f0c9c9; }
.btn.danger:hover { background: #fdf3f3; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 20px; white-space: nowrap;
}
.badge.high {
  background: linear-gradient(135deg, #fdf3d8, #f9e3ae);
  color: #8a6410; border: 1px solid #ecd489;
}
.badge.high::before { content: '★'; color: var(--gold); }
.badge.tag { background: #eef3fb; color: var(--navy-3); border: 1px solid #d6e2f5; font-weight: 500; }
.badge.tag.gold { background: #fdf6e3; color: #8a6410; border-color: #ecd489; }
.badge.status-ok { background: #e6f7ef; color: var(--green); border: 1px solid #bfe8d4; }
.badge.status-warn { background: #fdf0e0; color: #b06a12; border: 1px solid #f2d6ab; }
.badge.status-sent { background: #eef3fb; color: var(--navy-3); border: 1px solid #d6e2f5; }
.badge.status-draft { background: #f1f3f6; color: var(--muted); border: 1px solid #dfe4ec; }
.badge.legal-ok { background: #e6f7ef; color: var(--green); border: 1px solid #bfe8d4; }
.badge.legal-dead { background: #f1f3f6; color: var(--muted); border: 1px solid #dfe4ec; }

/* ---------- 表单 ---------- */
.input, .select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
  font-size: 13px; font-family: var(--font); color: var(--text); background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(29, 74, 128, .12); }
.select { cursor: pointer; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; user-select: none; }
label.check input { accent-color: var(--navy-3); width: 15px; height: 15px; }

/* ---------- 布局骨架 ---------- */
#app-shell { display: flex; min-height: 100vh; }
#sidebar {
  width: 236px; flex: none;
  background: linear-gradient(180deg, var(--navy-deep), var(--navy) 60%, var(--navy-2));
  color: #dce6f4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.logo {
  display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.logo-mark {
  width: 40px; height: 40px; flex: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 16px; letter-spacing: 0;
}
.logo-name { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.25; }
.logo-sub { font-size: 11px; color: #9fb3cc; margin-top: 2px; }

.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 11px; color: #7e93ad; letter-spacing: .08em; padding: 12px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 2px 0; border-radius: 8px;
  color: #c6d4e6; font-size: 13.5px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(200, 160, 42, .5);
  color: #fff;
}
.nav-item.active .ic { color: var(--gold-2); }
.side-user {
  padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.side-user .nm { font-size: 13px; color: #fff; font-weight: 600; }
.side-user .rl { font-size: 11px; color: #9fb3cc; }
.side-user .logout { margin-left: auto; color: #9fb3cc; cursor: pointer; }
.side-user .logout:hover { color: #fff; }

#main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#topbar {
  height: 58px; flex: none; background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 26px;
  position: sticky; top: 0; z-index: 20;
}
.top-title { font-size: 17px; font-weight: 700; color: var(--navy); }
.top-meta { font-size: 12px; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.secure-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--green); background: #e6f7ef;
  border: 1px solid #bfe8d4; border-radius: 20px; padding: 4px 12px; font-weight: 600;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; position: relative;
}
.icon-btn:hover { color: var(--navy); border-color: var(--navy-3); }
.icon-btn .count {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  border-radius: 8px; background: var(--orange); color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

#content { padding: 24px 26px 40px; max-width: 1440px; width: 100%; }

/* ---------- 页面切换 ---------- */
.page { display: none; }
.page.active { display: block; animation: pageIn .28s ease; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 登录页 ---------- */
#page-login { min-height: 100vh; display: none; }
#page-login.active { display: flex; }
.login-side {
  flex: 1.15; background:
    radial-gradient(900px 500px at 15% 0%, rgba(200, 160, 42, .25), transparent 55%),
    radial-gradient(800px 600px at 90% 100%, rgba(29, 74, 128, .5), transparent 60%),
    linear-gradient(160deg, var(--navy-deep), var(--navy) 55%, var(--navy-2));
  color: #dbe6f5; padding: 56px 60px; display: flex; flex-direction: column;
}
.login-side .big {
  font-size: 30px; font-weight: 800; color: #fff; line-height: 1.45; margin-top: 8vh; max-width: 520px;
}
.login-side .big em { font-style: normal; color: var(--gold-2); }
.login-side .desc { margin-top: 18px; font-size: 14.5px; line-height: 1.9; color: #b9c9dd; max-width: 500px; }
.login-points { margin-top: 40px; display: grid; gap: 14px; max-width: 520px; }
.login-points .pt { display: flex; gap: 12px; align-items: flex-start; }
.login-points .pt .no {
  width: 26px; height: 26px; flex: none; border-radius: 8px; margin-top: 1px;
  background: rgba(200, 160, 42, .18); border: 1px solid rgba(200, 160, 42, .4);
  color: var(--gold-2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}
.login-points .pt .t { font-size: 13.5px; font-weight: 600; color: #fff; }
.login-points .pt .d { font-size: 12.5px; color: #9fb3cc; margin-top: 3px; line-height: 1.6; }
.login-side .foot { margin-top: auto; font-size: 12px; color: #7e93ad; line-height: 1.8; }

.login-form-side {
  flex: 1; background: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 48px;
}
.login-box { width: 100%; max-width: 400px; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.login-brand .logo-mark { width: 52px; height: 52px; border-radius: 14px; font-size: 22px; }
.login-brand .b1 { font-size: 20px; font-weight: 800; color: var(--navy); }
.login-brand .b2 { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.login-box h2 { font-size: 22px; color: var(--navy); margin: 18px 0 4px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.fld { margin-bottom: 16px; }
.fld label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.fld .input { width: 100%; padding: 11px 13px; font-size: 14px; }
.login-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.login-row a { font-size: 12.5px; }
.btn-login {
  width: 100%; padding: 12px; font-size: 15px; border-radius: 9px;
  background: linear-gradient(135deg, var(--navy-2), var(--navy-3));
  color: #fff; border: none; font-weight: 700; cursor: pointer; font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover { background: linear-gradient(135deg, var(--navy), var(--navy-2)); }
.quick-login { margin-top: 22px; border-top: 1px dashed var(--line); padding-top: 18px; }
.quick-login .ql-t { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.quick-login .ql-row { display: flex; gap: 10px; }
.quick-login .ql-btn {
  flex: 1; border: 1px solid var(--line); border-radius: 9px; background: #f8fafd;
  padding: 10px 6px; cursor: pointer; text-align: center; transition: all .15s;
}
.quick-login .ql-btn:hover { border-color: var(--navy-3); background: #eef3fb; }
.quick-login .ql-btn .t { font-size: 12.5px; font-weight: 700; color: var(--navy); }
.quick-login .ql-btn .d { font-size: 11px; color: var(--muted); margin-top: 3px; }
.safe-note { margin-top: 22px; font-size: 12px; color: var(--muted); text-align: center; }
.safe-note b { color: var(--green); }

/* ---------- KPI 卡片 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 20px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; position: relative; overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--gold), var(--orange));
}
.kpi:nth-child(2)::before { background: linear-gradient(180deg, var(--navy-3), var(--navy-2)); }
.kpi:nth-child(3)::before { background: linear-gradient(180deg, var(--orange), #e6a05a); }
.kpi:nth-child(4)::before { background: linear-gradient(180deg, var(--green), #4cbf92); }
.kpi .k-label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .k-value { font-size: 34px; font-weight: 800; color: var(--navy); margin: 8px 0 4px; letter-spacing: -0.5px; }
.kpi .k-value .unit { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 3px; }
.kpi .k-sub { font-size: 12px; color: var(--muted); line-height: 1.6; }
.kpi .k-sub .hl { color: var(--orange); font-weight: 700; }

/* ---------- 仪表盘图表 ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 20px; }
.chart-box { width: 100%; height: 300px; }
.top-list-wrap { overflow-x: auto; }

/* ---------- 通用表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 10px 12px; font-size: 12px; color: var(--muted);
  font-weight: 600; background: #f7f9fc; border-bottom: 1px solid var(--line);
  white-space: nowrap; user-select: none;
}
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--navy); }
.tbl th .arr { font-size: 10px; margin-left: 2px; color: var(--gold); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #f6f9fe; }
.tbl tbody tr.clickable { cursor: pointer; }
.num-cell { font-variant-numeric: tabular-nums; }

/* ---------- 评分列表页 ---------- */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-mini {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
}
.stat-mini .v { font-size: 22px; font-weight: 800; color: var(--navy); }
.stat-mini .l { font-size: 12px; color: var(--muted); line-height: 1.4; }
.stat-mini .ic-w { width: 38px; height: 38px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; }
.stat-mini .ic-w.b1 { background: #eef3fb; color: var(--navy-3); }
.stat-mini .ic-w.b2 { background: #fdf3d8; color: var(--gold); }
.stat-mini .ic-w.b3 { background: #e6f7ef; color: var(--green); }
.stat-mini .ic-w.b4 { background: #fdf0e0; color: var(--orange); }

.list-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.list-toolbar .search-wrap { position: relative; }
.list-toolbar .search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.list-toolbar .search-wrap .input { padding-left: 34px; width: 250px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 20px;
  padding: 6px 14px; font-size: 12.5px; color: var(--muted); cursor: pointer; font-weight: 600;
  transition: all .15s; font-family: var(--font);
}
.chip:hover { border-color: var(--navy-3); color: var(--navy); }
.chip.on { background: linear-gradient(135deg, var(--navy-2), var(--navy-3)); color: #fff; border-color: var(--navy-3); }
.chip.on-gold { background: linear-gradient(135deg, var(--gold), #d9ab2e); color: #fff; border-color: var(--gold); }

.score-cell { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score-cell.high { color: #b8860b; }
.score-cell.mid { color: var(--navy-3); }
.score-cell.low { color: var(--muted); }
.minibar { width: 54px; height: 6px; background: #edf1f7; border-radius: 3px; overflow: hidden; position: relative; }
.minibar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, var(--navy-3), var(--blue)); }
.minibar i.warm { background: linear-gradient(90deg, var(--gold), var(--orange)); }
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 22px; border-radius: 6px; font-weight: 800; font-size: 12px;
  background: #eef3fb; color: var(--navy-3); font-variant-numeric: tabular-nums;
}
.rank-badge.top3 { background: linear-gradient(135deg, var(--gold), var(--orange)); color: #fff; }

.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.pagination .info { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.pg-btn {
  min-width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; font-size: 12.5px; color: var(--text); cursor: pointer; font-family: var(--font);
  display: inline-flex; align-items: center; justify-content: center; padding: 0 8px;
}
.pg-btn:hover { border-color: var(--navy-3); color: var(--navy); }
.pg-btn.on { background: var(--navy-3); border-color: var(--navy-3); color: #fff; font-weight: 700; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- 详情页 ---------- */
.detail-top { display: grid; grid-template-columns: 300px 1fr; gap: 18px; margin-bottom: 18px; }
.score-card { text-align: center; }
#detail-score { height: 190px; }
.score-note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.patent-head .p-num { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.patent-head h1 { font-size: 21px; color: var(--navy); line-height: 1.45; margin: 10px 0 12px; font-weight: 800; }
.patent-head .meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.path-box {
  background: linear-gradient(135deg, #fdf6e3, #fdf0d0);
  border: 1px solid #ecd489; border-radius: 10px; padding: 12px 16px;
  display: flex; gap: 10px; align-items: flex-start;
}
.path-box .pb-t { font-size: 12px; font-weight: 700; color: #8a6410; white-space: nowrap; }
.path-box .pb-c { font-size: 13px; color: #6b4e0e; line-height: 1.6; }
.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-bottom: 18px; }
.detail-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.dim-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #eef2f7; }
.dim-row:last-child { border-bottom: none; }
.dim-name { width: 88px; font-size: 13px; font-weight: 600; color: var(--text); flex: none; }
.dim-bar { flex: 1; height: 9px; background: #edf1f7; border-radius: 5px; overflow: hidden; }
.dim-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--navy-3), var(--blue)); transition: width .4s ease; }
.dim-val { width: 30px; text-align: right; font-weight: 800; font-size: 14px; color: var(--navy); font-variant-numeric: tabular-nums; }
.dim-w { width: 92px; font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.formula-line {
  background: #f7f9fc; border: 1px dashed var(--line); border-radius: 8px;
  padding: 10px 14px; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.bonus-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #eef2f7; align-items: flex-start; }
.bonus-item:last-child { border-bottom: none; }
.bonus-item .pts {
  flex: none; min-width: 42px; text-align: center; border-radius: 7px; padding: 3px 6px;
  font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums;
}
.bonus-item .pts.plus { background: #e6f7ef; color: var(--green); }
.bonus-item .pts.minus { background: #fdeaea; color: var(--red); }
.bonus-item .b-t { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bonus-item .b-r { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.info-grid .it { padding: 9px 12px; border-bottom: 1px dashed #eef2f7; }
.info-grid .it:nth-last-child(-n+2) { border-bottom: none; }
.info-grid .it .k { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.info-grid .it .v { font-size: 13px; color: var(--text); font-weight: 600; }
.detail-nav { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---------- 导入页 ---------- */
.dropzone {
  border: 2px dashed #c9d6e8; border-radius: 14px; background: #f8fafd;
  padding: 46px 20px; text-align: center; cursor: pointer; transition: all .2s;
}
.dropzone:hover, .dropzone.over { border-color: var(--navy-3); background: #eef3fb; }
.dropzone .dz-ic { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 16px; background: linear-gradient(135deg, var(--navy-2), var(--navy-3)); color: #fff; display: flex; align-items: center; justify-content: center; }
.dropzone .dz-t { font-size: 15px; font-weight: 700; color: var(--navy); }
.dropzone .dz-s { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.7; }
.dropzone .dz-act { margin-top: 14px; }
.progress-wrap { margin-top: 18px; }
.progress-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; color: var(--text); }
.progress-head b { color: var(--navy); }
.progress {
  height: 10px; background: #edf1f7; border-radius: 6px; overflow: hidden;
}
.progress i {
  display: block; height: 100%; width: 0%; border-radius: 6px;
  background: linear-gradient(90deg, var(--navy-3), var(--blue));
  transition: width .2s ease;
}
.progress i.done { background: linear-gradient(90deg, var(--green), #4cbf92); }
.imp-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 18px 0; }
.imp-stat { background: #f8fafd; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.imp-stat .v { font-size: 22px; font-weight: 800; color: var(--navy); }
.imp-stat .v.ok { color: var(--green); }
.imp-stat .v.warn { color: var(--orange); }
.imp-stat .l { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.pending-list { margin-top: 12px; }
.pending-item {
  display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px;
  padding: 8px 12px; border-radius: 8px; background: #fdf6e3; border: 1px solid #f2e3b8; margin-bottom: 6px;
}
.pending-item .row-no { font-weight: 700; color: #8a6410; flex: none; }
.pending-item .reason { color: #6b4e0e; }

/* ---------- 规则配置页 ---------- */
.rules-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; margin-bottom: 18px; }
.w-slider { margin-bottom: 16px; }
.w-slider .w-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.w-slider .w-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.w-slider .w-val { font-size: 20px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.w-slider .w-val .pct { font-size: 13px; color: var(--muted); font-weight: 600; }
.w-slider input[type="range"] { width: 100%; accent-color: var(--navy-3); height: 22px; cursor: pointer; }
.w-sum {
  display: flex; align-items: center; justify-content: space-between;
  background: #f7f9fc; border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; margin: 4px 0 14px;
  font-size: 13px;
}
.w-sum .ok { color: var(--green); font-weight: 700; }
.w-sum .bad { color: var(--red); font-weight: 700; }
#chart-weight { height: 160px; }
.ver-line { font-size: 12px; color: var(--muted); margin-top: 10px; }
.ver-line b { color: var(--navy-3); }

.threshold-box { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.threshold-box .input { width: 90px; text-align: center; font-size: 18px; font-weight: 700; color: var(--navy); }
.diag-box {
  background: #f8fafd; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-size: 12.5px; color: var(--muted); line-height: 1.8;
}
.diag-box .r { display: flex; gap: 8px; align-items: baseline; }
.diag-box .r .k { color: var(--muted); }
.diag-box .r .v { color: var(--navy); font-weight: 700; font-variant-numeric: tabular-nums; }
.diag-box .verdict { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.diag-box .verdict.ok { color: var(--green); font-weight: 700; }
.diag-box .verdict.warn { color: var(--orange); font-weight: 700; }

.rules-table-wrap { overflow-x: auto; }
.rule-log { margin-top: 14px; }
.rule-log .rl-item { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed #eef2f7; font-size: 12.5px; }
.rule-log .rl-item:last-child { border-bottom: none; }
.rule-log .rl-time { color: var(--muted); flex: none; width: 96px; }
.rule-log .rl-ver { color: var(--gold); font-weight: 700; flex: none; }
.rule-log .rl-what { color: var(--text); }
.switch { position: relative; width: 36px; height: 20px; display: inline-block; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .sl { position: absolute; inset: 0; background: #cfd8e4; border-radius: 20px; transition: .2s; }
.switch .sl::before {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .sl { background: var(--green); }
.switch input:checked + .sl::before { transform: translateX(16px); }

/* ---------- 周报页 ---------- */
.weekly-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; margin-bottom: 18px; align-items: start; }
.week-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px;
  cursor: pointer; border: 1px solid transparent; transition: all .15s; margin-bottom: 6px;
}
.week-item:hover { background: #f6f9fe; }
.week-item.on { background: #eef3fb; border-color: #c9d9f0; }
.week-item .w-l { font-size: 13px; font-weight: 700; color: var(--navy); }
.week-item .w-r { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.week-item .badge { margin-left: auto; }
.week-cfg { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.week-cfg .cfg-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 6px 0; color: var(--muted); }
.week-cfg .cfg-row b { color: var(--text); font-weight: 600; }
.week-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.week-head h3 { font-size: 17px; color: var(--navy); }
.week-points {
  background: linear-gradient(135deg, #fdf6e3, #fdf0d0); border: 1px solid #ecd489;
  border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: #6b4e0e; line-height: 1.8;
}
.week-points b { color: #8a6410; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.col-head { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.col-head .ic-w { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.col-head .ic-w.f { background: #eef3fb; color: var(--navy-3); }
.col-head .ic-w.i { background: #fdf3d8; color: var(--gold); }
.n-item { padding: 12px 0; border-bottom: 1px dashed #eef2f7; }
.n-item:last-child { border-bottom: none; }
.n-item .n-t { font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.5; cursor: pointer; }
.n-item .n-t:hover { color: var(--navy-3); }
.n-item .n-s { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.65; }
.n-item .n-meta { display: flex; gap: 10px; align-items: center; margin-top: 7px; font-size: 11.5px; }
.n-item .n-meta .src { color: var(--blue); }
.n-item .n-meta .dt { color: var(--muted); }

/* ---------- Toast ---------- */
#toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--navy); color: #fff; border-radius: 10px; padding: 12px 18px;
  font-size: 13px; box-shadow: 0 8px 24px rgba(8, 28, 54, .35);
  display: flex; align-items: center; gap: 10px; animation: toastIn .25s ease; max-width: 420px;
}
.toast.ok { background: linear-gradient(135deg, #14694a, var(--green)); }
.toast.warn { background: linear-gradient(135deg, #a05f10, var(--orange)); }
.toast.error { background: linear-gradient(135deg, #a02f2f, var(--red)); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .3s; }

.empty-tip { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; }

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .detail-grid, .cols { grid-template-columns: 1fr; }
  .detail-top { grid-template-columns: 260px 1fr; }
  .rules-grid, .weekly-grid { grid-template-columns: 1fr; }
}

/* ---------- 资源加载失败提示（data.js / app.js 缺失时兜底，避免白屏） ---------- */
#fatal[hidden] { display: none; }
#fatal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); font-family: var(--font);
}
.fatal-inner {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 38px 46px; max-width: 460px; text-align: center;
}
.fatal-inner .fatal-title { font-size: 19px; font-weight: 800; color: var(--red); margin-bottom: 12px; }
.fatal-inner .fatal-msg { font-size: 13.5px; color: var(--muted); line-height: 1.8; }
