@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@600;700&display=swap');

/* A 版：淺色、暖底、襯線標題、單欄 */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c2321;
  --muted: #4a5552;
  --accent: #0f5c4d;
  --accent-soft: #e4efe9;
  --line: #d9d6cd;
  --tag: #7a4317;
  --tag-bg: #f5e9da;
  --shadow: 0 1px 2px rgba(28, 35, 33, 0.06), 0 6px 18px rgba(28, 35, 33, 0.06);
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
}
:root[data-contrast="high"] {
  --bg: #000000;
  --surface: #000000;
  --text: #ffffff;
  --muted: #e6e6e6;
  --accent: #7ef0c9;
  --accent-soft: #000000;
  --line: #9a9a9a;
  --tag: #ffd88a;
  --tag-bg: #000000;
  --shadow: none;
}
* { box-sizing: border-box; }
html { font-size: 112.5%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  line-height: 1.8;
}
.wrap { max-width: 50rem; margin: 0 auto; padding: 0 1.2rem; }
a { color: var(--accent); text-underline-offset: 0.2em; }
p { margin: 0 0 0.8rem; }
.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: 0.4rem 0.8rem; z-index: 10; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* 頁首 */
.header-in { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-top: 1.4rem; padding-bottom: 1.1rem; }
.brand { text-decoration: none; color: var(--text); display: block; }
.brand-zh { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.3rem; line-height: 1.4; word-break: keep-all; }
.brand-en { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.5; margin-top: 0.2rem; }
#contrast {
  flex: none;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}
.site-nav { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-between; gap: 0.4rem 0.8rem; }
.site-nav a {
  display: flex; flex-direction: column;
  padding: 0.7rem 0 0.55rem;
  color: var(--text); text-decoration: none; font-weight: 600; line-height: 1.4; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.site-nav a span { font-size: 0.72rem; font-weight: 400; color: var(--muted); }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* 頁面標題區 */
.page-head { padding: 2.4rem 0 0.6rem; }
.page-head .wrap > * { max-width: 40rem; }
.eyebrow { margin: 0 0 0.3rem; color: var(--accent); font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; }
h1 { font-family: var(--serif); font-weight: 700; font-size: 2rem; line-height: 1.35; margin: 0 0 0.6rem; word-break: keep-all; }
.lead { color: var(--muted); font-size: 1.02rem; margin: 0; }
.hero { padding: 2rem 0 0; }
.hero .wrap { position: relative; }
.hero .wrap::before {
  content: ""; position: absolute; inset: 0 1.2rem; z-index: -1;
  background: var(--accent-soft); border: 1px solid var(--line); border-radius: 20px;
}
.hero .wrap { padding-top: 2.6rem; padding-bottom: 2.6rem; }
.hero .wrap > * { margin-left: 1.8rem; margin-right: 1.8rem; }
.hero h1 { font-size: 2.3rem; color: var(--accent); }
.hero .lead { color: var(--text); }

/* 內容區 */
.content { padding-bottom: 2rem; }
.block { padding: 2rem 0 0.4rem; }
.block > h2 {
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem; margin: 0 0 1rem;
  display: flex; align-items: center; gap: 0.8rem;
}
.block > h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
h3 { font-size: 1.05rem; line-height: 1.5; margin: 0 0 0.3rem; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
.tiles li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.1rem 1rem; box-shadow: var(--shadow); }
.tile-num { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--accent); line-height: 1.4; }
.tile-label { display: block; color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin-top: 0.3rem; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.card {
  display: block; height: 100%; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card h3 { color: var(--accent); }
.card h3::after { content: " →"; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }

.purpose { margin: 0; background: var(--accent-soft); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 0 14px 14px 0; padding: 1.3rem 1.5rem; }
.purpose p { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; line-height: 1.9; margin: 0 0 0.6rem; }
.purpose footer, .source { color: var(--muted); font-size: 0.85rem; margin: 0; }
.source { margin-top: 0.8rem; }

.tasks { list-style: none; margin: 0; padding: 0; counter-reset: task; }
.tasks li {
  counter-increment: task; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.8rem 1rem 0.8rem 3.6rem; margin-bottom: 0.6rem;
}
.tasks li::before {
  content: counter(task); position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
  width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--accent); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem;
}

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--line); }
.timeline > li { position: relative; padding: 0 0 1.5rem 1rem; }
.timeline > li:last-child { padding-bottom: 0.2rem; }
.timeline > li::before {
  content: ""; position: absolute; left: calc(-1.4rem - 8px); top: 0.55rem;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
}
.when { display: block; font-family: var(--serif); font-weight: 700; color: var(--accent); font-size: 1.1rem; }
.when small { font-family: "PingFang TC", "Noto Sans TC", sans-serif; font-weight: 400; font-size: 0.85rem; color: var(--muted); margin-left: 0.6rem; }
.what p { margin: 0.1rem 0 0; }
.what ul { margin: 0.2rem 0 0; padding-left: 1.2rem; }
.what li { margin-bottom: 0.15rem; }

.tag { display: inline-block; margin: 0 0 0.5rem; padding: 0.05rem 0.7rem; border-radius: 999px; background: var(--tag-bg); color: var(--tag); border: 1px solid transparent; font-size: 0.8rem; font-weight: 600; }
:root[data-contrast="high"] .tag { border-color: var(--tag); }
.by { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.85rem; }
.feature { background: var(--accent-soft); border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem 1.5rem; }
.feature h3 { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; color: var(--accent); }
.feature p { margin-bottom: 0; }
.projects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.9rem; }
.projects li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem 1.1rem; box-shadow: var(--shadow); }
.projects h3 { margin: 0; }

.info { margin: 0; display: grid; grid-template-columns: max-content 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0.4rem 1.3rem; }
.info dt, .info dd { padding: 0.65rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.info dt { color: var(--muted); padding-right: 1.6rem; }
.info dd { overflow-wrap: anywhere; }
.info dt:last-of-type, .info dd:last-of-type { border-bottom: 0; }

/* 英文區 */
.en { margin-top: 2.4rem; padding: 1.4rem 1.5rem 0.8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; font-size: 0.95rem; line-height: 1.7; }
.en > h2 { font-size: 1.1rem; font-family: inherit; }
.en h3 { margin-top: 1rem; }
.en ol, .en ul { margin: 0 0 0.8rem; padding-left: 1.4rem; }
.en li { margin-bottom: 0.25rem; }
.en .info { border: 0; padding: 0; }

.site-footer { border-top: 1px solid var(--line); margin-top: 1rem; padding: 1.4rem 0 2.6rem; color: var(--muted); font-size: 0.85rem; }
.site-footer p { margin: 0; }

@media (max-width: 40rem) {
  .tiles, .cards, .projects { grid-template-columns: 1fr; }
  h1 { font-size: 1.65rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero .wrap > * { margin-left: 1.1rem; margin-right: 1.1rem; }
  .hero .wrap { padding-top: 1.8rem; padding-bottom: 1.8rem; }
  .header-in { flex-direction: column-reverse; align-items: stretch; padding-top: 0.8rem; }
  #contrast { align-self: flex-end; }
}
@media (max-width: 30rem) {
  .site-nav ul { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; }
  .info { grid-template-columns: 1fr; }
  .info dt { border-bottom: 0; padding-bottom: 0; }
  .info dd { padding-top: 0.1rem; }
  .info dt:last-of-type { border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
