/* ============================================================
 * material.css —— Android 16 Material You 设计系统
 * ITTeach学习网 · 强调色：科技蓝 · 星空 + 流萤
 * ============================================================ */

/* ---------- 1. 设计令牌（Material 3 Expressive 语义色） ---------- */
:root {
  color-scheme: dark light;

  /* 科技蓝主色阶 */
  --blue-10: #001a33;
  --blue-20: #002d5c;
  --blue-30: #00428a;
  --blue-40: #1a5fbf;
  --blue-50: #3b82f6;   /* 品牌强调色 */
  --blue-60: #6aa4ff;
  --blue-70: #9cc6ff;
  --blue-80: #c7e0ff;
  --cyan:    #22d3ee;
  --gold:    #f5c96b;

  /* 深空底色 */
  --space-0: #060a14;
  --space-1: #0b1220;
  --space-2: #111c30;
  --space-3: #182741;

  /* 暗色（默认）语义色 */
  --md-sys-color-primary:            var(--blue-60);
  --md-sys-color-on-primary:         #04203f;
  --md-sys-color-primary-container:  var(--blue-30);
  --md-sys-color-on-primary-container: var(--blue-80);
  --md-sys-color-secondary:          #9cc6ff;
  --md-sys-color-on-secondary:       #062146;
  --md-sys-color-secondary-container:#24406e;
  --md-sys-color-on-secondary-container: #d3e4ff;
  --md-sys-color-tertiary:           var(--cyan);
  --md-sys-color-on-tertiary:        #00333c;
  --md-sys-color-tertiary-container: #0d5563;
  --md-sys-color-error:              #ffb4ab;
  --md-sys-color-on-error:           #690005;
  --md-sys-color-error-container:    #93000a;
  --md-sys-color-on-error-container: #ffdad6;
  --md-sys-color-success:            #6ee7b7;
  --md-sys-color-warning:            var(--gold);

  --md-sys-color-surface-dim:   var(--space-0);
  --md-sys-color-surface:       var(--space-1);
  --md-sys-color-surface-bright:#16233b;
  --md-sys-color-surface-container-lowest: #04070f;
  --md-sys-color-surface-container-low:    #0d1626;
  --md-sys-color-surface-container:        var(--space-2);
  --md-sys-color-surface-container-high:   #16233a;
  --md-sys-color-surface-container-highest:#1d2c47;
  --md-sys-color-surface-variant:   #1a2942;
  --md-sys-color-on-surface:        #e3ecff;
  --md-sys-color-on-surface-variant:#b3c4de;
  --md-sys-color-outline:           #50628a;
  --md-sys-color-outline-variant:   #33456b;
  --md-sys-color-shadow:            #000000;
  --md-sys-color-scrim:             #000000;
  --md-sys-color-inverse-surface:   #e3ecff;
  --md-sys-color-inverse-on-surface:#16233b;
  --md-sys-color-inverse-primary:   var(--blue-40);

  /* 圆角（Expressive：更大更软） */
  --md-sys-shape-corner-none: 0px;
  --md-sys-shape-corner-extra-small: 6px;
  --md-sys-shape-corner-small: 10px;
  --md-sys-shape-corner-medium: 16px;
  --md-sys-shape-corner-large: 22px;
  --md-sys-shape-corner-extra-large: 28px;
  --md-sys-shape-corner-extra-extra-large: 36px;
  --md-sys-shape-corner-full: 999px;

  /* 间距 4dp 基准 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* 高度（ tonal surface + 微弱蓝调投影） */
  --md-sys-elevation-0: none;
  --md-sys-elevation-1: 0 1px 2px rgba(0,0,0,.28), 0 1px 3px rgba(59,130,246,.06);
  --md-sys-elevation-2: 0 2px 6px rgba(0,0,0,.32), 0 1px 8px rgba(59,130,246,.08);
  --md-sys-elevation-3: 0 4px 12px rgba(0,0,0,.38), 0 2px 16px rgba(59,130,246,.10);
  --md-sys-elevation-4: 0 8px 24px rgba(0,0,0,.44), 0 4px 28px rgba(59,130,246,.12);

  /* 动效（Material 3 缓动） */
  --md-sys-motion-easing-emphasized: cubic-bezier(.2, 0, 0, 1);
  --md-sys-motion-easing-emphasized-decelerate: cubic-bezier(.05, .7, .1, 1);
  --md-sys-motion-easing-emphasized-accelerate: cubic-bezier(.3, 0, .8, .15);
  --md-sys-motion-easing-standard: cubic-bezier(.2, 0, 0, 1);
  --md-sys-motion-duration-short: 200ms;
  --md-sys-motion-duration-medium: 350ms;
  --md-sys-motion-duration-long: 500ms;

  /* 布局 */
  --nav-rail-w: 80px;
  --top-bar-h: 64px;
  --content-max: 1180px;

  /* 星空调色（供 canvas / 背景使用） */
  --star-1: rgba(255,255,255,.85);
  --star-2: rgba(156,198,255,.65);
  --mote:   rgba(245,201,107,.9);

  --font-sans: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI",
               "WenQuanYi Micro Hei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", Consolas,
               "WenQuanYi Micro Hei Mono", monospace;
}

