:root {
  --ink: #142b29;
  --ink-soft: #536562;
  --forest: #163a36;
  --forest-light: #255d56;
  --paper: #f3f0e8;
  --surface: #fffdf8;
  --line: #d9d6cd;
  --accent: #e89b54;
  --accent-soft: #f8e2cc;
  --blue-soft: #dce9ef;
  --violet-soft: #e7e0ef;
  --green-soft: #dcebe2;
  --rose-soft: #f1dfdc;
  --shadow: 0 18px 60px rgba(20, 43, 41, .09);
  --radius-lg: 28px;
  --radius-md: 18px;
  --content: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  padding: .7rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: white;
}
.skip-link:focus { top: 1rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(20, 43, 41, .12);
  background: rgba(243, 240, 232, .9);
  backdrop-filter: blur(18px);
}

.header-inner {
  max-width: var(--content);
  min-height: 78px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-family: Georgia, "Noto Serif TC", serif;
  font-size: 18px;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .03em; }
.brand small { color: var(--ink-soft); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #56a572;
  box-shadow: 0 0 0 5px rgba(86, 165, 114, .12);
}

main { overflow: hidden; }

.hero {
  position: relative;
  max-width: var(--content);
  margin: 0 auto;
  padding: 92px 28px 84px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, .65fr);
  align-items: end;
  gap: 70px;
}

.hero::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  left: -250px;
  top: -210px;
  border: 1px solid rgba(22, 58, 54, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(22, 58, 54, .025), 0 0 0 140px rgba(22, 58, 54, .018);
  pointer-events: none;
}

.eyebrow, .section-index {
  margin: 0 0 18px;
  color: var(--forest-light);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, "Noto Serif TC", "Songti TC", serif;
  font-size: clamp(44px, 6.7vw, 78px);
  font-weight: 600;
  letter-spacing: -.055em;
  line-height: 1.15;
}

.hero-description {
  max-width: 650px;
  margin: 32px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
}

.issue-card {
  padding: 28px;
  border-radius: var(--radius-md);
  background: var(--forest);
  color: white;
  box-shadow: var(--shadow);
}

.issue-card > p { margin: 0 0 8px; color: rgba(255, 255, 255, .66); font-size: 12px; }
.issue-card > strong { display: block; font-family: Georgia, "Noto Serif TC", serif; font-size: 24px; }
.issue-stats { margin-top: 30px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.18); display: flex; gap: 20px; color: rgba(255,255,255,.72); font-size: 12px; }
.issue-stats b { color: white; font-size: 20px; margin-right: 3px; }

.explorer {
  padding: 74px max(28px, calc((100vw - var(--content)) / 2 + 28px)) 100px;
  background: var(--surface);
  border-radius: 44px 44px 0 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2, .privacy-note h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif TC", "Songti TC", serif;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -.035em;
  line-height: 1.2;
}

.result-count { margin: 0 0 7px; color: var(--ink-soft); font-size: 13px; }

