@import url("../ui/a11y.css");
:root {
  color-scheme: light;
  --ink: #24362f;
  --muted: #536158;
  --line: #e5e8e2;
  --paper: #fbfcf9;
  --canvas: #f3f4ef;
  --green: #24634f;
  --green-dark: #194b3b;
  --green-soft: #e8f2ec;
  --amber: #9a6729;
  --amber-soft: #f8f0e2;
  --red: #a3483e;
  --red-soft: #f9ece8;
  --shadow: 0 18px 44px rgba(42, 62, 51, .055);
  font-family: "Segoe UI", "Noto Sans TC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); min-width: 320px; }
button, select { color: inherit; font: inherit; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; z-index: 20; left: 16px; top: -60px; padding: 10px 14px; border-radius: 9px; background: var(--green-dark); color: white; }
.skip-link:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.preview-banner { position: sticky; top: 0; z-index: 10; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 16px; background: #193e34; color: #f5fbf6; font-size: 12px; letter-spacing: .01em; }
.banner-mark { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; }
.banner-mark svg { width: 14px; height: 14px; }
.preview-banner strong { margin-right: 7px; font-weight: 650; }
.banner-copy { color: #cadbd1; }
.state-picker { position: absolute; right: max(16px, calc((100vw - 1290px) / 2)); display: flex; align-items: center; gap: 7px; color: #cadbd1; }
.state-picker[hidden] { display: none; }
.state-picker select { max-width: 94px; border: 1px solid #678277; border-radius: 7px; background: #244c41; color: white; padding: 4px 24px 4px 8px; font-size: 12px; }

.app-shell { max-width: 1440px; min-height: calc(100vh - 46px); margin: 0 auto; display: grid; grid-template-columns: 228px minmax(0, 1fr); background: var(--paper); box-shadow: var(--shadow); }
.sidebar { position: sticky; top: 46px; height: calc(100vh - 46px); min-height: 620px; display: flex; flex-direction: column; padding: 28px 15px 18px; border-right: 1px solid var(--line); background: #fbfcf9; }
.brand { display: flex; align-items: center; gap: 11px; margin: 0 8px 43px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--green); color: white; }
.brand-mark svg { width: 19px; height: 19px; }
.brand strong, .brand small, .child-mini strong, .child-mini small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .015em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.side-caption { margin: 0 12px 10px; color: #536158; font-size: 10px; letter-spacing: .12em; }
.side-nav { display: grid; gap: 5px; }
.side-nav a { display: flex; align-items: center; min-height: 44px; gap: 12px; padding: 0 12px; border-radius: 10px; color: #69766f; text-decoration: none; font-size: 13px; transition: background .18s ease, color .18s ease; }
.side-nav a:hover { background: #f1f4f0; color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--green-soft); color: var(--green-dark); font-weight: 650; }
.side-nav a svg { width: 18px; height: 18px; }
.nav-count { margin-left: auto; min-width: 20px; padding: 2px 5px; border-radius: 10px; background: #d9e9df; color: #194b3b; text-align: center; font-size: 10px; }
.sidebar-bottom { display: grid; gap: 13px; margin-top: auto; padding: 15px 8px 0; border-top: 1px solid var(--line); }
.child-mini { display: flex; align-items: center; gap: 10px; }
.child-mini strong { font-size: 12px; font-weight: 650; }
.child-mini small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; background: #e9eee6; color: #49624f; font-size: 13px; font-weight: 650; }
.preview-chip { width: fit-content; padding: 4px 8px; border: 1px solid #dfe9e1; border-radius: 6px; color: #577261; font-size: 10px; }

.main-column { min-width: 0; }
.topbar { display: flex; min-height: 66px; align-items: center; justify-content: space-between; padding: 0 42px; border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: #536158; font-size: 11px; }
.breadcrumbs strong { color: #46564d; font-weight: 600; }
.child-switch { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--green); }
.child-switch svg { width: 16px; height: 16px; }
.child-switch select { max-width: 210px; border: 0; outline: none; background: transparent; color: var(--ink); font-size: 11px; cursor: pointer; }
main { max-width: 1080px; margin: 0 auto; padding: 39px 42px 64px; }
.page-intro { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.eyebrow { display: block; margin: 0 0 9px; color: var(--muted); font-size: 10px; letter-spacing: .11em; }
h1 { margin: 0; font-size: clamp(23px, 3vw, 29px); font-weight: 620; letter-spacing: -.035em; }
.page-intro > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.avatar-large { width: 48px; height: 48px; border-radius: 16px; font-size: 17px; }

.card { border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 5px 20px rgba(35,55,45,.025); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card h2, .card h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.card h3 { font-size: 12px; }
.card-copy { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.icon-box { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 11px; background: #eff4ef; color: #3f755b; }
.icon-box svg { width: 17px; height: 17px; }
.icon-box.amber { background: #f8f0e2; color: #9a6729; }
.section-head { margin: 30px 0 13px; }
.section-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.shortcut-card { display: flex; min-height: 110px; flex-direction: column; justify-content: space-between; padding: 16px; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.shortcut-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.shortcut-card .card-head { align-items: flex-start; }
.shortcut-card .arrow { width: 16px; height: 16px; color: #9ba69e; }
.metric-line { display: flex; align-items: baseline; gap: 7px; margin-top: 16px; }
.metric-line strong { font-size: 20px; font-weight: 620; letter-spacing: -.04em; }
.metric-line span { color: var(--muted); font-size: 10px; }
.summary-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(240px, .8fr); gap: 14px; align-items: stretch; }
.summary-card { padding: 19px; }
.summary-card .card-head { align-items: flex-start; }
.summary-range { margin-top: 15px; color: #64736a; font-size: 10px; }
.summary-items { display: grid; gap: 11px; margin: 13px 0 0; padding: 0; list-style: none; }
.summary-items li { display: flex; align-items: flex-start; gap: 8px; color: #46554c; font-size: 11px; line-height: 1.6; }
.summary-items svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; color: var(--green); }
.notice-card { padding: 19px; background: #f5f8f3; }
.notice-card .icon-box { margin-bottom: 14px; }
.notice-card .card-copy { max-width: 250px; }
.inline-action { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--green-dark); font-size: 11px; font-weight: 620; text-decoration: none; }
.inline-action svg { width: 15px; height: 15px; }
.info-strip { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 11px 12px; border-radius: 10px; background: #f2f5f1; color: #627067; font-size: 10px; line-height: 1.55; }
.info-strip svg { flex: 0 0 auto; width: 15px; height: 15px; color: #607d68; }
.stack { display: grid; gap: 12px; }
.panel { padding: 20px; }
.panel-top { display: flex; align-items: flex-start; gap: 12px; }
.panel-top .grow { flex: 1; min-width: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 5px 8px; border-radius: 20px; background: var(--green-soft); color: #326049; font-size: 10px; font-weight: 600; }
.status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status.pending { background: var(--amber-soft); color: #84551b; }
.status.neutral { background: #eef0ed; color: #536158; }
.status.danger { background: var(--red-soft); color: var(--red); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 17px; margin-top: 13px; color: #77847c; font-size: 10px; }
.meta-row strong { color: #47574d; font-weight: 550; }
.row-list { display: grid; }
.data-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid #edf0ec; }
.data-row:first-child { margin-top: 14px; }
.row-main { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.row-main .icon-box { width: 30px; height: 30px; border-radius: 9px; }
.row-main .icon-box svg { width: 15px; height: 15px; }
.row-main strong { display: block; font-size: 11px; font-weight: 620; }
.row-main small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.row-end { display: flex; align-items: center; gap: 11px; }
.row-end small { color: #536158; font-size: 10px; white-space: nowrap; }
.button { display: inline-flex; min-height: 37px; align-items: center; justify-content: center; gap: 8px; padding: 0 13px; border: 1px solid #dce4dd; border-radius: 9px; background: white; color: #315e49; text-decoration: none; font-size: 11px; font-weight: 630; cursor: pointer; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover { border-color: #b9cfc0; background: #f6faf6; }
.button:active { transform: translateY(1px); }
.button svg { width: 15px; height: 15px; }
.button.primary { border-color: var(--green); background: var(--green); color: white; }
.button.primary:hover { background: var(--green-dark); }
.button.danger-button { border-color: #ead3ce; color: var(--red); }
.button:disabled { opacity: .52; cursor: not-allowed; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.details { margin-top: 14px; border-top: 1px solid #edf0ec; }
.details summary { width: fit-content; padding: 11px 0 2px; color: #536158; font-size: 10px; cursor: pointer; }
.details summary:focus-visible, a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #90b99d; outline-offset: 3px; }
.details-body { max-width: 680px; padding: 6px 0 2px; color: #536158; font-size: 10px; line-height: 1.75; }
.details-body p { margin: 7px 0; }
.details-body ul { margin: 6px 0; padding-left: 18px; }
.progress-line { height: 2px; margin: 15px 0 4px; overflow: hidden; border-radius: 4px; background: #e6e9e5; }
.progress-line span { display: block; width: 42%; height: 100%; background: var(--green); }
.timeline { display: grid; gap: 0; margin: 19px 0 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 10px; min-height: 54px; color: #506057; font-size: 11px; }
.timeline li:not(:last-child)::before { position: absolute; top: 16px; bottom: 0; left: 7px; width: 1px; background: #dce4dd; content: ""; }
.timeline .timeline-dot { z-index: 1; width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; background: #e8f1eb; color: var(--green); }
.timeline .timeline-dot svg { width: 10px; height: 10px; stroke-width: 2; }
.timeline strong { display: block; font-size: 11px; font-weight: 620; }
.timeline small { display: block; margin-top: 4px; color: #536158; font-size: 10px; line-height: 1.5; }
.receipt { margin-top: 18px; padding: 15px; border: 1px solid #d8e7dc; border-radius: 11px; background: #f4f9f5; }
.receipt h3 { display: flex; align-items: center; gap: 8px; }
.receipt dl { display: grid; grid-template-columns: 115px 1fr; gap: 8px; margin: 12px 0 0; color: #64736a; font-size: 10px; }
.receipt dt { color: #839087; }
.receipt dd { margin: 0; color: #354c3e; }
.more-panel { margin-top: 12px; padding: 15px 17px; }
.more-panel summary { padding: 0; }
.notification-list { display: grid; }
.notification { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; gap: 11px; align-items: start; padding: 16px 0; border-top: 1px solid #edf0ec; }
.notification:first-child { margin-top: 14px; }
.notification.unread .icon-box { background: var(--green-soft); }
.notification h3 { margin: 1px 0 0; font-size: 12px; }
.notification p { margin: 6px 0 0; color: #536158; font-size: 10px; line-height: 1.6; }
.notification time { display: block; margin-top: 7px; color: #536158; font-size: 9px; }
.read-state { padding: 5px 7px; border-radius: 12px; background: #f0f2ef; color: #536158; font-size: 9px; }
.notification.unread .read-state { background: var(--green-soft); color: var(--green-dark); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-top: 18px; }
.form-field { display: grid; gap: 7px; color: #57665d; font-size: 10px; }
.form-field input, .form-field select { width: 100%; min-height: 39px; padding: 0 11px; border: 1px solid #dfe5df; border-radius: 8px; background: #fff; color: #324238; font-size: 11px; }
.scope-field { max-width: 240px; margin-bottom: 16px; }
.grade-prompt { margin-top: 18px; padding: 15px; border: 1px solid #d5e0d7; border-radius: 11px; background: #f4f8f4; }
.grade-prompt h3 { margin: 0; color: #263d2f; font-size: 13px; }
.grade-prompt .card-copy { margin-top: 7px; }
.grade-prompt .button { min-height: 44px; }
.toggle-list { display: grid; gap: 0; margin-top: 13px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid #edf0ec; }
.toggle-row strong { display: block; font-size: 11px; font-weight: 620; }
.toggle-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.switch { position: relative; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: #cbd2cc; pointer-events: none; transition: background .2s ease; }
.switch span::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; content: ""; transition: transform .2s ease; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid #90b99d; outline-offset: 3px; }
.notice-inline { min-height: 19px; margin-top: 10px; color: #315b42; font-size: 11px; }
.empty-card, .state-card { display: grid; justify-items: center; padding: 40px 24px; text-align: center; }
.empty-card .icon-box, .state-card .icon-box { width: 42px; height: 42px; margin-bottom: 14px; }
.empty-card p, .state-card p { max-width: 320px; margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.empty-card .button, .state-card .button { margin-top: 16px; }
.state-card[aria-busy="true"] { min-height: 194px; }
.skeleton { width: min(420px, 86%); height: 11px; margin: 7px 0; border-radius: 8px; background: linear-gradient(90deg,#edf0ec,#f7f8f5,#edf0ec); background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite; }
.skeleton.short { width: min(240px, 64%); }
.page-footer { position: fixed; right: 0; bottom: 0; left: max(228px, calc((100vw - 1440px) / 2 + 228px)); display: flex; align-items: center; gap: 8px; min-height: 39px; padding: 0 42px; border-top: 1px solid rgba(229,232,226,.9); background: rgba(251,252,249,.96); color: #536158; font-size: 10px; backdrop-filter: blur(12px); }
.footer-dot { width: 6px; height: 6px; border-radius: 50%; background: #7ba184; }
.page-footer a { margin-left: auto; color: #315b42; text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 184px minmax(0,1fr); }
  .sidebar { padding-right: 11px; padding-left: 11px; }
  .topbar { padding: 0 26px; }
  main { padding-right: 26px; padding-left: 26px; }
  .page-footer { left: 184px; padding-right: 26px; padding-left: 26px; }
  .summary-layout { grid-template-columns: minmax(0,1.1fr) minmax(210px,.9fr); }
}
@media (max-width: 680px) {
  .preview-banner { justify-content: flex-start; min-height: 48px; padding: 6px 12px; font-size: 10px; }
  .banner-copy { display: block; margin-top: 2px; font-size: 9px; }
  .state-picker { right: 11px; gap: 4px; font-size: 0; }
  .state-picker select { max-width: 88px; font-size: 10px; }
  .app-shell { display: flex; min-height: calc(100vh - 48px); flex-direction: column; }
  .sidebar { position: sticky; top: 48px; z-index: 8; height: auto; min-height: 0; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: rgba(251,252,249,.97); backdrop-filter: blur(12px); }
  .brand, .side-caption, .sidebar-bottom { display: none; }
  .side-nav { display: flex; gap: 3px; overflow-x: auto; padding: 8px 10px; scrollbar-width: none; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { flex: 0 0 auto; min-height: 38px; gap: 6px; padding: 0 10px; font-size: 10px; }
  .side-nav a svg { width: 15px; height: 15px; }
  .nav-count { min-width: 16px; margin-left: 0; font-size: 9px; }
  .topbar { min-height: 52px; padding: 0 16px; }
  .breadcrumbs { gap: 7px; font-size: 9px; }
  .child-switch { min-height: 32px; gap: 5px; padding: 0 7px; }
  .child-switch select { max-width: 143px; font-size: 9px; }
  main { padding: 27px 16px 74px; }
  .page-intro { margin-bottom: 20px; }
  .eyebrow { margin-bottom: 6px; font-size: 9px; }
  .page-intro > div > p:last-child { max-width: 250px; margin-top: 6px; font-size: 10px; }
  .avatar-large { width: 40px; height: 40px; border-radius: 13px; }
  .overview-grid { grid-template-columns: 1fr; gap: 8px; }
  .shortcut-card { min-height: 76px; padding: 12px; }
  .shortcut-card .card-head { align-items: center; }
  .shortcut-card .metric-line { margin-top: 8px; }
  .metric-line strong { font-size: 17px; }
  .summary-layout { grid-template-columns: 1fr; }
  .summary-card, .notice-card { padding: 15px; }
  .section-head { margin-top: 23px; }
  .panel { padding: 15px; }
  .panel-top { gap: 9px; }
  .panel-top .status { margin-left: auto; }
  .data-row { align-items: flex-start; }
  .row-end { flex-direction: column; align-items: flex-end; gap: 6px; }
  .row-end .button { min-height: 32px; padding: 0 9px; }
  .notification { grid-template-columns: 30px minmax(0,1fr); gap: 9px; }
  .notification .read-state { grid-column: 2; justify-self: start; margin-top: -4px; }
  .notification .icon-box { width: 29px; height: 29px; }
  .notification p { max-width: 250px; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .page-footer { position: fixed; left: 0; min-height: 36px; padding: 0 15px; font-size: 8px; }
}
@media (max-width: 390px) {
  .state-picker { right: 8px; }
  .state-picker select { max-width: 75px; padding-left: 6px; }
  .banner-copy { max-width: 155px; }
  .side-nav { padding-right: 6px; padding-left: 6px; }
  .side-nav a { gap: 5px; padding: 0 8px; }
  main { padding-right: 13px; padding-left: 13px; }
  .topbar { padding-right: 12px; padding-left: 12px; }
  .child-switch select { max-width: 130px; }
  .row-main small { max-width: 175px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