/* 亮色主题：仍以科技蓝为强调色，浅空背景 */
:root[data-theme="light"] {
  color-scheme: light;
  --md-sys-color-primary:            var(--blue-40);
  --md-sys-color-on-primary:         #ffffff;
  --md-sys-color-primary-container:  var(--blue-80);
  --md-sys-color-on-primary-container:#001a33;
  --md-sys-color-secondary:          var(--blue-30);
  --md-sys-color-on-secondary:       #ffffff;
  --md-sys-color-secondary-container:#cfe1ff;
  --md-sys-color-on-secondary-container:#001d3d;
  --md-sys-color-tertiary:           #0d5563;
  --md-sys-color-on-tertiary:        #ffffff;
  --md-sys-color-tertiary-container: #b8ecf5;
  --md-sys-color-on-tertiary-container:#002027;
  --md-sys-color-error:              #ba1a1a;
  --md-sys-color-on-error:           #ffffff;
  --md-sys-color-error-container:    #ffdad6;
  --md-sys-color-on-error-container: #410002;
  --md-sys-color-success:            #0f7b55;
  --md-sys-color-warning:            #9a6a00;

  --md-sys-color-surface-dim:   #dde4f2;
  --md-sys-color-surface:       #f4f7ff;
  --md-sys-color-surface-bright:#ffffff;
  --md-sys-color-surface-container-lowest:#ffffff;
  --md-sys-color-surface-container-low:   #eef3fd;
  --md-sys-color-surface-container:       #e8effb;
  --md-sys-color-surface-container-high:  #e2eaf8;
  --md-sys-color-surface-container-highest:#dbe5f4;
  --md-sys-color-surface-variant: #e0e8f7;
  --md-sys-color-on-surface:      #16233b;
  --md-sys-color-on-surface-variant:#3f5170;
  --md-sys-color-outline:         #7082a3;
  --md-sys-color-outline-variant: #bfcbe0;
  --md-sys-color-inverse-surface: #2b384f;
  --md-sys-color-inverse-on-surface:#f0f4ff;
  --md-sys-color-inverse-primary: var(--blue-50);

  --md-sys-elevation-1: 0 1px 2px rgba(22,35,59,.06), 0 1px 4px rgba(59,130,246,.05);
  --md-sys-elevation-2: 0 2px 6px rgba(22,35,59,.08), 0 2px 10px rgba(59,130,246,.06);
  --md-sys-elevation-3: 0 4px 14px rgba(22,35,59,.10), 0 4px 20px rgba(59,130,246,.08);
  --md-sys-elevation-4: 0 10px 30px rgba(22,35,59,.14), 0 6px 34px rgba(59,130,246,.10);

  --star-1: rgba(59,130,246,.55);
  --star-2: rgba(59,130,246,.32);
  --mote:   rgba(160,110,0,.75);
}

/* ---------- 2. 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard),
              color var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}
h1, h2, h3, h4, h5 { line-height: 1.3; margin: 0 0 var(--sp-3); font-weight: 650; letter-spacing: .01em; }
h1 { font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.3rem); }
h2 { font-size: clamp(1.3rem, 1rem + 1vw, 1.75rem); }
h3 { font-size: 1.12rem; }
p  { margin: 0 0 var(--sp-3); }
a  { color: var(--md-sys-color-primary); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
img, svg, canvas { max-width: 100%; }
code, pre, kbd { font-family: var(--font-mono); }
:focus-visible {
  outline: 3px solid var(--md-sys-color-primary);
  outline-offset: 3px;
  border-radius: var(--md-sys-shape-corner-small);
}
::selection { background: rgba(59,130,246,.32); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-full);
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--md-sys-color-outline); background-clip: content-box; }

/* ---------- 3. 星空背景 + 流萤 canvas ---------- */
#sky {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
}
.bg-aura {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(59,130,246,.20), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(34,211,238,.13), transparent 60%),
    radial-gradient(1000px 700px at 50% 108%, rgba(139,92,246,.12), transparent 62%);
  transition: opacity var(--md-sys-motion-duration-long) var(--md-sys-motion-easing-standard);
}
:root[data-theme="light"] .bg-aura { opacity: .55; }

.app-shell { position: relative; z-index: 1; }

