:root {
  --red: #9e2121;
  --red-deep: #6e1616;
  --red-ink: #4c1010;
  --red-soft: #f6e7e3;
  --gold: #b08958;
  --ink: #241816;
  --muted: #5e463f;
  --paper: #f6f1ea;
  --paper-2: #efe6dc;
  --white: #fffdfb;
  --line: #e4d5c8;
  --sea: #1e4e5a;
  --sea-soft: #e5eef0;
  --shadow: 0 18px 40px rgba(36, 24, 22, 0.08);
  --serif: "Noto Serif CJK SC", "Noto Serif CJK TC", "Songti SC", "Source Han Serif SC", serif;
  --sans: "Noto Sans CJK SC", "Noto Sans CJK TC", "PingFang SC", "Microsoft YaHei", "Noto Sans", sans-serif;
  --latin: "Liberation Serif", "Noto Serif", "Times New Roman", serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.75;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(158, 33, 33, 0.07), transparent 55%),
    var(--paper);
}
img { max-width: 100%; display: block; }
a { color: var(--red-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 650; line-height: 1.25; letter-spacing: 0.01em; }
p { margin: 0 0 0.8em; }

.skip {
  position: absolute; left: 12px; top: -40px; background: var(--red); color: white; padding: 6px 10px; z-index: 50;
}
.skip:focus { top: 8px; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.wrap-narrow { width: min(760px, calc(100% - 40px)); margin: 0 auto; }

.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(246, 241, 234, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 90px; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 81px; height: 81px; object-fit: contain; }
.brand strong { display: block; font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: 0.04em; }
.brand em { display: block; font-style: normal; font-family: var(--latin); font-size: 11px; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--ink); text-decoration: none; font-size: 15px; letter-spacing: 0.08em; }
.nav a[aria-current="page"] { color: var(--red); }
.nav a:hover { color: var(--red); }
.nav-toggle { display: none; background: transparent; border: 1px solid var(--line); padding: 6px 10px; }
.rule { height: 3px; background: linear-gradient(90deg, var(--red), var(--red) 72%, var(--gold)); }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 32px; align-items: center; padding: 64px 0 36px; }
.hero > div:first-child { container-type: inline-size; }
.eyebrow { font-family: var(--latin); letter-spacing: 0.22em; text-transform: uppercase; color: var(--red); font-size: 13px; margin-bottom: 14px; }
.eyebrow .cn { font-family: var(--serif); letter-spacing: 0.28em; text-transform: none; margin-right: 8px; }
.hero h1 {
  margin: 0 0 16px;
  white-space: nowrap;
  letter-spacing: 0;
  font-size: clamp(28px, 4.8vw, 64px);
  font-size: min(64px, 8.6cqi);
}
.lede { font-size: 18px; color: var(--muted); max-width: 38em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--red); background: var(--red); color: #fffdfb;
  padding: 10px 18px; text-decoration: none; letter-spacing: 0.08em; cursor: pointer;
}
.btn:hover { background: var(--red-deep); color: white; }
.btn.ghost { background: transparent; color: var(--red-deep); }
.btn.ghost:hover { background: var(--red); color: white; }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.danger { background: transparent; color: var(--red-deep); border-color: var(--line); }
.hero-seal {
  display: grid; justify-items: center; gap: 8px;
  padding: 0;
}
.hero-seal img { width: 240px; max-width: 100%; height: auto; filter: drop-shadow(0 12px 24px rgba(36, 24, 22, 0.16)); }
.hero-seal span { font-family: var(--latin); letter-spacing: 0.28em; font-size: 12px; color: var(--muted); }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  margin-top: 10px; margin-bottom: 20px;
}
.stat { padding: 22px 16px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font-family: var(--serif); font-size: 36px; font-weight: 650; color: var(--red); line-height: 1; }
.stat span { color: var(--muted); font-size: 14px; letter-spacing: 0.06em; }

.section { padding: 42px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; }
.section-head h2 { margin: 0; font-size: 32px; }
.section-head p { margin: 6px 0 0; color: var(--muted); }
.kicker { color: var(--gold); letter-spacing: 0.18em; font-size: 12px; font-family: var(--latin); text-transform: uppercase; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; min-height: 100%; color: inherit; text-decoration: none;
}
.card:hover { transform: translateY(-2px); }
.card .cover { aspect-ratio: 16/10; background: var(--red-soft); overflow: hidden; }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 16px 16px 18px; }
.meta { color: var(--red); font-size: 13px; letter-spacing: 0.06em; }
.card h3 { margin: 6px 0 8px; font-size: 22px; }
.card p { color: var(--muted); font-size: 15px; }

