/* ============================================================
   中学物理实验仿真平台 · 视觉系统 v3.0（蓝白 / 明亮 / 清爽）
   ------------------------------------------------------------
   风格：浅蓝白背景 + 纯白卡片 + 单一蓝色强调（辅助青绿用于成功态）
   - 主色 #2f6bff，辅助 #12b7a8；文字 #0f1b33 / #5b6b85
   - 阴影 0 6px 20px rgba(47,107,255,.08)，圆角 16~22px，1px 淡描边
   - 动效克制：入场 stagger / hover 上浮 / 目录高度过渡 / 弹层缩放
   - 正文字号 ≥13px；prefers-reduced-motion 下全部动效关闭
   - 仅平台自用，零依赖、无外部字体与图片
   ============================================================ */

/* ---------------------------- 设计令牌 ---------------------------- */
:root {
  --bg: #f5f8ff;
  --surface: #ffffff;
  --ink: #0f1b33;
  --ink-2: #5b6b85;
  --ink-3: #8494ac;
  --blue: #2f6bff;
  --blue-600: #2459e0;
  --blue-050: #eef4ff;
  --blue-100: #e3edff;
  --teal: #12b7a8;
  --teal-050: #e6f9f6;
  --line: #e6ecf8;
  --line-2: #d8e3f5;
  --shadow: 0 6px 20px rgba(47, 107, 255, .08);
  --shadow-md: 0 10px 28px rgba(47, 107, 255, .12);
  --shadow-lg: 0 30px 70px rgba(15, 27, 51, .22);
  --r-xl: 22px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 11px;
  --ease: cubic-bezier(.2, .8, .3, 1);
  --topbar-h: 68px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

/* ---------------------------- 基础重置 ---------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.68;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -12%, #e7f0ff 0%, rgba(231, 240, 255, 0) 62%),
    radial-gradient(920px 480px at 102% -6%, #e2faf7 0%, rgba(226, 250, 247, 0) 60%),
    linear-gradient(180deg, #f8fbff 0%, #f3f7ff 46%, #eef4ff 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, dl, dd, dt { margin: 0; }
button { font-family: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); }
::selection { background: rgba(47, 107, 255, .16); }

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .24);
}

/* ---------------------------- 背景装饰 ---------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(2px);
}

.bg-blob-a {
  width: 620px;
  height: 620px;
  left: -180px;
  top: -220px;
  background: radial-gradient(circle at 35% 35%, rgba(47, 107, 255, .13), rgba(47, 107, 255, 0) 68%);
}

.bg-blob-b {
  width: 560px;
  height: 560px;
  right: -160px;
  top: 120px;
  background: radial-gradient(circle at 55% 45%, rgba(18, 183, 168, .11), rgba(18, 183, 168, 0) 68%);
}

.bg-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(47, 107, 255, .07) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(900px 520px at 50% 0%, #000 0%, transparent 78%);
  mask-image: radial-gradient(900px 520px at 50% 0%, #000 0%, transparent 78%);
  opacity: .7;
}

/* 内容压在背景之上 */
.shell,
.topbar,
.modal-layer,
.drawer-layer,
.toast { position: relative; z-index: 1; }

.shell {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

/* ---------------------------- 按钮 / 输入 ---------------------------- */
.btn {
  height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(15, 27, 51, .04);
  transition: background .18s var(--ease), border-color .18s var(--ease),
              box-shadow .18s var(--ease), transform .18s var(--ease), color .18s var(--ease);
}

.btn:hover {
  border-color: #c9d9f5;
  background: #f8fbff;
  box-shadow: 0 4px 12px rgba(47, 107, 255, .1);
}

.btn:active { transform: translateY(1px); }

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #2f6bff, #4d8bff);
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 107, 255, .26);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #2459e0, #3f7dff);
  box-shadow: 0 8px 20px rgba(47, 107, 255, .32);
}

.btn.ghost {
  background: #f7faff;
  border-color: #eaf1ff;
  color: #5a7bb0;
}

.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }

