:root {
  --paper: #fffdf6;
  --ink: #1e1b16;
  --muted: #70685c;
  --line: #d7c9a8;
  --gold: #d69b2d;
  --green: #446f45;
  --red: #a84732;
  --blue: #336c8d;
  --soft-green: #eef6e9;
  --soft-gold: #fff0c7;
  --shadow: 0 18px 42px rgba(70, 55, 25, .16);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(90deg, rgba(68,111,69,.08), transparent 18%, transparent 82%, rgba(168,71,50,.08)), #f7f2e6;
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Heiti TC", "PMingLiU", sans-serif;
}
a { color: #8b2f22; }
button, input { font: inherit; }
.site-shell {
  width: min(960px, calc(100% - 24px));
  margin: 12px auto 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.masthead { border-bottom: 8px solid #e5bc61; }
.date-strip {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  padding: 8px 18px; color: var(--muted); background: #fff8df;
  border-bottom: 1px solid var(--line); font-size: .95rem;
}
.brand-banner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 150px; padding: 24px 32px; color: #fffaf0;
  background: radial-gradient(circle at 85% 30%, rgba(255,235,164,.42), transparent 23%), linear-gradient(120deg, rgba(68,111,69,.95), rgba(51,108,141,.92) 48%, rgba(168,71,50,.9));
}
.brand-banner h1 { margin: 4px 0 8px; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: 0; }
.brand-banner h1 a { color: inherit; text-decoration: none; }
.brand-banner h1 a:hover, .brand-banner h1 a:focus-visible { text-decoration: underline; }
.brand-banner p { margin: 0; }
.eyebrow, .label { color: inherit; font-size: .86rem; letter-spacing: .04em; text-transform: uppercase; }
.seal {
  display: grid; place-items: center; width: 110px; aspect-ratio: 1;
  border: 5px double rgba(255,255,255,.78); border-radius: 50%;
  color: #fff9db; font-size: 2.1rem; font-weight: 700;
}
.mobile-toggle { display: none; width: 100%; padding: 12px; border: 0; color: #fff; background: var(--green); cursor: pointer; }
.utility-nav {
  display: flex; flex-wrap: wrap; gap: 0; padding: 0 16px; background: #fff8df;
  border-bottom: 1px solid var(--line);
}
.utility-nav button {
  padding: 8px 12px; border: 0; border-right: 1px solid var(--line); color: #5d4720;
  background: transparent; cursor: pointer; font-size: .9rem;
}
.utility-nav button:hover, .utility-nav button:focus-visible, .utility-nav button.active { color: var(--red); background: #fff1bf; }
.top-nav { display: grid; grid-template-columns: repeat(6, 1fr); background: linear-gradient(#fff7c7, #e7c05a); }
.top-nav button {
  min-height: 44px; padding: 10px 6px; border: 0; border-right: 1px solid rgba(105,77,22,.32);
  color: #4a2c08; background: transparent; cursor: pointer;
}
.top-nav button:hover, .top-nav button:focus-visible, .top-nav button.active { background: rgba(255,255,255,.62); color: #7d3026; }
.layout { display: grid; grid-template-columns: 180px 1fr; gap: 18px; padding: 18px; }
.side-rail {
  position: sticky; top: 12px; align-self: start; min-height: 620px; padding: 14px;
  background: linear-gradient(180deg, rgba(68,111,69,.14), rgba(214,155,45,.12)), repeating-linear-gradient(135deg, transparent 0 16px, rgba(255,255,255,.55) 17px 18px);
  border: 1px solid var(--line);
}
.side-title { margin: 0 0 12px; color: var(--green); font-weight: 700; }
.sitemap-link {
  display: block; margin: 0 0 10px; padding: 9px 8px; color: #fff; background: var(--red);
  text-decoration: none; text-align: center;
}
.sitemap-link:hover, .sitemap-link:focus-visible { background: #7d3026; }
.side-links { display: grid; gap: 2px; }
.side-links button {
  display: block; width: 100%; padding: 9px 8px; color: var(--ink); text-align: left;
  background: transparent; border: 0; border-bottom: 1px dashed rgba(112,104,92,.38); cursor: pointer;
}
.side-links button:hover, .side-links button:focus-visible, .side-links button.active { color: var(--red); background: rgba(255,255,255,.68); }
.content { display: grid; gap: 18px; min-width: 0; }
.notice, .sitemap-panel, .article-shell { border: 1px solid var(--line); background: #fffefa; }
.notice { display: flex; gap: 16px; justify-content: space-between; padding: 18px; border-left: 8px solid var(--red); }
.notice h2, .sitemap-card h3, .article-content h2 { margin: 0 0 8px; color: #2f5f39; font-size: 1.45rem; }
.notice p, .article-content p { margin: 0 0 10px; line-height: 1.72; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.search-label { color: var(--muted); }
#siteSearch { min-height: 38px; width: min(260px, 100%); padding: 8px 10px; border: 1px solid var(--line); background: #fff; }
.sitemap-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px; }
.home-page .sitemap-panel { display: none; }
.home-page .quick-actions { display: none; }
.sitemap-page .layout { display: block; }
.sitemap-page .side-rail, .sitemap-page .notice, .sitemap-page .article-shell { display: none; }
.sitemap-page .sitemap-panel { margin: 18px; }
.sitemap-card { padding: 12px; background: #fff8e4; border: 1px solid var(--line); }
.sitemap-card h3 { font-size: 1.06rem; }
.sitemap-card button { display: inline-block; margin: 0 7px 7px 0; padding: 0; border: 0; color: #703126; background: transparent; text-decoration: underline; cursor: pointer; }
.article-shell { padding: 18px; }
.article-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 13px;
  border: 1px solid #b99a4b; color: #4a2c08; background: linear-gradient(#fff8d6, #eac865); text-decoration: none;
}
.article-content { line-height: 1.78; }
.article-content h2 { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.xiang-lesson-page { max-width: 880px; margin: 0 auto; color: #111; font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif; }
.xiang-title { width: fit-content; max-width: 100%; margin: 8px auto 34px; padding: 9px 42px; color: #5d0a0a; background: #ff7171; border: 3px double #8e6262; box-shadow: inset 0 0 0 4px #ff7171; font-size: 2.2rem; font-weight: 800; letter-spacing: 0; text-align: center; }
.xiang-divider { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; color: #ee7f23; font-size: 1.1rem; font-weight: 700; letter-spacing: .45em; text-align: center; }
.xiang-divider::before, .xiang-divider::after { content: ""; flex: 1; height: 14px; border-top: 2px solid #aaa; border-bottom: 2px solid #aaa; background: repeating-linear-gradient(90deg, transparent 0 12px, #aaa 12px 14px, transparent 14px 24px); }
.xiang-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 280px); gap: 28px; align-items: center; min-height: 190px; padding: 20px 34px; border-bottom: 1px solid #d4d4d4; }
.xiang-step-copy h3, .xiang-notes h3 { margin: 0 0 14px; color: #0645e4; font-size: 1.25rem; text-align: center; }
.xiang-step-copy p { margin: 0; color: #171717; font-size: 1.04rem; line-height: 1.9; }
.xiang-step-copy .xiang-step-note { margin-top: 12px; color: #7d1f1f; font-weight: 700; }
.xiang-step img { justify-self: center; display: block; max-width: 100%; max-height: 360px; object-fit: contain; }
.xiang-prose { white-space: pre-wrap; overflow-wrap: anywhere; padding: 20px 34px 34px; color: #171717; line-height: 2; }
.xiang-notes { margin-top: 12px; padding-top: 20px; border-top: 1px solid #d4d4d4; }
.xiang-visual-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; align-items: center; justify-items: center; padding: 12px 34px 34px; }
.xiang-visual-grid img { display: block; max-width: 100%; height: auto; }
.xiang-degas-grid { grid-template-columns: repeat(4, minmax(0, 120px)); justify-content: center; }
.xiang-water-grid { grid-template-columns: repeat(2, minmax(0, 150px)); justify-content: center; }
.xiang-intro-grid { grid-template-columns: repeat(2, minmax(0, 100px)); justify-content: space-between; max-width: 680px; margin: 0 auto; }
.article-text {
  max-height: none; white-space: pre-wrap; overflow-wrap: anywhere;
  padding: 14px; background: var(--soft-gold); border: 1px dashed #c8a64e;
}
.article-media { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.article-media a { display: block; border: 1px solid var(--line); background: #fff; }
.article-media img { display: block; width: 100%; height: auto; }
.article-media.image-aside-right { float: right; width: min(42%, 320px); margin: 0 0 14px 18px; grid-template-columns: 1fr; }
.article-media.image-stack-left { float: left; width: min(42%, 270px); margin: 0 18px 14px 0; grid-template-columns: 1fr; }
.article-media.image-pair { float: left; width: min(42%, 240px); margin: 0 18px 14px 0; grid-template-columns: repeat(2, 1fr); align-items: start; }
.article-media.image-pair img { max-height: 122px; object-fit: contain; }
.article-media.image-centered { grid-template-columns: minmax(0, 400px); justify-content: center; }
.article-media.image-gallery-two { grid-template-columns: repeat(2, minmax(0, 160px)); justify-content: space-between; }
.article-media.image-gallery-five { grid-template-columns: repeat(5, minmax(0, 160px)); justify-content: center; }
.article-media.image-history { grid-template-columns: repeat(6, minmax(100px, 130px)); justify-content: start; }
.article-media.image-history a:nth-child(9) { grid-column: 1 / -1; max-width: 768px; }
.article-media.image-history a:nth-child(10) { grid-column: 2 / span 3; max-width: 400px; }
.article-media.image-donation { grid-template-columns: minmax(0, 640px); justify-content: center; }
mark { background: #ffe08a; color: inherit; }
.empty { padding: 18px; color: var(--muted); }
.footer { padding: 20px; color: var(--muted); text-align: center; background: #fff8df; border-top: 1px solid var(--line); }
.footer p { margin: 4px 0; }
.back-top {
  position: fixed; right: 18px; bottom: 18px; width: 42px; height: 42px;
  border: 1px solid var(--line); color: var(--ink); background: #fff8df; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.back-top.show { opacity: 1; pointer-events: auto; }
@media (max-width: 760px) {
  .site-shell { width: calc(100% - 12px); margin-top: 6px; }
  .brand-banner { min-height: 132px; padding: 20px; }
  .seal { display: none; }
  .mobile-toggle { display: block; }
  .utility-nav { padding: 0; }
  .top-nav { display: none; grid-template-columns: 1fr 1fr; }
  .top-nav.open { display: grid; }
  .layout { grid-template-columns: 1fr; padding: 12px; }
  .side-rail { position: static; min-height: 0; }
  .notice { flex-direction: column; }
  .quick-actions { justify-content: flex-start; }
  .sitemap-panel { grid-template-columns: 1fr; }
  .article-media.image-aside-right, .article-media.image-stack-left, .article-media.image-pair { float: none; width: 100%; margin: 14px 0; }
  .article-media.image-gallery-five { grid-template-columns: repeat(2, minmax(0, 160px)); justify-content: start; }
  .article-media.image-history { grid-template-columns: repeat(2, minmax(0, 130px)); }
  .article-media.image-history a:nth-child(10) { grid-column: 1 / -1; }
  .xiang-title { margin-bottom: 24px; padding: 8px 22px; font-size: 1.7rem; }
  .xiang-divider { gap: 10px; font-size: 1rem; }
  .xiang-step { grid-template-columns: 1fr; gap: 12px; padding: 20px 12px; }
  .xiang-step img { grid-row: 1; }
  .xiang-prose { padding: 16px 12px 28px; }
  .xiang-visual-grid { grid-template-columns: repeat(2, minmax(0, 150px)); justify-content: start; padding: 12px; }
  .xiang-degas-grid { grid-template-columns: repeat(2, minmax(0, 120px)); justify-content: center; }
  .xiang-intro-grid { grid-template-columns: repeat(2, minmax(0, 90px)); justify-content: space-between; }
  .article-tools { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 420px) {
  .date-strip, .brand-banner, .notice, .sitemap-panel, .article-shell { padding-left: 12px; padding-right: 12px; }
  .top-nav { grid-template-columns: 1fr; }
}