.role-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.role-col { background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--red); padding: 16px 16px 8px; }
.role-col h3 { margin: 0 0 8px; font-size: 18px; }
.role-col p { color: var(--muted); font-size: 15px; margin: 0; }
.role-col li { list-style: none; padding: 8px 0; border-top: 1px solid var(--line); }
.role-col ul { margin: 0; padding: 0; }
.role-col small { display: block; color: var(--muted); }

.invite {
  display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 28px; align-items: center;
  background: var(--red); color: #fff8f2; padding: 36px; margin: 10px 0 40px;
}
.invite h2 { margin: 0 0 8px; font-size: 34px; color: white; }
.invite p { color: rgba(255, 248, 242, 0.88); }
.invite .btn { background: #fff8f2; color: var(--red-ink); border-color: #fff8f2; }
.invite .btn:hover { background: transparent; color: white; }
.invite .kicker { color: #f0d7b0; }

.site-footer { background: var(--ink); color: #f6efe8; padding: 36px 0 22px; margin-top: 20px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; }
.site-footer a { color: #f6efe8; }
.foot-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.foot-brand img { width: 64px; height: 64px; object-fit: contain; }
.foot-brand strong { font-family: var(--serif); font-size: 18px; }
.muted-inv { color: rgba(246, 239, 232, 0.72); font-size: 14px; }
.legal { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 22px; padding-top: 12px; font-size: 13px; color: rgba(246, 239, 232, 0.62); }

.page-hero { padding: 36px 0 10px; }
.page-hero h1 { font-size: clamp(34px, 4vw, 48px); margin: 8px 0; }
.page-hero p { color: var(--muted); max-width: 40em; }

.year-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.year-nav a { border: 1px solid var(--line); background: var(--white); color: var(--ink); text-decoration: none; padding: 4px 10px; }
.year-nav a[aria-current="page"], .year-nav a:hover { border-color: var(--red); color: var(--red); }

.timeline { position: relative; margin-top: 12px; margin-bottom: 40px; }
.year-block { margin: 0 0 28px; }
.year-block > h2 {
  font-size: 42px; margin: 8px 0 12px; color: var(--red);
}
.month-label { margin: 18px 0 8px 108px; font-size: 14px; letter-spacing: 0.16em; color: var(--muted); }
.t-item { display: grid; grid-template-columns: 88px 20px 1fr; gap: 0 12px; margin: 0 0 16px; }
.t-item time { text-align: right; font-family: var(--serif); font-size: 20px; padding-top: 16px; }
.rail { position: relative; }
.rail::before {
  content: ""; position: absolute; left: 50%; top: 0; bottom: -16px; width: 1px; background: #e2c8c2; transform: translateX(-50%);
}
.rail i {
  position: absolute; left: 50%; top: 24px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--red); transform: translateX(-50%);
}
.t-card { background: var(--white); border: 1px solid var(--line); display: grid; grid-template-columns: 210px 1fr; text-decoration: none; color: inherit; }
.t-card:hover { border-color: #c9a099; }
.t-card .ph { background: var(--paper-2); aspect-ratio: 3/4; overflow: hidden; }
.t-card img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.t-card .txt { padding: 14px 16px; }
.t-card h3 { margin: 4px 0 6px; font-size: 22px; }
.t-card p { color: var(--muted); margin: 0; }

.article { padding-bottom: 48px; }
.article-head { padding: 28px 0 12px; }
.article-head h1 { font-size: clamp(32px, 4vw, 46px); margin: 8px 0; }
.cover-wide { margin: 8px 0 18px; }
.cover-wide img { width: 100%; height: auto; object-fit: contain; }
.prose { font-size: 17.5px; }
.prose p { margin: 0 0 1em; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 16px 0; }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; }
.gallery img { width: 100%; height: 180px; object-fit: cover; }
.video-block { margin: 14px 0 22px; }
.video-block video, .video-block iframe { width: 100%; aspect-ratio: 16/9; background: #111; border: 0; }
.caption { color: var(--muted); font-size: 14px; margin-top: 4px; }

.lightbox {
  position: fixed; inset: 0; background: rgba(20, 10, 10, 0.86); display: none;
  align-items: center; justify-content: center; z-index: 80; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(1100px, 100%); max-height: 88vh; }
.lightbox button { position: absolute; top: 16px; right: 16px; background: transparent; color: white; border: 0; font-size: 28px; cursor: pointer; }

.org-board { padding-bottom: 48px; display: flex; flex-direction: column; align-items: center; }
.org-level { width: 100%; display: flex; flex-direction: column; align-items: center; }
.org-level h2 { margin: 0 0 8px; font-size: 15px; letter-spacing: 0.22em; color: var(--red); font-weight: 600; font-family: var(--sans); }
.org-stem { width: 1px; height: 28px; background: var(--red); }
.org-row { list-style: none; display: flex; justify-content: center; flex-wrap: nowrap; gap: 0; padding: 0; margin: 0; width: 100%; }
.org-row li { position: relative; padding: 18px 10px 0; flex: 0 1 210px; max-width: 230px; }
.org-row li::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 18px; background: var(--red);
}
.org-row li::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--red);
}
.org-row li:first-child::after { left: 50%; }
.org-row li:last-child::after { right: 50%; }
.org-row li:only-child::after { display: none; }
.org-grid {
  width: min(960px, 100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.org-grid .person { width: min(220px, 100%); }
.person {
  background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--red);
  text-align: center; padding: 16px 12px 14px; height: 100%;
}
.avatar {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 8px; overflow: hidden;
  background: var(--red); color: #fff8f2; display: grid; place-items: center;
  font-family: var(--serif); font-size: 30px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person h3 { margin: 0; font-size: 20px; }
.person .duty { color: var(--muted); font-size: 14px; min-height: 1.4em; }
.person .org { color: var(--ink); font-size: 13px; }
.empty-note { color: var(--muted); padding: 12px; }

.split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 28px; align-items: start; }
.panel { background: var(--white); border: 1px solid var(--line); padding: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }
.field span { font-size: 14px; letter-spacing: 0.04em; }
.req::after { content: " *"; color: var(--red); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="url"], select, textarea {
  width: 100%; background: #fff; border: 1px solid var(--line); padding: 9px 10px; border-radius: 0;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(158, 33, 33, 0.25); border-color: var(--red); }
.check { display: flex; gap: 8px; align-items: center; }
.errors { background: var(--red-soft); border: 1px solid #e3b8b2; padding: 10px 12px; margin-bottom: 12px; }
.errors li { margin-left: 1em; }
.flash { background: #eef5f2; border: 1px solid #b7d2c8; padding: 10px 12px; margin: 12px 0; }
.flash.warn { background: var(--red-soft); border-color: #e3b8b2; }

.stat-grid { display: grid; grid-template-columns: 280px 1fr; gap: 18px; margin-top: 8px; }
.donut {
  width: 160px; height: 160px; border-radius: 50%; margin: 8px auto;
  background: conic-gradient(var(--red) calc(var(--p) * 1%), #eadfd6 0);
  display: grid; place-items: center;
}
.donut span {
  width: 108px; height: 108px; border-radius: 50%; background: var(--white);
  display: grid; place-items: center; text-align: center; font-family: var(--serif); line-height: 1.15;
}
.donut b { font-size: 28px; color: var(--red); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(96px, 168px) 1fr auto; gap: 8px; align-items: center; font-size: 14px; }
.ph-date {
  min-height: 140px; height: 100%;
  display: grid; place-items: center;
  background: linear-gradient(160deg, var(--red), var(--red-deep));
  color: #fff8f2; font-family: var(--serif); letter-spacing: 0.08em;
}
.bar { height: 8px; background: #eadfd6; }
.bar i { display: block; height: 100%; background: var(--red); }
.bar.sea i { background: var(--sea); }
.chart-card { background: var(--white); border: 1px solid var(--line); padding: 16px; margin-bottom: 14px; }
.chart-card h3 { margin: 0 0 10px; font-size: 18px; }
.two-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.admin-sub { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 0 0; }
.admin-sub a { text-decoration: none; color: var(--ink); letter-spacing: 0.06em; font-size: 14px; }
.admin-sub a[aria-current="page"] { color: var(--red); }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: #faf6f2; letter-spacing: 0.04em; }
.badge { display: inline-block; border: 1px solid var(--line); padding: 0 6px; font-size: 12px; letter-spacing: 0.06em; }
.badge.on { color: var(--sea); border-color: #b7d0d4; background: var(--sea-soft); }
.badge.off { color: var(--muted); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.media-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.media-list label { display: flex; gap: 8px; align-items: center; }
.thumb { width: 72px; height: 48px; object-fit: cover; background: var(--paper-2); }
.login-box { width: min(440px, calc(100% - 32px)); margin: 48px auto; background: var(--white); border: 1px solid var(--line); padding: 24px; }
.dash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dash-card { display: block; background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--red); padding: 16px; text-decoration: none; color: inherit; }
.dash-card b { font-family: var(--serif); font-size: 32px; color: var(--red); }
.help { color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .site-header { padding-top: env(safe-area-inset-top); }
  .hero, .cards, .role-cols, .invite, .split, .stat-grid, .two-charts, .foot-grid, .dash-grid { grid-template-columns: 1fr; }
  .hero { padding: 28px 0 8px; gap: 4px; }
  .hero-seal { padding: 4px 0 0; }
  .hero-seal img { width: min(220px, 68vw); }
  .lede { font-size: 16.5px; }
  .section { padding: 28px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-head h2 { font-size: 28px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 16px 12px; }
  .stat b { font-size: 30px; }
  .stat + .stat { border-left: 0; }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .t-card { grid-template-columns: 1fr; }
  .month-label { margin-left: 0; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px;
  }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 3px solid var(--red);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 6px 8px 10px; box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .org-row { flex-wrap: wrap; gap: 12px; }
  .org-row li::after, .org-row li::before { display: none; }
  .org-row li { padding: 0; flex: 1 1 150px; max-width: calc(50% - 8px); }
  .org-row li:only-child { flex-basis: 220px; max-width: 220px; }
  .org-grid { gap: 12px; }
  .org-grid .person { width: min(220px, calc(50% - 8px)); }
  .bar-row { grid-template-columns: minmax(72px, 34%) 1fr auto; }
  .invite { padding: 22px; margin: 8px 0 28px; }
  .invite h2 { font-size: 28px; }
  .invite .btn, .panel .actions .btn { width: 100%; }
  .year-nav a { padding: 8px 14px; }
  .page-hero { padding: 24px 0 8px; }
  .foot-grid { gap: 18px; }
  .site-footer { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .wrap, .wrap-narrow { width: min(var(--max), calc(100% - 28px)); }
  .t-item { display: block; margin-bottom: 14px; }
  .t-item time, .t-item .rail { display: none; }
  .site-header .bar { min-height: 72px; gap: 10px; }
  .brand { gap: 8px; min-width: 0; }
  .brand img { width: 63px; height: 63px; }
  .brand strong { font-size: 15px; letter-spacing: 0; line-height: 1.25; }
  .brand em { display: none; }
  .year-block > h2 { font-size: 32px; }
  .panel { padding: 16px; }
  .check { align-items: flex-start; }
  .check input { width: 1.15em; height: 1.15em; margin-top: 0.35em; flex: none; }
  .login-box { margin: 24px auto; padding: 18px; }
  .actions .btn { min-height: 44px; }
}

.share-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--red);
  padding: 20px 22px 18px;
  margin: 8px auto 22px;
}
.share-panel h2 { margin: 4px 0 8px; font-size: 28px; }
.share-panel > p { color: var(--muted); margin: 0 0 14px; max-width: 42em; }
.share-wechat-hint {
  background: var(--sea-soft);
  border: 1px solid #b7d0d4;
  color: var(--sea);
  padding: 10px 12px;
  margin: 0 0 14px;
}
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 6px 12px 6px 6px;
  background: var(--white); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; cursor: pointer;
}
.share-btn:hover { border-color: var(--red); color: var(--red-deep); }
.share-btn svg { width: 32px; height: 32px; flex: none; display: block; }
.share-link-field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.share-link-field span { font-size: 14px; letter-spacing: 0.04em; }
.share-link {
  width: 100%; background: #fff; border: 1px solid var(--line); padding: 9px 10px;
}
textarea.share-link { min-height: 78px; resize: none; line-height: 1.55; }
.share-note { min-height: 1.4em; margin: 10px 0 0; color: var(--sea); font-size: 14px; }
.share-dialog {
  border: 1px solid var(--line); padding: 0; background: var(--white); color: var(--ink);
  width: min(420px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto;
}
.share-dialog::backdrop { background: rgba(36, 24, 22, 0.45); }
.share-dialog form { padding: 20px; }
.share-dialog h3 { margin: 0 0 10px; font-family: var(--serif); font-size: 26px; }
.share-dialog p { color: var(--muted); }
.share-qr-wrap { display: grid; place-items: center; margin: 4px 0 12px; }
.share-qr { width: 220px; height: 220px; background: #fffdfb; }
.share-btn[hidden], .share-dialog .btn[hidden], .share-qr-wrap[hidden], .share-wechat-hint[hidden] { display: none; }
.share-dialog .actions { margin-top: 8px; }
@media (max-width: 640px) {
  .share-panel { padding: 16px; }
  .share-panel h2 { font-size: 24px; }
  .share-btn { flex: 1 1 calc(50% - 10px); justify-content: flex-start; }
  .share-dialog .actions .btn { width: 100%; }
}
