:root {
  --ink: #263238;
  --muted: #607d8b;
  --line: #d7e3e3;
  --soft: #f3f7f7;
  --green: #256c5d;
  --green-dark: #174d43;
  --teal: #0b7d78;
  --amber: #91600a;
  --rose: #a13e4d;
  --blue: #245e9b;
  --white: #fff;
  --shadow: 0 12px 30px rgba(28, 68, 61, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", sans-serif;
  line-height: 1.7;
}
a { color: var(--blue); }
button, input, select { font: inherit; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(215, 227, 227, .9);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
}
.header-inner, .layout, .hero { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-weight: 800; }
.brand-title { font-weight: 800; color: var(--green-dark); }
.header-badge { padding: 7px 12px; border-radius: 999px; color: var(--green-dark); background: #e3f2ed; font-size: 14px; font-weight: 700; white-space: nowrap; }
.hero { padding: 46px 0 26px; }
.eyebrow { margin: 0 0 6px; color: var(--teal); font-weight: 800; letter-spacing: .08em; }
h1 { margin: 0; color: var(--green-dark); font-size: clamp(30px, 5vw, 48px); line-height: 1.22; }
.lead { max-width: 850px; margin: 14px 0 0; color: var(--muted); font-size: 17px; }
.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.summary-card { min-height: 104px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--shadow); }
.summary-number { display: block; color: var(--green-dark); font-size: 28px; font-weight: 850; line-height: 1.2; }
.summary-label { display: block; margin-top: 7px; color: var(--muted); font-size: 14px; }
.notice { margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--teal); border-radius: 8px; background: #eaf5f4; }
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; padding-bottom: 64px; }
.sidebar { position: sticky; top: 88px; align-self: start; display: grid; gap: 14px; }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); box-shadow: var(--shadow); }
.panel h2, .panel h3 { margin: 0 0 12px; color: var(--green-dark); font-size: 18px; }
.field { display: grid; gap: 6px; margin-top: 11px; }
.field label { color: var(--muted); font-size: 13px; font-weight: 700; }
.field input, .field select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #b9cccc; border-radius: 9px; color: var(--ink); background: #fff; }
.nav-list { display: grid; gap: 4px; }
.nav-list a { padding: 7px 9px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.nav-list a:hover { background: var(--soft); color: var(--green); }
.content { min-width: 0; }
.submission-card { margin-bottom: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.submission-card h2 { margin: 0 0 16px; color: var(--green-dark); font-size: 24px; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.meta-item { padding: 12px 14px; border-radius: 10px; background: #f7faf9; }
.meta-item.wide { grid-column: 1 / -1; }
.meta-label { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.meta-value { display: block; margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.course-list { display: grid; gap: 14px; }
.course-card { scroll-margin-top: 88px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.course-toggle { width: 100%; padding: 18px 20px; border: 0; background: #fff; color: var(--ink); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; text-align: left; cursor: pointer; }
.course-toggle:hover { background: #fbfdfc; }
.course-heading { display: flex; align-items: flex-start; gap: 12px; }
.course-code { flex: 0 0 auto; padding: 3px 8px; border-radius: 7px; color: #fff; background: var(--green); font-size: 13px; font-weight: 800; }
.course-title { color: var(--green-dark); font-size: 20px; font-weight: 800; line-height: 1.35; }
.course-category { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 600; }
.toggle-symbol { color: var(--green); font-size: 25px; line-height: 1; transition: transform .18s ease; }
.course-toggle[aria-expanded="true"] .toggle-symbol { transform: rotate(45deg); }
.course-body { padding: 0 20px 22px; border-top: 1px solid var(--line); }
.course-body[hidden] { display: none; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 16px 0 2px; }
.status-pill { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.status-same { color: var(--green-dark); background: #e4f3ed; }
.status-minor { color: #705005; background: #fff1c8; }
.status-major { color: #873040; background: #fde5e9; }
.status-na { color: #4f5c63; background: #e8eef1; }
.block { margin-top: 16px; }
.block h3 { margin: 0 0 8px; color: var(--green-dark); font-size: 16px; }
.answer { margin: 0; padding: 15px 16px; border-left: 4px solid #b8d7d1; border-radius: 8px; background: #f7faf9; white-space: pre-wrap; overflow-wrap: anywhere; }
.link-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.link-list a { display: inline-flex; align-items: center; gap: 7px; overflow-wrap: anywhere; }
.attachment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.attachment { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.attachment-preview { display: block; aspect-ratio: 4 / 3; background: #edf3f2; }
.attachment-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.file-icon { height: 100%; display: grid; place-items: center; color: var(--green-dark); font-size: 22px; font-weight: 850; }
.attachment-info { padding: 11px 12px; }
.attachment-name { display: block; color: var(--ink); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.attachment-meta { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.attachment-action { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 750; }
.material-link { display: inline-flex; align-items: center; padding: 8px 12px; border: 1px solid #aac9c3; border-radius: 9px; color: var(--green-dark); text-decoration: none; font-weight: 750; }
.material-link:hover { background: #eaf5f2; }
.empty-state { padding: 34px; border: 1px dashed #a9bfba; border-radius: 14px; color: var(--muted); background: #fff; text-align: center; }
.footer { padding: 28px 16px 44px; color: var(--muted); text-align: center; font-size: 13px; }
.mobile-tools { display: none; }

@media (max-width: 900px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .nav-panel { display: none; }
  .mobile-tools { display: block; }
  .attachment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 580px) {
  .header-inner, .layout, .hero { width: min(100% - 22px, 1180px); }
  .header-inner { min-height: 60px; }
  .brand-title { font-size: 14px; }
  .header-badge { font-size: 12px; padding: 5px 8px; }
  .hero { padding-top: 30px; }
  .summary-grid { gap: 8px; }
  .summary-card { min-height: 88px; padding: 12px; }
  .summary-number { font-size: 23px; }
  .meta-grid, .attachment-grid { grid-template-columns: 1fr; }
  .course-toggle { padding: 15px; }
  .course-heading { display: grid; gap: 7px; }
  .course-body { padding: 0 15px 18px; }
}

@media print {
  .site-header, .sidebar, .mobile-tools, .toggle-symbol { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .hero, .layout { width: 100%; padding-inline: 0; }
  .summary-card, .submission-card, .course-card { box-shadow: none; break-inside: avoid; }
  .layout { display: block; }
  .course-body[hidden] { display: block; }
  .attachment-preview { max-height: 160px; }
}