.toolbar {
  margin: 26px 0 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.search-box {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.search-box:focus-within { border-color: var(--forest-light); box-shadow: 0 0 0 3px rgba(37, 93, 86, .12); }
.search-box svg, .primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box input::placeholder { color: #87928f; }

.sort-box {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-soft);
  background: white;
  font-size: 13px;
}
.sort-box select { border: 0; outline: 0; color: var(--ink); background: transparent; font-weight: 700; }

.filter-list { display: flex; gap: 8px; padding: 0 0 28px; overflow-x: auto; scrollbar-width: thin; }
.filter-button {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  transition: .18s ease;
}
.filter-button:hover { border-color: var(--forest-light); color: var(--forest); }
.filter-button[aria-pressed="true"] { border-color: var(--forest); background: var(--forest); color: white; }

.article-list { border-top: 1px solid var(--line); }
.article-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px 150px minmax(0, 1fr) 34px;
  gap: 22px;
  align-items: start;
  padding: 34px 4px;
  border-bottom: 1px solid var(--line);
  transition: background .18s ease, padding .18s ease, margin .18s ease;
}
.article-card:hover { margin: 0 -18px; padding-left: 18px; padding-right: 18px; background: #f7f5ef; }
.article-card.is-selected { margin: 0 -18px; padding-left: 18px; padding-right: 18px; background: #eff4f0; }

.select-control { position: relative; margin-top: 3px; }
.select-control input { position: absolute; opacity: 0; pointer-events: none; }
.checkmark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #9ba7a4;
  border-radius: 7px;
  background: white;
  transition: .18s ease;
}
.checkmark::after { content: "✓"; color: white; font-size: 14px; opacity: 0; transform: scale(.7); transition: .18s ease; }
.select-control input:checked + .checkmark { border-color: var(--forest); background: var(--forest); }
.select-control input:checked + .checkmark::after { opacity: 1; transform: scale(1); }
.select-control input:focus-visible + .checkmark { outline: 3px solid rgba(37, 93, 86, .22); outline-offset: 2px; }

.article-meta { padding-top: 1px; color: var(--ink-soft); font-size: 12px; }
.category-badge { display: inline-block; margin-bottom: 10px; padding: 4px 9px; border-radius: 6px; color: var(--ink); font-weight: 700; }
.category-ai { background: var(--blue-soft); }
.category-library { background: var(--green-soft); }
.category-ethics { background: var(--rose-soft); }
.category-college { background: var(--violet-soft); }
.category-thesis { background: var(--accent-soft); }
.article-meta time, .article-source { display: block; }

.article-copy h3 { margin: 0; font-size: clamp(19px, 2vw, 24px); line-height: 1.4; letter-spacing: -.015em; }
.article-copy h3 a { color: var(--ink); text-decoration: none; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.article-copy h3 a:hover { text-decoration: underline; }
.article-copy p { max-width: 760px; margin: 11px 0 0; color: var(--ink-soft); font-size: 14px; }
.article-subcategory { margin-top: 13px; color: var(--forest-light); font-size: 12px; font-weight: 700; }
.external-icon { width: 22px; height: 22px; margin-top: 3px; color: var(--ink-soft); }
.external-icon svg { width: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; }

.status-card { padding: 80px 24px; text-align: center; border-top: 1px solid var(--line); }
.status-card h3 { margin: 14px 0 4px; }
.status-card p { margin: 0; color: var(--ink-soft); }
.loader { display: inline-block; width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--forest); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-icon { width: 42px; height: 42px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); font-size: 22px; }

.secondary-button { margin-top: 18px; padding: 9px 16px; border: 1px solid var(--forest); border-radius: 10px; background: transparent; color: var(--forest); font-weight: 700; }

.privacy-note {
  max-width: var(--content);
  margin: 0 auto;
  padding: 90px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.privacy-note > p { max-width: 520px; margin: 38px 0 0; color: var(--ink-soft); }

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 100;
  width: min(620px, calc(100% - 32px));
  min-height: 70px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 12px 11px 22px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  background: rgba(20, 43, 41, .97);
  color: white;
  box-shadow: 0 18px 60px rgba(20,43,41,.28);
}
.selection-bar[hidden] { display: none; }
.text-button { margin-left: 12px; border: 0; background: transparent; color: rgba(255,255,255,.68); font-size: 12px; text-decoration: underline; }
.primary-button { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--accent); color: var(--ink); font-weight: 800; }

.toast {
  position: fixed;
  top: 92px;
  right: 24px;
  z-index: 120;
  max-width: 360px;
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  font-size: 13px;
}
.toast[hidden] { display: none; }

.site-footer {
  min-height: 130px;
  padding: 36px max(28px, calc((100vw - var(--content)) / 2 + 28px));
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--forest);
  color: rgba(255,255,255,.72);
  font-size: 12px;
}
.site-footer p { margin: 0; }

@media (max-width: 780px) {
  .header-inner { min-height: 68px; padding: 0 18px; }
  .brand small, .header-meta { display: none; }
  .hero { padding: 62px 20px 64px; grid-template-columns: 1fr; gap: 38px; }
  .hero h1 { font-size: clamp(40px, 12vw, 58px); }
  .hero-description { margin-top: 24px; font-size: 15px; }
  .issue-card { padding: 22px; }
  .explorer { padding: 54px 20px 80px; border-radius: 28px 28px 0 0; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .result-count { margin: 0; }
  .toolbar { grid-template-columns: 1fr; }
  .sort-box { justify-content: space-between; }
  .article-card { grid-template-columns: 34px minmax(0, 1fr) 24px; gap: 12px; padding: 25px 0; }
  .article-card:hover, .article-card.is-selected { margin: 0 -10px; padding-left: 10px; padding-right: 10px; }
  .article-meta { grid-column: 2 / 3; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .category-badge { margin: 0; }
  .article-meta time, .article-source { display: inline; }
  .article-copy { grid-column: 2 / 3; }
  .external-icon { grid-column: 3; grid-row: 1 / 3; }
  .select-control { grid-column: 1; grid-row: 1 / 3; }
  .article-copy p { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
  .privacy-note { padding: 68px 20px; grid-template-columns: 1fr; gap: 8px; }
  .privacy-note > p { margin-top: 18px; }
  .selection-bar { bottom: 12px; min-height: 64px; padding-left: 16px; }
  .primary-button { padding: 0 13px; font-size: 13px; }
  .site-footer { padding: 34px 20px 110px; align-items: start; flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