.btn.danger {
  color: #d94a5a;
  border-color: #ffd9de;
  background: #fff7f8;
}
.btn.danger:hover { background: #fff1f3; border-color: #ffc9d0; }

.btn:disabled,
.btn[disabled] {
  opacity: 1;
  cursor: not-allowed;
  transform: none;
  background: #f3f6fc;
  border-color: #e6ecf8;
  color: #93a3bb;
  box-shadow: none;
}
.btn.primary:disabled,
.btn.primary[disabled] {
  background: #c9d9f5;
  border-color: transparent;
  color: #fff;
  box-shadow: none;
}

.btn-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 3px 5px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-link:hover { background: var(--blue-050); text-decoration: none; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.icon-btn:hover { background: #f2f6ff; color: var(--ink); }

.ghost-btn {
  height: 28px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f2f6ff;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.ghost-btn:hover { background: var(--blue-050); color: var(--blue); }

/* ---------------------------- 顶部栏 ---------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(230, 236, 248, .9);
}

.topbar-inner {
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex: 0 0 auto;
  border-radius: 12px;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2f6bff 0%, #4d9bff 58%, #12b7a8 100%);
  box-shadow: 0 6px 14px rgba(47, 107, 255, .28);
  flex: 0 0 auto;
}
.brand-mark svg { display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-title {
  font-size: 15.5px;
  font-weight: 750;
  letter-spacing: .01em;
  white-space: nowrap;
}
.brand-sub { font-size: 13px; color: var(--ink-3); white-space: nowrap; }

/* 学段切换 */
.stage-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef3ff;
  flex: 0 0 auto;
}

.stage-btn {
  height: 32px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.stage-btn:hover { color: var(--blue); }
.stage-btn.is-on {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(47, 107, 255, .18);
}

.subject-chip {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color .18s var(--ease), color .18s var(--ease);
}
.subject-chip:hover { border-color: #c9d9f5; color: var(--blue); }

/* 搜索 */
.search {
  position: relative;
  flex: 1 1 240px;
  max-width: 360px;
  margin-left: auto;
}

.search input {
  width: 100%;
  height: 38px;
  padding: 0 34px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f2f6ff;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.search input::placeholder { color: #93a4bd; }
.search input:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .16);
}
.search input::-webkit-search-cancel-button { display: none; }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a6c2;
  display: inline-flex;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.search-clear:hover { background: var(--blue-050); color: var(--blue); }

.topbar-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.guest-actions { display: flex; align-items: center; gap: 8px; }

/* 用户区 */
.user-area { position: relative; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 10px 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.user-chip:hover { border-color: #c9d9f5; box-shadow: var(--shadow); }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2f6bff, #12b7a8);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}
.avatar.lg { width: 48px; height: 48px; font-size: 19px; border-radius: 15px; }

.user-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.user-meta b { font-size: 13.5px; font-weight: 650; line-height: 1.2; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.role-badge {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--blue-050);
  color: var(--blue);
  display: inline-block;
}
.role-badge.is-admin { background: #fff3e6; color: #c9772a; }
.role-badge.is-teacher { background: #eef4ff; color: #2f6bff; }

.caret { color: var(--ink-3); display: inline-flex; }

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 232px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  z-index: 60;
  animation: popIn .2s var(--ease) both;
}

.user-menu-head {
  padding: 10px 12px 9px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.user-menu-head b { display: block; font-size: 13.5px; }
.user-menu-head small { display: block; font-size: 13px; color: var(--ink-3); line-height: 1.5; }

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.menu-item:hover { background: var(--blue-050); color: var(--blue); }
.menu-item.is-danger:hover { background: #fff2f4; color: #d94a5a; }
.menu-key { color: var(--ink-3); }

/* ---------------------------- 三栏布局 ---------------------------- */
.layout {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr) 304px;
  gap: 22px;
  align-items: start;
  padding-top: 22px;
  padding-bottom: 44px;
}

/* ---------------------------- 卡片容器 ---------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 4px 16px rgba(47, 107, 255, .05);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 16px 12px;
}

.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .01em;
}

.panel-tools { display: flex; gap: 6px; }

.pill-soft {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  padding: 1px 8px;
  border-radius: 7px;
  background: var(--blue-050);
  color: var(--blue);
  white-space: nowrap;
}

/* ---------------------------- 目录树 ---------------------------- */
.tree-panel {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  max-height: calc(100vh - var(--topbar-h) - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tree-scroll {
  flex: 1 1 auto;
  overflow: auto;
  padding: 2px 10px 8px;
  scrollbar-width: thin;
  scrollbar-color: #d5e1f5 transparent;
}
.tree-scroll::-webkit-scrollbar { width: 8px; }
.tree-scroll::-webkit-scrollbar-thumb { background: #d9e4f6; border-radius: 8px; }
.tree-scroll::-webkit-scrollbar-track { background: transparent; }

.tree-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: #fbfdff;
  font-size: 13px;
  color: var(--ink-3);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.tree-foot b { color: var(--ink); font-weight: 700; }

.tree-book,
.tree-chapter { margin: 2px 0; }

.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.tree-row:hover { background: #f5f9ff; color: var(--blue); }

.tree-chapter > .tree-row { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.tree-chapter > .tree-row:hover { color: var(--blue); }

.caret {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  display: inline-flex;
  color: #9fb0c9;
  transition: transform .25s var(--ease);
}
.caret svg { width: 12px; height: 12px; display: block; }
.tree-book.is-open > .tree-row .caret,
.tree-chapter.is-open > .tree-row .caret { transform: rotate(90deg); }

.tree-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-count {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: #8494ac;
  background: #f2f6ff;
  border-radius: 6px;
  padding: 0 6px;
  line-height: 1.6;
}

/* 展开 / 收起：grid-template-rows 高度过渡（0.25s） */
.tree-children {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .25s var(--ease);
}
.tree-book.is-open > .tree-children,
.tree-chapter.is-open > .tree-children { grid-template-rows: 1fr; }

.tree-children-inner {
  overflow: hidden;
  min-height: 0;
}

/* 层级细竖线 */
.tree-children > .tree-children-inner {
  margin-left: 13px;
  padding-left: 10px;
  border-left: 1px solid #e9eff9;
}
.tree-book > .tree-children > .tree-children-inner { margin-left: 6px; border-left: 0; padding-left: 2px; }
.tree-chapter > .tree-children > .tree-children-inner { margin-left: 14px; }

.tree-exp {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.tree-exp:hover { background: #f5f9ff; color: var(--blue); }

.tree-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #c9d6ea;
}
.tree-exp.ready .tree-dot { background: var(--teal); box-shadow: 0 0 0 3px rgba(18, 183, 168, .14); }

.tree-no {
  flex: 0 0 auto;
  min-width: 18px;
  text-align: right;
  font-size: 13px;
  color: #9fb0c9;
  font-variant-numeric: tabular-nums;
}

.tree-exp-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-exp.is-active {
  background: var(--blue-050);
  color: var(--blue);
  font-weight: 650;
  box-shadow: inset 0 0 0 1px rgba(47, 107, 255, .14);
}
.tree-exp.is-active .tree-no { color: var(--blue); }

.tree-exp-enter {
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--blue);
  font-size: 13px;
  line-height: 1;
  padding: 3px 5px;
  cursor: pointer;
  transition: background .16s var(--ease);
}
.tree-exp-enter:hover { background: var(--blue-100); }

.tree-empty { padding: 10px; font-size: 13px; color: var(--ink-3); }

/* ---------------------------- 主内容区 ---------------------------- */
.content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* 概览 */
.overview {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 24px 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.overview::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 220px at 100% 0%, rgba(18, 183, 168, .09), rgba(18, 183, 168, 0) 70%),
    radial-gradient(520px 200px at 0% 100%, rgba(47, 107, 255, .08), rgba(47, 107, 255, 0) 70%);
}
.overview-text { position: relative; min-width: 0; }

.eyebrow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }

.tag-plain {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  background: #f4f8ff;
  border: 1px solid #eaf1ff;
  border-radius: 7px;
  padding: 0 8px;
}

.overview-title {
  margin-bottom: 8px;
  font-size: clamp(21px, 2.1vw, 27px);
  font-weight: 750;
  line-height: 1.32;
  letter-spacing: .01em;
  color: var(--ink);
}

.overview-desc {
  max-width: 640px;
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--ink-2);
}
.overview-desc b { color: var(--blue); font-weight: 700; }

.overview-note {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 11px;
  font-size: 13px;
  line-height: 1.6;
  color: #8a6524;
  background: #fffaf0;
  border: 1px solid #fdeec9;
  border-radius: 9px;
}

.ov-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(96px, 1fr));
  gap: 10px;
}

.ov-stat {
  min-width: 96px;
  padding: 10px 12px;
  border: 1px solid #eef3fd;
  border-radius: 12px;
  background: #f7faff;
}
.ov-stat dt { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.ov-stat dd {
  font-size: 21px;
  font-weight: 750;
  line-height: 1.25;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.ov-stat:nth-child(2) dd { color: var(--teal); }

/* 两张渐变主卡 */
.quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.quick-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 188px;
  padding: 20px 22px;
  overflow: hidden;
  border-radius: 20px;
  color: #fff;
  box-shadow: 0 12px 30px rgba(47, 107, 255, .22);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.quick-card::before,
.quick-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.quick-card::before {
  width: 240px;
  height: 240px;
  right: -70px;
  top: -90px;
  background: rgba(255, 255, 255, .14);
}
.quick-card::after {
  width: 280px;
  height: 280px;
  right: -110px;
  bottom: -150px;
  background: rgba(255, 255, 255, .09);
}
.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(47, 107, 255, .3);
}

.quick-a { background: linear-gradient(135deg, #2f6bff 0%, #3d8bff 50%, #12b7a8 100%); }
.quick-b { background: linear-gradient(135deg, #3b76ff 0%, #2f9be8 52%, #12c7b4 100%); }

.quick-card.is-disabled { filter: saturate(.9); }
.quick-card.is-disabled .quick-btn {
  background: rgba(255, 255, 255, .3);
  color: rgba(255, 255, 255, .92);
  box-shadow: none;
  cursor: not-allowed;
}

.quick-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
}

.quick-body { position: relative; z-index: 1; }
.quick-kicker {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .84;
}
.quick-title {
  margin-bottom: 6px;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: .01em;
}
.quick-desc {
  max-width: 36ch;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .9);
}

.quick-btn {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: auto;
  border: 0;
  background: #fff;
  color: var(--blue);
  box-shadow: 0 4px 12px rgba(15, 27, 51, .14);
}
.quick-btn:hover { background: #f6f9ff; border-color: transparent; }

/* 实验目录 */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 2px 12px;
}
.section-head h2 { font-size: 16px; font-weight: 750; }
.section-count { font-size: 13px; color: var(--ink-3); }

.catalog { display: flex; flex-direction: column; gap: 18px; }

.book-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 2px 10px;
  font-size: 13px;
  color: var(--ink-3);
  min-width: 0;
}
.book-name {
  flex: 0 0 auto;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 750;
  box-shadow: 0 2px 6px rgba(47, 107, 255, .05);
}
.book-full {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-meta { flex: 0 0 auto; margin-left: auto; font-size: 13px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* 实验卡片 */
.exp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(15, 27, 51, .035);
  animation: cardIn .34s var(--ease) both;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.exp-card:hover,
.exp-card.is-hover {
  transform: translateY(-2px);
  border-color: #c9d9f5;
  box-shadow: 0 12px 28px rgba(47, 107, 255, .16);
}
.exp-card.is-flash {
  border-color: #b6cdf7;
  box-shadow: 0 0 0 2px rgba(47, 107, 255, .32), 0 12px 28px rgba(47, 107, 255, .16);
}

.card-top { display: flex; align-items: center; gap: 8px; }

.card-logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid #e6efff;
  border-radius: 12px;
  background: linear-gradient(160deg, #eef4ff, #e4eeff);
  color: var(--blue);
}
.card-logo svg { display: block; }

.card-logo.is-char {
  border: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 750;
  line-height: 1;
  background: linear-gradient(140deg, #7aa6ff, #2f6bff);
}
.card-logo.t1 { background: linear-gradient(140deg, #7aa6ff, #2f6bff); }
.card-logo.t2 { background: linear-gradient(140deg, #5fd8c8, #12b7a8); }
.card-logo.t3 { background: linear-gradient(140deg, #9a9bff, #5b6ce0); }
.card-logo.t4 { background: linear-gradient(140deg, #ffc17a, #f0954a); }
.card-logo.t5 { background: linear-gradient(140deg, #ff9ec0, #e5779f); }
.card-logo.t6 { background: linear-gradient(140deg, #7fc4ff, #3d8bff); }

.card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #e8f0ff;
  border-radius: 999px;
  background: #f2f6ff;
  color: #5a7bb0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.card-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
  white-space: nowrap;
}
.card-status.ready { color: #0a8c80; background: var(--teal-050); border: 1px solid #cdf1ec; }
.card-status.beta { color: #1d4ed8; background: #eef3ff; border: 1px solid #d6e2ff; }
.card-status.todo { color: #6b7a94; background: #f2f5fb; border: 1px solid #e6ecf8; }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.55em;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}
.exp-card.todo .card-title { color: #33445f; }

.card-chapter {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px dashed #edf2fb;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  padding: 1px 7px;
  border: 1px solid #e8f0ff;
  border-radius: 7px;
  background: #f4f8ff;
  color: #4a6fa8;
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
}
.tag-time { color: #0a8c80; background: #eefaf8; border-color: #d7f2ee; }

.card-action { flex: 0 0 auto; }

/* 卡片两个按钮：查看详情（次要）+ 直接进入（主要） */
.card-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.card-actions .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }

/* 卡片整块可点：点非按钮区打开详情 */
.exp-card.is-clickable { cursor: pointer; }
.exp-card.is-clickable:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(47, 107, 255, .28), var(--shadow-md); }
.exp-card.is-clickable .btn,
.exp-card.is-clickable a { cursor: pointer; }

/* 效果图/扫描件缺图时的占位底纹 */
.figure-thumb.is-missing {
  background:
    repeating-linear-gradient(45deg, #f2f6ff 0 10px, #eaf0fb 10px 20px);
}
.figure-thumb.is-missing::before {
  content: "图片未找到";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #93a6c2;
  font-size: 12.5px;
}

/* 空态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 42px 20px 48px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink-2);
}
.empty-art { width: 180px; max-width: 70%; height: auto; margin-bottom: 8px; }
.empty b { font-size: 15px; color: var(--ink); }
.empty p { font-size: 13.5px; line-height: 1.7; }

/* 页脚 */
.page-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 0 4px;
  font-size: 13px;
  color: var(--ink-3);
}

.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c2cfe3;
  display: inline-block;
}

/* ---------------------------- 右栏 ---------------------------- */
.rail {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-body { padding: 0 16px 16px; }

.service-state {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid #eef3fd;
  border-radius: 12px;
  background: #f7faff;
}

.service-state .dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: #c9d6ea;
  box-shadow: 0 0 0 3px rgba(201, 214, 234, .25);
}
.service-state[data-state="online"] .dot { background: var(--teal); box-shadow: 0 0 0 3px rgba(18, 183, 168, .18); }
.service-state[data-state="offline"] .dot { background: #f0a35a; box-shadow: 0 0 0 3px rgba(240, 163, 90, .18); }
.service-state[data-state="checking"] .dot { background: #7aa6ff; box-shadow: 0 0 0 3px rgba(122, 166, 255, .2); }

.service-state b { display: block; font-size: 13.5px; }
.service-state small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-3);
  word-break: break-all;
}

.pill {
  padding: 1px 9px;
  border: 1px solid #e6ecf8;
  border-radius: 999px;
  background: #f2f5fb;
  color: #6b7a94;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}
.pill[data-state="online"] { background: var(--teal-050); border-color: #cdf1ec; color: #0a8c80; }
.pill[data-state="offline"] { background: #fff6ec; border-color: #ffe6c9; color: #b4711f; }
.pill[data-state="checking"] { background: #eef4ff; border-color: #dbe7ff; color: var(--blue); }

.hint {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.68;
  color: var(--ink-3);
}

.service-actions { display: flex; gap: 8px; margin-top: 12px; }

/* 右栏「我的」 */
.me-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px 4px;
}

.me-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .18s var(--ease);
}
.me-item:hover { background: #f5f9ff; }

.me-ic {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--blue-050);
  color: var(--blue);
}

.me-text { flex: 1 1 auto; min-width: 0; }
.me-text b { display: block; font-size: 13.5px; font-weight: 650; line-height: 1.4; }
.me-text small {
  display: block;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.me-key { flex: 0 0 auto; color: #b9c6db; font-size: 16px; line-height: 1; }

#me-panel .panel-head { padding-bottom: 6px; }
#me-panel .hint { padding: 0 16px 14px; margin-top: 4px; }

/* ---------------------------- 弹层通用 ---------------------------- */
.modal-layer,
.drawer-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 51, .38);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fadeIn .2s ease both;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(428px, 100%);
  padding: 26px 26px 20px;
  border-radius: var(--r-xl);
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: popIn .24s var(--ease) both;
}
.modal-card.sm { width: min(408px, 100%); }

.modal-x { position: absolute; right: 12px; top: 12px; }

.modal-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }

.modal-logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2f6bff 0%, #4d9bff 58%, #12b7a8 100%);
  box-shadow: 0 8px 18px rgba(47, 107, 255, .28);
}

.modal-head h2 { margin-bottom: 4px; font-size: 19px; font-weight: 750; line-height: 1.35; }
.modal-sub { font-size: 13px; line-height: 1.65; color: var(--ink-2); }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 12px; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}

.field input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #f8fbff;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input::placeholder { color: #9aabc4; }
.field input:focus {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .16);
}
.field input:disabled { background: #f3f6fc; color: #9fb0c6; cursor: not-allowed; }

.form-msg { min-height: 18px; font-size: 13px; color: #d94a5a; }
.form-msg.is-ok { color: #0a8c80; }

.modal-foot-hint {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
}
.modal-foot-hint code {
  padding: 0 4px;
  border: 1px solid #e8f0ff;
  border-radius: 5px;
  background: #f4f8ff;
  color: #4a6fa8;
  font-size: 13px;
}

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------------------------- 存档列表（继续上次实验） ---------------------------- */
.archive-layer { z-index: 100; }

.archive-card {
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: min(78vh, 640px);
  padding: 0;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: #fff;
}

.archive-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 12px;
  border-bottom: 1px solid var(--line);
}
.archive-head-text { flex: 1 1 auto; min-width: 0; }
.archive-head h2 { font-size: 18px; font-weight: 750; line-height: 1.35; }
.archive-sub {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.archive-head .icon-btn { flex: 0 0 auto; margin-left: auto; }

.archive-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding: 12px 14px;
  background: #fbfdff;
  scrollbar-width: thin;
  scrollbar-color: #d5e1f5 transparent;
}
.archive-body::-webkit-scrollbar { width: 8px; }
.archive-body::-webkit-scrollbar-thumb { background: #d9e4f6; border-radius: 8px; }

.archive-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.archive-row:hover { border-color: #c9d9f5; background: #f8fbff; }
.archive-row:focus-visible { outline: 2px solid rgba(47, 107, 255, .45); outline-offset: 2px; }
.archive-row.is-on {
  border-color: var(--blue);
  background: #f7faff;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .14);
}

.archive-check {
  position: relative;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1.5px solid #c9d9f5;
  border-radius: 50%;
  background: #fff;
}
.archive-row.is-on .archive-check { border-color: var(--blue); background: var(--blue); }
.archive-row.is-on .archive-check::after {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 3.5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.archive-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.archive-name {
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
}
.archive-tag {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--blue-050);
  color: #3c62a8;
  font-weight: 650;
  white-space: nowrap;
}
.archive-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.archive-progress { color: var(--ink-2); }
.archive-status {
  padding: 1px 7px;
  border-radius: 999px;
  background: #f2f5fb;
  color: #6b7a94;
  font-weight: 650;
  white-space: nowrap;
}
.archive-status.is-doing { background: var(--teal-050); color: #0a8c80; }
.archive-status.is-done { background: #e9f7ee; color: #1f8a4c; }
.archive-del { flex: 0 0 auto; }

.archive-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 20px;
  border: 1px dashed #d8e6ff;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #f8fbff, #fff);
  text-align: center;
}
.archive-empty b { font-size: 14.5px; color: var(--ink); }
.archive-empty p { max-width: 420px; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }

.archive-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.archive-hint { flex: 1 1 auto; min-width: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }
.archive-foot-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ---------------------------- 账户中心（居中抽屉） ---------------------------- */
.drawer-layer { padding: 28px; }

.drawer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1000px, 100%);
  max-height: 90vh;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: popIn .24s var(--ease) both;
}

.drawer-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff, #fff);
}

.drawer-id { min-width: 0; }
.drawer-id h2 { margin-bottom: 3px; font-size: 18px; font-weight: 750; line-height: 1.35; }
.drawer-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-2);
}

.drawer-head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 18px 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  overflow-x: auto;
}

.tab {
  position: relative;
  padding: 9px 14px 11px;
  border: 0;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.tab:hover { color: var(--blue); background: #f7faff; }
.tab.is-on { color: var(--blue); }
.tab.is-on::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, #2f6bff, #12b7a8);
}

.drawer-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 20px 22px 24px;
  background: #fbfdff;
  scrollbar-width: thin;
  scrollbar-color: #d5e1f5 transparent;
}
.drawer-body::-webkit-scrollbar { width: 8px; }
.drawer-body::-webkit-scrollbar-thumb { background: #d9e4f6; border-radius: 8px; }

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-bar h3 { font-size: 15px; font-weight: 750; }
.panel-bar-actions { display: flex; align-items: center; gap: 10px; }
.muted { font-size: 13px; color: var(--ink-3); }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f6f9ff;
  color: var(--ink-2);
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f1f5fc;
  vertical-align: top;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafdff; }
.table .num { font-variant-numeric: tabular-nums; }

.t-time { white-space: nowrap; color: var(--ink-2); }
.t-exp { display: block; font-weight: 650; color: var(--ink); }
.t-sub { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.t-actions { white-space: nowrap; }

.level {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #f2f5fb;
  color: #5b6b85;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
}
.level.is-a { background: var(--teal-050); color: #0a8c80; }
.level.is-b { background: var(--blue-050); color: var(--blue); }
.level.is-c { background: #fff6ec; color: #b4711f; }

.state-host { padding: 6px 0; }
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 40px 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  background: #fff;
  text-align: center;
  color: var(--ink-2);
}
.state-icon { display: grid; place-items: center; margin-bottom: 4px; color: #a9bad3; }
.state-box b { font-size: 14px; color: var(--ink); }
.state-box span { font-size: 13px; line-height: 1.7; }

.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.sub-panel {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.sub-panel h4 { margin-bottom: 12px; font-size: 13.5px; font-weight: 750; }

.kv { display: grid; gap: 8px; }
.kv > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #eef3fb;
  font-size: 13px;
}
.kv > div:last-child { padding-bottom: 0; border-bottom: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { color: var(--ink); font-weight: 600; text-align: right; }

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  border-color: #ffd9de;
  background: #fffafb;
}
.danger-zone h4 { margin-bottom: 4px; }
.danger-zone .hint { margin-top: 0; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.quick-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.quick-tile .quick-kicker {
  margin: 0;
  font-size: 13px;
  letter-spacing: .12em;
  color: #8494ac;
}
.quick-tile h4 { font-size: 15px; font-weight: 700; }
.quick-tile .quick-desc {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
}
.quick-tile .btn { margin-top: auto; }

.url-box {
  margin: 10px 0 8px;
  padding: 12px;
  border: 1px solid #e8f0ff;
  border-radius: var(--r-sm);
  background: #f4f8ff;
  color: #3f5d8f;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}

/* 报告层 */
.report-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  animation: fadeIn .18s ease both;
}
.report-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}
.report-toolbar b { font-size: 14px; }
.report-frame-wrap { flex: 1 1 auto; min-height: 0; background: #fff; }
.report-frame { display: block; width: 100%; height: 100%; min-height: 420px; border: 0; }

/* ---------------------------- 轻提示 ---------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  max-width: min(92vw, 520px);
  padding: 10px 18px;
  border-radius: var(--r-sm);
  background: rgba(15, 27, 51, .92);
  color: #fff;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: 0 14px 34px rgba(15, 27, 51, .3);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.noscript { padding: 20px; text-align: center; font-size: 14px; color: var(--ink-2); }

/* ---------------------------- 动效 ---------------------------- */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.96) translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ============================================================
   实验详情（全屏弹层）：概览 / 效果图 / 流程 / 教材参考
   ------------------------------------------------------------
   结构：.detail-layer（遮罩） > .detail-panel（头 + Tab + 滚动体 + 固定操作条）
   配色沿用蓝白：蓝色 #2f6bff 表「讲/入口」，青绿 #12b7a8 表「动手实验」
   ============================================================ */
.detail-layer {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 22px;
}

/* 详情弹层的遮罩比普通弹窗更深一点，让白色面板与后面的列表拉开层次 */
.detail-layer .modal-backdrop {
  background: rgba(15, 27, 51, .52);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.detail-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1240px, 100%);
  max-height: 94vh;
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: popIn .24s var(--ease) both;
}
/* 头部 / Tab 条 / 操作条不参与收缩：只剩内容区滚动，杜绝「页签栏压住内容」 */
.detail-panel > * { min-height: 0; }
.detail-panel > .detail-head,
.detail-panel > .detail-tabs,
.detail-panel > .detail-foot { flex: 0 0 auto; }

/* 头部：Logo + 名称 + 元信息 */
.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff, #fff);
}

.detail-logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid #e6efff;
  border-radius: 16px;
  background: linear-gradient(160deg, #eef4ff, #e4eeff);
  color: var(--blue);
}
.detail-logo svg { display: block; }
.detail-logo.is-char {
  border: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 750;
  line-height: 1;
  background: linear-gradient(140deg, #7aa6ff, #2f6bff);
}

.detail-id { min-width: 0; }
.detail-kicker {
  margin-bottom: 3px;
  overflow: hidden;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-id h2 {
  overflow: hidden;
  font-size: 20px;
  font-weight: 780;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--ink-2);
}

.detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border: 1px solid #e8f0ff;
  border-radius: 999px;
  background: #f4f8ff;
  color: #4a6fa8;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.detail-chip.is-time { background: #eefaf8; border-color: #d7f2ee; color: #0a8c80; }
.detail-chip.is-ready { background: var(--teal-050); border-color: #cdf1ec; color: #0a8c80; }
.detail-chip.is-beta { background: #eef3ff; border-color: #d6e2ff; color: #1d4ed8; }
.detail-chip.is-todo { background: #f2f5fb; border-color: #e6ecf8; color: #6b7a94; }

.detail-x { position: absolute; right: 14px; top: 14px; }

/* Tab 条 */
.detail-tabs {
  position: relative;
  z-index: 3;
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 18px 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.detail-tabs::-webkit-scrollbar { display: none; }

.dt-tab {
  position: relative;
  padding: 9px 16px 11px;
  border: 0;
  border-radius: 10px 10px 0 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.dt-tab:hover { color: var(--blue); background: #f7faff; }
.dt-tab.is-on { color: var(--blue); }
.dt-tab.is-on::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, #2f6bff, #12b7a8);
}

/* 滚动内容区 */
.detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px 22px 22px;
  background: #fbfdff;
  scrollbar-width: thin;
  scrollbar-color: #d5e1f5 transparent;
}
.detail-body::-webkit-scrollbar { width: 8px; }
.detail-body::-webkit-scrollbar-thumb { background: #d9e4f6; border-radius: 8px; }

.detail-tab-panel { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.detail-tab-panel > * { flex: 0 0 auto; min-width: 0; }
.detail-tab-panel[hidden] { display: none !important; }

/* 底部固定操作条 */
.detail-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #fbfdff);
}
.detail-foot-hint {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.55;
}
.detail-foot-hint b { color: var(--ink-2); font-weight: 650; }
.detail-foot-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------------- 概览 ---------------- */
.det-intro {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #f8fbff, #fff);
  color: #22314d;
  font-size: 14px;
  line-height: 1.9;
}
.det-intro::first-letter { font-size: 1.05em; }

.det-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.det-card {
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 27, 51, .03);
}
.det-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 750;
  color: var(--ink);
}
.det-card h4 .det-dot {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--blue-050);
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
}
.det-card.gain h4 .det-dot { background: var(--teal-050); color: #0a8c80; }

.det-list { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.det-list li {
  position: relative;
  padding-left: 20px;
  color: #33425e;
  font-size: 13.5px;
  line-height: 1.8;
}
.det-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .78em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f6bff, #12b7a8);
}
.det-card.gain .det-list li::before { background: linear-gradient(135deg, #12b7a8, #2f6bff); }

.det-sec-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-height: 22px;
  line-height: 1.45;
  font-size: 15px;
  font-weight: 750;
  color: var(--ink);
}
.det-sec-title small { flex: 1 1 auto; min-width: 0; color: var(--ink-3); font-size: 12.5px; font-weight: 500; }

/* ---------------- 效果图 ---------------- */
.figure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.figure-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 27, 51, .04);
  cursor: zoom-in;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.figure-item:hover {
  transform: translateY(-2px);
  border-color: #c9d9f5;
  box-shadow: 0 12px 26px rgba(47, 107, 255, .15);
}
.figure-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eef3fc;
}
.figure-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s var(--ease);
}
.figure-item:hover .figure-thumb img { transform: scale(1.03); }
.figure-thumb::after {
  content: "点击放大";
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 27, 51, .62);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  opacity: 0;
  transition: opacity .18s var(--ease);
}
.figure-item:hover .figure-thumb::after { opacity: 1; }

.figure-cap { display: block; padding: 10px 13px 12px; }
.figure-cap b { display: block; margin-bottom: 3px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.figure-cap small { display: block; color: var(--ink-2); font-size: 12.5px; line-height: 1.65; }

.det-tip {
  padding: 10px 14px;
  border: 1px dashed #d8e6ff;
  border-radius: var(--r-sm);
  background: #f6faff;
  color: #52719f;
  font-size: 12.5px;
  line-height: 1.7;
}

/* ---------------- 流程 ---------------- */
.flow-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 12.5px; color: var(--ink-2); }
.flow-legend span { display: inline-flex; align-items: center; gap: 6px; }
.flow-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--blue);
}
.flow-legend i.is-do { background: var(--teal); }

.flow-track {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 4px 2px 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #d5e1f5 transparent;
}
.flow-track::-webkit-scrollbar { height: 7px; }
.flow-track::-webkit-scrollbar-thumb { background: #d9e4f6; border-radius: 8px; }

.flow-step {
  position: relative;
  flex: 1 1 0;
  min-width: 118px;
  padding: 12px 12px 13px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--blue);
  border-radius: 4px var(--r-sm) var(--r-sm) 4px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 27, 51, .03);
}
.flow-step.is-do { border-top-color: var(--teal); }
.flow-step + .flow-step { margin-left: 16px; }
.flow-step + .flow-step::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 30px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #c4d6f2;
  border-right: 2px solid #c4d6f2;
  transform: rotate(45deg);
}

.flow-num {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-bottom: 7px;
  border-radius: 6px;
  background: var(--blue-050);
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.flow-step.is-do .flow-num { background: var(--teal-050); color: #0a8c80; }
.flow-name { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.45; }
.flow-kind {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--blue-050);
  color: #3c62a8;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.flow-step.is-do .flow-kind { background: var(--teal-050); color: #0a8c80; }
.flow-desc { display: block; margin-top: 7px; color: var(--ink-2); font-size: 12px; line-height: 1.65; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.plan-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
}
.plan-card h4 { font-size: 14px; font-weight: 750; color: var(--ink); }
.plan-tag {
  align-self: flex-start;
  padding: 1px 8px;
  border: 1px solid #dbe7ff;
  border-radius: 999px;
  background: #f2f7ff;
  color: #3c62a8;
  font-size: 11.5px;
  font-weight: 650;
}
.plan-card p { color: var(--ink-2); font-size: 13px; line-height: 1.78; }

/* ---------------- 教材参考 ---------------- */
.tb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
}
.tb-toolbar .tb-toolbar-text { flex: 1 1 200px; min-width: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.65; }

.tb-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tb-point {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 27, 51, .03);
}
.tb-point-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.tb-point h4 {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
  color: var(--ink);
}
.tb-page {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 1px 8px;
  border: 1px solid #e8f0ff;
  border-radius: 999px;
  background: #f4f8ff;
  color: #4a6fa8;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  cursor: help;
}
.tb-point p { margin: 0; color: #33425e; font-size: 12.5px; line-height: 1.7; overflow-wrap: anywhere; }

.tb-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.tb-fig {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 27, 51, .04);
}
.tb-fig .figure-thumb { aspect-ratio: 3 / 4; background: #f7f9fe; }
.tb-fig .figure-thumb img { object-fit: contain; }
.tb-fig .figure-thumb::after { content: "查看大图"; }
.tb-fig-cap { padding: 9px 12px 11px; }
.tb-fig-cap b { display: block; font-size: 13px; font-weight: 700; }
.tb-fig-cap small { color: var(--ink-3); font-size: 12px; line-height: 1.6; }

.tb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 20px;
  border: 1px dashed #d8e6ff;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #f8fbff, #fff);
  text-align: center;
}
.tb-empty svg { flex: 0 0 auto; opacity: .9; }
.tb-empty b { flex: 0 0 auto; font-size: 14.5px; color: var(--ink); }
.tb-empty p { max-width: 640px; margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.8; }
.tb-empty code {
  padding: 1px 5px;
  border: 1px solid #e8f0ff;
  border-radius: 5px;
  background: #f4f8ff;
  color: #3c62a8;
  font-size: 12.5px;
}
.tb-loading { color: var(--ink-3); font-size: 12.5px; }

/* ---------------- Lightbox ---------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
}

.lightbox-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(1200px, 100%);
}
.lightbox-count {
  padding: 3px 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: #eaf1ff;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.lightbox-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lightbox-tools .btn { background: rgba(255, 255, 255, .92); }
.lightbox-tools .icon-btn { background: rgba(255, 255, 255, .14); color: #fff; }
.lightbox-tools .icon-btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }

.lightbox-figure {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
  max-width: min(1200px, 100%);
  animation: popIn .2s var(--ease) both;
}
#lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  border-radius: 12px;
  background: #0b1220;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .45);
}
.lightbox-figure figcaption {
  max-width: 780px;
  color: #dbe6fb;
  font-size: 13.5px;
  line-height: 1.7;
  text-align: center;
}
.lightbox-figure figcaption b { display: block; margin-bottom: 2px; color: #fff; font-size: 14px; font-weight: 700; }

.lightbox .modal-backdrop { background: rgba(8, 14, 26, .86); backdrop-filter: blur(4px); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background .18s var(--ease), transform .18s var(--ease);
}
.lightbox-nav:hover { background: rgba(255, 255, 255, .28); }
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }

/* ---------------------------- 自适应 ---------------------------- */
@media (max-width: 1500px) {
  .layout { grid-template-columns: 272px minmax(0, 1fr) 288px; gap: 18px; }
}

@media (max-width: 1270px) {
  .layout { grid-template-columns: 264px minmax(0, 1fr); }
  .rail {
    position: static;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tree-panel { max-height: calc(100vh - var(--topbar-h) - 40px); }
}

@media (max-width: 1100px) {
  .topbar-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; }
  .search { order: 5; flex: 1 1 100%; max-width: none; margin-left: 0; }
  .topbar-right { margin-left: auto; }
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  /* 窄屏：内容优先，目录树与右栏后置 */
  .content { order: 1; }
  .tree-panel { order: 2; position: static; max-height: none; }
  .tree-scroll { max-height: 330px; }
  .rail { order: 3; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .layout { gap: 14px; }
  .overview { grid-template-columns: 1fr; padding: 20px; }
  .ov-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .rail { grid-template-columns: 1fr; }
  .account-grid,
  .quick-grid { grid-template-columns: 1fr; }
  .drawer-layer,
  .modal-layer { padding: 14px; }
  .drawer { max-height: 94vh; border-radius: 20px; }
  .drawer-body { padding: 16px 16px 20px; }
}

@media (max-width: 600px) {
  .shell { padding-left: 16px; padding-right: 16px; }
  .layout { padding-bottom: 28px; }
  .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-title { font-size: 14px; }
  .brand-sub { display: none; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .stage-btn { padding: 0 12px; }
  .card-grid { gap: 10px; }
  .exp-card { padding: 14px 14px 12px; }
  .book-full { display: none; }
  .toast { bottom: 18px; }
}

/* 截图验收用：?still=1 关闭卡片入场动画（不影响正常页面） */
body.no-anim .exp-card { animation: none !important; opacity: 1 !important; transform: none !important; }
body.no-anim *,
body.no-anim *::before,
body.no-anim *::after { animation: none !important; transition: none !important; }

/* 减少动效偏好：关闭全部动画与过渡 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
  }
  html { scroll-behavior: auto; }
  .exp-card { opacity: 1 !important; transform: none !important; }
  .quick-card:hover,
  .exp-card:hover,
  .exp-card.is-hover { transform: none !important; }
}

/* 打印：只保留内容 */
@media print {
  .bg, .topbar, .tree-panel, .rail, .quick, .page-foot, .modal-layer, .drawer-layer, .toast { display: none !important; }
  body { background: #fff; }
  .layout { display: block; padding: 0; }
  .exp-card { break-inside: avoid; box-shadow: none; }
}

/* ---------------------------- 详情页自适应 ---------------------------- */
@media (max-width: 1100px) {
  .figure-grid,
  .tb-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .det-duo,
  .tb-points { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .detail-layer { padding: 10px; }
  .detail-panel { max-height: 96vh; border-radius: 18px; }
  .detail-head { gap: 10px; padding: 14px 14px 12px; }
  .detail-logo { width: 42px; height: 42px; border-radius: 13px; }
  .detail-id h2 { font-size: 17px; }
  .detail-meta { margin-top: 6px; }
  .detail-tabs { padding: 6px 12px 0; }
  .dt-tab { padding: 8px 12px 10px; font-size: 13px; }
  .detail-body { padding: 14px 14px 18px; }
  .detail-foot { flex-wrap: wrap; gap: 8px; padding: 11px 12px; }
  .detail-foot-hint { flex: 1 1 100%; }
  .detail-foot-actions { flex: 1 1 100%; justify-content: stretch; }
  .detail-foot-actions .btn { flex: 1 1 auto; }
  .figure-grid,
  .tb-gallery,
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-step { min-width: 132px; }
  .lightbox-figure figcaption { max-width: 92vw; }
  .archive-card { max-height: 82vh; }
  .archive-head { padding: 16px 16px 10px; }
  .archive-body { padding: 10px; }
  .archive-foot { flex-wrap: wrap; padding: 10px 12px; }
  .archive-hint { flex: 1 1 100%; }
  .archive-foot-actions { flex: 1 1 100%; justify-content: flex-end; }
}

@media (max-width: 600px) {
  .detail-layer { padding: 0; }
  .detail-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
  .detail-x { right: 8px; top: 8px; }
  .detail-id h2 { font-size: 16px; }
  .figure-grid,
  .tb-gallery,
  .plan-grid { grid-template-columns: 1fr; }
  .detail-foot-actions .btn { flex: 1 1 100%; }
  .lightbox { padding: 10px; }
  .lightbox-nav { width: 38px; height: 38px; font-size: 22px; }
  .lightbox-nav.prev { left: 6px; }
  .lightbox-nav.next { right: 6px; }
  #lightbox-img { max-height: 66vh; }
}

/* 打印「教材参考」：只输出要点卡与扫描件图集（由 platform.js 加 body.print-textbook） */
@media print {
  body.print-textbook { background: #fff; }
  body.print-textbook .bg,
  body.print-textbook .topbar,
  body.print-textbook #layout,
  body.print-textbook .layout,
  body.print-textbook .toast,
  body.print-textbook .modal-layer,
  body.print-textbook .drawer-layer,
  body.print-textbook .lightbox,
  body.print-textbook .detail-head,
  body.print-textbook .detail-tabs,
  body.print-textbook .detail-foot,
  body.print-textbook .tb-toolbar,
  body.print-textbook .detail-x,
  body.print-textbook .modal-backdrop { display: none !important; }
  body.print-textbook .detail-layer {
    position: static;
    display: block;
    padding: 0;
  }
  body.print-textbook .detail-panel {
    display: block;
    width: 100%;
    max-height: none;
    overflow: visible;
    border-radius: 0;
    box-shadow: none;
    animation: none;
  }
  body.print-textbook .detail-body {
    display: block;
    overflow: visible;
    padding: 0;
    background: #fff;
  }
  body.print-textbook .detail-tab-panel:not([data-dpanel="textbook"]) { display: none !important; }
  body.print-textbook .tb-points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.print-textbook .tb-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.print-textbook .tb-point,
  body.print-textbook .tb-fig { break-inside: avoid; box-shadow: none; }
  body.print-textbook .tb-fig .figure-thumb { aspect-ratio: auto; }
  body.print-textbook .tb-fig .figure-thumb img { height: auto; object-fit: contain; }
  body.print-textbook .tb-fig .figure-thumb::after { display: none; }
  body.print-textbook .tb-empty { border-style: dashed; }
}