/* ---------- 4. 顶栏（TopAppBar） ---------- */
.app-bar {
  position: sticky; top: 0; z-index: 40;
  height: var(--top-bar-h);
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-4);
  background: color-mix(in srgb, var(--md-sys-color-surface) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 55%, transparent);
}
.brand { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.brand-logo {
  width: 40px; height: 40px; flex: none;
  border-radius: var(--md-sys-shape-corner-medium);
  object-fit: cover;
  box-shadow: var(--md-sys-elevation-1), 0 0 14px rgba(59,130,246,.35);
}
.brand-mark {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--md-sys-shape-corner-medium);
  background: linear-gradient(140deg, var(--blue-50), var(--blue-30));
  color: #fff; box-shadow: 0 0 16px rgba(59,130,246,.45);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name {
  font-size: 1.06rem; font-weight: 700; letter-spacing: .01em;
  background: linear-gradient(92deg, var(--md-sys-color-on-surface) 20%, var(--cyan) 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.brand-sub {
  font-size: .72rem; color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-bar-spacer { flex: 1 1 auto; }
.app-bar-actions { display: flex; align-items: center; gap: var(--sp-2); }

.stat-mini {
  font-size: .74rem; color: var(--md-sys-color-on-surface-variant);
  padding: 5px 12px; border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  white-space: nowrap;
}
.stat-mini b { color: var(--md-sys-color-primary); font-variant-numeric: tabular-nums; }

.auth-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px;
  font-size: .78rem; font-weight: 600;
  border-radius: var(--md-sys-shape-corner-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}
.auth-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--md-sys-color-outline);
}
.auth-badge[data-tier="full"] {
  background: color-mix(in srgb, var(--md-sys-color-primary-container) 55%, transparent);
  color: var(--md-sys-color-on-primary-container);
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 45%, transparent);
}
.auth-badge[data-tier="full"]::before { background: var(--md-sys-color-success); box-shadow: 0 0 8px var(--md-sys-color-success); }
.auth-badge[data-tier="trial"]::before { background: var(--md-sys-color-warning); box-shadow: 0 0 8px var(--md-sys-color-warning); }
.auth-badge:hover { box-shadow: var(--md-sys-elevation-1); }

/* ---------- 5. 导航（NavRail → 底部 NavBar） ---------- */
.nav-rail {
  position: sticky; top: var(--top-bar-h); z-index: 30;
  width: var(--nav-rail-w);
  height: calc(100dvh - var(--top-bar-h));
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4) 0;
  background: color-mix(in srgb, var(--md-sys-color-surface-container-low) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 45%, transparent);
}
.nav-item {
  position: relative;
  width: 60px; padding: 9px 4px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 0; background: transparent; cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  font-family: inherit; font-size: .67rem; line-height: 1.2;
  border-radius: var(--md-sys-shape-corner-full);
  transition: color var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}
.nav-item svg { width: 21px; height: 21px; }
.nav-item .nav-ico {
  display: grid; place-items: center;
  width: 44px; height: 30px;
  border-radius: var(--md-sys-shape-corner-full);
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized);
}
.nav-item:hover .nav-ico { background: var(--md-sys-color-surface-container-highest); }
.nav-item[aria-current="page"] { color: var(--md-sys-color-on-primary-container); font-weight: 650; }
.nav-item[aria-current="page"] .nav-ico {
  background: var(--md-sys-color-primary-container);
  box-shadow: 0 0 18px rgba(59,130,246,.35);
  transform: translateY(-1px);
}

/* ---------- 6. 布局容器 ---------- */
.layout { display: flex; align-items: flex-start; }
.content-wrap { flex: 1 1 auto; min-width: 0; }
.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-6) var(--sp-12);
}
.page-head { margin-bottom: var(--sp-6); }
.page-title { margin-bottom: var(--sp-2); }
.page-lead {
  color: var(--md-sys-color-on-surface-variant);
  max-width: 72ch; font-size: .94rem;
}
.crumb { font-size: .76rem; color: var(--md-sys-color-on-surface-variant); margin-bottom: var(--sp-2); }
.crumb a { color: inherit; }
.crumb span { opacity: .6; margin: 0 6px; }

/* ---------- 7. Material 卡片与表面 ---------- */
.surface {
  background: var(--md-sys-color-surface-container);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 50%, transparent);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--md-sys-elevation-1);
}
.card {
  position: relative;
  background: var(--md-sys-color-surface-container);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 50%, transparent);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--md-sys-elevation-1);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-5);
  transition: box-shadow var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized),
              transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized),
              border-color var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}
