:root {
  --paper: #f3f1ea;
  --paper-deep: #ebe8df;
  --ink: #17211d;
  --muted: #68716c;
  --jade: #165542;
  --jade-dark: #103d31;
  --jade-soft: #dfe8e1;
  --orange: #c95321;
  --line: rgba(28, 39, 34, .17);
  --line-strong: rgba(28, 39, 34, .32);
  --radius: 14px;
  --shadow: 0 12px 34px rgba(35, 46, 40, .09), 0 2px 8px rgba(35, 46, 40, .08);
  --sans: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "Songti SC", SimSun, Georgia, serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 15px/1.65 var(--sans); background: var(--paper) url('../img/paper-texture.png') repeat; background-size: 680px 680px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(22,85,66,.28); outline-offset: 3px; }
.site-header { height: 64px; padding: 0 36px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 190px 1fr 190px; align-items: stretch; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(18px); background: rgba(243,241,234,.86); }
.brand { align-self: center; font: 600 22px/1 var(--serif); letter-spacing: .12em; }
.primary-nav { display: flex; justify-content: center; gap: 42px; }
.primary-nav a { display: grid; place-items: center; position: relative; color: #303a35; }
.primary-nav a::after { content: ""; position: absolute; bottom: 0; left: 50%; width: 0; height: 2px; background: var(--jade); transition: .2s ease; }
.primary-nav a:hover::after, .primary-nav a.active::after { left: 0; width: 100%; }
.primary-nav a.active { color: var(--jade); font-weight: 650; }
.account-menu { justify-self: end; align-self: center; position: relative; }
.account-menu summary { list-style: none; padding: 8px 4px; }
.account-menu summary::after { content: "⌄"; margin-left: 8px; }
.menu-popover { position: absolute; right: 0; top: 42px; min-width: 190px; max-height: calc(100vh - 80px); overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #f8f6f0; box-shadow: var(--shadow); }
.menu-popover a, .menu-popover button { display: block; width: 100%; padding: 9px 11px; text-align: left; border-radius: 8px; }
.menu-popover a:hover, .menu-popover button:hover { background: var(--jade-soft); }
.link-button { border: 0; background: transparent; }
.secondary-nav { min-height: 40px; padding: 6px 36px; border-bottom: 1px solid rgba(28,39,34,.09); display: flex; justify-content: center; gap: 28px; font-size: 13px; color: var(--muted); background: rgba(243,241,234,.7); }
.secondary-nav a:hover { color: var(--jade); }
.page-shell { width: min(1280px, calc(100% - 64px)); margin: 0 auto; padding: 54px 0 100px; }
.flash-stack { position: fixed; right: 28px; top: 82px; z-index: 50; display: grid; gap: 8px; }
.flash { max-width: 420px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px; background: #f8f6f0; box-shadow: var(--shadow); }
.flash.error { color: #8c301b; border-color: rgba(201,83,33,.35); }
.undo-float { position: fixed; right: 28px; bottom: 28px; z-index: 18; }
.undo-float button { width: 58px; height: 58px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: white; background: var(--jade); box-shadow: var(--shadow); }
.mobile-nav { display: none; }
.eyebrow, .section-kicker, .date-kicker { color: var(--jade); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.page-header { display: flex; justify-content: space-between; gap: 30px; align-items: end; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.page-header h1, .daily-brief > h1 { margin: 0; font: 500 clamp(30px, 4vw, 47px)/1.25 var(--serif); letter-spacing: .02em; }
.page-header p { margin: 8px 0 0; color: var(--muted); }
.page-actions, .action-row, .form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button { min-height: 42px; padding: 9px 18px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(255,255,255,.25); display: inline-flex; justify-content: center; align-items: center; gap: 8px; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); background: rgba(255,255,255,.55); box-shadow: 0 5px 16px rgba(35,46,40,.08); }
.button.primary { border-color: var(--jade); color: #fff; background: var(--jade); box-shadow: inset 0 0 0 1px rgba(255,255,255,.23), 0 8px 20px rgba(22,85,66,.18); }
.button.primary:hover { background: var(--jade-dark); }
.button[aria-busy="true"] { pointer-events: none; opacity: .72; }
.button[aria-busy="true"]::before { content: ""; width: 12px; height: 12px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: busy-spin .7s linear infinite; }
@keyframes busy-spin { to { transform: rotate(360deg); } }
.button.danger { color: #8f321e; border-color: rgba(201,83,33,.4); }
.button.small { min-height: 34px; padding: 5px 11px; font-size: 13px; }
.editorial-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, .9fr); gap: 64px; }
.daily-brief > h1 { margin-top: 10px; }
.hairline { height: 1px; background: var(--line); margin: 26px 0 34px; }
.section-kicker { margin: 0 0 12px; color: var(--ink); letter-spacing: .08em; }
.next-class { display: grid; grid-template-columns: minmax(320px, 1fr) 1fr; gap: 46px; align-items: center; padding-bottom: 30px; }
.hero-time { font: 300 clamp(74px, 9.5vw, 142px)/.88 var(--serif); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.next-meta h2 { margin: 0; font: 500 32px/1.25 var(--serif); }
.next-meta p { margin: 6px 0; font-size: 18px; }
.next-meta .button { margin-top: 18px; min-width: 220px; }
.muted { color: var(--muted); }
.quiet-hero { padding: 30px 0 60px; }
.class-pulse { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 0; align-items: center; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.class-pulse > * { padding: 0 20px; border-left: 1px solid var(--line); }
.class-pulse > :first-child { padding-left: 0; border-left: 0; }
.class-pulse b { margin-left: 8px; color: var(--jade); font: 500 27px var(--serif); }
.class-pulse .urgent b { color: var(--orange); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin: 34px 0 14px; }
.section-heading h2, .focus-rail h2 { margin: 0; font: 500 24px var(--serif); }
.section-heading a { color: var(--jade); font-size: 13px; }
.agenda-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.1); }
.editorial-quote { margin: 34px 0 0; color: var(--muted); text-align: center; font: 14px/1.8 var(--serif); letter-spacing: .06em; }
.agenda-row { min-height: 62px; padding: 0 18px; display: grid; grid-template-columns: 74px 18px 125px minmax(160px, 1fr) 110px 14px; gap: 10px; align-items: center; border-top: 1px solid var(--line); transition: background .16s ease; }
.agenda-row:first-child { border-top: 0; }
.agenda-row:hover { background: rgba(255,255,255,.42); }
.agenda-row time { color: var(--jade); font: 500 21px var(--serif); font-variant-numeric: tabular-nums; }
.agenda-row small { color: var(--muted); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a8ada9; }
.status-dot.current { background: var(--jade); box-shadow: 0 0 0 5px rgba(22,85,66,.1); }
.focus-rail { padding: 60px 0 0 54px; border-left: 1px solid var(--line); }
.focus-rail > h2 { margin-bottom: 26px; }
.focus-item { display: grid; grid-template-columns: 46px 1fr 14px; gap: 14px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.focus-item:hover strong { color: var(--jade); }
.focus-item span:nth-child(2) { display: grid; gap: 2px; }
.focus-item small { color: var(--muted); }
.focus-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--jade-soft); border: 1px solid rgba(22,85,66,.08); }
.focus-mark { display: grid; place-items: center; }
.focus-mark img { width: 23px; height: 23px; opacity: .82; }
.quick-block { margin-top: 54px; }
.quick-block h3 { font: 500 21px var(--serif); }
.quick-record { min-height: 58px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 9px; display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.18); }
.quick-links { display: flex; gap: 22px; margin-top: 18px; color: var(--jade); }
.panel { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.14); }
.panel h2, .panel h3 { margin-top: 0; font-family: var(--serif); font-weight: 500; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.content-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.stack-form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { color: #505a55; font-size: 13px; }
.field b { color: var(--orange); }
.field-wide { grid-column: 1 / -1; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: rgba(255,255,255,.38); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(22,85,66,.09); outline: none; }
textarea { resize: vertical; }
.form-actions { grid-column: 1 / -1; padding-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.danger-zone { margin-top: 24px; padding-top: 22px; border-top: 1px solid rgba(201,83,33,.25); }
hr { border: 0; border-top: 1px solid var(--line); margin: 26px 0; }
.data-table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.08); }
.data-table th { padding: 10px 12px; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; }
.data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table tr:hover td { background: rgba(255,255,255,.28); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 100px; }
.filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 24px; }
.filters .field { min-width: 130px; }
.empty-state, .empty-line { padding: 34px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); }
.pill { display: inline-flex; padding: 3px 9px; border-radius: 999px; background: var(--jade-soft); color: var(--jade-dark); font-size: 12px; }
.pill.urgent { color: #9b3f1f; background: #f3ded5; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 0; white-space: nowrap; }
.tabs a.active { color: var(--jade); border-bottom: 2px solid var(--jade); }
.timeline { display: grid; }
.timeline-item { padding: 18px 0 18px 26px; border-left: 1px solid var(--line-strong); position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -5px; top: 26px; width: 9px; height: 9px; border-radius: 50%; background: var(--jade); }
.timeline-item p { margin: 5px 0; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; }
.login-panel { width: min(470px, 100%); padding: 48px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.2); box-shadow: var(--shadow); }
.login-panel h1 { margin: 0; font: 500 62px var(--serif); letter-spacing: .16em; }
.lede { color: var(--muted); margin: 8px 0 34px; }
.demo-note { color: var(--muted); font-size: 12px; }
.error-page { max-width: 700px; margin: 12vh auto; text-align: center; }
.error-page h1 { font: 500 44px var(--serif); }
.stats-row { display: flex; gap: 1px; border-block: 1px solid var(--line); margin: 24px 0; }
.stat { flex: 1; padding: 16px 22px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat strong { display: block; color: var(--jade); font: 500 30px var(--serif); }
.stat span { color: var(--muted); font-size: 12px; }
.schedule-grid { display: grid; grid-template-columns: repeat(5, minmax(170px, 1fr)); gap: 12px; overflow-x: auto; }
.schedule-day { min-width: 170px; }
.schedule-day > h3 { font: 500 18px var(--serif); }
.course-cell { padding: 12px; margin-bottom: 9px; border-left: 3px solid var(--jade); background: rgba(255,255,255,.25); border-radius: 0 8px 8px 0; }
.course-cell small { display: block; color: var(--muted); }
.sensitive-banner { padding: 16px 20px; border: 1px solid rgba(201,83,33,.35); border-radius: 10px; color: #79331f; background: rgba(243,222,213,.35); margin-bottom: 24px; }
@media print { .site-header,.secondary-nav,.page-actions,.undo-float,.mobile-nav,.button,form { display:none!important; } body { background:#fff; } .page-shell { width:100%; padding:0; } }
@media (prefers-reduced-motion: reduce) { .button[aria-busy="true"]::before { animation: none; } }
@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; padding: 0 18px; }
  .primary-nav, .secondary-nav { display: none; }
  .account-menu { grid-column: 2; }
  .page-shell { width: calc(100% - 32px); padding: 30px 0 100px; }
  .editorial-grid, .two-column, .content-sidebar { grid-template-columns: 1fr; gap: 28px; }
  .focus-rail { border-left: 0; border-top: 1px solid var(--line); padding: 28px 0 0; }
  .next-class { grid-template-columns: 1fr; gap: 16px; }
  .hero-time { font-size: 92px; }
  .class-pulse { grid-template-columns: 1fr 1fr; }
  .class-pulse > * { border: 0; padding: 9px 10px; }
  .agenda-row { grid-template-columns: 64px 14px minmax(100px,1fr) 14px; }
  .agenda-row span, .agenda-row small { display:none; }
  .mobile-nav { position: fixed; z-index: 19; bottom: 0; left: 0; right: 0; height: 66px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-around; border-top: 1px solid var(--line); background: rgba(243,241,234,.94); backdrop-filter: blur(18px); font-size: 12px; }
  .undo-float { bottom: 78px; right: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide, .form-actions { grid-column: auto; }
  .page-header { align-items: start; flex-direction: column; }
}
@media (max-width: 560px) {
  .site-header { height: 56px; }
  .page-shell { width: calc(100% - 24px); padding-top: 22px; }
  .daily-brief > h1 { font-size: 30px; }
  .hero-time { font-size: 72px; }
  .class-pulse { font-size: 12px; }
  .class-pulse b { display:block; margin:0; }
  .login-panel { padding: 30px 22px; }
  .flash-stack { left: 12px; right: 12px; top: 66px; }
}
