:root {
  --ink: #173c31;
  --ink-soft: #547267;
  --paper: rgba(250, 255, 250, 0.83);
  --line: rgba(39, 111, 77, 0.16);
  --green-900: #174f3c;
  --green-800: #216447;
  --green-700: #2f8055;
  --green-600: #45a669;
  --green-500: #68bd79;
  --green-300: #a9dba8;
  --green-100: #e8f5e7;
  --warm: #f3bd58;
  --danger: #a74343;
  --shadow: 0 22px 70px rgba(30, 87, 61, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: #eaf6e9;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 9% 6%, rgba(255, 255, 255, 0.94) 0 10%, transparent 29%),
    linear-gradient(145deg, #edf8eb 0%, #ddefdc 48%, #cbe6d4 100%);
}

button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.52; }
input:focus-visible, button:focus-visible { outline: 3px solid rgba(66, 151, 99, 0.28); outline-offset: 3px; }
.is-hidden { display: none !important; }

.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image:
    radial-gradient(circle at center, rgba(255,255,255,.75) 0 1px, transparent 2px),
    radial-gradient(circle at center, rgba(42,120,75,.22) 0 1px, transparent 2px);
  background-size: 58px 58px, 93px 93px;
  background-position: 0 0, 16px 22px;
}
.glow { position: absolute; border-radius: 50%; filter: blur(4px); opacity: .45; animation: drift 13s ease-in-out infinite alternate; }
.glow-a { width: 340px; height: 340px; left: -80px; top: 28%; background: rgba(123,194,126,.28); }
.glow-b { width: 430px; height: 430px; right: -160px; top: -80px; background: rgba(244,224,138,.27); animation-delay: -4s; }
.glow-c { width: 300px; height: 300px; right: 26%; bottom: -160px; background: rgba(112,182,161,.26); animation-delay: -7s; }
.wind-lines { width: 100%; height: 100%; opacity: .18; }
.wind-lines path { fill: none; stroke: #5f9e78; stroke-width: 1.2; stroke-dasharray: 9 18; animation: dash 18s linear infinite; }

.site-header {
  width: min(1500px, calc(100% - 48px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 30;
}
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 13px; }
.brand strong { display: block; font-size: clamp(20px, 2vw, 28px); letter-spacing: .05em; }
.brand small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 13px; letter-spacing: .08em; }
.leaf-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 64% 36% 64% 36%;
  color: white;
  font-family: serif;
  font-size: 20px;
  background: linear-gradient(145deg, #69b97b, #20704b);
  box-shadow: 0 10px 26px rgba(39,119,75,.22);
  transform: rotate(-6deg);
}
.header-actions { display: flex; gap: 10px; }
.icon-button { border: 1px solid var(--line); background: rgba(255,255,255,.58); color: var(--ink); padding: 10px 15px; border-radius: 999px; backdrop-filter: blur(14px); }

.view { width: min(1500px, calc(100% - 48px)); margin: 0 auto; padding: 30px 0 64px; }
.glass-panel, .entry-card {
  background: var(--paper);
  border: 1px solid rgba(255,255,255,.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.eyebrow { margin: 0 0 10px; color: var(--green-700); font-size: 13px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }

.landing-view { min-height: calc(100vh - 100px); display: grid; grid-template-columns: minmax(360px, .82fr) minmax(650px, 1.18fr); gap: clamp(40px, 7vw, 110px); align-items: center; }
.hero-copy h1 { margin: 0; font-family: "STSong", "Songti SC", serif; font-weight: 600; font-size: clamp(50px, 5.7vw, 92px); line-height: 1.12; letter-spacing: -.035em; }
.hero-copy h1 em { color: var(--green-700); font-style: normal; }
.hero-note { max-width: 610px; margin: 26px 0; font-size: clamp(16px, 1.35vw, 21px); line-height: 1.8; color: var(--ink-soft); }
.principles { display: flex; flex-wrap: wrap; gap: 10px; }
.principles span { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.5); color: var(--green-800); font-size: 13px; }

.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.entry-card { border-radius: var(--radius-xl); padding: clamp(24px, 3vw, 38px); min-height: 470px; position: relative; overflow: hidden; }
.entry-card::after { content: ""; position: absolute; width: 180px; height: 180px; border: 1px solid rgba(46,128,85,.11); border-radius: 64% 36% 64% 36%; right: -52px; top: -58px; transform: rotate(26deg); }
.teacher-entry { background: linear-gradient(155deg, rgba(250,255,250,.92), rgba(226,244,224,.88)); }
.student-entry { background: linear-gradient(155deg, rgba(250,255,250,.9), rgba(211,237,224,.9)); }
.card-kicker { display: inline-flex; padding: 6px 10px; color: var(--green-800); background: rgba(255,255,255,.7); border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.entry-card h2 { margin: 24px 0 10px; font-family: "STSong", "Songti SC", serif; font-size: clamp(26px, 2.25vw, 38px); line-height: 1.3; }
.entry-card > p { margin: 0 0 26px; color: var(--ink-soft); line-height: 1.7; }
.entry-card label { display: block; margin: 16px 0 7px; font-size: 13px; font-weight: 700; }
.entry-card input, .share-link-row input {
  width: 100%;
  height: 50px;
  border: 1px solid rgba(34,103,70,.17);
  border-radius: 14px;
  padding: 0 15px;
  background: rgba(255,255,255,.72);
  color: var(--ink);
}
.code-input { text-transform: uppercase; letter-spacing: .26em; font-weight: 800; font-size: 20px; }
.primary-button, .secondary-button, .danger-button {
  min-height: 52px;
  border-radius: 16px;
  padding: 0 22px;
  border: 1px solid transparent;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.primary-button { color: white; background: linear-gradient(135deg, var(--green-700), var(--green-900)); box-shadow: 0 12px 28px rgba(27,99,64,.2); }
.secondary-button { color: var(--green-900); background: rgba(255,255,255,.72); border-color: rgba(37,111,74,.2); }
.danger-button { color: white; background: var(--danger); }
.primary-button:hover, .secondary-button:hover, .danger-button:hover { transform: translateY(-2px); }
.entry-card .primary-button, .entry-card .secondary-button { width: 100%; margin-top: 24px; }
.text-button, .danger-text-button { border: 0; background: none; color: var(--green-700); padding: 10px 4px; text-decoration: underline; text-underline-offset: 3px; }

.teacher-view { padding-top: 12px; }
.teacher-topbar { min-height: 105px; border-radius: var(--radius-lg); padding: 20px 26px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 28px; }
.teacher-topbar h1 { margin: 0; font-family: "STSong", "Songti SC", serif; font-size: clamp(25px, 2.4vw, 40px); }
.room-share { display: grid; grid-template-columns: auto auto; column-gap: 11px; align-items: center; }
.room-share span { color: var(--ink-soft); font-size: 12px; }
.room-share strong { grid-row: 1 / 3; grid-column: 2; font-size: clamp(26px, 3vw, 44px); letter-spacing: .16em; color: var(--green-900); }
.mini-button { grid-column: 1; border: 0; background: none; color: var(--green-700); padding: 2px; font-size: 12px; }
.status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 999px; color: #16613a; background: #dff3df; border: 1px solid rgba(36,128,71,.14); font-weight: 800; font-size: 13px; white-space: nowrap; }
.status-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3aa55c; box-shadow: 0 0 0 5px rgba(58,165,92,.11); }
.status-chip.paused { color: #8b661d; background: #fff3d2; }
.status-chip.paused::before { background: #d99a2f; box-shadow: 0 0 0 5px rgba(217,154,47,.11); }
.status-chip.ended { color: #7c5555; background: #f4e8e8; }
.status-chip.ended::before { background: #aa6666; box-shadow: 0 0 0 5px rgba(170,102,102,.1); }

.teacher-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 22px; margin-top: 22px; align-items: start; }
.teacher-sidebar { display: grid; gap: 18px; position: sticky; top: 12px; }
.share-panel, .control-panel { border-radius: var(--radius-lg); padding: 20px; }
.qr-wrap { aspect-ratio: 1; width: min(100%, 230px); margin: 0 auto 12px; border-radius: 18px; background: white; display: grid; place-items: center; overflow: hidden; color: var(--ink-soft); font-size: 13px; }
.qr-wrap img { width: 100%; height: 100%; object-fit: contain; }
.share-panel > p { text-align: center; font-weight: 800; margin: 10px 0; }
.share-link-row { display: flex; gap: 7px; }
.share-link-row input { min-width: 0; height: 42px; font-size: 11px; }
.share-link-row button { border: 0; border-radius: 11px; color: white; background: var(--green-800); padding: 0 10px; flex: none; }
.share-panel > small { display: block; margin-top: 12px; color: var(--ink-soft); line-height: 1.55; }
.control-panel h2 { margin: 0 0 14px; font-size: 17px; }
.button-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.control-button { min-height: 43px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.65); color: var(--ink); font-weight: 700; }
.control-button.accent { grid-column: 1 / -1; color: white; background: linear-gradient(135deg, var(--green-700), var(--green-900)); border: 0; min-height: 50px; }
.toggle-row { display: flex; gap: 11px; align-items: center; margin: 18px 0 8px; padding: 13px; border-radius: 14px; background: rgba(230,244,228,.65); }
.toggle-row input { width: 19px; height: 19px; accent-color: var(--green-700); }
.toggle-row span { display: grid; gap: 2px; }
.toggle-row strong { font-size: 13px; }.toggle-row small { color: var(--ink-soft); font-size: 10px; }
.danger-text-button { color: var(--danger); font-size: 12px; display: block; width: 100%; }
.danger-text-button.muted { opacity: .7; margin-top: -5px; }

.teacher-main { min-width: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.stats-grid article { padding: 17px 18px; min-height: 108px; border-radius: 19px; background: rgba(249,255,248,.72); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 12px 30px rgba(42,91,62,.07); display: grid; grid-template-columns: 1fr auto; align-items: center; }
.stats-grid span { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.stats-grid strong { grid-row: 1 / 3; grid-column: 2; font-family: "Georgia", serif; font-size: 38px; color: var(--green-800); }
.stats-grid small { font-size: 10px; color: #81978e; }
.gallery-panel { margin-top: 16px; border-radius: var(--radius-lg); padding: 23px; min-height: 600px; overflow: hidden; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading h1, .section-heading h2 { margin: 0; font-family: "STSong", "Songti SC", serif; }
.section-heading h1 { font-size: clamp(28px, 3vw, 45px); }.section-heading h2 { font-size: clamp(22px, 2vw, 31px); }
.count-badge, .step-badge { color: var(--green-800); background: var(--green-100); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.empty-state { min-height: 430px; display: grid; place-content: center; text-align: center; color: var(--ink-soft); }
.empty-state h3 { color: var(--ink); margin: 18px 0 7px; }.empty-state p { margin: 0; }
.empty-leaf { width: 78px; height: 110px; margin: 0 auto; border-radius: 90% 0 90% 0; background: linear-gradient(145deg, rgba(88,170,105,.22), rgba(34,110,73,.12)); transform: rotate(35deg); position: relative; }
.empty-leaf::after { content: ""; position: absolute; left: 10px; top: 54px; width: 80px; border-top: 2px solid rgba(49,126,77,.22); transform: rotate(-40deg); transform-origin: left; }
.gallery-stage { position: relative; min-height: 480px; margin-top: 20px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 13px; align-content: start; }
.work-card { position: relative; min-width: 0; border-radius: 18px; overflow: hidden; background: white; border: 1px solid rgba(39,111,77,.14); box-shadow: 0 10px 24px rgba(30,85,58,.1); transition: transform .65s cubic-bezier(.2,.8,.2,1), opacity .35s ease, box-shadow .3s ease; }
.work-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(30,85,58,.16); }
.work-card .image-button { display: block; width: 100%; aspect-ratio: 1; border: 0; padding: 0; background: #d8ead9; overflow: hidden; }
.work-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .55s ease; }
.work-card:hover img { transform: scale(1.035); }
.work-card-copy { padding: 11px 12px 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.work-card-copy strong { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.work-card-copy span { color: var(--ink-soft); font-size: 10px; }
.visibility-button { position: absolute; right: 8px; top: 8px; z-index: 2; border: 0; border-radius: 999px; padding: 7px 9px; color: var(--green-900); background: rgba(255,255,255,.88); box-shadow: 0 4px 12px rgba(0,0,0,.12); font-size: 11px; }
.work-card.hidden-work { background: repeating-linear-gradient(135deg,#e9efe9,#e9efe9 10px,#dce8dc 10px,#dce8dc 20px); }
.hidden-placeholder { aspect-ratio: 1; display: grid; place-items: center; text-align: center; color: var(--ink-soft); padding: 20px; }
.generating-card .image-button, .failed-card .image-button { display: grid; place-items: center; color: var(--ink-soft); }
.generating-card .image-button::before { content: ""; width: 38px; height: 52px; border-radius: 90% 0 90% 0; background: var(--green-500); animation: breathe 1.5s ease-in-out infinite; }

.leaf-puzzle { width: min(94%, 1040px); height: min(60vw, 610px); min-height: 430px; max-height: 64vh; margin: 0 auto; position: relative; filter: drop-shadow(0 24px 35px rgba(26,91,58,.22)); transform-origin: 50% 100%; }
.leaf-puzzle::before { content: ""; position: absolute; inset: 0; z-index: -2; background: linear-gradient(135deg,#2e8755,#90d290); clip-path: polygon(0 52%,6% 38%,18% 23%,36% 11%,58% 4%,79% 13%,94% 30%,100% 50%,93% 68%,78% 84%,57% 96%,35% 89%,17% 76%,6% 63%); }
.leaf-puzzle::after { content: ""; position: absolute; left: 49%; bottom: -15%; width: 2.2%; height: 65%; z-index: -1; background: linear-gradient(#5e9c69,#2f6d4a); border-radius: 999px; transform: rotate(40deg); transform-origin: top; }
.leaf-puzzle .work-card, .puzzle-filler { position: absolute; margin: 0; border-radius: 9px; overflow: hidden; transition: transform 1.25s cubic-bezier(.18,.82,.18,1), left 1.25s cubic-bezier(.18,.82,.18,1), top 1.25s cubic-bezier(.18,.82,.18,1), width 1.25s ease, height 1.25s ease, opacity .4s ease; }
.leaf-puzzle .work-card { box-shadow: none; border: 1px solid rgba(255,255,255,.48); }
.leaf-puzzle .work-card-copy, .leaf-puzzle .visibility-button { opacity: 0; pointer-events: none; }
.leaf-puzzle .image-button { height: 100%; aspect-ratio: auto; }
.puzzle-filler { background: radial-gradient(circle at 30% 24%,rgba(255,255,255,.3),transparent 28%), linear-gradient(145deg,#68b87b,#2e7a52); border: 1px solid rgba(255,255,255,.28); }
.leaf-vein { position: absolute; left: 7%; right: 7%; top: 50%; height: 2px; background: rgba(238,255,231,.68); transform: rotate(-2deg); z-index: 8; pointer-events: none; box-shadow: 0 0 8px rgba(255,255,255,.5); }
.leaf-vein::before, .leaf-vein::after { content: ""; position: absolute; width: 36%; border-top: 1px solid rgba(238,255,231,.52); transform-origin: right; right: 26%; }
.leaf-vein::before { transform: rotate(26deg); }.leaf-vein::after { transform: rotate(-26deg); }
.leaf-puzzle.complete { animation: leaf-breathe 1.7s ease-in-out 1, leaf-sway 4.6s ease-in-out 1.8s 1; }
.collection-poem { position: relative; width: min(760px, 92%); margin: 34px auto 8px; text-align: center; display: flex; justify-content: center; gap: clamp(20px, 5vw, 70px); opacity: 0; animation: poem-in 1s ease forwards; }
.collection-poem p { margin: 0; font-family: "STSong", "Songti SC", serif; font-size: clamp(16px, 1.6vw, 23px); line-height: 1.75; }

.student-view { max-width: 1240px; padding-top: 12px; }
.student-room-bar { min-height: 68px; border-radius: 20px; padding: 12px 19px; display: flex; align-items: center; justify-content: space-between; }
.student-room-bar > div { display: grid; gap: 3px; }.student-room-bar span { font-weight: 800; }.student-room-bar small { color: var(--ink-soft); }
.student-shell { width: min(1050px, 100%); margin: 22px auto 0; display: grid; gap: 20px; }
.poem-workbench, .preview-step, .result-step, .student-gallery-section { border-radius: var(--radius-xl); padding: clamp(25px, 4vw, 48px); }
.gentle-example { margin: 24px 0 28px; padding: 14px 17px; color: var(--ink-soft); background: rgba(232,246,230,.74); border-left: 3px solid var(--green-500); border-radius: 0 12px 12px 0; line-height: 1.65; }
.poem-form { display: grid; gap: 13px; }
.poem-line { position: relative; min-height: 68px; display: grid; grid-template-columns: max-content minmax(120px,1fr) max-content; align-items: center; gap: 8px; padding: 10px 66px 10px 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.65); font-family: "STSong", "Songti SC", serif; font-size: clamp(17px, 2.1vw, 25px); }
.poem-line input { height: 44px; min-width: 0; border: 0; border-bottom: 2px solid var(--green-500); background: transparent; color: var(--green-900); text-align: center; font-weight: 800; }
.poem-line small { position: absolute; right: 16px; bottom: 10px; color: #8ca097; font-family: sans-serif; font-size: 10px; }.poem-line small b { font-weight: inherit; }
.wide-button { width: 100%; margin-top: 26px; }
.poem-preview { width: min(680px,100%); margin: 34px auto; padding: 34px clamp(25px,7vw,80px); border: 0; border-radius: 28px; color: var(--ink); background: linear-gradient(145deg,rgba(241,250,239,.95),rgba(215,239,220,.88)); font-family: "STSong", "Songti SC", serif; font-size: clamp(20px,2.7vw,33px); line-height: 1.8; box-shadow: inset 0 0 0 1px rgba(255,255,255,.9); }
.poem-preview p, .mini-poem p { margin: 0 0 14px; }.poem-preview p:last-child, .mini-poem p:last-child { margin-bottom: 0; }
.thinking-prompt { text-align: center; color: var(--ink-soft); }
.dual-actions { display: flex; justify-content: center; gap: 12px; margin-top: 25px; flex-wrap: wrap; }
.result-layout { display: grid; grid-template-columns: minmax(300px,1fr) minmax(280px,.8fr); gap: clamp(24px,5vw,60px); margin-top: 28px; align-items: center; }
.result-image-wrap { aspect-ratio: 1; border-radius: 26px; padding: 9px; background: rgba(255,255,255,.74); box-shadow: 0 18px 45px rgba(29,87,58,.16); }
.result-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 20px; }
.author-chip { display: inline-flex; padding: 7px 12px; border-radius: 999px; background: var(--green-100); color: var(--green-800); font-size: 12px; font-weight: 800; }
.mini-poem { margin: 20px 0; padding: 0; border: 0; font-family: "STSong", "Songti SC", serif; font-size: clamp(17px,2vw,25px); line-height: 1.7; }
.ai-note { color: var(--ink-soft); line-height: 1.7; padding-top: 17px; border-top: 1px solid var(--line); }
.reflection-box { margin-top: 30px; padding: 20px; border-radius: 19px; background: rgba(231,245,229,.75); }
.reflection-box h2 { margin: 0 0 14px; font-size: 16px; }
.reflection-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.reflection-grid span { padding: 13px; border-radius: 13px; background: rgba(255,255,255,.68); text-align: center; color: var(--green-900); font-weight: 700; font-size: 13px; }
.submitted-message { margin-top: 20px; padding: 15px; text-align: center; color: #17663c; background: #def4df; border-radius: 14px; font-weight: 800; }
.student-gallery-section { padding: 28px; }
.student-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 12px; margin-top: 20px; }
.student-gallery .work-card-copy span { display: none; }
.quiet-placeholder { grid-column: 1/-1; padding: 55px 20px; text-align: center; color: var(--ink-soft); }

.loading-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; text-align: center; padding: 30px; color: var(--ink); background: rgba(234,246,233,.88); backdrop-filter: blur(20px); }
.loading-overlay h2 { font-family: "STSong", "Songti SC", serif; font-size: clamp(25px,4vw,46px); line-height: 1.5; margin: 28px 0 10px; }.loading-overlay p { color: var(--ink-soft); }
.growing-leaf { width: 120px; height: 120px; margin: auto; position: relative; }
.growing-leaf span { position: absolute; width: 62px; height: 86px; left: 30px; top: 18px; border-radius: 90% 0 90% 0; background: linear-gradient(145deg,var(--green-500),var(--green-800)); animation: grow 1.8s ease-in-out infinite; }
.growing-leaf::after { content: ""; position: absolute; width: 52px; left: 33px; top: 73px; border-top: 3px solid var(--green-900); transform: rotate(-45deg); }

.modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 25px; }
.modal-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(13,42,31,.58); backdrop-filter: blur(10px); }
.modal-card, .confirm-card { position: relative; z-index: 1; width: min(920px,100%); max-height: 90vh; overflow: auto; border-radius: 28px; padding: 20px; background: #f8fdf7; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.modal-card { display: grid; grid-template-columns: minmax(300px,1.1fr) minmax(250px,.9fr); gap: 28px; align-items: center; }
.modal-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 20px; }
.modal-close { position: absolute; right: 13px; top: 13px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 25px; z-index: 2; }
.confirm-card { width: min(460px,100%); text-align: center; padding: 34px; }
.confirm-card h2 { margin: 15px 0 8px; }.confirm-card p { color: var(--ink-soft); line-height: 1.65; }
.confirm-icon { display: grid; place-items: center; width: 50px; height: 50px; margin: auto; border-radius: 50%; background: #f8e5dc; color: var(--danger); font-size: 25px; font-weight: 900; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 9px; pointer-events: none; }
.toast { max-width: min(390px,calc(100vw - 44px)); padding: 13px 17px; border-radius: 14px; color: white; background: rgba(24,76,55,.94); box-shadow: 0 12px 28px rgba(0,0,0,.18); animation: toast-in .35s ease both; }
.toast.error { background: rgba(142,56,56,.95); }

@keyframes drift { to { transform: translate3d(30px,-22px,0) scale(1.08); } }
@keyframes dash { to { stroke-dashoffset: -150; } }
@keyframes breathe { 50% { transform: scale(1.12) rotate(8deg); filter: brightness(1.12); } }
@keyframes grow { 0%,100% { transform: scale(.82) rotate(-9deg); opacity:.65 } 50% { transform: scale(1.08) rotate(3deg); opacity:1 } }
@keyframes leaf-breathe { 50% { filter: drop-shadow(0 0 36px rgba(129,218,124,.75)) brightness(1.09); transform: scale(1.018); } }
@keyframes leaf-sway { 0%,100% { transform: rotate(0); } 20% { transform: rotate(-2.2deg); } 40% { transform: rotate(2.1deg); } 60% { transform: rotate(-1.5deg); } 80% { transform: rotate(1deg); } }
@keyframes poem-in { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes toast-in { from { opacity:0; transform:translateY(15px); } }

@media (max-width: 1100px) {
  .landing-view { grid-template-columns: 1fr; padding-top: 50px; }
  .hero-copy { text-align: center; }.hero-note { margin-left:auto; margin-right:auto; }.principles { justify-content:center; }
  .teacher-layout { grid-template-columns: 250px minmax(0,1fr); }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 820px) {
  .site-header, .view { width: min(100% - 26px,1500px); }
  .site-header { min-height: 74px; }.brand small { display:none; }.leaf-mark { width:42px; height:42px; }
  .landing-view { padding-top: 25px; }.entry-grid { grid-template-columns:1fr; }.entry-card { min-height:0; }
  .teacher-topbar { grid-template-columns:1fr auto; }.teacher-topbar .status-chip { grid-column:2; grid-row:1; }.room-share { grid-column:1/-1; border-top:1px solid var(--line); padding-top:12px; }
  .teacher-layout { grid-template-columns:1fr; }.teacher-sidebar { position:static; grid-template-columns:1fr 1fr; }.teacher-main { grid-row:1; }.share-panel { display:none; }
  .poem-line { grid-template-columns:1fr; gap:4px; padding:13px 56px 13px 16px; }.poem-line input { text-align:left; }.poem-line small { bottom:15px; }
  .result-layout { grid-template-columns:1fr; }.reflection-grid { grid-template-columns:1fr; }
  .leaf-puzzle { height:58vw; min-height:320px; }
}

@media (max-width: 560px) {
  .header-actions .icon-button span { display:none; }
  .landing-view { gap:30px; }.hero-copy h1 { font-size:43px; }.entry-card { padding:24px; }
  .teacher-sidebar { grid-template-columns:1fr; }.stats-grid { gap:8px; }.stats-grid article { min-height:90px; padding:12px; }.stats-grid strong { font-size:30px; }
  .gallery-panel { padding:16px; }.gallery-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .poem-workbench, .preview-step, .result-step, .student-gallery-section { border-radius:23px; padding:22px 17px; }
  .section-heading { align-items:center; }.section-heading .eyebrow { letter-spacing:.1em; }.step-badge { padding:6px 9px; }
  .dual-actions > button { width:100%; }.modal-card { grid-template-columns:1fr; padding:14px; }.modal-card > div { padding:0 10px 10px; }
  .collection-poem { gap:15px; flex-direction:column; }.collection-poem p { font-size:15px; line-height:1.5; }
  .leaf-puzzle { width:100%; height:72vw; min-height:250px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
