/*
 * SHIN 全站护眼主题。
 * 该文件被放在每个页面 head 的最后，用于接管历史页面中的深色内联样式。
 */
:root {
  color-scheme: light !important;
  --bg: #f3f6f1 !important;
  --bg-card: #ffffff !important;
  --bg-elev: #e8eee8 !important;
  --border: #cbd6cd !important;
  --text: #24332b !important;
  --text-dim: #53665b !important;
  --accent: #286b62 !important;
  --accent-2: #975846 !important;
  --good: #2f7647 !important;
  --warn: #8a6418 !important;
  --bad: #ac443f !important;
  --ab-blue: #286b62 !important;
  --ab-purple: #70549a !important;
  --ab-soft: rgba(40, 107, 98, .035) !important;
}

html { background: #f3f6f1 !important; }
body {
  background: #f3f6f1 !important;
  color: #24332b !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
  font-size: 16px !important;
  line-height: 1.68 !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

header {
  background: linear-gradient(135deg, #e8f0e9 0%, #dceae3 100%) !important;
  color: #203128 !important;
  border-color: #cbd6cd !important;
  box-shadow: 0 2px 12px rgba(52, 79, 65, .08) !important;
}

header h1, header h2, header h3, h1, h2, h3, h4, h5, h6,
.question-main, .metric-value, .result-headline, .value, .big {
  color: #24332b;
}

header .sub, .hero-copy, p, li, dd, .muted, .meta, .note,
.question-sub, .pending-family, .quality-list, .maintenance-note p,
.analysis-item p, .action-box, .variant-copy, .comparison-title {
  color: #53665b !important;
}

a { color: #286b62 !important; text-underline-offset: 2px; }
header nav a {
  color: #286b62 !important;
  background: rgba(40, 107, 98, .09) !important;
  font-size: 14px !important;
  font-weight: 650 !important;
}
header nav a:hover { background: rgba(40, 107, 98, .17) !important; }
header nav a.active, .tab-bar button.active, .filter-button.active {
  background: #286b62 !important;
  border-color: #286b62 !important;
  color: #ffffff !important;
}

.card, .panel, .entry-card, .chart-box, .metric-tile, .summary-tile,
.guide-card, .experiment-card, .family-card, .future-card,
.activity-period, .cohort-chart, .coverage-box, details.evidence-details,
.analysis-item, .kpi, .box, .section, .container, .pack-card {
  background-color: #ffffff !important;
  border-color: #cbd6cd !important;
  color: #24332b !important;
  box-shadow: 0 2px 10px rgba(52, 79, 65, .045);
}

.experiment-head, .summary-tile {
  background: linear-gradient(90deg, rgba(40, 107, 98, .075), rgba(112, 84, 154, .035)) !important;
}
.card h2, .card h3, .panel h2, .panel h3 { color: #344a3f !important; }
.wrap > .note {
  background: #fff0ee !important;
  color: #923b37 !important;
  border-color: #dca7a2 !important;
}

.focus-banner, .business-note.warn, .notice, .warn-box {
  background: #fff7df !important;
  border-color: #d6bd78 !important;
  color: #705016 !important;
}
.business-note, .trust-note, .info, .info-box {
  background: #edf5f1 !important;
  border-color: #9fc3b7 !important;
  color: #385a50 !important;
}
.trust-note b { color: #315a4f !important; }
.business-note.good, .ok, .success, .good-box {
  background: #edf7ef !important;
  border-color: #a4c9ac !important;
  color: #2d6540 !important;
}

[data-currency-boundary="historical-fx-not-current"] {
  background: #edf5f1 !important;
  border: 1px solid #93bdb0 !important;
  color: #315a4f !important;
}
[data-evidence-boundary="legacy-attribution-frozen"] {
  background: #fff7df !important;
  border-color: #d6bd78 !important;
  color: #705016 !important;
}
.error, .danger, .bad-box, .alert, #refresh-banner {
  background: #fff0ee !important;
  border-color: #dca7a2 !important;
  color: #923b37 !important;
}

table { background: #ffffff !important; color: #24332b !important; font-size: 14px !important; }
th {
  background: #e8eee8 !important;
  color: #41554a !important;
  border-color: #cbd6cd !important;
  font-size: 13px !important;
}
td { color: #2f4037 !important; border-color: #d7dfd8 !important; }
td.status-good, .status-good { color: #2f7647 !important; }
td.status-warn, .status-warn { color: #8a6418 !important; }
td.status-bad, .status-bad { color: #ac443f !important; }
tbody tr:nth-child(even) td { background: #fafcf9; }
tbody tr:hover td { background: #edf5f1 !important; }

button, input, select, textarea, .filter-button, .tab-bar button {
  background: #ffffff !important;
  color: #24332b !important;
  border-color: #aebdb2 !important;
  font-size: 14px !important;
}
button:hover, .filter-button:hover, .tab-bar button:hover { border-color: #286b62 !important; }

code, pre {
  background: #edf1ec !important;
  color: #2d473b !important;
  border-color: #cbd6cd !important;
}

.status-pill, .badge, .evidence-chip, .activity-chip, .subactivity-chip, .lane-chip,
.variant-key, .question-label span, .guide-number {
  background-color: #e8eee8 !important;
}
.status-pill, .badge, .evidence-chip, .activity-chip, .subactivity-chip, .lane-chip,
.tag-status, .eyebrow { font-size: 12px !important; }
.kpi .s, .kpi .l, .small {
  color: #53665b !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
}
.badge.v1 { background: #e8ece9 !important; color: #4d5e55 !important; }
.badge.v2 { background: #eee8f6 !important; color: #604784 !important; }
.badge.v3 { background: #e2f1f2 !important; color: #166675 !important; }
.badge.v4 { background: #e5f2e8 !important; color: #28683e !important; }
.badge.v5 { background: #fff2d8 !important; color: #765315 !important; }
.badge.v6 { background: #f8e8e3 !important; color: #854b3c !important; }
.tag-done { background: #e5f2e8 !important; color: #28683e !important; }
.tag-pending { background: #e8ece9 !important; color: #4d5e55 !important; }
.tag-status { font-size: 12px !important; }
.tag {
  background: #fff2d8 !important;
  color: #765315 !important;
  border-color: #dec48a !important;
  font-size: 12px !important;
}
.pack-card h3 { color: #684a11 !important; }
.pack-card .pack-sub { color: #53665b !important; }
.pack-card .pack-stats { color: #315f66 !important; }
.pack-card.todo { opacity: 1 !important; background: #f1f4f1 !important; }
.status-pill.running, .status-pill.ok, .good, .metric-delta.up, .trend-up { color: #2f7647 !important; }
.status-pill.warning, .status-pill.missing, .status-pill.mixed,
.warn, .evidence-warning, .metric-delta.warn { color: #8a6418 !important; }
.status-pill.negative, .bad, .metric-delta.down, .trend-down { color: #ac443f !important; }
.status-pill.inconclusive, .result-headline.inconclusive { color: #70549a !important; }
.result-headline.negative { color: #9f3e39 !important; }
.result-headline.missing, .result-headline.mixed { color: #7b5815 !important; }
.result-headline.pending { color: #286b62 !important; }
.alert .t, .neg { color: #923b37 !important; }
.ok .t, .pos, strong.pos { color: #2f7647 !important; }
.kpi .v { color: #765315 !important; }
.reason, .footer { color: #53665b !important; font-size: 13px !important; }
article strong { color: #344a3f !important; }

.metric-compare, .action-box, details.evidence-details, .analysis-item,
[style*="background:rgba(13,17,23"], [style*="background: rgba(13,17,23"] {
  background: #f7faf7 !important;
  border-color: #d3dcd5 !important;
}

/* 接管历史页面写死的深色背景和浅色文字。 */
[style*="background:#0d1117"], [style*="background: #0d1117"],
[style*="background:#0d1424"], [style*="background: #0d1424"],
[style*="background:#06080f"], [style*="background: #06080f"],
[style*="background:#161b22"], [style*="background: #161b22"],
[style*="background:#21262d"], [style*="background: #21262d"],
[style*="background:#0f172a"], [style*="background: #0f172a"] {
  background: #ffffff !important;
}
[style*="background:#1a2540"], [style*="background: #1a2540"],
[style*="background:linear-gradient(135deg,#1a2540"],
[style*="background: linear-gradient(135deg,#1a2540"] { background: #ffffff !important; }
[style*="background:#10243a"], [style*="background: #10243a"] {
  background: #edf5f1 !important;
  color: #315a4f !important;
}
[style*="background:#2b2110"], [style*="background: #2b2110"],
[style*="background:#4d2d00"], [style*="background: #4d2d00"] {
  background: #fff7df !important;
  color: #705016 !important;
}
[style*="background:#3d1414"], [style*="background: #3d1414"],
[style*="background:#2d1b1b"], [style*="background: #2d1b1b"] {
  background: #fff0ee !important;
  color: #923b37 !important;
}
[style*="color:#e6edf3"], [style*="color: #e6edf3"],
[style*="color:#e2e8f0"], [style*="color: #e2e8f0"],
[style*="color:#c9d1d9"], [style*="color: #c9d1d9"] { color: #24332b !important; }
[style*="color:#8b949e"], [style*="color: #8b949e"] { color: #53665b !important; }
[style*="color:#a0aec0"], [style*="color: #a0aec0"] { color: #53665b !important; }
[style*="color:#f6ad55"], [style*="color: #f6ad55"] { color: #684a11 !important; }
[style*="color:#3fb950"], [style*="color: #3fb950"] { color: #2f7647 !important; }
[style*="color:#d29922"], [style*="color: #d29922"],
[style*="color:#fbbf24"], [style*="color: #fbbf24"] { color: #8a6418 !important; }
[style*="color:#f85149"], [style*="color: #f85149"],
[style*="color:#f78166"], [style*="color: #f78166"],
[style*="color:#ff7b72"], [style*="color: #ff7b72"] { color: #ac443f !important; }
[style*="color:#58a6ff"], [style*="color: #58a6ff"],
[style*="color:#79c0ff"], [style*="color: #79c0ff"],
[style*="color:#60a5fa"], [style*="color: #60a5fa"] { color: #286b62 !important; }
[style*="background:#44337a"], [style*="background: #44337a"] {
  background: #eee8f6 !important;
  color: #604784 !important;
}

/* 历史页面普遍只有 10–13px；统一抬高最低可读字号。 */
[style*="font-size:10px"], [style*="font-size: 10px"] { font-size: 12px !important; }
[style*="font-size:11px"], [style*="font-size: 11px"] { font-size: 12.5px !important; }
[style*="font-size:12px"], [style*="font-size: 12px"] { font-size: 13px !important; }
[style*="font-size:13px"], [style*="font-size: 13px"] { font-size: 14px !important; }

.label, .compare, .delta, .sub, .note, .meta, small,
.question-label, .question-sub, .evidence-warning, .pending-family,
.quality-list, .maintenance-note summary, .maintenance-note p,
.metric-name, .metric-delta, .coverage-chip, .tech-table,
.chart-note, .cohort-legend, .cohort-quality, .sample-warn {
  font-size: max(12px, .8rem) !important;
}

svg text { fill: #465a4f !important; font-size: 12px !important; }
.mini-bar-wrap { color: #53665b !important; font-size: 12px !important; }
hr { border-color: #cbd6cd !important; }
::selection { background: #c8e2d8; color: #203128; }

/* Grid item 默认 min-width:auto 会被宽表格撑破移动端；允许卡片收缩，表格自己滚动。 */
.grid > *, .metric-strip > *, .analysis-grid > *, .cohort-chart-grid > * { min-width: 0; }

@media (max-width: 700px) {
  body { font-size: 15px !important; }
  table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13px !important;
  }
  th, td { padding: 9px 10px !important; }
  .mini-bar-wrap { min-width: 28px !important; }
}
