:root {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: #212820; background: #f5f6f2; font-size: 16px;
  --ink: #212820; --muted: #60695f; --quiet: #687166; --line: #e3e7df;
  --paper: #fff; --green: #31543c; --green-dark: #244630; --pale: #eaf1e6;
  --gold: #805b24; --danger: #a33832;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #789477; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .65; }
[hidden] { display: none !important; }
svg { width: 1.2em; height: 1.2em; flex: none; display: block; }
[data-icon] { display: inline-grid; place-items: center; flex: none; }
.skip-link { position: fixed; top: 12px; left: 12px; padding: 12px 18px; background: white; z-index: 10; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 35px; padding: 25px 17px 19px; background: #fcfdfa; border-right: 1px solid var(--line); }
.brand { margin: 1px 6px 0; display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 43px; height: 43px; border-radius: 13px; background: var(--green-dark); color: #edf4de; font-size: 23px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.12rem; letter-spacing: .04em; }
.brand small { margin-top: 3px; color: var(--quiet); font-size: .75rem; }
#navigation { display: grid; gap: 5px; }
.nav-link { border: 0; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 13px; border-radius: 10px; background: transparent; color: #535e52; font-size: .9rem; font-weight: 600; }
.nav-link:hover { background: #f0f3ed; }
.nav-link[aria-current="page"] { background: #e6eee3; color: #264a34; }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px; }
.side-semester { display: flex; align-items: center; gap: 10px; margin: 0 2px; padding: 12px; border-radius: 12px; background: #eff3eb; }
.side-semester [data-icon] { color: var(--green); }
.side-semester strong, .side-semester small { display: block; }
.side-semester strong { font-size: .84rem; }
.side-semester small { color: var(--quiet); font-size: .75rem; margin-top: 3px; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 31px; gap: 16px; border-bottom: 1px solid var(--line); background: #fafbf8; }
.crumb, .top-actions { display: flex; align-items: center; gap: 12px; }
.crumb { color: var(--muted); font-size: .87rem; }
.crumb [data-icon] { font-size: .7rem; color: #818a7e; }
.crumb strong { color: var(--ink); }
.icon-button, .avatar { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; border: 1px solid var(--line); color: #4b5a4d; background: var(--paper); position: relative; }
.icon-button:hover, .avatar:hover { background: var(--pale); }
.icon-button i { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; background: #bd6946; border-radius: 50%; box-shadow: 0 0 0 2px white; }
.avatar { background: #e4eddf; border-color: transparent; border-radius: 50%; font-size: .86rem; font-weight: 700; }
.install-button { min-height: 37px; padding-block: 7px; }
.install-steps { display: grid; gap: 12px; }
.install-steps p { margin-top: 3px; }
.share-address { margin-top: 10px; }
main { max-width: 1370px; margin: 0 auto; padding: 27px 32px 50px; min-width: 0; }
.page-title { margin: 0 0 21px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.65rem, 3vw, 2.04rem); line-height: 1.25; letter-spacing: -.035em; }
h2 { font-size: 1.1rem; line-height: 1.4; }
h3 { font-size: .98rem; line-height: 1.45; }
.page-title p { color: var(--muted); margin-top: 7px; font-size: .9rem; }
.hero { min-height: 221px; padding: 28px 31px; display: flex; align-items: center; border-radius: 19px; color: white; overflow: hidden; background: linear-gradient(90deg, rgba(20,47,34,.98) 0%, rgba(21,51,36,.90) 28%, rgba(24,52,37,.53) 53%, rgba(25,52,36,.06) 100%), url("campus-cover.jpg") 50% 53% / cover, #284d38; }
.hero-content { max-width: 590px; }
.hero-semester { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #e4f0df5c; background: #f4faf31a; border-radius: 30px; padding: 5px 9px; font-size: .77rem; font-weight: 600; }
.hero h2 { font-size: clamp(1.7rem, 3.3vw, 2.35rem); letter-spacing: -.025em; line-height: 1.22; margin-top: 12px; }
.hero p { font-size: .92rem; line-height: 1.55; color: #eef3e9; margin-top: 8px; }
.hero .progress { background: #ffffff40; width: min(100%, 209px); margin: 15px 0 7px; }
.hero .progress span { background: #d0e5bd; }
.hero small { color: #e1eadc; font-size: .77rem; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 15px; margin: 17px 0 23px; }
.quick { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 13px 15px; text-align: left; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); }
.quick:hover { border-color: #a0b69f; background: #fdfefb; }
.quick > span:nth-child(2) { flex: 1; min-width: 0; }
.quick strong, .quick small { display: block; }
.quick strong { font-size: .9rem; }
.quick small { color: var(--muted); font-size: .77rem; margin-top: 4px; line-height: 1.35; }
.quick > [data-icon]:last-child { color: #738170; font-size: .82rem; }
.tint { display: grid; place-items: center; width: 41px; height: 41px; flex: none; border-radius: 11px; color: #3c694b; background: #e9f1e6; }
.tint.gold { color: #88601f; background: #f8f0dc; }
.tint.blue { color: #4a6485; background: #eaf0f9; }
.tint.rose { color: #935b50; background: #f7ebe7; }
.panel-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); align-items: start; gap: 16px; }
.semester-review { margin-top: 16px; }
.semester-review .row-body small { overflow-wrap: anywhere; }
.panel { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 15px; padding: 18px 19px; }
.panel + .wide-panel, .panel-grid + .wide-panel { margin-top: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-bottom: 13px; }
.panel-head h2 { display: flex; gap: 8px; align-items: center; }
.panel-head h2 [data-icon] { color: #58705a; font-size: .9rem; }
.text-button { flex: none; display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--green); border-radius: 6px; padding: 5px 3px; font-size: .84rem; font-weight: 650; }
.text-button:hover { text-decoration: underline; }
.rows { display: grid; }
.row { min-width: 0; position: relative; display: flex; align-items: center; gap: 11px; min-height: 62px; padding: 9px 1px; }
.row + .row { border-top: 1px solid #eff1ec; }
.row-body { min-width: 0; flex: 1; }
.row-title { display: block; width: 100%; border: 0; color: var(--ink); background: transparent; text-align: left; padding: 0; line-height: 1.4; font-size: .91rem; font-weight: 650; overflow-wrap: anywhere; }
.row-title:hover { color: var(--green); text-decoration: underline; }
.row-body small, .row small { color: var(--muted); font-size: .77rem; }
.row-body small { display: block; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; line-height: 1.25; padding: 4px 8px; border-radius: 6px; background: #eef1ed; color: #506052; font-size: .76rem; white-space: nowrap; font-weight: 600; }
.chip.active { background: #e7f0e4; color: #356043; }
.chip.warning { background: #fbefdb; color: #805719; }
.chip.overdue { background: #f9e9e6; color: #9e4639; }
.chip.done { background: #e9eef5; color: #425d7d; }
.check { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #b9c3b6; border-radius: 6px; padding: 1px; background: white; color: white; flex: none; }
.check:hover { border-color: var(--green); background: #edf3e9; color: var(--green); }
.check[aria-pressed="true"] { border-color: var(--green); background: var(--green); }
.progress { height: 6px; background: #e8ece4; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: #5c8460; }
.primary, .secondary, .danger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 13px; min-height: 39px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; font-size: .87rem; line-height: 1.3; }
.primary { background: var(--green-dark); color: white; }
.primary:hover { background: #396147; }
.secondary { background: white; border-color: #dbe2d8; color: #3b5240; }
.secondary:hover { background: #eff4ed; }
.danger { background: #fcf0ed; color: var(--danger); }
.danger:hover { background: #f9e4e1; }
.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.filters input { min-width: 130px; flex: 1 1 170px; max-width: 310px; }
input, textarea, select { color: var(--ink); background: white; border: 1px solid #d9e0d6; border-radius: 8px; width: 100%; padding: 9px 10px; line-height: 1.45; font-size: .9rem; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, #52705a 50%), linear-gradient(135deg, #52705a 50%, transparent 50%); background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.filters select { width: auto; max-width: 100%; }
.semester-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 16px; }
.semester-button { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: white; color: var(--muted); font-size: .84rem; }
.semester-button:hover { border-color: #9eb49e; }
.semester-button[aria-pressed="true"] { color: #234831; border-color: #a5b9a2; background: #e7efe3; font-weight: 700; }
.collection { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.record-card { display: flex; gap: 11px; padding: 16px; align-items: flex-start; }
.record-main { min-width: 0; flex: 1; }
.record-main h2 { margin: 2px 0 6px; }
.record-main p { color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; font-size: .87rem; line-height: 1.5; margin-top: 8px; }
.record-meta { color: var(--muted); font-size: .79rem; line-height: 1.5; overflow-wrap: anywhere; }
.record-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; margin-top: 8px; }
.plan-panel .row { flex-wrap: wrap; }
.plan-panel .row .row-body { flex: 1 1 150px; }
.status-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.empty { padding: 25px 11px; text-align: center; color: var(--muted); }
.empty .tint { margin: 0 auto 9px; }
.empty p { font-size: .88rem; line-height: 1.55; margin: 4px 0 10px; }
.loading { padding: 30px; color: var(--muted); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.dialog-head h2 { font-size: 1.25rem; }
dialog { width: min(570px, calc(100% - 28px)); max-height: min(90dvh, 820px); border: 1px solid #d9e0d6; border-radius: 17px; color: var(--ink); box-shadow: 0 22px 75px #1d302639; padding: 21px; overflow: auto; overscroll-behavior: contain; }
dialog::backdrop { background: #1b292575; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 5px; font-size: .88rem; font-weight: 600; align-content: start; }
.field textarea { min-height: 76px; resize: vertical; }
.field small, .modal-note { font-size: .8rem; font-weight: 400; color: var(--muted); line-height: 1.55; }
.full { grid-column: 1 / -1; }
.form-actions { margin-top: 15px; display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 7px; }
.form-actions .push { margin-right: auto; }
.form-error { color: var(--danger); margin-top: 9px; font-size: .86rem; }
.history { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.history li { margin-bottom: 8px; padding-left: 2px; color: var(--muted); font-size: .83rem; line-height: 1.45; overflow-wrap: anywhere; }
.history ul { margin: 8px 0 0; padding-left: 18px; }
.files { display: grid; gap: 4px; }
.file-row { display: flex; gap: 8px; align-items: center; font-size: .83rem; overflow-wrap: anywhere; }
.file-row label { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.file-row input { width: auto; }
.backup { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 15px; }
.backup p { margin: 6px 0 9px; }
#toast { position: fixed; bottom: 21px; right: 22px; z-index: 5; max-width: min(380px, calc(100% - 44px)); background: #234331; color: white; border-radius: 10px; padding: 10px 14px; font-size: .89rem; box-shadow: 0 5px 22px #20302338; }
#toast:empty { display: none; }
@media (max-width: 1050px) { .app-shell { grid-template-columns: 187px minmax(0, 1fr); } .sidebar { padding-inline: 12px; } main { padding-inline: 23px; } .topbar { padding-inline: 23px; } }
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 2; top: auto; bottom: 0; height: auto; width: 100%; padding: 5px 8px max(5px, env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  .sidebar .brand, .sidebar-foot { display: none; }
  #navigation { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 3px; }
  .nav-link { flex-direction: column; text-align: center; gap: 4px; padding: 6px 2px; font-size: .75rem; border-radius: 8px; }
  .nav-link svg { width: 1.5em; height: 1.5em; }
  .topbar { height: 55px; padding-inline: 16px; }
  .top-actions { gap: 6px; }
  .install-button { padding-inline: 8px; }
  main { padding: 19px 14px 83px; }
  .hero { min-height: 202px; padding: 20px; border-radius: 15px; }
  .panel-grid { grid-template-columns: 1fr; gap: 12px; }
  .quick-grid { gap: 7px; margin: 12px 0 15px; }
  .quick { padding: 9px 5px; flex-direction: column; text-align: center; gap: 5px; }
  .quick .tint { width: 34px; height: 34px; font-size: .88rem; }
  .quick small, .quick > [data-icon]:last-child { display: none; }
  .panel { padding: 14px; }
  .collection { grid-template-columns: 1fr; }
  #toast { right: 12px; bottom: 73px; }
}
@media (max-width: 380px) { .crumb-root { display: none; } .crumb > [data-icon] { display: none; } .form-grid { grid-template-columns: 1fr; } .page-title { align-items: start; } .page-title .primary { flex-shrink: 0; } }
@media (prefers-reduced-motion: no-preference) { button, a { transition: background-color .15s ease, color .15s ease, border-color .15s ease; } }