.card:hover {
  box-shadow: var(--md-sys-elevation-3);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 38%, transparent);
}
.card-t {
  font-size: 1rem; font-weight: 650; margin-bottom: var(--sp-3);
  display: flex; align-items: center; gap: var(--sp-2);
}
.card-t .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: linear-gradient(140deg, var(--cyan), var(--blue-50));
  box-shadow: 0 0 10px rgba(34,211,238,.7);
}
.card p:last-child, .card ul:last-child, .card ol:last-child { margin-bottom: 0; }
.card-grid {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card-grid .card { margin-bottom: 0; }

.hero {
  position: relative; overflow: hidden;
  padding: var(--sp-8) var(--sp-6);
  border-radius: var(--md-sys-shape-corner-extra-extra-large);
  background:
    radial-gradient(700px 320px at 88% 12%, rgba(34,211,238,.16), transparent 60%),
    linear-gradient(150deg, var(--md-sys-color-surface-container-high), var(--md-sys-color-surface-container-low));
  border: 1px solid color-mix(in srgb, var(--md-sys-color-primary) 28%, transparent);
  box-shadow: var(--md-sys-elevation-2);
  margin-bottom: var(--sp-6);
}
.hero h1 { margin-bottom: var(--sp-3); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }

/* ---------- 8. 按钮（Material 3） ---------- */
.btn {
  --btn-bg: var(--md-sys-color-surface-container-highest);
  --btn-fg: var(--md-sys-color-on-surface);
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px;
  font-family: inherit; font-size: .9rem; font-weight: 600;
  color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 70%, transparent);
  border-radius: var(--md-sys-shape-corner-full);
  cursor: pointer; user-select: none;
  transition: transform var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-emphasized),
              box-shadow var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard),
              background var(--md-sys-motion-duration-short) linear;
}
.btn:hover { box-shadow: var(--md-sys-elevation-2); transform: translateY(-1px); }
.btn:active { transform: scale(.97); box-shadow: var(--md-sys-elevation-0); }
.btn-primary {
  --btn-bg: linear-gradient(120deg, var(--blue-50), var(--blue-30));
  --btn-fg: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(59,130,246,.32);
}
.btn-primary:hover { box-shadow: 0 8px 26px rgba(59,130,246,.42); }
.btn-tonal {
  --btn-bg: var(--md-sys-color-secondary-container);
  --btn-fg: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
}
.btn-outline { --btn-bg: transparent; --btn-fg: var(--md-sys-color-primary);
  border-color: color-mix(in srgb, var(--md-sys-color-outline) 70%, transparent); }
.btn-text { --btn-bg: transparent; --btn-fg: var(--md-sys-color-primary); border-color: transparent; }
.btn-danger { --btn-bg: var(--md-sys-color-error-container); --btn-fg: var(--md-sys-color-on-error-container); border-color: transparent; }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 13px;
  font-family: inherit; font-size: .76rem; font-weight: 550;
  color: var(--md-sys-color-on-secondary-container);
  background: var(--md-sys-color-secondary-container);
  border: 1px solid transparent; border-radius: var(--md-sys-shape-corner-full);
  cursor: pointer;
  transition: background var(--md-sys-motion-duration-short) linear;
}
.chip:hover { background: color-mix(in srgb, var(--md-sys-color-secondary-container) 70%, var(--md-sys-color-primary) 30%); }
.chip-outline {
  background: transparent; color: var(--md-sys-color-primary);
  border-color: color-mix(in srgb, var(--md-sys-color-outline) 65%, transparent);
}
.chip[aria-pressed="true"] {
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);
}
.chip-lock { background: var(--md-sys-color-surface-container-highest); color: var(--md-sys-color-on-surface-variant); }

/* 图标按钮 */
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: var(--md-sys-shape-corner-full); cursor: pointer;
  background: transparent; color: var(--md-sys-color-on-surface-variant);
  transition: background var(--md-sys-motion-duration-short) linear, color var(--md-sys-motion-duration-short) linear;
}
.icon-btn:hover { background: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- 9. 列表项 / 章节卡 ---------- */
.list { display: flex; flex-direction: column; gap: var(--sp-2); }
.list-item {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface-container-low);
  border: 1px solid transparent;
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}
.list-item:hover {
  background: var(--md-sys-color-surface-container);
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 30%, transparent);
}
.list-item-main { flex: 1 1 auto; min-width: 0; }
.list-item-t { font-weight: 600; margin-bottom: 2px; }
.list-item-s { font-size: .78rem; color: var(--md-sys-color-on-surface-variant); }
.list-item-x { flex: none; display: flex; align-items: center; gap: var(--sp-2); }

.topic-card {
  display: block; text-decoration: none; color: inherit;
  padding: var(--sp-5);
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: var(--md-sys-color-surface-container);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 50%, transparent);
  box-shadow: var(--md-sys-elevation-1);
  transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}
.topic-card:hover {
  text-decoration: none; transform: translateY(-3px);
  box-shadow: var(--md-sys-elevation-3), 0 0 26px rgba(59,130,246,.18);
  border-color: color-mix(in srgb, var(--md-sys-color-primary) 45%, transparent);
}
.topic-ico {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: var(--md-sys-shape-corner-medium);
  background: linear-gradient(140deg, rgba(59,130,246,.28), rgba(34,211,238,.14));
  color: var(--md-sys-color-primary); margin-bottom: var(--sp-3);
}
.topic-ico svg { width: 21px; height: 21px; }
.topic-t { font-weight: 650; margin-bottom: 4px; }
.topic-s { font-size: .8rem; color: var(--md-sys-color-on-surface-variant); }
.topic-meta {
  display: flex; gap: var(--sp-3); margin-top: var(--sp-3);
  font-size: .72rem; color: var(--md-sys-color-on-surface-variant);
}
.topic-meta i { font-style: normal; color: var(--md-sys-color-primary); font-weight: 650; }

