/* 我的高三 v0.14.0.0 — shared UI foundation
 * Loaded after app-v094.css as the final shared visual layer.
 * Business behavior remains in the existing runtime modules.
 */

:root {
  --ui-bg: #f6f7f5;
  --ui-surface: #ffffff;
  --ui-surface-soft: #fafbf9;
  --ui-text: #1d272b;
  --ui-text-secondary: #657177;
  --ui-text-tertiary: #7b878c;
  --ui-line: #dfe5e2;
  --ui-line-soft: #e9eeeb;
  --ui-accent: #2d6b5f;
  --ui-accent-soft: #eaf2ef;
  --ui-attention: #fbf7ed;
  --ui-attention-text: #765314;
  --ui-danger: #9d3030;
  --ui-danger-soft: #fff1f1;

  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-space-6: 24px;
  --ui-space-7: 32px;

  --ui-radius-sm: 10px;
  --ui-radius-md: 14px;
  --ui-radius-lg: 18px;
  --ui-radius-pill: 999px;

  --ui-shadow-sm: 0 4px 14px rgba(28, 45, 49, .045);
  --ui-shadow-md: 0 12px 30px rgba(28, 45, 49, .085);

  --ui-control-height: 44px;
  --ui-focus-ring: 0 0 0 3px rgba(45, 107, 95, .18);

  /* Map legacy shared tokens onto the new vocabulary during migration. */
  --bg: var(--ui-bg);
  --surface: var(--ui-surface);
  --surface-2: var(--ui-surface-soft);
  --text: var(--ui-text);
  --muted: var(--ui-text-secondary);
  --line: var(--ui-line);
  --accent: var(--ui-accent);
  --accent-soft: var(--ui-accent-soft);
  --warn: var(--ui-attention-text);
  --warn-soft: var(--ui-attention);
  --danger: var(--ui-danger);
  --danger-soft: var(--ui-danger-soft);
  --shadow: var(--ui-shadow-md);
}

html { background: var(--ui-bg); }

body {
  background: var(--ui-bg);
  color: var(--ui-text);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  min-width: 0;
  font: inherit;
}

button { color: inherit; }
a { text-underline-offset: 2px; }

:where(h1, h2, h3, h4, p) { overflow-wrap: anywhere; }
:where(h1, h2, h3, h4) { color: var(--ui-text); line-height: 1.28; }
:where(p) { color: var(--ui-text-secondary); }

