:root {
  /* 泰康品牌绿 */
  --primary: #0f6e56;
  --primary-d: #0a5239;
  --primary-l: #e1f5ee;
  /* 中性 */
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #fafbfa;
  --border: #e3e6ea;
  --text: #1c2422;
  --muted: #6b7280;
  /* 语义 */
  --blue: #185fa5; --blue-l: #e6f1fb;
  --amber: #b45309; --amber-l: #fef3c7;
  --danger: #b42318; --danger-l: #fdece9;
  /* 形状/阴影 */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15,110,86,.05);
  --shadow-md: 0 4px 14px rgba(15,110,86,.09);
  --shadow-lg: 0 10px 30px rgba(15,110,86,.12);
}

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

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

/* ---------- 顶部品牌栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 60px;
  background: var(--primary-d);
  color: #fff;
  box-shadow: 0 2px 8px rgba(10,82,57,.18);
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand .logo { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.brand .logo .accent { color: #6fd9b6; }
.brand .sub { font-size: 12.5px; color: rgba(255,255,255,.72); }
.topbar .btn-light {
  background: #fff; color: var(--primary-d); border: 1px solid #fff;
  font-weight: 600; box-shadow: var(--shadow-sm);
}
.topbar .btn-light:hover { background: var(--primary-l); border-color: var(--primary-l); }

/* ---------- 标签导航 ---------- */
.tabs {
  display: flex; gap: 2px; padding: 0 28px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.tab {
  border: none; background: none; padding: 14px 18px; cursor: pointer;
  font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

main { padding: 24px 28px; max-width: 1180px; margin: 0 auto; }
.panel { display: none; }
.panel.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }

.input, .select, .textarea {
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,110,86,.12);
}
.input { min-width: 210px; }
.input.narrow { min-width: 80px; width: 90px; }
.select { min-width: 130px; }
.textarea { width: 100%; min-height: 92px; resize: vertical; font-family: inherit; line-height: 1.7; }

.btn {
  padding: 9px 15px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font-size: 13px; color: var(--text);
  transition: all .15s; display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-d); color: #fff; box-shadow: var(--shadow-md); }
.btn-danger { color: var(--danger); border-color: #f3d4d0; }
.btn-danger:hover { background: var(--danger-l); border-color: var(--danger); color: var(--danger); }
.btn-icon { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; padding: 4px; }
.btn-icon:hover { color: var(--text); }

/* ---------- 首页仪表盘 ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 16px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-num { font-size: 30px; font-weight: 700; color: var(--primary-d); line-height: 1.1; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.stat-card.accent .stat-num { color: var(--primary); }

.overview-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.overview-section h3 { font-size: 15px; font-weight: 600; margin-bottom: 14px; color: var(--text); }
.ranking-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.ranking-item:last-child { border-bottom: none; }
.ranking-rank { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ranking-item:nth-child(1) .ranking-rank { background: var(--danger); color: #fff; }
.ranking-item:nth-child(2) .ranking-rank { background: var(--amber); color: #fff; }
.ranking-item:nth-child(3) .ranking-rank { background: var(--primary); color: #fff; }
.ranking-title { flex: 1; font-size: 13.5px; }
.ranking-heat { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- 列表卡片 ---------- */
.list { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-md); border-color: #d6ddd9; }
.card-head { display: flex; align-items: flex-start; gap: 12px; justify-content: space-between; }
.card-title { font-size: 15.5px; font-weight: 600; line-height: 1.5; }
.card-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card-body { margin-top: 10px; color: #374151; white-space: pre-wrap; line-height: 1.7; font-size: 13.5px; }
.card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.card-actions .btn { padding: 5px 11px; font-size: 12px; }
a.link { color: var(--blue); text-decoration: none; }
a.link:hover { text-decoration: underline; }

/* ---------- 热度可视化 ---------- */
.heat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.heat-bar { width: 56px; height: 6px; border-radius: 3px; background: #ececea; overflow: hidden; }
.heat-fill { height: 100%; border-radius: 3px; }
.heat-low .heat-fill { background: #9ca3a4; }
.heat-mid .heat-fill { background: var(--blue); }
.heat-high .heat-fill { background: var(--danger); }
.heat-low { color: #6b7280; }
.heat-mid { color: var(--blue); }
.heat-high { color: var(--danger); }

.tag { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; }
.tag-green { background: var(--primary-l); color: var(--primary-d); }
.tag-blue { background: var(--blue-l); color: var(--blue); }
.tag-amber { background: var(--amber-l); color: var(--amber); }
.tag-gray { background: #ececea; color: #5f5e5a; }

.empty { text-align: center; color: var(--muted); padding: 56px 0; font-size: 13px; }
.empty strong { display: block; font-size: 15px; color: var(--text); margin-bottom: 6px; font-weight: 600; }

/* ---------- 信源面板 ---------- */
.sources-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.sources-panel summary { cursor: pointer; font-size: 13px; color: var(--muted); user-select: none; }
.sources-panel summary:hover { color: var(--primary); }
.sources-body { margin-top: 14px; }
.source-group { margin-bottom: 14px; }
.source-group-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.source-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.source-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 16px; font-size: 12.5px; }
.source-chip .source-type { font-size: 10px; opacity: .55; }
.chip-green { background: var(--primary-l); color: var(--primary-d); }
.chip-blue { background: var(--blue-l); color: var(--blue); }
.chip-gray { background: #ececea; color: #5f5e5a; }

/* ---------- 模态框 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(15,40,33,.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal-box {
  background: var(--surface); border-radius: 16px; width: 660px; max-width: 92vw;
  max-height: 86vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 15px;
}
.modal-body { padding: 20px; overflow-y: auto; }
.form-row { margin-bottom: 15px; }
.form-row label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.check-group { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }
.check-group label { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text); cursor: pointer; }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--primary-d); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13px; z-index: 200; box-shadow: var(--shadow-lg);
}
.hidden { display: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  main { padding: 16px; }
  .topbar { padding: 0 16px; }
  .tabs { padding: 0 8px; }
  .tab { padding: 12px 10px; font-size: 13px; }
}