/* ---------- 10. 进度条 ---------- */
.progress {
  height: 7px; border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-surface-container-highest);
  overflow: hidden;
}
.progress > i {
  display: block; height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue-50));
  box-shadow: 0 0 12px rgba(59,130,246,.55);
  transition: width var(--md-sys-motion-duration-long) var(--md-sys-motion-easing-emphasized);
}
.ring {
  --p: 0; --sz: 96px; --th: 9px;
  width: var(--sz); height: var(--sz); flex: none;
  border-radius: 50%;
  background: conic-gradient(var(--blue-50) calc(var(--p) * 1%), var(--md-sys-color-surface-container-highest) 0);
  display: grid; place-items: center;
  position: relative;
}
.ring::before {
  content: ''; position: absolute;
  inset: var(--th); border-radius: 50%;
  background: var(--md-sys-color-surface-container);
}
.ring b { position: relative; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.ring span { position: absolute; bottom: 16%; font-size: .66rem; color: var(--md-sys-color-on-surface-variant); }

/* ---------- 11. 提示条 ---------- */
.note {
  display: flex; gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--md-sys-shape-corner-large);
  background: color-mix(in srgb, var(--md-sys-color-primary-container) 30%, transparent);
  border-left: 4px solid var(--md-sys-color-primary);
  margin-bottom: var(--sp-4);
  font-size: .88rem;
}
.note-warn {
  background: color-mix(in srgb, var(--md-sys-color-error-container) 26%, transparent);
  border-left-color: var(--md-sys-color-error);
}
.note-ok {
  background: color-mix(in srgb, var(--md-sys-color-tertiary-container) 36%, transparent);
border-left-color: var(--md-sys-color-tertiary);
}
.note b { color: var(--md-sys-color-on-surface); }
.hint { font-size: .78rem; color: var(--md-sys-color-on-surface-variant); }
.kbd {
  display: inline-block; padding: 1px 7px; font-size: .76rem;
  border-radius: var(--md-sys-shape-corner-extra-small);
  background: var(--md-sys-color-surface-container-highest);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
}

/* ---------- 12. 锁定遮罩 ---------- */
[data-pro].is-locked { position: relative; }
[data-pro].is-locked > * {
  filter: blur(4.5px) saturate(.7);
  pointer-events: none; user-select: none;
  transition: filter var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}
[data-pro].is-locked::after {
  content: '🔒 高阶内容 · 需授权码解锁';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: .92rem; font-weight: 650;
  color: var(--md-sys-color-on-primary-container);
  background: color-mix(in srgb, var(--md-sys-color-surface) 58%, transparent);
  border-radius: inherit;
  cursor: pointer;
  z-index: 3;
}
#content[data-locked="1"] .lock-veil { display: grid; }
.lock-veil {
  display: none;
  place-items: center; text-align: center;
  gap: var(--sp-4);
  padding: var(--sp-10) var(--sp-6);
  margin-bottom: var(--sp-5);
  border-radius: var(--md-sys-shape-corner-extra-extra-large);
  background:
    radial-gradient(520px 240px at 80% 8%, rgba(59,130,246,.18), transparent 60%),
    var(--md-sys-color-surface-container);
  border: 1px dashed color-mix(in srgb, var(--md-sys-color-primary) 55%, transparent);
}
.lock-ico {
  width: 56px; height: 56px; display: grid; place-items: center;
  border-radius: var(--md-sys-shape-corner-extra-large);
  background: linear-gradient(140deg, var(--blue-50), var(--blue-30));
  color: #fff; box-shadow: 0 0 26px rgba(59,130,246,.45);
}
.lock-ico svg { width: 26px; height: 26px; }

