:root {
  --paper: #f3efe5;
  --paper-deep: #e8dfce;
  --ink: #1e2420;
  --muted: #6f756d;
  --pine: #183d35;
  --pine-soft: #2f5a4e;
  --cinnabar: #a74432;
  --bronze: #8a7047;
  --line: rgba(30, 36, 32, .16);
  --white: #fffdf8;
  --shadow: 0 18px 60px rgba(27, 42, 35, .13);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
p { line-height: 1.75; }

body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .18; z-index: -1;
  background-image: radial-gradient(rgba(72, 57, 37, .14) .6px, transparent .6px);
  background-size: 7px 7px;
}

.app-shell { width: min(100%, 1180px); margin: 0 auto; min-height: 100vh; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; background: rgba(243, 239, 229, .92); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--cinnabar); color: var(--cinnabar); font-family: "Songti SC", serif; font-size: 20px; transform: rotate(-2deg); }
.brand b { display: block; font: 600 17px/1.25 "Songti SC", "STSong", serif; letter-spacing: .08em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); letter-spacing: .08em; }
.icon-button { min-height: 40px; padding: 0 12px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; color: var(--ink); font-size: 13px; }

main { padding: 24px 24px 128px; }
.view { animation: rise .36s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.hero-card { height: clamp(310px, 50vw, 520px); border-radius: 2px; overflow: hidden; position: relative; box-shadow: var(--shadow); background: var(--pine); }
.hero-card img { width: 100%; height: 100%; object-fit: cover; object-position: center 61%; filter: saturate(.86) contrast(1.02); }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 40, 33, .88), rgba(20, 40, 33, .08) 62%), linear-gradient(0deg, rgba(20, 40, 33, .3), transparent 55%); }
.hero-copy { position: absolute; left: clamp(24px, 6vw, 72px); top: 50%; transform: translateY(-50%); width: min(460px, 78%); color: #fff9eb; }
.eyebrow, .kicker { margin: 0 0 10px; color: var(--cinnabar); font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.hero-copy .eyebrow { color: #edc99b; }
.hero-copy h1, .page-head h1, .year-copy h1 { margin: 0; font: 500 clamp(42px, 7vw, 78px)/1.06 "Songti SC", "STSong", serif; letter-spacing: .05em; }
.hero-copy p:last-child { margin: 18px 0 0; font-size: clamp(15px, 2vw, 19px); color: rgba(255, 249, 235, .84); }

.date-switcher { margin: 30px auto 20px; display: grid; grid-template-columns: 48px minmax(180px, 280px) 48px; align-items: end; justify-content: center; gap: 10px; }
.date-switcher button, .month-toolbar button { width: 48px; height: 48px; border: 1px solid var(--line); background: transparent; color: var(--ink); }
.date-switcher label, .find-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; letter-spacing: .08em; }
input, select { min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; background: rgba(255,255,255,.35); color: var(--ink); }

.day-card { display: grid; grid-template-columns: .92fr 1.5fr; gap: 34px; padding: clamp(28px, 6vw, 66px); background: var(--white); box-shadow: var(--shadow); border-top: 4px solid var(--pine); }
.date-block { border-right: 1px solid var(--line); padding-right: 34px; }
.date-number { font: 400 clamp(78px, 13vw, 150px)/.85 Georgia, serif; letter-spacing: -.07em; color: var(--pine); }
.date-meta { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.date-meta span { padding-right: 8px; border-right: 1px solid var(--line); }
.lunar-date { margin: 22px 0 6px; font: 500 24px/1.35 "Songti SC", serif; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.pill { padding: 6px 10px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.pill.red { border-color: rgba(167,68,50,.45); color: var(--cinnabar); }
.day-main h2 { margin: 0 0 18px; font: 500 clamp(28px, 4vw, 44px)/1.25 "Songti SC", serif; }
.yi-ji { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.yi-ji article { padding-top: 14px; border-top: 1px solid var(--line); }
.yi-ji b { display: flex; align-items: center; gap: 8px; font-size: 13px; letter-spacing: .15em; }
.yi-ji b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pine); }
.yi-ji .avoid b::before { background: var(--cinnabar); }
.yi-ji p { margin: 10px 0 0; font-size: 15px; }
.day-foot { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); font-size: 13px; }

.action-card { margin: 18px 0 58px; display: grid; grid-template-columns: 130px 1fr; gap: 24px; padding: 26px 30px; border: 1px solid var(--line); background: rgba(255,255,255,.22); }
.action-card .officer { display: flex; align-items: baseline; gap: 4px; color: var(--cinnabar); }
.action-card .officer b { font: 500 54px/1 "Songti SC", serif; }
.action-card .officer span { font-size: 13px; letter-spacing: .18em; }
.action-card h3 { margin: 0 0 8px; font: 500 24px/1.3 "Songti SC", serif; }
.action-card p { margin: 0; color: var(--muted); }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin: 58px 0 22px; }
.section-heading h2, .share-panel h2, .year-section h2, .cta-panel h2 { margin: 0; font: 500 clamp(26px, 4vw, 38px)/1.25 "Songti SC", serif; }
.section-heading > p { max-width: 380px; margin: 0; color: var(--muted); font-size: 14px; }
.accordions { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { min-height: 62px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; font-weight: 600; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--cinnabar); font-size: 24px; font-weight: 300; }
details[open] summary::after { content: "−"; }
.detail-body { padding: 0 0 26px; color: var(--muted); }
.fact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.fact-grid div { background: var(--paper); padding: 18px; }
.fact-grid small { display: block; color: var(--muted); margin-bottom: 5px; }
.fact-grid b { color: var(--ink); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { border-bottom: 1px solid var(--line); padding: 6px 2px; }
.hours { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 26px; }
.hour-row { display: grid; grid-template-columns: 110px 80px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.hour-row.good b { color: var(--pine); }
.hour-row.bad b { color: var(--cinnabar); }
.hour-row small { color: var(--muted); }
.share-panel { margin: 56px 0 10px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 34px; background: var(--pine); color: #f7f0df; }
.share-panel .kicker { color: #e7c492; }
.primary-button { min-height: 48px; padding: 0 22px; border: 0; background: var(--cinnabar); color: #fff; font-weight: 700; letter-spacing: .08em; }
.share-panel .primary-button { background: #f4e9d5; color: var(--pine); }
#share-status { display: block; max-width: 230px; min-height: 20px; margin-top: 8px; color: #e7c492; font-size: 12px; line-height: 1.5; }

.page-head { padding: 70px 0 44px; max-width: 780px; }
.compact-head h1 { font-size: clamp(38px, 7vw, 68px); }
.page-head > p:last-child { color: var(--muted); max-width: 680px; }
.month-toolbar { display: grid; grid-template-columns: 48px 1fr 48px; gap: 12px; align-items: center; margin-bottom: 18px; }
.month-toolbar h2 { text-align: center; font: 500 28px/1.2 "Songti SC", serif; }
.weekday-row, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.weekday-row { border-bottom: 1px solid var(--ink); }
.weekday-row span { text-align: center; padding: 10px 2px; color: var(--muted); font-size: 12px; }
.calendar-day { min-height: 112px; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; text-align: left; color: var(--ink); position: relative; }
.calendar-day:nth-child(7n+1) { border-left: 1px solid var(--line); }
.calendar-day.empty { pointer-events: none; }
.calendar-day .num { font: 500 28px/1 Georgia, serif; }
.calendar-day .lunar { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; }
.calendar-day .marker { display: block; margin-top: 9px; color: var(--cinnabar); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-day:hover, .calendar-day:focus-visible { background: rgba(24,61,53,.07); outline: none; }
.calendar-day.today-preview { box-shadow: inset 0 0 0 2px var(--cinnabar); }
.month-note { margin-top: 28px; padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); }

.find-form { display: grid; grid-template-columns: 1.1fr 2fr auto; gap: 18px; align-items: end; padding: 26px; border: 1px solid var(--line); background: rgba(255,255,255,.25); }
.find-form select { width: 100%; }
.date-range { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.boundary-note { margin: 20px 0 34px; padding-left: 16px; border-left: 3px solid var(--cinnabar); color: var(--muted); }
.results-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.result-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 22px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: center; }
.result-date b { display: block; font: 500 24px/1.2 Georgia, serif; }
.result-date small, .result-copy p { color: var(--muted); }
.result-copy h3 { margin: 0; font: 500 20px/1.3 "Songti SC", serif; }
.result-copy p { margin: 6px 0 0; font-size: 13px; }
.text-button { border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 8px 0; }
.empty-state { padding: 50px 0; color: var(--muted); text-align: center; }

.year-hero { min-height: 560px; position: relative; overflow: hidden; display: flex; align-items: center; margin: 0 -24px; }
.year-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 58%; }
.year-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(19,42,35,.91), rgba(19,42,35,.25) 74%); }
.year-copy { position: relative; z-index: 1; color: #fff9ea; width: min(660px, 82%); margin-left: clamp(30px, 8vw, 110px); }
.year-copy h1 { font-size: clamp(42px, 7vw, 72px); }
.year-copy p:last-child { color: rgba(255,249,234,.82); font-size: 17px; }
.year-section { padding: 72px 0; border-bottom: 1px solid var(--line); }
.section-intro { color: var(--muted); max-width: 760px; }
.milestone-grid, .focus-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 28px; }
.milestone-grid article { padding: 28px; background: var(--white); box-shadow: 0 12px 40px rgba(30,36,32,.08); }
.milestone-grid span { font: 500 42px/1 Georgia, serif; color: var(--cinnabar); }
.milestone-grid b { display: block; margin-top: 14px; font-family: "Songti SC", serif; font-size: 20px; }
.milestone-grid p, .focus-grid p { color: var(--muted); margin-bottom: 0; }
.nine-grid { width: min(620px, 100%); display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--ink); border: 1px solid var(--ink); margin: 34px 0 22px; }
.nine-cell { aspect-ratio: 1; border: 0; background: var(--paper); display: grid; place-items: center; align-content: center; gap: 4px; color: var(--ink); }
.nine-cell b { font: 500 clamp(30px, 6vw, 54px)/1 "Songti SC", serif; }
.nine-cell span { font-size: 12px; color: var(--muted); }
.nine-cell.active { background: var(--pine); color: #fff9ea; }
.nine-cell.active span { color: #e9d4b2; }
.nine-detail { max-width: 760px; padding: 28px; border-left: 3px solid var(--cinnabar); background: rgba(255,255,255,.28); }
.nine-detail h3 { margin: 0 0 8px; font: 500 24px/1.3 "Songti SC", serif; }
.nine-detail p { color: var(--muted); margin: 8px 0; }
.focus-grid { grid-template-columns: repeat(4,1fr); }
.focus-grid article { padding: 22px 0; border-top: 2px solid var(--pine); }
.focus-grid b { font: 500 24px/1 "Songti SC", serif; }

.service-head { padding-top: 86px; }
.service-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.service-grid article { padding: 30px; border: 1px solid var(--line); background: rgba(255,255,255,.23); }
.service-grid span { color: var(--cinnabar); font: 500 32px/1 Georgia, serif; }
.service-grid h2 { margin: 50px 0 12px; font: 500 24px/1.3 "Songti SC", serif; }
.service-grid p, .service-grid small { color: var(--muted); }
.service-grid small { line-height: 1.6; }
.cta-panel { margin-top: 20px; padding: 50px; text-align: center; background: var(--pine); color: #fff9ea; }
.cta-panel p { color: #e7c492; letter-spacing: .15em; }
.cta-panel .primary-button { margin-top: 22px; background: #f3e7d1; color: var(--pine); }
#copy-status { display: block; min-height: 24px; margin-top: 10px; color: #e7c492; }
.source-card { margin-top: 24px; padding: 30px 0; border-top: 1px solid var(--line); }
.source-card h2 { font: 500 24px/1.3 "Songti SC", serif; }
.source-card p { color: var(--muted); max-width: 860px; }

.bottom-nav { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 30; width: min(calc(100% - 28px), 620px); display: grid; grid-template-columns: repeat(5,1fr); padding: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(20,47,40,.95); backdrop-filter: blur(18px); box-shadow: 0 16px 50px rgba(20,40,33,.3); }
.bottom-nav a { min-height: 58px; display: grid; place-items: center; align-content: center; gap: 3px; color: rgba(255,255,255,.62); font-size: 11px; }
.bottom-nav span { font: 500 18px/1 "Songti SC", serif; }
.bottom-nav a.active { background: rgba(255,255,255,.1); color: #fff9ea; }

dialog { width: min(560px, calc(100% - 32px)); border: 0; padding: 42px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15, 29, 25, .65); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 0; background: transparent; font-size: 26px; }
dialog h2 { font: 500 30px/1.3 "Songti SC", serif; }
dialog li { margin: 10px 0; line-height: 1.7; }
.muted { color: var(--muted); }

@media (max-width: 780px) {
  .topbar { padding: 0 16px; height: 64px; }
  .icon-button { font-size: 12px; }
  main { padding: 16px 16px 118px; }
  .hero-card { height: 390px; }
  .hero-copy { left: 24px; width: 78%; }
  .hero-copy h1 { font-size: 48px; }
  .day-card { grid-template-columns: 1fr; gap: 28px; padding: 30px 24px; }
  .date-block { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 26px; }
  .date-number { font-size: 104px; }
  .action-card { grid-template-columns: 84px 1fr; padding: 22px; }
  .action-card .officer b { font-size: 44px; }
  .section-heading { align-items: start; flex-direction: column; }
  .fact-grid { grid-template-columns: repeat(2, 1fr); }
  .hours { grid-template-columns: 1fr; }
  .share-panel { align-items: stretch; flex-direction: column; }
  .calendar-day { min-height: 86px; padding: 8px 5px; }
  .calendar-day .num { font-size: 22px; }
  .calendar-day .lunar { font-size: 10px; }
  .find-form { grid-template-columns: 1fr; }
  .result-row { grid-template-columns: 92px 1fr; }
  .result-row .text-button { grid-column: 2; justify-self: start; }
  .year-hero { min-height: 560px; margin: 0 -16px; }
  .year-copy { margin-left: 28px; width: calc(100% - 56px); }
  .milestone-grid, .focus-grid, .service-grid { grid-template-columns: 1fr; }
  .year-section { padding: 54px 0; }
  .focus-grid article { padding: 18px 0; }
  .cta-panel { padding: 36px 22px; }
}

@media (max-width: 430px) {
  .brand b { font-size: 15px; }
  .brand small { font-size: 9px; }
  .brand-mark { width: 34px; height: 34px; }
  .icon-button { padding: 0 4px; }
  .date-switcher { grid-template-columns: 44px 1fr 44px; }
  .date-switcher button { width: 44px; }
  .yi-ji { grid-template-columns: 1fr; }
  .fact-grid { grid-template-columns: 1fr 1fr; }
  .hour-row { grid-template-columns: 104px 62px 1fr; font-size: 13px; }
  .bottom-nav { bottom: 10px; }
  .page-head { padding-top: 48px; }
  .compact-head h1 { font-size: 36px; letter-spacing: .01em; }
  .date-range { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; } }
