:root {
  --gold: #f5ce78;
  --gold-light: #fff0ce;
  --gold-dark: #675224;
  --ink: #20312d;
  --muted: #667972;
  --line: #dce8e3;
  --cream: #fffaf0;
  --danger: #a9352f;
  --shadow: 0 18px 55px rgba(103, 82, 36, .13);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f8fbfa;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: linear-gradient(180deg, #fbfdfc 0%, #f4f8f6 100%); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.shell { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 100; padding: .7rem 1rem; background: #fff; border-radius: 8px; box-shadow: var(--shadow); }
.skip-link:focus { top: 1rem; }

.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid rgba(216, 230, 225, .85); background: rgba(255, 255, 255, .9); backdrop-filter: blur(14px); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 800; color: var(--gold-dark); }
.brand-mark { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; color: var(--gold-dark); background: var(--gold); }
.site-nav { display: flex; align-items: center; gap: .2rem; }
.site-nav a { padding: .55rem .8rem; border-radius: 999px; color: #526862; text-decoration: none; font-size: .95rem; font-weight: 650; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold-dark); background: var(--gold-light); }

.page-section { padding: clamp(1.2rem, 4vw, 2.4rem) 0 4rem; }
.teacher-hero { position: relative; min-height: 470px; display: grid; place-items: center; overflow: hidden; border-radius: 30px; text-align: center; background: var(--gold); box-shadow: var(--shadow); }
.hero-content { position: relative; z-index: 2; padding: 4.5rem 1.25rem; }
.hero-watermark { position: absolute; right: -2rem; top: -3.5rem; color: rgba(103, 82, 36, .1); font-size: clamp(9rem, 25vw, 17rem); font-weight: 900; transform: rotate(12deg); user-select: none; }
.hero-kicker, .eyebrow { margin: 0; color: var(--gold-dark); font-size: .82rem; font-weight: 850; letter-spacing: .2em; }
.teacher-hero h1 { margin: .75rem 0; color: #fff; font-size: clamp(2.65rem, 9vw, 5.7rem); line-height: 1.12; letter-spacing: .02em; }
.hero-subtitle { margin: 0; color: #fffaf0; font-size: clamp(1rem, 3vw, 1.3rem); }
.hero-actions, .wall-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 1.8rem; }
.hero-motto { position: absolute; left: 100%; bottom: 1.6rem; z-index: 1; white-space: nowrap; color: rgba(103, 82, 36, .34); font-size: clamp(1.45rem, 4vw, 3rem); font-weight: 700; transform: rotate(-8deg); animation: motto-scroll 18s linear infinite; }
@keyframes motto-scroll { from { transform: translateX(0) rotate(-8deg); } to { transform: translateX(-255%) rotate(-8deg); } }

.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: .35rem; border: 1px solid transparent; border-radius: 999px; padding: .72rem 1.2rem; text-decoration: none; font-weight: 760; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(103, 82, 36, .35); outline-offset: 2px; }
.button-light { color: var(--gold-dark); background: #fff; box-shadow: 0 8px 18px rgba(103, 82, 36, .12); }
.button-quiet { color: #fff; border-color: rgba(255,255,255,.62); background: rgba(255,255,255,.12); }
.button-primary { color: #fff; background: linear-gradient(135deg, #176b5b, #0f5145); }
.button-secondary { color: var(--gold-dark); border-color: #cddbd6; background: #fff; }
.button-outline { color: #fff; border-color: rgba(255,255,255,.6); background: transparent; }
.button-danger { color: #fff; background: var(--danger); }
.button:disabled { opacity: .6; cursor: wait; transform: none; }

.home-intro, .form-heading { max-width: 740px; margin: 4.2rem auto 1.8rem; text-align: center; }
.home-intro h2, .form-heading h1 { margin: .45rem 0 .6rem; color: var(--gold-dark); font-size: clamp(1.9rem, 5vw, 2.75rem); }
.home-intro > p:last-child, .form-heading > p:last-child { margin: 0; color: var(--muted); }
.blessing-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.blessing-card { position: relative; min-height: 220px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; overflow: hidden; padding: 1.5rem; border-radius: 22px; color: #fff; text-decoration: none; box-shadow: 0 12px 32px rgba(23, 107, 91, .17); transition: transform .2s ease, box-shadow .2s ease; }
.blessing-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(23, 107, 91, .23); }
.card-text { background: linear-gradient(145deg, #26816f, #176b5b); }
.card-image { background: linear-gradient(145deg, #d9a441, #a66f1d); }
.card-video { background: linear-gradient(145deg, #547487, #294d60); }
.card-icon { position: absolute; top: 1rem; right: 1.1rem; font-size: 4rem; opacity: .25; }
.blessing-card h3 { margin: 0 0 .35rem; font-size: 1.45rem; }
.blessing-card p { margin: 0; color: rgba(255,255,255,.84); }
.card-arrow { margin-top: .9rem; font-weight: 800; }
.cohort-band { margin-top: 4rem; padding: 2rem; border: 1px solid #d8e6e1; border-radius: 24px; text-align: center; background: rgba(255,255,255,.83); }
.cohort-band h2 { margin: .45rem 0 1.2rem; color: var(--gold-dark); font-size: clamp(1.45rem, 4vw, 2rem); }
.cohort-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.cohort-chip { padding: .55rem .9rem; border-radius: 999px; color: var(--gold-dark); background: var(--gold-light); font-weight: 680; }
.text-link { display: inline-block; margin-top: 1.3rem; color: var(--gold-dark); font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.wall-hero { position: relative; overflow: hidden; border-radius: 28px; padding: clamp(2.2rem, 7vw, 4.5rem) 1rem; color: #fff; text-align: center; background: var(--gold); box-shadow: var(--shadow); }
.wall-hero > *:not(.wall-watermark) { position: relative; z-index: 1; }
.wall-hero h1 { margin: .45rem 0 .65rem; font-size: clamp(2.25rem, 8vw, 4.6rem); }
.wall-hero p:not(.eyebrow) { margin: 0; color: #fffaf0; }
.wall-watermark { position: absolute; color: rgba(103,82,36,.13); font-size: 9rem; font-weight: 900; user-select: none; }
.wall-watermark-left { left: 4%; top: -2.5rem; transform: rotate(-10deg); }
.wall-watermark-right { right: 4%; bottom: -3rem; transform: rotate(10deg); }
.wall-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-top: 1.2rem; }
.cohort-nav { display: flex; min-width: 0; gap: .55rem; overflow-x: auto; padding: .2rem 0 .4rem; scrollbar-width: thin; }
.cohort-nav a { flex: 0 0 auto; padding: .62rem .9rem; border: 1px solid #d4e2dd; border-radius: 999px; color: var(--gold-dark); background: #fff; text-decoration: none; font-size: .9rem; font-weight: 650; }
.cohort-nav a:hover, .cohort-nav a[aria-current="true"] { background: var(--gold-light); }
.filter-control { display: inline-flex; flex: 0 0 auto; align-items: center; gap: .4rem; color: var(--muted); font-size: .88rem; }
.filter-control select { padding: .55rem .7rem; border: 1px solid #d4e2dd; border-radius: 10px; color: var(--ink); background: #fff; }
.status { min-height: 1.3rem; margin: .8rem 0; color: var(--muted); font-size: .9rem; }
.status.error { color: var(--danger); }
.wall-content { min-height: 160px; }
.cohort-section { scroll-margin-top: 90px; padding: 1.8rem 0 .8rem; }
.cohort-title { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.cohort-title h2 { margin: 0; color: var(--gold-dark); font-size: clamp(1.45rem, 5vw, 2.1rem); }
.cohort-count { padding: .25rem .65rem; border-radius: 999px; color: #8a6a2c; background: var(--gold-light); font-size: .82rem; font-weight: 700; }
.cohort-rule { flex: 1; height: 1px; background: linear-gradient(90deg, #c9dcd5, transparent); }
.entries-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.entry-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid #e0ebe7; border-radius: 20px; background: #fff; box-shadow: 0 8px 28px rgba(22, 83, 70, .08); }
.entry-media { background: #10241f; }
.entry-media img, .entry-media video { display: block; width: 100%; height: 260px; object-fit: contain; }
.entry-media img { cursor: zoom-in; }
.entry-body { display: flex; flex: 1; flex-direction: column; padding: 1.2rem; }
.entry-meta { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.entry-name { color: var(--gold-dark); font-size: 1.15rem; font-weight: 760; }
.entry-date { flex: 0 0 auto; color: #87968f; font-size: .78rem; }
.entry-message { margin-top: .7rem; color: #3e514b; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.media-badge { align-self: flex-start; margin-top: auto; padding-top: 1rem; color: #8a6a2c; font-size: .8rem; }
.empty-cohort { padding: 1.7rem; border: 1px dashed #b9cec7; border-radius: 18px; color: #73857f; text-align: center; background: #f8fbfa; }
.empty-cohort a { color: var(--gold-dark); font-weight: 700; }
.image-modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 2rem; background: rgba(6, 20, 16, .94); }
.image-modal.is-open { display: flex; }
.image-modal img { max-width: 95vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }
.image-modal button { position: absolute; top: 1rem; right: 1.2rem; border: 0; color: #fff; background: transparent; font-size: 2.5rem; line-height: 1; }

.form-heading.compact { margin-top: 1rem; }
.blessing-form, .admin-auth { max-width: 760px; margin: 0 auto; padding: clamp(1.25rem, 5vw, 2.5rem); border: 1px solid #e4eee9; border-radius: 24px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.form-section { margin-bottom: 1.7rem; }
.blessing-form label, .blessing-form legend, .admin-auth label { display: block; margin-bottom: .7rem; color: var(--ink); font-weight: 720; }
.required { color: #bf3d36; }
.blessing-form input[type="text"], .blessing-form select, .blessing-form textarea, .admin-auth input { width: 100%; padding: .86rem 1rem; border: 1px solid #cddbd6; border-radius: 12px; color: var(--ink); background: #fbfdfc; }
.blessing-form textarea { resize: vertical; min-height: 130px; }
.blessing-form input:focus, .blessing-form select:focus, .blessing-form textarea:focus, .admin-auth input:focus { outline: 3px solid rgba(103,82,36,.15); border-color: var(--gold-dark); }
.help-text { margin: .5rem 0 0; color: #71827d; font-size: .86rem; }
fieldset { min-width: 0; padding: 0; border: 0; }
.media-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.media-choice { position: relative; display: flex !important; min-height: 74px; align-items: center; justify-content: center; gap: .35rem; margin: 0 !important; padding: .75rem .5rem; border: 2px solid #d8e5e0; border-radius: 14px; color: #526862 !important; cursor: pointer; background: #fff; text-align: center; transition: .2s ease; }
.media-choice:has(input:checked) { border-color: var(--gold-dark); color: var(--gold-dark) !important; background: var(--gold-light); box-shadow: 0 7px 20px rgba(103,82,36,.1); }
.media-choice input { position: absolute; opacity: 0; pointer-events: none; }
.media-icon { font-size: 1.55rem; }
.file-drop { display: block; padding: 1.8rem 1rem; border: 2px dashed #9cbdb3; border-radius: 16px; color: #176b5b !important; cursor: pointer; background: #f4fbf8; text-align: center; }
.file-drop:hover { border-color: var(--gold-dark); background: var(--cream); }
.file-drop strong, .file-drop small { display: block; }
.file-drop small { margin-top: .35rem; color: #778a84; }
.selected-file { min-height: 1.2rem; margin: .65rem 0 0; color: #526862; font-size: .9rem; overflow-wrap: anywhere; }
.media-preview { margin-top: 1rem; }
.media-preview img, .media-preview video { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: 14px; background: #10201c; }
.form-error { margin-bottom: 1.4rem; padding: .9rem 1rem; border: 1px solid #ffc7c4; border-radius: 12px; color: #8d211e; background: #fff0ef; }
.form-actions { display: flex; gap: .8rem; }
.form-actions .button { flex: 1; }

.admin-auth { max-width: 760px; }
.admin-key-row { display: flex; gap: .7rem; }
.admin-key-row input { flex: 1; }
.admin-toolbar { display: flex; align-items: center; gap: .7rem; margin: 1.2rem 0; }
.admin-toolbar .status { flex: 1; margin: 0; }
.share-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; padding: 1rem 1.2rem; border: 1px solid #eadcb6; border-radius: 16px; background: var(--cream); }
.share-card p { margin: .35rem 0 0; color: var(--muted); font-size: .86rem; }
.admin-entries { display: grid; gap: .7rem; }
.admin-entry { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.admin-entry.is-hidden { opacity: .58; }
.admin-entry h3 { margin: 0; color: var(--gold-dark); font-size: 1rem; }
.admin-entry p { margin: .35rem 0 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-entry .admin-media a { color: var(--gold-dark); font-weight: 700; text-decoration: underline; }
.admin-entry-meta { color: #87968f; font-size: .8rem; }
.admin-entry-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .45rem; }
.admin-entry-actions button { padding: .48rem .7rem; border: 1px solid #cddbd6; border-radius: 9px; color: var(--gold-dark); background: #fff; font-size: .82rem; }
.admin-entry-actions .danger { color: var(--danger); border-color: #e9b3af; }

.site-footer { border-top: 1px solid #dce8e3; color: #73857f; background: #fff; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem; padding: 1.2rem 0; font-size: .8rem; }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; max-width: min(360px, calc(100% - 2rem)); padding: .85rem 1rem; border-radius: 12px; color: #fff; background: #20312d; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }

@media (max-width: 720px) {
  .header-inner { min-height: 60px; }
  .brand { font-size: .92rem; }
  .site-nav a { padding-inline: .55rem; font-size: .88rem; }
  .teacher-hero { min-height: 410px; border-radius: 22px; }
  .blessing-actions { grid-template-columns: 1fr; }
  .blessing-card { min-height: 170px; }
  .wall-toolbar { align-items: stretch; flex-direction: column; }
  .filter-control { justify-content: end; }
  .share-card { align-items: stretch; flex-direction: column; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 1rem, 1120px); }
  .media-options { grid-template-columns: 1fr; }
  .media-choice { min-height: 58px; flex-direction: row; }
  .form-actions, .admin-key-row { flex-direction: column; }
  .admin-entry { grid-template-columns: 1fr; }
  .admin-entry-actions { justify-content: start; }
  .entry-media img, .entry-media video { height: 220px; }
  .footer-inner { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