/* ---------- 13. 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--md-sys-shape-corner-large); }
table.tbl {
  width: 100%; border-collapse: collapse;
  font-size: .86rem;
  min-width: 520px;
}
table.tbl th, table.tbl td {
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
table.tbl thead th {
  background: var(--md-sys-color-surface-container-high);
  font-weight: 650; font-size: .8rem;
  color: var(--md-sys-color-on-surface-variant);
  position: sticky; top: 0;
}
table.tbl tbody tr { transition: background var(--md-sys-motion-duration-short) linear; }
table.tbl tbody tr:hover { background: var(--md-sys-color-surface-container-low); }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td code { font-size: .8rem; color: var(--cyan); }

/* ---------- 14. 代码 ---------- */
pre.code {
  margin: 0 0 var(--sp-4);
  padding: var(--sp-4);
  overflow-x: auto;
  font-size: .82rem; line-height: 1.7;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-large);
}
code.inline {
  padding: 1px 6px; font-size: .84em;
  background: var(--md-sys-color-surface-container-highest);
  border-radius: var(--md-sys-shape-corner-extra-small);
  color: var(--cyan);
}
.tk-k { color: #c4b5fd; } .tk-s { color: #6ee7b7; } .tk-n { color: #fbbf24; }
.tk-c { color: #64748b; } .tk-f { color: #7dd3fc; } .tk-b { color: #fda4af; }

/* ---------- 15. 动态图解容器 ---------- */
.dy-figure {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-3);
  background:
    radial-gradient(600px 200px at 15% 0%, rgba(59,130,246,.10), transparent 60%),
    var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-extra-large);
  overflow: hidden;
}
.dy-svg { display: block; width: 100%; height: auto; }
.dy-t { fill: var(--md-sys-color-on-surface); font-size: 12.5px; }
.dy-t2 { fill: var(--md-sys-color-on-surface-variant); font-size: 11px; }
.dy-h { fill: var(--md-sys-color-primary); font-size: 13px; font-weight: 600; }
.dy-tag { fill: var(--md-sys-color-tertiary); font-size: 10px; }
.dy-box rect { transition: all 420ms var(--md-sys-motion-easing-emphasized); }
.dy-box.is-hot rect {
  stroke: var(--cyan) !important;
  stroke-width: 2.4 !important;
  filter: url(#itteachGlow);
}
.dy-box.is-done rect { stroke: rgba(52,211,153,.75) !important; fill: rgba(52,211,153,.14) !important; }
.dy-box.is-done .dy-t { fill: #6ee7b7; }
.dy-line { transition: stroke .4s linear, opacity .4s linear; }
.dy-line.is-hot { stroke: var(--cyan) !important; stroke-width: 2.6; }
.dy-cap {
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  font-size: .83rem; color: var(--md-sys-color-on-surface-variant);
  background: color-mix(in srgb, var(--md-sys-color-tertiary-container) 32%, transparent);
  border-left: 3px solid var(--md-sys-color-tertiary);
  border-radius: var(--md-sys-shape-corner-medium);
}
.dy-cap b {
  display: inline-block; margin-right: 8px;
  color: var(--md-sys-color-tertiary); font-size: .78rem;
}
.dy-missing { padding: var(--sp-4); color: var(--md-sys-color-error); font-size: .85rem; }
.dy-wave { stroke-dasharray: 0; }

/* ---------- 16. 测验 ---------- */
.quiz { }
.quiz-q {
  padding: var(--sp-4) 0;
  border-bottom: 1px dashed var(--md-sys-color-outline-variant);
}
.quiz-q:last-child { border-bottom: 0; }
.quiz-stem { display: flex; gap: 10px; font-weight: 550; margin-bottom: var(--sp-3); }
.quiz-no {
  flex: none; width: 24px; height: 24px;
  display: grid; place-items: center;
  font-size: .74rem; font-weight: 700;
  border-radius: var(--md-sys-shape-corner-extra-small);
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}
.quiz-opts { display: flex; flex-direction: column; gap: 8px; margin-left: 34px; }
.quiz-opt {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 14px; cursor: pointer;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface-container-low);
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  font-size: .88rem;
}
.quiz-opt:hover { border-color: var(--md-sys-color-primary); background: var(--md-sys-color-surface-container); }
.quiz-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.quiz-opt .mk {
  flex: none; width: 18px; height: 18px; margin-top: 2px;
  border: 2px solid var(--md-sys-color-outline); border-radius: 50%;
  position: relative;
  transition: border-color var(--md-sys-motion-duration-short) linear;
}
.quiz-opt.right { border-color: #34d399; background: color-mix(in srgb, #34d399 14%, transparent); }
.quiz-opt.right .mk { border-color: #34d399; }
.quiz-opt.right .mk::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #34d399;
}
.quiz-opt.wrong { border-color: #f87171; background: color-mix(in srgb, #f87171 12%, transparent); }
.quiz-opt.wrong .mk { border-color: #f87171; }
.quiz-opt.wrong .mk::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #f87171;
}
.quiz-opt.disabled { pointer-events: none; }
.quiz-exp {
  margin: 10px 0 0 34px; padding: 10px 14px;
  font-size: .82rem; border-radius: var(--md-sys-shape-corner-medium);
  background: color-mix(in srgb, var(--md-sys-color-tertiary-container) 30%, transparent);
  border-left: 3px solid var(--md-sys-color-tertiary);
  display: none;
}
.quiz-exp.show { display: block; animation: slideIn var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized); }
.quiz-exp b { color: var(--md-sys-color-tertiary); }
.quiz-bar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4);
  background: color-mix(in srgb, var(--md-sys-color-surface) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-extra-large);
  box-shadow: var(--md-sys-elevation-2);
}
.quiz-score { font-size: .86rem; color: var(--md-sys-color-on-surface-variant); }
.quiz-score b { font-size: 1.1rem; color: var(--md-sys-color-primary); font-variant-numeric: tabular-nums; }

