:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f7faff;
  --text: #18304f;
  --muted: #6c82a1;
  --line: rgba(18, 84, 193, 0.12);
  --zero: #edf3fb;
  --one: #4c92ff;
  --two: #0a54d8;
  --accent: #0a54d8;
  --accent-2: #083f9f;
  --accent-soft: rgba(10, 84, 216, 0.08);
  --shadow: 0 14px 34px rgba(10, 84, 216, 0.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  line-height: 1.45;
}
.wrap {
  max-width: 1460px;
  margin: 0 auto;
  padding: 34px 24px 56px;
}
.hero {
  display:grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 22px;
  margin-bottom: 22px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.hero-main { padding: 28px 28px 22px; }
.hero-side { padding: 22px; }
.kicker {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  margin-bottom: 12px;
}
h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.lead {
  margin: 0;
  color: #4d6687;
  max-width: 66ch;
  font-size: 15px;
}
.meta {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top: 18px;
}
.meta-pill {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: #355578;
  font-size: 13px;
}
.section-title {
  font-size: 18px;
  font-weight: 650;
  margin: 0;
}
.section-note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}
.legend {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  align-items:center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 18px;
}
.legend-item {
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(10, 84, 216, 0.14);
}
.controls {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top: 16px;
}
.toggle {
  appearance:none;
  border:1px solid var(--line);
  background: var(--panel-soft);
  color: #355578;
  border-radius:999px;
  padding:9px 14px;
  font-size:13px;
  cursor:pointer;
}
.toggle.active {
  background: rgba(10, 84, 216, 0.10);
  border-color: rgba(10, 84, 216, 0.26);
  color: var(--accent);
}
.layout {
  display:grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.timeline-card { padding: 22px; }
.detail-card { padding: 20px; }
.years {
  display:flex;
  flex-direction:column;
  gap:22px;
  margin-top: 16px;
}
.year-block {
  padding: 18px 16px 16px;
  border-radius: 20px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}
.year-head {
  display:grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.year-num {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.year-sub {
  color: var(--muted);
  font-size: 13px;
}
.year-stats {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top: 8px;
}
.stat-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(10, 84, 216, 0.06);
  border: 1px solid rgba(10, 84, 216, 0.12);
  color: #355578;
  font-size: 12px;
}
.heatmap-shell {
  display:grid;
  grid-template-columns: 44px minmax(0,1fr);
  gap: 8px;
}
.day-labels {
  display:grid;
  grid-template-rows: 18px repeat(7, 14px);
  gap: 5px;
  padding-top: 2px;
}
.day-labels span {
  font-size: 12px;
  color: var(--muted);
  display:flex;
  align-items:center;
  height:14px;
}
.day-labels .blank { height:18px; }
.months {
  position: relative;
  height: 18px;
  margin-bottom: 5px;
}
.month-label {
  position:absolute;
  top:0;
  transform: translateX(-2px);
  font-size:11px;
  color: #6c82a1;
}
.grid {
  position:relative;
  display:grid;
  grid-auto-flow: column;
  grid-auto-columns: 14px;
  grid-template-rows: repeat(7, 14px);
  gap: 5px;
  align-items:start;
}
.month-divider {
  position:absolute;
  top:0;
  bottom:0;
  width:1px;
  background: rgba(10, 84, 216, 0.11);
}
.cell {
  width:14px;
  height:14px;
  border-radius: 4px;
  background: var(--zero);
  border:1px solid rgba(10, 84, 216, 0.08);
  cursor:pointer;
  transition: transform 120ms ease, border-color 120ms ease, opacity 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.cell:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 84, 216, 0.38);
}
.cell.count-1 {
  background: linear-gradient(145deg, #4c92ff 0%, #5ea0ff 45%, #3f86f6 100%);
  border-color: rgba(10, 84, 216, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(10, 84, 216, 0.05);
}
.cell.count-2 {
  background:
    linear-gradient(145deg, #083f9f 0%, #0a54d8 38%, #79b7ff 50%, #0f67f5 58%, #083f9f 100%);
  border-color: rgba(8, 63, 159, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(8, 63, 159, 0.20),
    0 0 0 1px rgba(255, 255, 255, 0.34),
    0 0 0 2px rgba(10, 84, 216, 0.22);
}
.cell.empty-hidden { opacity: 0.14; }
.cell.dimmed { opacity: 0.11; }
.cell.selected {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.tip {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(10, 84, 216, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  width: min(360px, calc(100vw - 24px));
  color: #163252;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.tip.show {
  opacity:1;
  transform: translateY(0);
}
.tip-date { font-weight: 650; margin-bottom: 4px; }
.tip-meta { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.tip-title { font-size: 13px; }
.detail-empty {
  color: #4d6687;
  font-size: 14px;
}
.detail-date {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.badges {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom: 16px;
}
.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}
.badge.hot {
  border-color: rgba(8, 63, 159, 0.24);
  background: rgba(10, 84, 216, 0.12);
  color: var(--accent-2);
}
.show-list {
  display:grid;
  gap:10px;
}
.show-item {
  padding: 14px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}
.show-title {
  font-size: 15px;
  font-weight: 650;
  margin-bottom: 6px;
}
.show-sub {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.show-body {
  font-size: 13px;
  color: #355375;
  white-space: pre-wrap;
  word-break: break-word;
}
.link-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(10, 84, 216, 0.08);
  border: 1px solid rgba(10, 84, 216, 0.18);
  color: var(--accent-2);
  text-decoration:none;
  font-size: 13px;
}
.footnote {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.materials-block {
  margin-top: 12px;
}
.materials-heading {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.material-list {
  display: grid;
  gap: 8px;
}
.material-item {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(10, 84, 216, 0.12);
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.material-item:hover {
  transform: translateY(-1px);
  border-color: rgba(10, 84, 216, 0.28);
  box-shadow: 0 8px 18px rgba(10, 84, 216, 0.08);
}
.material-title {
  font-size: 13px;
  font-weight: 600;
  color: #26496f;
  line-height: 1.4;
}
.material-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.timeline-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.timeline-scroll::-webkit-scrollbar {
  height: 10px;
}

.timeline-scroll::-webkit-scrollbar-thumb {
  background: rgba(10, 84, 216, 0.18);
  border-radius: 999px;
}

.timeline-scroll::-webkit-scrollbar-track {
  background: rgba(10, 84, 216, 0.04);
  border-radius: 999px;
}
