﻿/* ===== DHH Rails World 2026 專題 — 共用樣式 ===== */
:root {
  color-scheme: only light;
  --bg: #faf8f5;
  --card: #ffffff;
  --ink: #22262b;
  --muted: #6b7280;
  --accent: #c0392b;
  --accent-dark: #8e2a20;
  --line: #e8e2d9;
  --highlight: #fff3e4;
  --shadow: 0 2px 12px rgba(34, 38, 43, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
  line-height: 1.9;
  font-size: 17px;
}
.container { max-width: 880px; margin: 0 auto; padding: 0 24px; }

/* ---- 頁首與導覽 ---- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px;
}
.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 16px; }
.brand .tag { color: var(--accent); }
.nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 15px; padding: 4px 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--accent); }
.nav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---- Hero ---- */
.hero { padding: 64px 0 40px; }
.hero .kicker {
  display: inline-block; background: var(--highlight); color: var(--accent-dark);
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  padding: 5px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.35; margin: 0 0 18px; font-weight: 800; }
.hero .lead { font-size: 19px; color: #444b53; margin: 0 0 12px; }
.hero .meta { color: var(--muted); font-size: 14px; }

/* ---- 卡片 ---- */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; margin: 32px 0 56px;
}
.card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 26px 24px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card .num { color: var(--accent); font-weight: 800; font-size: 14px; letter-spacing: 0.1em; }
.card h2 { font-size: 20px; margin: 8px 0 10px; }
.card p { color: var(--muted); font-size: 15px; margin: 0; line-height: 1.8; }
.card .arrow { display: inline-block; margin-top: 14px; color: var(--accent); font-weight: 700; font-size: 14px; }

/* ---- 內文 ---- */
.article { padding: 40px 0 72px; }
.toc {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 20px 26px; margin: 28px 0 44px;
}
.toc h2 { font-size: 16px; margin: 0 0 10px; }
.toc ol { margin: 0; padding-left: 22px; }
.toc li { margin: 4px 0; }
.toc a { color: var(--ink); text-decoration: none; border-bottom: 1px dashed var(--muted); }
.toc a:hover { color: var(--accent); border-bottom-color: var(--accent); }

section.sec { margin: 52px 0; }
section.sec > h2 {
  font-size: 26px; line-height: 1.5; margin: 0 0 6px; padding-top: 12px;
  border-top: 3px solid var(--ink);
}
.sec-num {
  display: block; color: var(--accent); font-size: 13px; font-weight: 800;
  letter-spacing: 0.18em; margin-bottom: 6px;
}
section.sec h3 { font-size: 19px; margin: 28px 0 8px; }
section.sec p { margin: 12px 0; }
strong { color: #14181c; }
em { font-style: normal; background: linear-gradient(transparent 65%, var(--highlight) 65%); padding: 0 2px; }

blockquote.pull {
  margin: 28px 0; padding: 18px 26px; background: var(--card);
  border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0;
  font-size: 19px; font-weight: 600; line-height: 1.8; box-shadow: var(--shadow);
}
blockquote.pull .who { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); font-weight: 400; }

.callout {
  background: var(--highlight); border-radius: 10px; padding: 18px 24px; margin: 24px 0;
  border: 1px solid #f0dcc2;
}
.callout .label { font-weight: 800; color: var(--accent-dark); font-size: 14px; letter-spacing: 0.06em; }
ul.plain { padding-left: 22px; }
ul.plain li { margin: 8px 0; }

/* ---- 數字卡 ---- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin: 28px 0;
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 18px; text-align: center; box-shadow: var(--shadow);
}
.stat .big { font-size: 32px; font-weight: 800; color: var(--accent); line-height: 1.3; }
.stat .desc { font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.7; }

/* ---- 時間線 ---- */
.timeline { position: relative; margin: 36px 0; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 3px; background: var(--line); border-radius: 2px;
}
.t-item { position: relative; margin: 0 0 30px; }
.t-item::before {
  content: ""; position: absolute; left: -30px; top: 8px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--accent);
}
.t-item.hot::before { background: var(--accent); }
.t-item .when { font-weight: 800; color: var(--accent-dark); font-size: 15px; }
.t-item h3 { margin: 4px 0 6px; font-size: 18px; }
.t-item p { margin: 0; color: #444b53; }

/* ---- 清單 / 自查 ---- */
.checklist { list-style: none; padding: 0; margin: 24px 0; }
.checklist li {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 20px 16px 52px; margin: 12px 0; position: relative; box-shadow: var(--shadow);
}
.checklist li::before {
  content: "✓"; position: absolute; left: 18px; top: 16px;
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.q-block {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px 30px; margin: 28px 0; box-shadow: var(--shadow);
}
.q-block .q-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.q-block .q-num {
  background: var(--accent); color: #fff; font-weight: 800; border-radius: 10px;
  padding: 2px 12px; font-size: 15px; white-space: nowrap;
}
.q-block h2 { font-size: 21px; margin: 0; }

/* ---- 表格 ---- */
table.compare {
  width: 100%; border-collapse: collapse; margin: 24px 0; background: var(--card);
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); font-size: 15.5px;
}
table.compare th, table.compare td { border: 1px solid var(--line); padding: 12px 16px; text-align: left; vertical-align: top; }
table.compare th { background: var(--ink); color: #fff; font-weight: 700; }
table.compare tr:nth-child(even) td { background: #fbfaf8; }

/* ---- 頁尾 ---- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 28px 0 40px; color: var(--muted); font-size: 14px;
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer .to-home { text-align: right; margin: 14px 0 0; }
.pager { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 48px 0 24px; }
.pager a {
  flex: 1 1 220px; text-decoration: none; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; font-size: 15px;
}
.pager a:hover { border-color: var(--accent); }
.pager .dir { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 2px; }
.pager .right { text-align: right; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 40px 0 28px; }
  section.sec > h2 { font-size: 22px; }
  .stat .big { font-size: 26px; }
}
@media print {
  .site-header, .pager, .card-grid { display: none; }
  body { background: #fff; font-size: 12pt; }
  .card, .stat, .q-block { box-shadow: none; }
}