/* ---------- 17. 对话框 / Activity ---------- */
.dlg-scrim, .act-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(3,6,14,.62);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
}
.dlg-scrim.is-in, .act-scrim.is-in { opacity: 1; }
.dlg {
  position: fixed; z-index: 90; left: 50%; top: 50%;
  transform: translate(-50%, -46%) scale(.94);
  width: min(560px, calc(100vw - 32px));
  max-height: min(86dvh, 760px);
  display: flex; flex-direction: column;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid color-mix(in srgb, var(--md-sys-color-primary) 26%, transparent);
  border-radius: var(--md-sys-shape-corner-extra-extra-large);
  box-shadow: var(--md-sys-elevation-4), 0 0 60px rgba(59,130,246,.18);
  opacity: 0; pointer-events: none;
  transition: opacity var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized),
              transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
  overflow: hidden;
}
.dlg.is-in { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.dlg-head { padding: var(--sp-6) var(--sp-6) var(--sp-3); display: flex; gap: var(--sp-3); align-items: flex-start; }
.dlg-ico {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  border-radius: var(--md-sys-shape-corner-medium);
  background: linear-gradient(140deg, var(--blue-50), var(--blue-30));
  color: #fff; box-shadow: 0 0 20px rgba(59,130,246,.4);
}
.dlg-ico svg { width: 22px; height: 22px; }
.dlg-title { font-size: 1.16rem; font-weight: 680; margin: 0 0 2px; }
.dlg-sub { font-size: .8rem; color: var(--md-sys-color-on-surface-variant); margin: 0; }
.dlg-body {
  padding: 0 var(--sp-6) var(--sp-4);
  overflow-y: auto; overscroll-behavior: contain;
}
.dlg-actions {
  display: flex; justify-content: flex-end; gap: var(--sp-2); flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-6) var(--sp-5);
}
.field { margin-bottom: var(--sp-4); }
.field-label {
  display: block; font-size: .78rem; font-weight: 600;
  color: var(--md-sys-color-on-surface-variant); margin-bottom: 6px;
}
.input {
  width: 100%; height: 50px;
  padding: 0 16px;
  font-family: var(--font-mono); font-size: .95rem; letter-spacing: .06em;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-lowest);
  border: 1.5px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  transition: border-color var(--md-sys-motion-duration-short) linear,
              box-shadow var(--md-sys-motion-duration-short) linear;
}
.input:focus {
  outline: 0;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 22%, transparent);
}
.input.bad { border-color: var(--md-sys-color-error); animation: shake 320ms var(--md-sys-motion-easing-standard); }
.input.ok  { border-color: var(--md-sys-color-success); }
.msg { font-size: .8rem; min-height: 20px; margin: -6px 0 var(--sp-3); }
.msg.bad { color: var(--md-sys-color-error); }
.msg.ok  { color: var(--md-sys-color-success); }