:where(input, select, textarea) {
  min-height: var(--ui-control-height);
  border: 1px solid #cfd8d4;
  border-radius: 12px;
  background: var(--ui-surface);
  color: var(--ui-text);
  padding: 10px 12px;
  box-shadow: none;
}
:where(input, select, textarea)::placeholder { color: var(--ui-text-tertiary); opacity: 1; }
:where(input, select, textarea):disabled { background: #f3f5f4; color: #7d888d; cursor: not-allowed; }
:where(input[type="checkbox"], input[type="radio"]) { min-height: auto; }

:where(input, select, textarea):focus-visible,
:where(button, a, summary, [role="button"]):focus-visible {
  outline: 3px solid var(--ui-accent-soft);
  outline-offset: 2px;
  box-shadow: var(--ui-focus-ring);
}

:where(.btn) {
  min-height: var(--ui-control-height);
  border-radius: 12px;
  padding: 9px 15px;
  box-shadow: none;
}
:where(.btn-primary) { background: var(--ui-accent); }
:where(.btn-outline) { background: var(--ui-surface); border-color: var(--ui-line); }
:where(.btn-danger) { background: var(--ui-danger-soft); border-color: #f0cccc; }
:where(.btn-small) { min-height: var(--ui-control-height); padding: 8px 12px; }

:where(.card, .reading-section, .section-surface, .public-history, .public-reading-section, .deep-trajectory, .share-card) {
  border-radius: var(--ui-radius-md);
}
:where(.card) { border-color: var(--ui-line); box-shadow: var(--ui-shadow-sm); }

:where(.tabs) { gap: 4px; padding: 4px; border-radius: 12px; background: #e9eeeb; }
:where(.tab) { min-height: var(--ui-control-height); border-radius: 9px; padding: 8px 15px; color: var(--ui-text-secondary); }
:where(.tab.active) { color: var(--ui-text); background: var(--ui-surface); box-shadow: 0 1px 4px rgba(28, 45, 49, .06); }

:where(.status-region, .error-box, .notice-box) { border-radius: var(--ui-radius-sm); line-height: 1.55; }
:where(.empty) { min-height: 120px; display: grid; place-items: center; align-content: center; gap: 6px; padding: var(--ui-space-6) var(--ui-space-4); color: var(--ui-text-secondary); }
:where(.dialog-backdrop) { background: rgba(22, 31, 34, .38); }
:where(.dialog) { border-radius: var(--ui-radius-lg) var(--ui-radius-lg) 0 0; box-shadow: var(--ui-shadow-md); }
:where(.dialog-actions) { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
:where(.footer, .privacy-note) { color: var(--ui-text-tertiary); line-height: 1.5; }

@media (pointer: coarse) {
  :where(button, a.btn, .tab, summary, [role="button"]) { min-height: var(--ui-control-height); }
}

@media (max-width: 520px) {
  :root { --ui-control-height: 46px; }
  :where(.card-pad) { padding: var(--ui-space-4); }
  :where(.btn) { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --ui-line: #b8c3bf;
    --ui-line-soft: #cbd4d0;
    --ui-text-secondary: #4d5a60;
  }
  :where(input, select, textarea, .btn, .card, .reading-section, .public-reading-section, .dialog) { border-width: 2px; }
}

@media (forced-colors: active) {
  :where(input, select, textarea, .btn, a, summary, [role="button"]) { forced-color-adjust: auto; }
  :where(button, a, summary, [role="button"]):focus-visible { outline: 2px solid currentColor; box-shadow: none; }
}

/* v0.14.1 homepage and navigation — human-first reading */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.app-main{max-width:960px}
.app-main-tabs{width:min(100%,720px);margin:0 auto 22px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
.app-main-tabs .tab{width:100%;text-align:center}
.home-topbar .topbar-inner{gap:14px}
.home-brand{min-width:0}
.home-brand>span{white-space:nowrap}
.privacy-note-lite{color:var(--ui-text-tertiary);font-size:12px;white-space:nowrap}
.student-picker select{width:auto;min-width:112px;max-width:180px;background:var(--ui-surface)}
.home-account-trigger{min-width:64px}
.home-page{width:min(100%,900px);margin:0 auto;padding-bottom:24px}
.home-welcome{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin:2px 0 14px}
.home-welcome h1{margin:4px 0 0;font-size:clamp(30px,5vw,38px);letter-spacing:-.025em}
.home-welcome p{margin:5px 0 0;font-size:14px}
.home-latest{padding:22px;border:1px solid var(--ui-line);border-radius:20px;background:var(--ui-surface);box-shadow:var(--ui-shadow-sm)}
.home-latest-context{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.home-latest-context strong{display:block;font-size:18px}
.home-latest-context span{color:var(--ui-text-secondary);font-size:13px}
.home-latest-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(230px,.8fr);gap:22px;margin-top:20px}
.home-score-reading{display:grid;align-content:end;gap:4px}
.home-score-reading>strong{font-size:clamp(44px,9vw,68px);line-height:.98;letter-spacing:-.045em;font-weight:700}
.home-score-change{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:4px}
.home-score-change small{color:var(--ui-text-secondary);font-size:12px}
.home-position{min-width:0;padding-left:20px;border-left:1px solid var(--ui-line-soft)}
.home-coordinate-row{margin-top:6px}
.home-coordinate-row>span{display:block;margin:0 0 5px!important;font-size:17px;line-height:1.35;font-weight:650}
.home-coordinate-row>span::before{content:none!important}
.home-position-note{margin-top:8px;color:var(--ui-text-tertiary);font-size:12px;line-height:1.5}
.home-completion{margin-top:18px;padding-top:13px;border-top:1px solid var(--ui-line-soft);color:var(--ui-text-secondary);font-size:13px;line-height:1.55}
.home-completion .completion-note{margin:8px 0 0}
.home-change{margin-top:14px;padding:16px 2px;border-top:1px solid var(--ui-line);border-bottom:1px solid var(--ui-line)}
.home-change>div{display:grid;gap:3px}
.home-change strong{font-size:19px;line-height:1.45}
.home-change span{color:var(--ui-text-secondary);font-size:13px;line-height:1.55}
.home-change-sources{margin-top:14px}
.home-change-sources h2,.home-section-heading h2{margin:4px 0 0;font-size:18px}
.home-change-sources .change-source-list{margin-top:10px}
.home-subjects{margin-top:18px;padding:18px;border:1px solid var(--ui-line);border-radius:var(--ui-radius-md);background:var(--ui-surface)}
.home-subjects .subject-rows{margin-top:10px}
.home-subjects .subject-row{grid-template-columns:72px 94px minmax(0,1fr)}
.home-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:stretch;margin-top:18px}
.home-actions .btn{min-height:48px}
.home-empty{width:min(100%,640px);min-height:52vh;margin:0 auto;padding:42px 20px;display:grid;justify-items:center;align-content:center;text-align:center}
.home-empty-mark .brand-mark{margin-bottom:14px}
.home-empty .section-label{margin-top:2px}
.home-empty h1{max-width:520px;margin:6px 0 0;font-size:clamp(26px,5vw,34px)}
.home-empty>p{max-width:500px;margin:8px 0 0;line-height:1.7}
.home-empty .btn{margin-top:20px;min-width:180px}
.home-view-tabs{width:min(100%,540px);margin:-4px auto 18px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
.home-view-tabs .trajectory-subtab{width:100%;min-height:42px;text-align:center}
@media (max-width:760px){.app-main-tabs{width:100%;margin-bottom:18px}.home-welcome{align-items:flex-start}.home-latest-grid{grid-template-columns:1fr;gap:18px}.home-position{padding:14px 0 0;border-left:0;border-top:1px solid var(--ui-line-soft)}.home-subjects{padding:16px}}
@media (max-width:560px){.home-topbar .topbar-inner{align-items:center}.privacy-note-lite{display:none}.student-picker{flex:1 1 auto;min-width:0}.student-picker select{width:100%;max-width:none}.home-account-trigger{min-width:0}.home-brand>span{font-size:15px}.home-latest{padding:18px 16px;border-radius:18px}.home-latest-context{align-items:flex-start;flex-direction:column;gap:3px}.home-score-reading>strong{font-size:clamp(42px,15vw,58px)}.home-subjects .subject-row{grid-template-columns:64px 82px minmax(0,1fr);gap:9px}.home-actions{grid-template-columns:1fr}.home-actions .btn{width:100%}.home-view-tabs{margin-top:-2px}}

/* v0.14.4 global layout architecture — one shared spatial system.
 * Center the work/reading area; keep information left-aligned inside it.
 */
:root{
  --layout-outer:1200px;
  --layout-workspace:960px;
  --layout-reading:760px;
  --layout-measure:640px;
  --layout-gutter:clamp(16px,3vw,32px);
  --layout-section-gap:clamp(28px,5vw,48px);
}
.topbar-inner{
  width:min(100%,var(--layout-outer));
  max-width:var(--layout-outer);
  margin-inline:auto;
  padding-inline:var(--layout-gutter);
}
.container{
  width:min(100%,var(--layout-outer));
  max-width:var(--layout-outer);
  margin-inline:auto;
  padding:24px var(--layout-gutter) 64px;
}
.app-main{
  width:min(100%,var(--layout-workspace));
  max-width:var(--layout-workspace);
  margin-inline:auto;
}
.home-page{
  width:min(100%,var(--layout-workspace));
  max-width:var(--layout-workspace);
  margin-inline:auto;
}
.app-main-tabs{
  width:min(100%,var(--layout-reading));
  max-width:var(--layout-reading);
  margin-inline:auto;
}
.public-shell:not(.eink-share),
.reading-frame,
.change-section,
.deep-trajectory{
  width:min(calc(100% - (2 * var(--layout-gutter))),var(--layout-reading));
  max-width:var(--layout-reading);
  margin-inline:auto;
  box-sizing:border-box;
}
:where(.reading-section,.public-reading-section,.public-history){
  width:min(100%,var(--layout-reading));
  max-width:var(--layout-reading);
  margin-inline:auto;
  box-sizing:border-box;
}
@media (min-width:1200px){
  .container{padding-top:32px}
  .home-page{padding-bottom:40px}
}
@media (max-width:640px){
  .app-main-tabs{width:100%}
  .public-shell:not(.eink-share),
  .reading-frame,
  .change-section,
  .deep-trajectory,
  :where(.reading-section,.public-reading-section,.public-history){
    width:100%;
    max-width:none;
  }
}

/* v0.14.4 reading typography — one stable rhythm for page families. */
:root{
  --ui-font-body:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans CJK SC",sans-serif;
  --ui-font-reading:ui-serif,"Songti SC","STSong","Noto Serif CJK SC",serif;
  --ui-text-size-body:16px;
  --ui-text-size-meta:13px;
  --ui-text-size-label:12px;
  --ui-leading-body:1.62;
}
body{
  font-family:var(--ui-font-body);
  font-size:var(--ui-text-size-body);
  line-height:var(--ui-leading-body);
}
:where(.page-heading h1,.home-welcome h1){text-wrap:balance}
:where(.page-heading p,.section-head-simple p,.home-welcome p){max-width:var(--layout-measure,640px)}
:where(.section-label,.eyebrow){font-size:var(--ui-text-size-label)}
:where(.page-heading p,.section-head-simple p,.home-welcome p,small){line-height:1.55}

/* v0.15.2 private human-flow correction */
.exam-list-row { text-decoration: none; color: inherit; }
