:root {
  --paper: #f7f3ea;
  --card: #fffdf8;
  --card-open: #fffefb;
  --ink: #1c2b24;
  --muted: #68736d;
  --green: #215743;
  --green-soft: #e4ede7;
  --orange: #bb6537;
  --orange-soft: #f4e3d7;
  --line: #dcd4c6;
  --line-dark: #cfc5b4;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --header-height: 64px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 0 0, rgba(187, 101, 55, 0.08), transparent 28rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
summary {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(187, 101, 55, 0.45);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px max(22px, calc((100vw - 1040px) / 2));
  background: rgba(247, 243, 234, 0.92);
  border-bottom: 1px solid rgba(220, 212, 198, 0.9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand h1 {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fffdf8;
  background: var(--green);
  border-radius: 11px 11px 11px 3px;
  font-size: 14px;
}

.site-header nav {
  display: flex;
  gap: 8px;
}

.site-header nav a {
  padding: 7px 10px;
  color: var(--muted);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.site-header nav a:hover {
  color: var(--green);
  background: rgba(255, 253, 248, 0.8);
}

.site-header nav b {
  margin-left: 3px;
  color: var(--orange);
  font-family: var(--serif);
}

main {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
}

h2 {
  margin: 0;
  font-family: var(--serif);
}

.essay-section {
  padding: 42px 0 52px;
}

.essay-section + .essay-section {
  padding-top: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-dark);
}

.section-head > div {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.section-head span {
  color: var(--orange);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
}

.section-head h2 {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1;
}

.template-list {
  display: grid;
  gap: 10px;
}

.template-card {
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(41, 48, 43, 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.template-card:hover {
  border-color: var(--line-dark);
}

.template-card[open] {
  background: var(--card-open);
  border-color: rgba(33, 87, 67, 0.35);
  box-shadow: 0 16px 40px rgba(41, 48, 43, 0.075);
}

.template-card summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 12px 18px 12px 14px;
  cursor: pointer;
  list-style: none;
}

.template-card summary::-webkit-details-marker {
  display: none;
}

.template-index {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 12px;
  text-align: center;
}

.template-title {
  font-family: var(--serif);
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 700;
  line-height: 1.35;
}

.chevron {
  position: relative;
  width: 28px;
  height: 28px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 50%;
}

.chevron::before,
.chevron::after {
  position: absolute;
  top: 13px;
  left: 9px;
  width: 10px;
  height: 1.5px;
  content: "";
  background: currentColor;
  border-radius: 999px;
  transition: transform 160ms ease;
}

.chevron::after {
  transform: rotate(90deg);
}

.template-card[open] .chevron::after {
  transform: rotate(0);
}

.card-body {
  padding: 2px 18px 26px;
}

.template-note {
  margin: 0 0 18px 56px;
  padding: 10px 13px;
  color: #73503b;
  background: var(--orange-soft);
  border-radius: 9px;
  font-size: 13px;
  line-height: 1.65;
}

.answer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-left: 56px;
}

.language-panel {
  min-width: 0;
  padding: 20px;
  border-radius: 11px;
}

.language-panel.en {
  background: #faf8f2;
  border: 1px solid #e4ded2;
}

.language-panel.cn {
  background: #f2f7f3;
  border: 1px solid #d8e5dc;
}

.language-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(104, 115, 109, 0.16);
}

.language-label span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.language-label strong {
  color: var(--green);
  font-size: 12px;
}

.language-copy {
  overflow-wrap: anywhere;
}

.language-copy p {
  margin: 0 0 0.9em;
}

.language-copy p:last-child {
  margin-bottom: 0;
}

.language-panel.en .language-copy {
  color: #25342c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.82;
}

.language-panel.cn .language-copy {
  color: #3e4a43;
  font-size: 14px;
  line-height: 1.85;
}

mark {
  padding: 0 3px;
  color: #854823;
  background: #f0d9c9;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.chinese-only {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px dashed rgba(104, 115, 109, 0.3);
}

.chinese-only-label {
  display: inline-block;
  margin-bottom: 8px;
  color: #8b4d2c;
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 760px) {
  :root {
    --header-height: 58px;
  }

  .site-header {
    padding-inline: 16px;
  }

  .brand {
    font-size: 15px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px 9px 9px 3px;
  }

  .site-header nav a {
    padding: 6px;
    font-size: 12px;
  }

  main {
    width: min(100% - 28px, 1040px);
  }

  .essay-section {
    padding-top: 28px;
    padding-bottom: 38px;
  }

  .section-head {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .template-card summary {
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    gap: 10px;
    min-height: 62px;
    padding: 10px 13px;
  }

  .template-index {
    font-size: 11px;
  }

  .template-title {
    font-size: 17px;
  }

  .card-body {
    padding: 0 12px 18px;
  }

  .template-note {
    margin: 0 2px 12px;
  }

  .answer-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-left: 0;
  }

  .language-panel {
    padding: 16px;
  }

  .language-panel.en .language-copy {
    font-size: 15px;
  }

  .language-panel.cn .language-copy {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