/* Activity（QQ 联系页） */
.act {
  position: fixed; z-index: 90; right: 0; top: 0;
  width: min(480px, 100vw); height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--md-sys-color-surface-container-low);
  border-left: 1px solid color-mix(in srgb, var(--md-sys-color-primary) 22%, transparent);
  box-shadow: var(--md-sys-elevation-4);
  transform: translateX(102%);
  transition: transform var(--md-sys-motion-duration-long) var(--md-sys-motion-easing-emphasized);
  overflow: hidden;
}
.act.is-in { transform: translateX(0); }
.act-bar {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--md-sys-color-surface-container) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.act-title { flex: 1 1 auto; margin: 0; font-size: 1rem; font-weight: 650; }
.act-body { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-4); }
.contact-hero { display: flex; gap: var(--sp-4); align-items: center; }
.contact-name { font-weight: 700; margin: 0 0 2px; }
.contact-sub { font-size: .78rem; color: var(--md-sys-color-on-surface-variant); margin: 0 0 6px; }
.contact-qq { margin: 0; font-size: .9rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.contact-qq b { font-family: var(--font-mono); font-size: 1.05rem; color: var(--md-sys-color-primary); }
.contact-reason {
  font-size: .84rem; padding: 10px 14px;
  background: color-mix(in srgb, var(--md-sys-color-primary-container) 28%, transparent);
  border-radius: var(--md-sys-shape-corner-medium);
}
.contact-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.qr-host { display: grid; place-items: center; padding: var(--sp-3) 0; }
.qr-svg { width: 190px; height: 190px; border-radius: 12px; box-shadow: var(--md-sys-elevation-2); }
.dot-list { margin: 0; padding-left: 18px; }
.dot-list li { margin-bottom: 6px; font-size: .85rem; }

/* Snackbar */
.snack-host {
  position: fixed; z-index: 120; left: 50%; bottom: 22px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.snack {
  display: flex; align-items: center; gap: 12px;
  max-width: min(520px, calc(100vw - 28px));
  padding: 12px 18px;
  font-size: .86rem;
  color: var(--md-sys-color-inverse-on-surface);
  background: var(--md-sys-color-inverse-surface);
  border-radius: var(--md-sys-shape-corner-medium);
  box-shadow: var(--md-sys-elevation-3);
  animation: snackIn var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}
.snack.out { animation: snackOut 200ms var(--md-sys-motion-easing-accelerate, ease) forwards; }
.snack-ico { flex: none; width: 18px; height: 18px; }
.snack[data-kind="ok"]   .snack-ico { color: var(--md-sys-color-success); }
.snack[data-kind="warn"] .snack-ico { color: var(--md-sys-color-warning); }
.snack[data-kind="bad"]  .snack-ico { color: #fca5a5; }
.snack[data-kind="info"] .snack-ico { color: var(--md-sys-color-primary); }

/* ---------- 18. 页脚 ---------- */
.app-footer {
  position: relative; z-index: 1;
  margin-top: var(--sp-10);
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
  border-top: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 60%, transparent);
  background: color-mix(in srgb, var(--md-sys-color-surface-container-low) 70%, transparent);
}
.foot-grid {
  max-width: var(--content-max); margin: 0 auto;
  display: grid; gap: var(--sp-6);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.foot-h { font-size: .82rem; font-weight: 700; margin-bottom: var(--sp-3); color: var(--md-sys-color-on-surface); }
.foot-l { list-style: none; margin: 0; padding: 0; }
.foot-l li { margin-bottom: 6px; font-size: .8rem; }
.foot-l a { color: var(--md-sys-color-on-surface-variant); }
.foot-l a:hover { color: var(--md-sys-color-primary); }
.copyright {
  max-width: var(--content-max); margin: var(--sp-6) auto 0;
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--md-sys-color-outline-variant);
  font-size: .76rem; color: var(--md-sys-color-on-surface-variant);
  display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center;
}
.copyright .sep { opacity: .4; }

/* 返回顶部 */
.to-top {
  position: fixed; z-index: 50; right: 18px; bottom: 20px;
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-full);
  background: color-mix(in srgb, var(--md-sys-color-surface-container-high) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: var(--md-sys-color-on-surface-variant); cursor: pointer;
  box-shadow: var(--md-sys-elevation-2);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { color: var(--md-sys-color-primary); }

/* ---------- 19. 动画 ---------- */
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes snackIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes snackOut { to { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(3px)} }
@keyframes pulseGlow { 0%,100%{ box-shadow:0 0 0 0 rgba(59,130,246,.34);} 50%{ box-shadow:0 0 0 12px rgba(59,130,246,0);} }
.is-pulsing { animation: pulseGlow 1.6s var(--md-sys-motion-easing-standard) infinite; }

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 620ms var(--md-sys-motion-easing-emphasized-decelerate),
              transform 620ms var(--md-sys-motion-easing-emphasized-decelerate);
}

/* ---------- 20. 响应式：窄屏转底部 NavBar ---------- */
@media (max-width: 900px) {
  .nav-rail {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: 100%; height: auto;
    flex-direction: row; justify-content: space-around;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid color-mix(in srgb, var(--md-sys-color-outline-variant) 60%, transparent);
    background: color-mix(in srgb, var(--md-sys-color-surface-container) 94%, transparent);
    z-index: 45;
  }
  .nav-item { width: auto; flex: 1 1 0; font-size: .64rem; padding: 6px 2px 4px; }
  .nav-item .nav-ico { width: 42px; height: 28px; }
  .content { padding: var(--sp-4) var(--sp-4) 96px; }
  .app-bar { padding: 0 var(--sp-3); }
  .brand-sub { display: none; }
  .stat-mini { display: none; }
  .card { padding: var(--sp-4); border-radius: var(--md-sys-shape-corner-extra-large); }
  .hero { padding: var(--sp-6) var(--sp-4); border-radius: var(--md-sys-shape-corner-extra-large); }
  .act { width: 100vw; border-left: 0; }
  .dlg { width: calc(100vw - 20px); }
  .to-top { bottom: 84px; right: 14px; }
}

@media (max-width: 520px) {
  .brand-name { font-size: .98rem; }
  .auth-badge { height: 30px; padding: 0 11px; font-size: .72rem; }
  .btn { min-height: 42px; padding: 9px 18px; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ---------- 21. 可访问性与打印 ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary);
  transition: top var(--md-sys-motion-duration-short) linear;
}
.skip-link:focus { top: 8px; }

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

@media print {
  #sky, .bg-aura, .nav-rail, .app-bar, .to-top, .snack-host, .quiz-bar { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .hero, .dy-figure { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  [data-pro].is-locked > * { filter: none; }
}
