:root {
  color-scheme: light;
  --green: #426653;
  --sage: #648674;
  --cream: #f4f0e6;
  --ink: #333b36;
  --muted: #5d6c63;
  --line: #dbe1d8;
  --wash: #edf2ed;
  --white: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.55rem, 4vw, 2rem); letter-spacing: .01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.04rem; }
svg { width: 24px; height: 24px; flex: none; }
.wrap { width: min(100% - 48px, 900px); margin-inline: auto; }
.top { border-bottom: 1px solid #e1e1d6; background: #faf8f2; }
.top-inner { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.wordmark { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 2.25rem; line-height: 1; letter-spacing: -.055em; color: var(--green); }
.top-actions { display: flex; gap: 10px; }
.icon-button { display: grid; place-items: center; width: 46px; height: 46px; color: var(--green); border: 1px solid var(--line); background: var(--white); border-radius: 50%; }
.icon-button:hover, .button:hover, .tile:hover { background: var(--wash); }
.shell { padding-block: 30px calc(110px + env(safe-area-inset-bottom)); }
.home { padding-top: clamp(28px, 7vh, 68px); }
.scope { display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto; padding: 4px; margin-inline: -4px; scrollbar-width: thin; }
.scope a { flex: 1 0 auto; text-align: center; min-height: 45px; line-height: 43px; font-size: .9rem; border: 1px solid var(--line); border-radius: 9px; background: #faf9f4; padding: 0 10px; }
.scope a[aria-current="true"] { background: var(--green); border-color: var(--green); color: var(--white); }
.modules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.tile { display: grid; place-content: center; justify-items: center; gap: 13px; min-height: clamp(132px, 16vh, 166px); border: 1px solid var(--line); border-radius: 14px; background: var(--white); font-size: 1.12rem; font-weight: 650; }
.tile[aria-disabled="true"] { opacity: .74; }
.tile svg { width: 36px; height: 36px; color: var(--green); }
.quick { margin-top: 32px; padding-top: 20px; border-top: 1px solid #d9dfd4; }
.quick h2 { margin-bottom: 12px; font-size: 1rem; }
.quick-row { display: flex; flex-wrap: wrap; gap: 9px; }
.quick-row .button { justify-content: center; flex: 1 0 auto; }
.quick-row svg { width: 17px; height: 17px; }
.bottom { position: fixed; z-index: 2; inset: auto 0 0; background: #faf9f4; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom .wrap { display: flex; max-width: 650px; }
.bottom a { flex: 1; display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 68px; font-size: .79rem; color: var(--muted); }
.bottom a[aria-current="page"] { color: var(--green); font-weight: 750; }
.bottom a[aria-current="page"] svg { stroke-width: 2.3; }
#kfc-update { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  max-width: 560px; margin: 12px auto; padding: 10px 12px;
  background: #faf9f4; border: 1px solid var(--line); border-radius: 8px; }
#kfc-update button { flex-shrink: 0; }
.garden-actions summary { list-style: none; cursor: pointer; }
.garden-actions summary::-webkit-details-marker { display: none; }
.garden-actions[open] summary { margin-bottom: 8px; }
.garden-actions .form-actions { justify-content: flex-end; }
.garden-work-row h2 { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
.garden-work-row h2 svg { flex: 0 0 18px; width: 18px; height: 18px; }
.button { display: inline-flex; min-height: 44px; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 13px; color: var(--green); background: var(--white); font-weight: 600; }
.primary { background: var(--green); border-color: var(--green); color: var(--white); }
.primary:hover { background: #345443; }
.danger { color: #8a3834; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--green); margin-bottom: 8px; }
.back svg { width: 19px; height: 19px; }
.heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.subhead { margin: 20px 0 12px; }
.panel { padding: clamp(16px, 3vw, 24px); border: 1px solid var(--line); border-radius: 13px; background: var(--white); }
.stack { display: grid; gap: 12px; }
.tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a, .tabs span { padding: 8px 13px; min-height: 43px; }
.tabs [aria-current] { border-color: var(--sage); background: var(--wash); }
.muted, .meta { color: var(--muted); }
.meta { display: flex; gap: 6px 13px; flex-wrap: wrap; font-size: .87rem; margin-top: 4px; }
.empty { color: var(--muted); display: grid; justify-items: start; gap: 12px; }
.record-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: 11px 5px; }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.row .button { flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.full { grid-column: 1/-1; }
label { display: grid; gap: 6px; min-width: 0; }
input:not([type=checkbox]), select, textarea { border: 1px solid #b8c8bd; border-radius: 7px; padding: 8px 10px; min-height: 44px; width: 100%; color: var(--ink); background: var(--white); }
textarea { resize: vertical; min-height: 136px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.error { color: #8a3834; }
fieldset { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 3px 17px; }
.check { display: flex; align-items: center; gap: 6px; min-height: 42px; }
.check input { accent-color: var(--green); width: 18px; height: 18px; }
.picker { max-height: 240px; overflow: auto; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 16px; }
.filters label { flex: 1 1 135px; font-size: .88rem; }
.filters .check { flex: 0 1 auto; }
.facts { margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 12px; }
.facts dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.facts dt { color: var(--muted); font-size: .86rem; }
.auth { min-height: 100svh; display: grid; justify-items: center; align-content: center; padding: 24px; }
.auth-card { width: min(100%, 430px); padding: 28px; }
.auth-card .wordmark { display: block; margin-bottom: 22px; }
#toast { position: fixed; z-index: 5; bottom: calc(80px + env(safe-area-inset-bottom)); right: max(12px, calc((100vw - 900px) / 2)); max-width: calc(100vw - 24px); color: white; background: #355445; border-radius: 8px; padding: 9px 15px; }
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .top-inner { height: 64px; }
  .wordmark { font-size: 2rem; }
  .home { padding-top: 24px; }
  .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 112px; gap: 8px; border-radius: 11px; }
  .tile svg { width: 29px; height: 29px; }
  .quick { margin-top: 21px; padding-top: 15px; }
  .quick-row { gap: 5px; }
  .quick-row .button { padding-inline: 6px; font-size: .86rem; gap: 3px; }
  .form-grid { grid-template-columns: minmax(0,1fr); }
  .bottom .wrap { width: 100%; }
  .scope { gap: 4px; margin-bottom: 16px; }
  .scope a { padding-inline: 6px; font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

.student-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,240px),1fr)); gap: 12px; }
.student-card, .student-summary { display: flex; align-items: center; gap: 12px; min-width: 0; }
.student-card { justify-content: space-between; }
.student-card > .button { flex: none; }
.student-summary > div { min-width: 0; overflow-wrap: anywhere; }
.student-grid .student-card { flex-direction: column; align-items: stretch; }
.student-grid .student-card > .button { align-self: flex-start; }
.student-photo { width: 48px; height: 48px; border-radius: 50%; flex: none; object-fit: cover; }
.photo-empty { display: grid; place-items: center; background: var(--wash); color: var(--green); }
.profile-title { align-items: flex-start; margin-bottom: 18px; }
.profile-title .heading { flex: 1; margin-bottom: 0; min-height: 48px; }
.profile-title .student-photo { width: 56px; height: 56px; }
.profile-history, .work-form, .report-summary { margin-bottom: 16px; }
.profile-history summary { cursor: pointer; color: var(--green); }
.profile-history ul, .report-summary ul { padding-inline-start: 1.3em; margin-block: 7px; }
.file-card { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.file-card > div:first-of-type { flex: 1; min-width: min(100%,145px); overflow-wrap: anywhere; }
.file-preview { display: block; width: 78px; height: 65px; border-radius: 7px; object-fit: cover; }
.observation-fields textarea { min-height: 85px; }
input[type=file] { min-width: 0; }
.modules.course-menu { grid-template-columns: repeat(2,minmax(0,1fr)); }
.teaching-profile, .teaching-upload, .teaching-legacy { margin-bottom: 16px; }
.teaching-legacy [data-known-files] { margin-top: 8px; }
.teaching-legacy summary { cursor: pointer; color: var(--green); }
.teaching-shared textarea, [data-teaching-outcomes] textarea { min-height: 72px; }
.question { margin: 0; padding: 12px; }
.question output { align-self: center; }
.resource-preview { display: block; max-width: 100%; max-height: 420px; object-fit: contain; border-radius: 8px; }
.upload-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; overflow-wrap: anywhere; }
.upload-line progress { max-width: 100%; width: 220px; accent-color: var(--green); }
.garden-rich { overflow-wrap: anywhere; }
.garden-rich ul { margin-block: 0; }
.garden-inline-link { text-decoration: underline; color: var(--green); }
.shell:has(> .garden-reader) > .heading { overflow-wrap: anywhere; }
.garden-reader { min-width: 0; grid-template-columns: minmax(0, 1fr); overflow-wrap: anywhere; }
.garden-reader-image { display: block; width: auto; max-width: 100%; height: auto; margin-inline: auto; }
.garden-group > summary { cursor: pointer; font-weight: 600; }
.garden-group > .stack, [data-garden-location] { margin-top: 12px; }
.garden-photo-placeholder { display: block; }
.garden-reader-table { max-width: 100%; overflow-x: auto; }
.garden-reader-table table { border-collapse: collapse; width: max-content; max-width: none; }
.garden-reader-table td { border: 1px solid var(--line, #d6dfd5); padding: 8px; min-width: 3rem; max-width: 26rem; white-space: pre-wrap; overflow-wrap: anywhere; }
audio { max-width: 100%; }
.management-metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,175px),1fr)); gap:10px; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; margin-bottom:16px; }
.calendar-grid > strong { text-align:center; }
.calendar-day { display:grid; min-height:48px; padding:5px; background:var(--white); border:1px solid var(--line); border-radius:6px; }
.report-letter > span { color:var(--green); font-family:Georgia,serif; font-weight:700; font-size:2rem; }
.report-area { border-top:1px solid var(--line); padding-top:10px; }
.report-area h3 { color:var(--green); }
.report-area h4 { margin-block:10px 4px; }
.report-paper { margin-block:18px; }
.report-evidence { margin:8px 0 12px; }
.report-evidence img { max-height:220px; }
@media print {
  @page { size: A4; margin: 15mm; }
  body:has(.report-paper) { background:#fff; }
  body:has(.report-paper) :is(.top,.bottom,.back,.no-print,.shell > .heading,.shell > .tabs) { display:none !important; }
  body:has(.report-paper) .shell { padding:0; width:100%; margin:0; }
  .report-paper { margin:0; border:0; border-radius:0; padding:0; background:#fff; }
  .report-paper + .report-paper { break-before:page; }
  .report-area h3,.report-area h4 { break-after:avoid; }
  .report-evidence img { break-inside:avoid; }
}
.project-cover { width: 76px; height: 60px; border-radius: 8px; object-fit: cover; }
.project-cover.large { width: min(100%,340px); height: auto; max-height: 220px; }
.research-assets { margin-bottom: 12px; }
.research-table { overflow-x: auto; }
.research-table table { border-collapse: collapse; width: 100%; }
.research-table th, .research-table td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--line); }
.research-table td { overflow-wrap: anywhere; }
.research-cell-image { max-width: 88px; max-height: 68px; object-fit: contain; }
@media print {
  body:has(.research-print) { background: #fff; }
  body:has(.research-print) .top, body:has(.research-print) .bottom,
  body:has(.research-print) .back, body:has(.research-print) .no-print { display: none !important; }
  body:has(.research-print) .shell { width: 100%; padding: 0; }
  .research-print { border: 0; padding: 0; overflow: visible; }
  .research-print td, .research-print th { padding: 4px; }
  .research-print tr { break-inside: avoid; }
}
@media (max-width: 480px) {
  .row { flex-wrap: wrap; }
  .student-photo { width: 40px; height: 40px; }
}

