:root {
  color-scheme: light;
  --ink: #172e43;
  --ink2: #294358;
  --muted: #52677a;
  --line: #dbe5ec;
  --paper: #fff;
  --wash: #f1f5f8;
  --accent: #126b66;
  --accent2: #0b5753;
  --teal-pale: #e5f5f1;
  --nav: #14293e;
  --warn: #8b5111;
  --warn-bg: #fff3dd;
  --red: #ad382f;
  --rad: 15px;
  --shadow: 0 8px 28px rgba(23, 46, 67, .065);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--wash); }
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #329c96; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.24; font-weight: 780; letter-spacing: -.03em; }
h2 { font-size: 21px; line-height: 1.35; font-weight: 740; }
h3 { font-size: 16px; line-height: 1.45; font-weight: 720; }
.i { width: 19px; height: 19px; flex: none; vertical-align: -.22em; }
.dim { color: var(--muted); }
.small { font-size: 12px; }
.caps { font-size: 11px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.mono { font-family: ui-monospace, "Cascadia Code", monospace; font-variant-numeric: tabular-nums; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px;
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper); font-weight: 650; line-height: 1.35; text-align: center;
}
.button:hover { background: #f5f9fa; border-color: #b8cbd6; }
.button.primary { color: white; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent2); border-color: var(--accent2); }
.button.quiet { background: transparent; border-color: transparent; }
.button.quiet:hover { background: var(--teal-pale); }
.button.danger { color: var(--red); }
.button.compact { min-height: 33px; padding: 5px 10px; font-size: 12px; }
.button.icon-button { padding: 8px; min-width: 40px; }
.button.favorite[aria-pressed="true"] { color: #926219; background: #fff7e7; border-color: #ead9af; }
.button.favorite[aria-pressed="true"] svg { fill: #f0b957; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 5px;
  background: #edf2f7; color: #355067; font-size: 11px; font-weight: 700; line-height: 1.55; white-space: nowrap;
}
.badge.teal { background: #e1f3ed; color: #146353; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.red { background: #faebe8; color: var(--red); }
.badge.blue { background: #e7f0fa; color: #2a557d; }
.field { display: grid; gap: 6px; color: var(--ink2); font-weight: 650; }
input:not([type=checkbox]), select, textarea {
  min-width: 0; width: 100%; min-height: 42px; border: 1px solid #cad8e2; border-radius: 9px;
  color: var(--ink); background: var(--paper); padding: 8px 11px; font-weight: 450;
}
input::placeholder, textarea::placeholder { color: #617589; }
textarea { min-height: 112px; resize: vertical; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.gap { display: grid; gap: 16px; }
.divider { border-top: 1px solid var(--line); }
.panel { background: white; border: 1px solid var(--line); border-radius: var(--rad); box-shadow: var(--shadow); }
.pad { padding: 21px; }
.notice { border: 1px solid #d3e5e6; background: #eaf5f5; padding: 11px 14px; border-radius: 9px; color: #28585b; }
.notice.warning { border-color: #efdcb9; background: #fff6e6; color: #764714; }
.error { color: var(--red); font-size: 13px; }
.error:not(:empty) { background: #fff2f0; border: 1px solid #f2d5d0; border-radius: 8px; padding: 8px 11px; }
.boot { min-height: 100vh; display: grid; justify-items: center; align-content: center; gap: 14px; color: var(--muted); }
.boot img { width: 52px; }
.empty { padding: 32px 18px; text-align: center; color: var(--muted); }

/* Sign-in */
.login-shell { min-height: 100svh; display: grid; grid-template-columns: 1.1fr 1fr; background: #f4f8fa; }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 100%; justify-content: space-between; gap: 48px; padding: clamp(30px, 6vw, 85px); color: #f0f9fb; background: linear-gradient(145deg, #11293f 15%, #183c52 65%, #13595c); }
.login-brand::before {
  content: ""; position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background-image: linear-gradient(90deg, #76b8b9 1px, transparent 1px), linear-gradient(#76b8b9 1px, transparent 1px);
  background-size: 72px 72px; mask-image: linear-gradient(125deg, transparent, #000 60%);
}
.brand-line, .login-copy, .login-foot { position: relative; z-index: 1; }
.brand-line { display: flex; align-items: center; gap: 13px; font-weight: 750; }
.brand-line img { width: 47px; height: 47px; }
.brand-line span { display: block; }
.login-brand .caps { color: #a7d8d4; }
.login-copy h1 { font-size: clamp(37px, 5vw, 66px); line-height: 1.13; margin: 15px 0 22px; }
.login-copy p { max-width: 370px; color: #c1d6e2; font-size: 16px; }
.flightline { position: relative; width: 84%; height: 80px; border: 1px solid #85b7bf88; border-radius: 15px; transform: rotate(-10deg); background: #236d7025; }
.flightline::before { content: ""; position: absolute; top: 39px; left: 5%; right: 5%; border-top: 2px dashed #a0d9d0; }
.flightline::after { content: ""; position: absolute; inset: 10px; border-left: 4px double #89d5c8; border-right: 4px double #89d5c8; }
.login-foot { color: #b9d2de; font-size: 12px; }
.login-side { display: grid; align-content: center; justify-items: center; padding: 42px clamp(21px, 5vw, 62px); }
.login-panel { width: min(100%, 416px); padding: 32px 34px; }
.login-panel h2 { margin: 12px 0 5px; font-size: 28px; }
.login-panel form { display: grid; gap: 14px; margin-top: 23px; }
.login-panel .primary { min-height: 45px; }
.login-panel .alternate { margin-top: 12px; }
.login-panel .setup-hint { margin-top: 13px; }

/* Layout */
.shell { min-height: 100vh; display: grid; grid-template-columns: 222px minmax(0,1fr); }
.sidebar { color: #dce8ef; background: var(--nav); min-height: 100vh; position: sticky; align-self: start; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px 15px; overflow-y: auto; }
.sidebar .brand-line { padding: 0 6px 24px; color: #f3f9fb; line-height: 1.45; }
.sidebar .brand-line img { width: 39px; height: 39px; }
.sidebar .brand-line .caps { font-size: 9px; color: #9cc1cb; }
.nav-label { padding: 10px 11px 5px; font-size: 10px; color: #9fb6c8; letter-spacing: .12em; font-weight: 750; }
.nav-link { display: flex; gap: 10px; align-items: center; border-radius: 8px; margin: 3px 0; padding: 9px 11px; min-height: 41px; font-weight: 640; }
.nav-link .i { color: #9cc4d0; }
.nav-link:hover { background: #233e54; }
.nav-link[aria-current=page] { background: #235769; color: #fff; box-shadow: inset 3px 0 #6ad6c3; }
.nav-link[aria-current=page] .i { color: #90e0cf; }
.nav-bottom { margin-top: auto; padding-top: 12px; }
.nav-user { display: flex; align-items: center; gap: 9px; border-top: 1px solid #31495c; padding: 14px 4px 0; color: #ecf5f8; }
.nav-user .who { flex: 1; min-width: 0; }
.nav-user .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user .who span { color: #acc3d2; font-size: 11px; }
.nav-user button { color: #c2d5e0; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #316073; color: #f5fcff; font-weight: 750; flex: none; }
.main { min-width: 0; }
.topbar { position: sticky; z-index: 4; top: 0; display: flex; align-items: center; gap: 16px; padding: 12px 25px; min-height: 68px; background: #ffffffee; backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.breadcrumb { font-weight: 740; white-space: nowrap; }
.global-search { display: flex; margin-left: auto; gap: 6px; min-width: 0; width: min(51%, 440px); }
.global-search input { background: #f4f8fa; }
.topbar .utility { white-space: nowrap; color: var(--muted); font-size: 12px; }
.mobile-nav { display: none; }
.content { max-width: 1600px; margin: auto; padding: 23px clamp(16px, 2.4vw, 34px) 40px; }
.page-heading { display: flex; gap: 13px 18px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin: 3px 0 19px; }
.page-heading .caps { color: var(--accent); margin-bottom: 4px; }
.page-heading p { color: var(--muted); margin-top: 7px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 18px 0 11px; }
.section-heading a { color: var(--accent2); font-weight: 650; }
.hero { overflow: hidden; position: relative; color: #f4fbff; background: linear-gradient(112deg,#18364f 5%,#1c5262 80%,#217168); padding: 25px clamp(20px,3.6vw,42px); border-radius: 16px; box-shadow: var(--shadow); }
.hero::before { content: ""; pointer-events: none; position: absolute; right: -22px; top: -95px; width: 390px; height: 325px; transform: rotate(-27deg); border: 1px solid #90dad85c; border-radius: 52px; box-shadow: 0 0 0 22px #8fd3d923, 0 0 0 49px #8fd3d914, 0 0 0 77px #8fd3d914; }
.hero .hero-inner { position: relative; z-index: 1; }
.hero .caps { color: #a5e2db; margin-bottom: 8px; }
.hero p { margin: 10px 0 15px; color: #d9eaf0; }
.hero .button { border-color: #5e999d; background: #285c6a; color: white; }
.hero .button:hover { background: #327079; }
.hero .primary { background: #ddf7ef; border-color: #ddf7ef; color: #154b49; }
.hero .primary:hover { background: white; }
.kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-top: 14px; }
.kpi { display: flex; align-items: center; gap: 11px; padding: 13px 15px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.kpi strong { display: block; font-size: 23px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi span:last-child { color: var(--muted); font-size: 12px; }
.symbol { display: inline-grid; place-items: center; width: 37px; height: 37px; background: var(--teal-pale); color: var(--accent2); border-radius: 9px; flex: none; }
.symbol.blue { color: #315a7b; background: #e8f0f8; }
.symbol.amber { color: #805a29; background: #fbf0dd; }
.grid3 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.division { display: flex; flex-direction: column; gap: 10px; padding: 17px; min-height: 174px; border-top: 3px solid #358886; }
.division:nth-child(2) { border-top-color: #51799d; }
.division:nth-child(3) { border-top-color: #a17c45; }
.division .heading { display: flex; align-items: center; gap: 9px; }
.division .heading span:last-child { margin-left: auto; }
.division p { color: var(--muted); font-size: 13px; }
.division .foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 8px; }
.inline-link { display: inline-flex; gap: 6px; align-items: center; color: var(--accent2); font-weight: 680; }
.inline-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.shortcut { display: flex; align-items: center; gap: 10px; min-height: 61px; padding: 11px 13px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.shortcut:hover { border-color: #93bfb9; background: #fcffff; }
.shortcut strong { display: block; }
.shortcut .tail { margin-left: auto; color: #57747f; }
.segmented { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { display: inline-flex; gap: 6px; align-items: center; padding: 8px 13px; border-radius: 8px; border: 1px solid #cfdae3; background: #fff; color: #39546a; font-weight: 650; }
.tab:hover { background: #f3faf8; }
.tab[aria-current=page], .tab[aria-pressed=true] { border-color: #78b6ab; background: #e5f5f0; color: #145d55; }
.filterbar { display: grid; grid-template-columns: minmax(170px, 2fr) minmax(115px, 1fr) minmax(115px, 1fr); gap: 10px; margin-bottom: 13px; }
.filterbar.two { grid-template-columns: minmax(170px, 2fr) minmax(115px, 1fr); }
.list { overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 13px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #f7fbfc; }
.list-row .item-main { flex: 1; min-width: 0; }
.item-title { display: block; font-weight: 730; line-height: 1.45; overflow-wrap: anywhere; }
a.item-title:hover { color: var(--accent2); text-decoration: underline; text-underline-offset: 3px; }
.item-meta { margin-top: 5px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; color: var(--muted); font-size: 12px; }
.item-code { color: #365a75; font-weight: 700; flex: none; min-width: 46px; }
.plan-card, .lesson-card { display: grid; align-content: start; gap: 9px; padding: 17px; }
.plan-card:hover { border-color: #8ebcb8; }
.plan-card p, .lesson-card p { color: var(--muted); font-size: 13px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .number { flex: none; background: #e6f2f4; color: #1b6570; font-weight: 800; border-radius: 7px; padding: 5px 9px; }
.refs { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.ref { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #c8dedc; background: #eff9f7; color: #1b5e58; padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 690; }
.ref:hover { background: #dff1ee; }
.pdf-frame { display: block; width: 100%; height: min(67vh, 770px); min-height: 430px; border: 1px solid #c6d4e0; border-radius: 11px; background: #dde5ec; }
.bookmarks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px 12px; padding-top: 9px; }
.bookmarks a { padding: 6px; border-radius: 6px; color: var(--ink2); font-size: 13px; }
.bookmarks a:hover { background: #eef6f6; }
.nowrap { white-space: nowrap; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #edf3f7; color: #344f62; font-size: 12px; font-weight: 750; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.phone { font-variant-numeric: tabular-nums; font-weight: 750; letter-spacing: .02em; }
.phone a { color: var(--accent2); }
.phone a:hover { text-decoration: underline; }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.detail-block { white-space: pre-line; overflow-wrap: anywhere; }
.scenario { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.scenario:last-child { border-bottom: 0; }
.scenario p { font-size: 13px; color: var(--muted); }
.map-wrap { overflow: hidden; }
.map-tools { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); }
.map-viewport { position: relative; height: min(65vh, 760px); min-height: 350px; background: #e2e8ed; overflow: hidden; }
.map-viewport canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.map-viewport canvas.dragging { cursor: grabbing; }
.map-caption { padding: 9px 12px; color: var(--muted); font-size: 12px; }
.editor { width: min(94vw, 590px); border: 1px solid var(--line); border-radius: 15px; padding: 0; color: var(--ink); background: white; box-shadow: 0 20px 80px #14293e40; }
.editor::backdrop { background: #11283d80; }
.editor .editor-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 19px; border-bottom: 1px solid var(--line); }
.editor form { padding: 16px 19px 19px; display: grid; gap: 12px; }
.editor .check { display: flex; gap: 8px; align-items: center; }
.toast { position: fixed; z-index: 20; right: 20px; bottom: 22px; max-width: min(92vw, 440px); color: white; background: #16384c; border-radius: 10px; box-shadow: var(--shadow); padding: 11px 15px; }
.toast.problem { background: #922f28; }
.page-input { width: 84px; min-height: 33px; }
.profile { max-width: 540px; }
.profile form { display: grid; }
.profile form .button { justify-self: start; }

@media (max-width: 1050px) {
  .shell { grid-template-columns: 192px minmax(0,1fr); }
  .sidebar { padding-inline: 10px; }
  .topbar { padding-inline: 16px; }
  .topbar .utility { display: none; }
  .grid3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kpis { gap: 8px; }
  .kpi { padding-inline: 9px; gap: 7px; }
}
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 310px; gap: 17px; padding: 24px; }
  .login-copy h1 { margin: 6px 0 9px; }
  .login-copy p { font-size: 14px; }
  .flightline { display: none; }
  .login-side { padding: 18px 14px 30px; }
  .login-panel { padding: 23px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; height: auto; min-height: 0; position: fixed; z-index: 8; top: 60px; left: 0; bottom: 0; width: 220px; box-shadow: var(--shadow); }
  .sidebar.open { display: flex; }
  .sidebar .brand-line { display: none; }
  .topbar { min-height: 60px; padding: 8px 12px; gap: 7px; }
  .mobile-nav { display: inline-flex; }
  .global-search { width: min(54%, 350px); }
  .global-search input { min-height: 37px; padding-inline: 7px; }
  .global-search .button { min-width: 34px; min-height: 37px; padding: 6px; }
  .content { padding: 15px 12px 32px; }
  .kpis, .grid3 { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kpi .symbol { width: 31px; height: 31px; }
  .kpi strong { font-size: 19px; }
  .grid2, .notes-grid, .bookmarks { grid-template-columns: 1fr; }
  .filterbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filterbar input { grid-column: span 2; }
  .filterbar.two input { grid-column: auto; }
  .list-row { padding: 10px; gap: 7px; }
  .list-row .symbol { display: none; }
  .map-viewport { min-height: 330px; height: 56vh; }
}
@media (max-width: 430px) {
  .grid3 { grid-template-columns: 1fr; }
  .breadcrumb { font-size: 12px; max-width: 108px; overflow: hidden; text-overflow: ellipsis; }
  .filterbar.two { grid-template-columns: 1fr; }
}
