:root {
  color-scheme: light;
  --paper: #f8f7f2;
  --white: #fffefa;
  --ink: #172923;
  --muted: #51615a;
  --line: #dedfd4;
  --green: #1f4d3d;
  --green-dark: #17392e;
  --rust: #a1402a;
  --peach: #fbe3d5;
  --sage: #e2ede1;
  --blue: #e5e9f4;
  --gold: #faedcb;
  --rounded: 18px;
  font-family: "Inter", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 280px; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.6; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible, [tabindex="-1"]:focus-visible {
  outline: 3px solid var(--rust);
  outline-offset: 4px;
}
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
h2, h3 { line-height: 1.32; }
.wrap { width: min(1180px, 100% - 72px); margin-inline: auto; }
.visually-hidden, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus { position: absolute; inset: 8px auto auto 10px; z-index: 4; padding: 8px 14px; background: white; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; line-height: 1.16; font-weight: 800; text-decoration: none; white-space: nowrap; }
.brand-mark { display: block; width: 42px; height: 42px; flex: 0 0 42px; }
nav { display: flex; gap: clamp(10px, 2.8vw, 36px); align-items: center; }
nav a { padding: 9px 3px; color: #394a42; font-size: .94rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
nav a:hover, nav a[aria-current="page"] { color: var(--rust); }
.nav-bookmark { margin-inline-end: 3px; vertical-align: -.07em; }
.bookmark { width: .78em; height: 1em; display: inline-block; position: relative; color: inherit; background: currentColor; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
.bookmark::after { content: ""; background: var(--bookmark-fill, var(--white)); position: absolute; inset: 1.6px; clip-path: inherit; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(30px, 5vw, 76px);
  padding-block: 60px 60px;
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-family: "Noto Serif TC", "Source Han Serif TC", "PMingLiU", Georgia, serif; font-size: clamp(2.5rem, 4.7vw, 4.4rem); font-weight: 800; line-height: 1.10; letter-spacing: -.052em; margin-block: 17px 16px; }
.hero-description { color: #44574c; max-width: 34em; }
.search { display: flex; position: relative; align-items: center; gap: 10px; background: var(--white); padding: 6px 6px 6px 16px; border: 1px solid #b8c4b8; border-radius: 12px; margin-top: 23px; min-width: 0; box-shadow: 0 3px 0 #e9e9df; }
.search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px #dbe9e0; }
.search input { color: var(--ink); background: transparent; min-width: 0; width: 100%; padding: 8px 0; border: 0; outline: none; }
.search input::placeholder { color: #52635a; opacity: 1; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.magnifier { flex: 0 0 15px; width: 15px; height: 15px; border: 2px solid #51685b; border-radius: 50%; position: relative; margin-right: 3px; }
.magnifier::after { content: ""; position: absolute; right: -6px; bottom: -3px; width: 7px; height: 2px; background: #51685b; transform: rotate(44deg); }
.search-button, .primary { background: var(--green); color: #fff; border-radius: 8px; border: 1px solid transparent; font-weight: 750; padding: 8px 17px; text-decoration: none; white-space: nowrap; }
.search-button:hover, .primary:hover { background: var(--green-dark); }
.clear-search { flex: 0 0 36px; height: 40px; background: transparent; border: 0; color: var(--muted); font-size: 1.4rem; border-radius: 8px; }
.clear-search:hover { background: var(--sage); }
.quick-search { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 13px; color: var(--muted); font-size: .86rem; }
.quick-search > span { margin-right: 3px; }
.quick-search button, .pills button, .more {
  border: 1px solid #d7ddd2;
  background: var(--white);
  border-radius: 99px;
  color: var(--green-dark);
  padding: 5px 11px;
}
.quick-search button:hover, .pills button:hover, .more:hover { border-color: var(--green); background: var(--sage); }
.hero-art {
  display: grid;
  place-items: center;
  min-height: 305px;
  padding: clamp(16px, 3vw, 36px);
  border: 1px solid #e2d8c7;
  border-radius: 24px;
  background-color: #f3eddf;
  background-image: linear-gradient(#66745a18 1px, transparent 1px), linear-gradient(90deg, #66745a18 1px, transparent 1px);
  background-size: 25px 25px;
  background-position: center;
}
.hero-art img { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 6px #373c2626); }
.hero.compact { display: block; padding-block: 21px; }
.hero.compact .hero-copy { max-width: 780px; }
.hero.compact :is(h1, .hero-description, .hero-art, .quick-search) { display: none; }
.hero.compact .search { margin: 0; }
.view { min-height: 50vh; padding-block: 36px 64px; }
.section-heading { display: flex; gap: 12px 22px; flex-wrap: wrap; align-items: end; justify-content: space-between; margin-bottom: 17px; }
.section-heading h2, .page-heading h2 { font-size: clamp(1.65rem, 3.1vw, 2.35rem); letter-spacing: -.038em; }
.section-heading p, .page-heading p { color: var(--muted); margin-top: 4px; }
.sublink { color: var(--green); font-weight: 750; font-size: .92rem; text-decoration-color: #8cac9c; text-underline-offset: 4px; padding: 4px 0; }
.sublink:hover { color: var(--rust); }
.study-grid, .course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.study-card, .course-card {
  display: block;
  text-decoration: none;
  border: 1px solid #dcded3;
  border-radius: var(--rounded);
  background: var(--white);
  padding: 18px 19px 17px;
  min-width: 0;
}
.study-card:hover, .course-card:hover { border-color: #7a9d8a; box-shadow: 0 3px 0 #e1e8dd; }
.study-card h3, .course-card h4 { font-size: 1.15rem; margin-block: 9px 5px; line-height: 1.35; letter-spacing: -.012em; }
.study-card p, .course-card p { color: var(--muted); font-size: .92rem; }
.tile-icon { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding-inline: 6px; border-radius: 10px; font: 700 1.42rem Georgia, serif; color: #203d33; }
.peach { background: var(--peach); }
.sage { background: var(--sage); }
.blue { background: var(--blue); }
.gold { background: var(--gold); }
.catalog { margin-top: 39px; }
.page-heading { margin-bottom: 25px; }
.breadcrumb { display: inline-block; margin-bottom: 9px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 21px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills button { font-weight: 680; padding: 7px 13px; font-size: .92rem; }
.pills button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: white; }
.select { position: relative; display: inline-flex; }
.select::after { content: ""; position: absolute; top: calc(50% - 6px); right: 15px; width: 8px; height: 8px; border-right: 1.5px solid var(--green); border-bottom: 1.5px solid var(--green); transform: rotate(45deg); pointer-events: none; }
.select select { color: var(--green-dark); background: var(--white); padding: 8px 35px 8px 12px; border: 1px solid #d7ddd2; border-radius: 8px; appearance: none; font-size: .91rem; }
.year + .year { margin-top: 27px; }
.year h3 { margin-bottom: 11px; font-size: 1.19rem; }
.year h3 small { color: var(--muted); margin-inline-start: 8px; font-size: .78rem; font-weight: 500; }
.course-card-top { display: flex; gap: 6px 10px; align-items: flex-start; flex-wrap: wrap; justify-content: space-between; }
.course-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-block; border-radius: 5px; padding: 3px 8px; background: #ecefe7; color: #344c41; font-size: .77rem; line-height: 1.4; }
.course-card h4 { margin-block: 8px 2px; }
.course-card p { overflow-wrap: anywhere; }
.page-section { margin-top: 24px; }
.page-section h3, .example-panel h3 { margin-bottom: 12px; font-size: 1.26rem; }
.example-panel { background: #eef2e8; border: 1px solid #dce5d9; border-radius: var(--rounded); padding: 19px 22px; margin-block: 19px 24px; }
.example-panel ol { margin: 0; padding-inline-start: 22px; }
.example-panel li + li { margin-top: 8px; }
.example-panel .example-zh { color: #42564b; }
.term-list { display: grid; gap: 10px; }
.term { position: relative; min-width: 0; padding: 14px 59px 14px 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); overflow-wrap: anywhere; }
.term:target { border-color: var(--green); }
.term small { display: block; color: var(--muted); margin-bottom: 3px; font-size: .83rem; }
.term h3 { font-size: 1.12rem; margin-bottom: 2px; font-weight: 760; }
.term .term-zh { color: var(--green-dark); font-weight: 650; font-size: .99rem; }
.term-save { position: absolute; right: 10px; top: 10px; width: 42px; height: 42px; border: 1px solid transparent; background: transparent; border-radius: 8px; color: var(--green); }
.term-save .bookmark { vertical-align: -.06em; width: .83em; font-size: 1.2rem; }
.term-save:hover { background: var(--sage); --bookmark-fill: var(--sage); border-color: #a7bead; }
.term-save[aria-pressed="true"] { color: var(--rust); }
.term-save[aria-pressed="true"] .bookmark::after { display: none; }
.course-heading { display: flex; align-items: center; gap: 13px; }
.course-heading .tile-icon { width: 53px; height: 53px; font-size: 1.7rem; flex: 0 0 auto; }
.course-heading h2 { overflow-wrap: anywhere; }
.course-heading p { overflow-wrap: anywhere; }
.course-intro { margin-top: 12px; }
.course-intro + .course-meta { margin-top: 9px; }
.results { margin-top: 18px; }
.results .course-grid { margin-bottom: 20px; }
.more { display: block; padding: 8px 18px; font-weight: 700; margin: 18px auto 0; }
.empty { text-align: center; background: var(--white); border: 1px dashed #b9c9bb; border-radius: var(--rounded); padding: 29px 19px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); }
.empty a { display: inline-block; margin-top: 12px; }
.site-footer { border-top: 1px solid var(--line); padding-block: 23px 29px; }
.footer-main { display: grid; grid-template-columns: 1fr .95fr; gap: 16px 36px; align-items: center; }
.footer-main p { color: var(--muted); font-size: .86rem; margin-top: 4px; max-width: 40em; }
.footer-contact a { color: var(--green); font-size: 1rem; overflow-wrap: anywhere; text-underline-offset: 3px; }
.footer-credit { border-top: 1px solid var(--line); color: var(--muted); font-size: .87rem; margin-top: 16px; padding-top: 11px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 15px; }
.footer-links a { color: #425b4c; font-size: .84rem; text-underline-offset: 3px; }
@media (max-width: 850px) {
  .wrap { width: min(100% - 40px, 1180px); }
  .hero { gap: 24px; padding-block: 40px 43px; }
  .hero h1 { font-size: clamp(2.3rem, 5.6vw, 3.7rem); }
  .hero-art { min-height: 278px; }
  .footer-main { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}
@media (max-width: 660px) {
  .header-inner { flex-wrap: wrap; gap: 4px 18px; padding-block: 10px 4px; }
  nav { flex: 1 1 auto; justify-content: flex-end; gap: 12px; }
  nav a { font-size: .88rem; padding-inline: 2px; }
  .hero { grid-template-columns: 1fr; gap: 23px; padding-block: 28px; }
  .hero h1 { font-size: clamp(2.24rem, 8.8vw, 3.6rem); margin-block: 13px 11px; }
  .hero-description { max-width: 29em; }
  .hero-art { min-height: 196px; }
  .view { padding-block: 27px 43px; }
  .study-grid, .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .study-card, .course-card { padding: 13px; }
  .catalog { margin-top: 29px; }
  .section-heading { margin-bottom: 13px; }
}
@media (max-width: 420px) {
  .wrap { width: calc(100% - 30px); }
  .header-inner { padding-top: 11px; }
  .header-inner nav { justify-content: space-between; flex-basis: 100%; }
  .hero-art { min-height: 168px; }
  .search { gap: 7px; padding-left: 12px; }
  .search-button { padding-inline: 11px; }
  .clear-search { flex-basis: 28px; }
  .example-panel { padding: 13px 15px; }
}

.hero h1 { margin-block: 0 8px; }
.study-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.study-card h3 { margin-bottom: 0; }
.course-card small { display: block; margin-top: 7px; color: var(--muted); font-size: .84rem; }
.filter-links { gap: 7px; justify-content: flex-start; }
.filter-links a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  text-decoration: none;
  background: var(--white);
}
.filter-links a[aria-current="page"] { background: var(--green); border-color: var(--green); color: #fff; }
.topic-pills { margin-block: 8px 19px; }
.term { padding: 12px 59px 12px 16px; }
.term small { margin-bottom: 3px; }
.term h3 { margin-bottom: 0; }
.term-link { display: block; color: var(--ink); text-decoration: none; }
.term-link > span:first-child { text-decoration: underline; text-decoration-color: #a7bead; text-underline-offset: 3px; }
.term-link::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.term:has(.term-link:hover) { border-color: #819e8b; }
.term-link:focus-visible { outline: none; }
.term-link:focus-visible::after { outline: 3px solid var(--rust); outline-offset: 2px; }
.term .term-zh { display: block; color: var(--green); margin-top: 3px; }
.term-save { z-index: 1; }
.result-group + .result-group { margin-top: 24px; }
.page-heading h2 { overflow-wrap: anywhere; }

.word-page, .word-index { max-width: 810px; padding-block: 24px 52px; }
.word-search { margin: 0 0 22px; }
.word-panel {
  background: var(--white);
  margin-top: 10px;
  padding: clamp(18px, 4vw, 37px);
  border: 1px solid var(--line);
  border-radius: var(--rounded);
  overflow-wrap: anywhere;
}
.word-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.word-heading h1 {
  font-family: "Inter", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: clamp(1.8rem, 4.7vw, 3rem);
  line-height: 1.16;
  letter-spacing: -.03em;
}
.word-topic { margin-bottom: 6px; color: var(--muted); font-size: .86rem; font-weight: 650; }
.word-chinese { font-size: clamp(1.12rem, 3.3vw, 1.42rem); font-weight: 750; color: var(--green); margin-top: 6px; }
.word-definition { border-top: 1px solid var(--line); padding-top: 17px; margin-top: 20px; }
.word-page h2 { font-size: 1.18rem; margin-bottom: 8px; }
.word-definition p, .word-panel .example-panel p { line-height: 1.68; }
.word-panel .example-panel { margin-bottom: 0; }
.word-save {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #b6cabe;
  background: var(--white);
  color: var(--green);
  border-radius: 9px;
  padding: 8px 11px;
  white-space: nowrap;
}
.word-save:hover { background: var(--sage); --bookmark-fill: var(--sage); }
.word-save[aria-pressed="true"] { color: var(--rust); }
.word-save[aria-pressed="true"] .bookmark::after { display: none; }
.related { margin-top: 24px; }
.related ul, .word-index ul { margin-block: 8px 18px; padding-inline-start: 21px; }
.related a, .word-index a { color: var(--green); text-underline-offset: 3px; }
.related li + li, .word-index li + li { margin-top: 5px; }
.word-index h1 { font-size: 2rem; }
.word-index h2 { margin-block: 18px 10px; }
.word-index summary { padding: 7px 0; cursor: pointer; font-weight: 700; }
@media (max-width: 850px) {
  .study-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 570px) {
  .study-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { gap: 20px; }
  .hero h1 { margin-block: 0 7px; }
  .word-heading { flex-wrap: wrap; gap: 9px; }
  .word-save { padding-block: 6px; }
  .word-panel h1 { font-size: clamp(1.55rem, 6.2vw, 2.1rem); }
}
