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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F7F4EF;
  --text: #1A1A1A;
  --gold: #C9A84C;
  --navy: #1B2A4A;
  --muted: #666;
  --border: #E0D9CE;
  --max-w: 760px;
}

html { font-size: 17px; }
body { background: var(--bg); color: var(--text); font-family: 'Noto Sans TC', sans-serif; line-height: 1.9; }

/* Layout */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* Header */
header { border-bottom: 1px solid var(--border); padding: 20px 0; }
header .inner { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; }
.brand { font-family: 'Noto Serif TC', serif; font-weight: 700; font-size: 1.1rem; color: var(--navy); text-decoration: none; }
.brand span { color: var(--gold); }
nav a { color: var(--muted); text-decoration: none; margin-left: 24px; font-size: 0.9rem; }
nav a:hover { color: var(--gold); }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 80px; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* Hero */
.hero { padding: 64px 0 48px; text-align: center; }
.hero h1 { font-family: 'Noto Serif TC', serif; font-size: 2rem; font-weight: 700; color: var(--navy); margin-bottom: 16px; }
.hero p { color: var(--muted); font-size: 1rem; line-height: 1.8; margin-bottom: 32px; }
.cta { display: inline-block; background: var(--gold); color: #fff; padding: 12px 32px; border-radius: 4px; text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.cta:hover { background: #b8943e; }

/* Stats */
.stats { display: flex; justify-content: center; gap: 48px; padding: 32px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 48px; }
.stats div { text-align: center; font-family: 'Noto Serif TC', serif; }
.stats .num { font-size: 2rem; font-weight: 700; color: var(--gold); }
.stats .label { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

/* Section headers */
.section-title { font-family: 'Noto Serif TC', serif; font-size: 1.3rem; font-weight: 700; color: var(--navy); margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--gold); }

/* Letter list */
.letter-list { list-style: none; }
.letter-list li { border-bottom: 1px solid var(--border); }
.letter-list a { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; text-decoration: none; color: var(--text); font-size: 0.95rem; }
.letter-list a:hover { color: var(--gold); }
.letter-list .year-badge { font-size: 0.8rem; color: var(--muted); min-width: 48px; text-align: right; }

/* Letter groups on index */
.letter-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
@media (max-width: 600px) { .letter-groups { grid-template-columns: 1fr; } }

/* Article / letter page */
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin: 32px 0 8px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.letter-header { margin-bottom: 40px; }
.letter-header h1 { font-family: 'Noto Serif TC', serif; font-size: 1.75rem; font-weight: 700; color: var(--navy); line-height: 1.4; }
.letter-nav { display: flex; justify-content: space-between; margin: 40px 0; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.letter-nav a { color: var(--gold); text-decoration: none; }
.letter-nav a:hover { text-decoration: underline; }
.letter-nav .spacer { flex: 1; }

/* Article body */
article h1, article h2, article h3 { font-family: 'Noto Serif TC', serif; color: var(--navy); margin: 2em 0 0.8em; }
article h1 { font-size: 1.5rem; }
article h2 { font-size: 1.25rem; }
article h3 { font-size: 1.05rem; }
article p { margin-bottom: 1.4em; }
article ul, article ol { margin: 0.8em 0 1.4em 1.5em; }
article li { margin-bottom: 0.4em; }
article blockquote { background: var(--navy); color: #F0EDE8; border-left: 4px solid var(--gold); padding: 20px 24px; margin: 1.5em 0; border-radius: 0 4px 4px 0; font-style: italic; font-family: 'Noto Serif TC', serif; line-height: 1.8; }
article table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.9rem; overflow-x: auto; display: block; }
article th { background: #EDE8DF; color: var(--navy); font-weight: 600; padding: 10px 12px; text-align: left; border: 1px solid var(--border); }
article td { padding: 8px 12px; border: 1px solid var(--border); }
article tr:nth-child(even) { background: #FAF8F5; }

/* Latest section on homepage */
.latest-list { list-style: none; }
.latest-list li { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.latest-list a { text-decoration: none; color: var(--text); font-size: 0.95rem; }
.latest-list a:hover { color: var(--gold); }
.latest-list .year { color: var(--muted); font-size: 0.85rem; }

@media (max-width: 640px) {
  html { font-size: 16px; }
  .container { padding: 0 16px; }
  .hero h1 { font-size: 1.5rem; }
  .stats { gap: 24px; }
  .letter-header h1 { font-size: 1.4rem; }
}