:root {
  /* Apple/Figma chrome tokens — warm neutral, single accent */
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --muted: #86868b;
  --line: #d2d2d7;
  --hairline: rgba(0, 0, 0, 0.06);
  --peach: #f4a261;
  --coral: #e76f51;
  --sage: #1d9e75;
  --accent: #1d9e75;
  --sky: #5ac8fa;
  --lavender: #9b7ebd;
  --cream: #f5f5f7;
  --amber: #e9c46a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

.app { max-width: none; width: 100%; margin: 0 auto; padding: 12px clamp(16px, 2.5vw, 28px) 64px; box-sizing: border-box; }

/* —— Chrome: Apple / Figma —— */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 10px 4px 12px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: none;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--hairline);
  box-shadow: none;
}
.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.tagline { margin: 1px 0 0; font-size: 0.72rem; color: var(--muted); font-weight: 400; }
.topbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 9px;
  border: 1px solid var(--hairline);
}
.nav-btn {
  border: none;
  background: transparent;
  padding: 7px 12px;
  border-radius: 7px;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.nav-btn:hover { color: var(--ink); background: rgba(255,255,255,0.55); }
.nav-btn.active {
  background: #fff;
  color: var(--ink);
  font-weight: 560;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.role-switch {
  display: inline-flex;
  padding: 2px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  border: 1px solid var(--hairline);
}
.role-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 6px;
  font: inherit;
  font-size: 0.8rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.role-btn:hover { color: var(--ink); }
.role-btn.active {
  background: #fff;
  color: var(--ink);
  font-weight: 560;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.role-hint {
  margin: 0 4px 10px;
  font-size: 0.84rem;
  color: var(--ink-soft);
  min-height: 1.3em;
}

.process-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 14px;
  padding: 10px 16px;
  border-radius: 12px;
  background: linear-gradient(90deg, #e8f6f3, #fff5eb);
  border: 1px solid #c9e8e2;
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.process-banner strong { color: var(--sage); }

/* —— 布局 —— */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr 1fr; }
  .col-side { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
}
@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { display: block; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: none;
  padding: 20px 22px;
  margin-bottom: 16px;
}
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.card-head h2 { margin: 0; font-size: 1.05rem; }
.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.muted { color: var(--muted); font-size: 0.8rem; }

/* —— 按钮 —— */
.btn {
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover { border-color: var(--muted); background: #fafafa; }
.btn.primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* —— 雷达 —— */
.radar-wrap { display: flex; justify-content: center; }
#radar-svg { width: 100%; max-width: 260px; height: auto; }
.radar-legend {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.radar-legend li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding: 3px 0;
  border-bottom: 1px dashed var(--line);
}
.radar-legend .score { font-weight: 700; color: var(--coral); }

/* —— 掌握度（Tynker mastery stats） —— */
.mastery-list { display: grid; gap: 10px; }
.mastery-row { display: grid; gap: 4px; }
.mastery-row .mr-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.mastery-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--cream);
  overflow: hidden;
  border: 1px solid var(--line);
}
.mastery-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sage), #5ec4b0);
  transition: width 0.4s ease;
}

/* —— 证书墙：横向卡片网格 —— */
.cert-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.cert-card {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #fff9e8, #fff);
  border: 1px solid #f0e0b8;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.cert-card h3 {
  margin: 0;
  font-size: 0.82rem;
  color: #8a6d1d;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cert-card p { margin: 0; font-size: 0.72rem; color: var(--ink-soft); line-height: 1.35; }
.cert-card > p:not(.cert-meta) {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cert-card .cert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: auto;
  padding-top: 2px;
}
.cert-card .cert-actions .linkish {
  font-size: 0.68rem;
  padding: 0;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* —— 筛选 —— */
.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-btn {
  border: 1px solid var(--line);
  background: var(--cream);
  padding: 5px 10px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.filter-btn.active {
  background: var(--coral);
  color: #fff;
  border-color: var(--coral);
}

/* —— 作品缩略墙：五列网格（Chrome column-count+balance 会少用列，故改 grid） —— */
.works-grid,
.thumb-grid,
.museum-works-wall,
.museum-thumb-grid,
.teacher-feed,
.teacher-pending-list,
#parent-summaries,
#activity-updates .day-items,
.museum-tl-list,
.museum-rel-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  justify-items: stretch;
  /* 清除旧多列排版，避免干扰 grid */
  columns: auto;
}
@supports (grid-template-rows: masonry) {
  .works-grid,
  .thumb-grid,
  .museum-works-wall,
  .museum-thumb-grid,
  .teacher-feed,
  .teacher-pending-list,
  #parent-summaries,
  #activity-updates .day-items {
    grid-template-rows: masonry;
  }
}
.works-grid > .thumb-card,
.thumb-grid > .thumb-card,
.museum-works-wall > .thumb-card,
.museum-thumb-grid > .thumb-card,
.teacher-feed > .thumb-card,
.teacher-pending-list > .thumb-card,
#parent-summaries > .thumb-card,
#activity-updates .day-items > .thumb-card,
.museum-tl-list > .thumb-card,
.museum-rel-list > .thumb-card {
  margin: 0;
  width: auto;
  max-width: none;
  min-width: 0;
  display: flex;
  flex-direction: column;
  break-inside: auto;
}
.works-grid > .empty-state,
.thumb-grid > .empty-state,
.teacher-feed > .empty-state,
.teacher-pending-list > .empty-state,
#parent-summaries > .empty-state,
#activity-updates > .empty-state,
.museum-tl-list > .empty-state,
.museum-rel-list > .empty-state {
  grid-column: 1 / -1;
  display: block;
}
@media (max-width: 900px) {
  .works-grid,
  .thumb-grid,
  .museum-works-wall,
  .museum-thumb-grid,
  .teacher-feed,
  .teacher-pending-list,
  #parent-summaries,
  #activity-updates .day-items,
  .museum-tl-list,
  .museum-rel-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-width: 560px) {
  .works-grid,
  .thumb-grid,
  .museum-works-wall,
  .museum-thumb-grid,
  .teacher-feed,
  .teacher-pending-list,
  #parent-summaries,
  #activity-updates .day-items,
  .museum-tl-list,
  .museum-rel-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* Scratch 式缩略图卡：图为主、等高、信息极简 */
.thumb-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
  min-width: 0;
  border-radius: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.thumb-card:hover,
.thumb-card:focus {
  transform: translateY(-2px);
  outline: none;
}
.thumb-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(74, 144, 164, 0.35);
}
.thumb-image {
  position: relative;
  aspect-ratio: 4 / 3;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #e9eef2;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  display: grid;
  place-items: center;
}
.thumb-card:hover .thumb-image {
  box-shadow: 0 6px 16px rgba(44, 36, 25, 0.12);
}
.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none; /* 点击落到 .thumb-card / .thumb-image，避免拖图吞导航 */
  user-select: none;
  -webkit-user-drag: none;
}
.thumb-fallback {
  font-size: 2rem;
  line-height: 1;
  opacity: 0.85;
}
.thumb-corner {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  line-height: 1.2;
  pointer-events: none;
}
.thumb-corner.type {
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-soft);
}
.thumb-info {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 0 2px;
}
.thumb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #7eb8c9, #4a90a4);
  flex-shrink: 0;
}
.thumb-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.thumb-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thumb-by {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thumb-caption {
  margin: 4px 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--ink-soft, #5a6a72);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.thumb-action {
  margin-top: 4px;
}
.thumb-action .linkish,
.thumb-action .tp-review,
.thumb-action .tb-open-review {
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0;
  border: none;
  background: none;
  color: var(--sky, #4a90a4);
  cursor: pointer;
}
.thumb-action .linkish:hover,
.thumb-action .tp-review:hover,
.thumb-action .tb-open-review:hover {
  text-decoration: underline;
}

/* 旧 work-card 样式保留给可能的其它入口，柜面已改用 thumb-card */
.work-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}
.work-card:hover, .work-card:focus {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(44, 36, 25, 0.12);
  outline: none;
}
.wc-thumb {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  position: relative;
}
.wc-thumb .wc-type-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: var(--ink-soft);
  font-weight: 600;
}
.wc-thumb .wc-remix-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(44, 36, 25, 0.55);
  color: #fff;
}
.wc-body { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.wc-body h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wc-author { font-size: 0.75rem; color: var(--sky); }
.wc-date { font-size: 0.72rem; color: var(--muted); }
.wc-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  font-size: 0.72rem;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
}
.wc-stats span { display: inline-flex; align-items: center; gap: 3px; }

/* —— 时间线 —— */
.timeline { display: grid; gap: 10px; max-height: 70vh; overflow: auto; }
.tl-item {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--cream);
  cursor: pointer;
  transition: border-color 0.15s;
}
.tl-item.rich-row {
  display: grid;
  background: #fff;
}
.tl-item:hover { border-color: var(--peach); }
.tl-date { font-size: 0.72rem; color: var(--muted); }
.tl-title { margin: 2px 0 6px; font-size: 0.95rem; }
.tl-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.tl-body { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: #eee;
  color: var(--ink-soft);
}
.badge.type-绘画 { background: #ffe8d6; color: #a85a2a; }
.badge.type-手工 { background: #d8f3ef; color: #1a6b60; }
.badge.type-编程 { background: #d6eaf8; color: #1a5270; }
.badge.type-写作 { background: #e8daef; color: #6c3483; }
.badge.type-项目 { background: #fdebd0; color: #9a7b1a; }
.badge.scene { background: #f0f0f0; }
.badge.kind-self { background: #eafaf1; color: #1e8449; }
.badge.kind-teacher { background: #ebf5fb; color: #1a5276; }
.badge.kind-parent { background: #fef5e7; color: #9a7d0a; }

/* —— 家长看板 —— */
.parent-dash { display: grid; gap: 18px; }

/* 成长全貌 | 进度与勋章：宽屏两栏，窄屏上下叠 */
.dash-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 16px 18px;
  align-items: start;
}
.dash-overview-left,
.dash-overview-right {
  display: grid;
  gap: 10px;
  padding: 12px 14px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--hairline, var(--line));
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  min-width: 0;
  align-content: start;
}
.dash-overview-col-title,
.dash-overview-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 900px) {
  .dash-overview {
    grid-template-columns: 1fr;
  }
}
.stat-tile {
  padding: 10px 8px;
  border-radius: 10px;
  background: linear-gradient(160deg, #fff 0%, var(--cream, #faf6f1) 100%);
  border: 1px solid var(--hairline, var(--line));
  text-align: center;
  min-width: 0;
}
.stat-tile .num {
  font-size: 1.45rem;
  font-weight: 750;
  color: var(--coral, var(--accent));
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.stat-tile .lbl {
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 550;
  color: var(--ink-soft);
  line-height: 1.25;
}
/* 兼容旧 primary/secondary class，避免缓存半残 */
.stat-tile.stat-primary,
.stat-tile.stat-secondary {
  flex: unset;
  display: block;
  border-radius: 10px;
  padding: 10px 8px;
  background: linear-gradient(160deg, #fff 0%, var(--cream, #faf6f1) 100%);
  border: 1px solid var(--hairline, var(--line));
  text-align: center;
  gap: 0;
}
.stat-tile.stat-primary .num,
.stat-tile.stat-secondary .num {
  font-size: 1.45rem;
  font-weight: 750;
  color: var(--coral, var(--accent));
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.stat-tile.stat-primary .lbl,
.stat-tile.stat-secondary .lbl {
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 550;
  color: var(--ink-soft);
}
.dash-progress {
  display: grid;
  gap: 0;
}
.dash-progress-title {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--ink-soft);
}
.dash-activity h3,
.dash-parent-summaries h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .dash-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-overview-left,
  .dash-overview-right { padding: 10px 12px 12px; }
}
.progress-item {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.progress-item .pi-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
}
.activity-item {
  padding: 10px 12px;
  border-left: 3px solid var(--sage);
  background: #f7fbfa;
  margin-bottom: 8px;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
}
.activity-item.rich-row {
  border-left: none;
  border-radius: 14px;
}
.activity-item .ai-meta { font-size: 0.72rem; color: var(--muted); margin-bottom: 2px; }

/* —— 师评流：与作品墙同一 thumb 瀑布流（边框气泡已弃用） —— */
.teacher-feed,
.teacher-pending-list {
  /* 五列 grid 见上方统一瀑布流 */
}
.teacher-bubble {
  /* legacy — 渲染已改 thumb-card；保留空壳防旧缓存 */
  display: none;
}
.tb-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #a8d5e5, #4a90a4);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}
.tb-body { min-width: 0; }
.tb-head {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  align-items: baseline;
  margin-bottom: 4px;
  font-size: 0.82rem;
}
.tb-head strong { color: var(--sky); }
.tb-work {
  color: var(--coral);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tb-text {
  margin: 0;
  padding: 8px 12px;
  background: #fff;
  border-radius: 12px 12px 12px 4px;
  border: 1px solid #e0eef5;
  font-size: 0.88rem;
  color: var(--ink);
  position: relative;
}
.tb-process {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--sage);
  font-weight: 600;
}

/* —— 表单 —— */
.form { display: grid; gap: 10px; }
.form label {
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.form input, .form select, .form textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  width: 100%;
}
.form textarea { resize: vertical; }
.form.compact label { font-size: 0.76rem; }
.ability-checks {
  display: grid;
  gap: 4px;
  font-weight: 400;
  max-height: 140px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--cream);
}
.ability-checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 400;
  cursor: pointer;
}

.mini-list { margin-top: 12px; display: grid; gap: 8px; }
.mini-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--cream);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}
.mi-head { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
.mini-item p { margin: 0; color: var(--ink-soft); }

.relation-feed { display: grid; gap: 8px; margin-top: 10px; max-height: 280px; overflow: auto; }
.relation-feed.large { max-height: none; margin-top: 0; }
.rel-item {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.82rem;
}
.ri-head { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px; }
.rel-item p { margin: 0; color: var(--ink-soft); }

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* —— 抽屉 —— */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(44, 36, 25, 0.35);
  z-index: 40;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  background: var(--bg-card);
  z-index: 50;
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 1.1rem; padding-right: 8px; }
.drawer-body { padding: 16px 18px 32px; overflow: auto; flex: 1; }
.drawer-section { margin-bottom: 20px; }
.drawer-section h3 { margin: 0 0 10px; font-size: 0.95rem; }
.ability-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ability-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: #fde8df;
  color: #a04030;
  font-size: 0.75rem;
}
.version-list { display: grid; gap: 8px; }
.version-card {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--cream);
  font-size: 0.85rem;
}
.v-num { font-size: 0.72rem; color: var(--muted); margin-bottom: 2px; font-weight: 600; }
.remix-chain {
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef6fb;
  border: 1px solid #c5dde8;
  font-size: 0.84rem;
  margin-bottom: 12px;
}
.remix-chain a, .remix-chain button.linkish {
  background: none;
  border: none;
  color: var(--sky);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  padding: 0;
}
.drawer-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 12px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.form-inline {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.form-inline input {
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  width: 100%;
}

[hidden] { display: none !important; }


/* —— §6.5 加深补全样式 —— */
.privacy-hint {
  margin: 0 0 10px;
  padding: 8px 14px;
  font-size: 0.8rem;
  color: var(--sky);
  background: #eef6fb;
  border-radius: 10px;
  border: 1px solid #c5dde8;
}
.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--line);
}
.mode-toggle input { accent-color: var(--coral); }
.subhead { font-size: 0.85rem; margin: 12px 0 8px; color: var(--ink-soft); }
.cert-meta { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.cert-issue { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.btn.tiny { padding: 2px 8px; font-size: 0.72rem; }
.btn.small { padding: 6px 12px; font-size: 0.82rem; }
.badge.vis { background: #eef6fb; color: var(--sky); }
.badge.kind-cert { background: #fff3d6; color: #9a6b00; }
.wc-vis-pill {
  position: absolute; top: 8px; right: 8px;
  font-size: 0.65rem; padding: 2px 6px; border-radius: 6px;
  background: rgba(255,255,255,0.85); color: var(--ink-soft);
}
.wc-thumb { position: relative; }
.wc-teacher-snip {
  font-size: 0.72rem; color: var(--sage); margin: 4px 0;
  line-height: 1.35; max-height: 2.7em; overflow: hidden;
}
.ability-tag.mini { font-size: 0.65rem; padding: 1px 6px; }
.ability-tags.inline { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.tl-parent-sum, .tb-parent, .parent-sum-text {
  margin-top: 6px; padding: 8px 10px; border-radius: 8px;
  background: #f0faf7; border: 1px solid #c5e8de;
  font-size: 0.84rem; color: var(--sage);
}
.tl-flash {
  animation: flashPulse 1.2s ease;
  outline: 2px solid var(--coral);
}
.tl-enter { animation: slideIn 0.5s ease; }
@keyframes flashPulse {
  0% { background: #ffe8d6; }
  100% { background: transparent; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.day-group { margin-bottom: 14px; }
.day-label {
  font-weight: 700; font-size: 0.82rem; color: var(--ink-soft);
  margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px dashed var(--line);
}
.compare-panel { margin-top: 10px; }
.compare-pick {
  display: grid; gap: 8px; grid-template-columns: 1fr 1fr auto;
  align-items: end; margin-bottom: 10px;
}
.compare-pick label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); }
.compare-pick select {
  display: block; width: 100%; margin-top: 4px;
  font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line);
}
.compare-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.compare-col {
  padding: 12px; border-radius: 10px; background: var(--cream); border: 1px solid var(--line);
  font-size: 0.84rem;
}
.compare-col h4 { margin: 0 0 8px; font-size: 0.88rem; }
.compare-diff {
  margin-top: 10px; padding: 12px; border-radius: 10px;
  background: #fff8f0; border: 1px solid #f0d9c0; font-size: 0.84rem;
}
.template-box {
  margin: 8px 0; padding: 8px; border-radius: 10px;
  background: var(--cream); border: 1px solid var(--line);
}
.template-head { font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.template-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 10px; font: inherit; font-size: 0.75rem; cursor: pointer; color: var(--sage);
}
.tpl-btn:hover { border-color: var(--sage); background: #f0faf7; }
.peer-likes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.peer-chip {
  font-size: 0.75rem; padding: 3px 8px; border-radius: 999px;
  background: #ffe8e8; color: var(--coral);
}
.rel-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }

/* 小手存档 */
.kid-panel { background: linear-gradient(180deg, #fff8f0, #fff); }
.kid-intro { color: var(--ink-soft); margin: 0 0 12px; }
.kid-type-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px;
}
.kid-type-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 8px; border-radius: 16px; border: 2px solid var(--line);
  background: #fff; font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: 0.15s ease;
}
.kid-type-btn:hover, .kid-type-btn.active {
  border-color: var(--coral); background: #fff3eb; transform: scale(1.03);
}
.kid-emoji { font-size: 2rem; line-height: 1; }
.kid-input {
  font-size: 1.15rem !important; padding: 14px 16px !important; border-radius: 14px !important;
}
.kid-save {
  width: 100%; padding: 16px; font-size: 1.2rem; border-radius: 16px; margin-top: 8px;
}
.kid-pop {
  margin-top: 14px; text-align: center; font-size: 1.1rem; font-weight: 700; color: var(--coral);
}
.kid-pop-anim { animation: popBounce 0.6s ease; }
@keyframes popBounce {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
body.lowage-mode .nav-btn { padding: 10px 14px; font-size: 0.95rem; }
body.lowage-mode .btn.primary { padding: 12px 18px; font-size: 1rem; }
body.lowage-mode .work-card h3 { font-size: 1.05rem; }

@media (max-width: 900px) {
  .kid-type-grid { grid-template-columns: repeat(3, 1fr); }
  .compare-grid, .compare-pick { grid-template-columns: 1fr; }
}

/* —— v4 降密度 IA：故事首页 / 更多 / 设置 / 挑战 —— */
.layout-focus { display: block; }
.layout-focus .col-main.full { width: 100%; max-width: none; margin: 0; }
.role-hint.slim {
  margin: 0 0 12px; padding: 6px 12px; font-size: 0.78rem;
  color: var(--ink-soft); background: transparent; border: none;
}
.role-switch.compact .role-btn { padding: 5px 10px; font-size: 0.78rem; }
.btn.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; padding: 0;
  display: grid; place-items: center; font-size: 1.15rem;
  border: 1px solid var(--line); background: var(--cream); cursor: pointer;
}
.btn.icon-btn:hover { border-color: var(--coral); background: #fff3eb; }

.nav-more-wrap { position: relative; }
.more-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40;
  min-width: 160px; padding: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
}
.more-item {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  padding: 10px 12px; border-radius: 8px; font: inherit; font-size: 0.86rem;
  color: var(--ink); cursor: pointer;
}
.more-item:hover, .more-item.active { background: var(--cream); color: var(--coral); }

.story-panel { padding-bottom: 24px; }
.story-head { align-items: flex-start; }
.story-sub { margin: 4px 0 0; font-size: 0.8rem; }
.story-level-strip {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 340px;
}
.lvl-pill {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 10px; font: inherit; font-size: 0.72rem; cursor: pointer; color: var(--ink-soft);
}
.lvl-pill.weak { border-color: var(--soft-warn-border, #f0d4a8); color: #a67c2d; background: var(--soft-warn-bg, #fff6e8); }
.lvl-pill:hover { border-color: var(--sage); color: var(--sage); }

.story-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0 20px;
}
.story-card {
  display: flex; gap: 12px; padding: 16px; border-radius: 16px;
  background: linear-gradient(160deg, #fff, var(--cream));
  border: 1px solid var(--line); box-shadow: var(--shadow);
  cursor: pointer; transition: 0.15s ease; min-height: 140px;
}
.story-card:hover { transform: translateY(-2px); border-color: #e0c8b0; }
.story-card.kind-work { border-top: 3px solid var(--peach); }
.story-card.kind-review { border-top: 3px solid var(--sky); }
.story-card.kind-progress, .story-card.kind-event { border-top: 3px solid var(--sage); }
.sc-icon { font-size: 1.4rem; line-height: 1; }
.sc-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.sc-eye { font-size: 0.75rem; color: var(--ink-soft); margin-bottom: 6px; }
.sc-body p { margin: 0 0 8px; font-size: 0.86rem; color: var(--ink); line-height: 1.45; }
.sc-date { font-size: 0.72rem; color: var(--muted); }
.story-empty { grid-column: 1 / -1; }

.story-weak {
  padding: 14px 16px; border-radius: 14px; background: #f7fbf9;
  border: 1px dashed #c5ddd6;
}
.mini-radar-wrap {
  display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: center;
}
#mini-radar-svg { width: 240px; height: 240px; }
.radar-legend.compact { font-size: 0.8rem; }
.radar-legend li.weak .score { color: var(--soft-warn, #e9a84c); font-weight: 700; }
.tiny { font-size: 0.75rem; }

.ability-tag.level {
  background: #e8f4f0; color: var(--sage); border-color: #b8d9d0;
}

.settings-drawer { width: min(440px, 100vw); }
.settings-body { display: flex; flex-direction: column; gap: 12px; }
.card.nested {
  box-shadow: none; border: 1px solid var(--line); padding: 12px 14px;
}
.card.nested .card-head { margin-bottom: 8px; }
.card.nested h3 { margin: 0; font-size: 0.95rem; }
.mode-toggle.block {
  display: flex; align-items: flex-start; gap: 8px; font-size: 0.86rem; cursor: pointer;
}
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rubric-live {
  font-size: 0.8rem; padding: 8px 10px; border-radius: 8px;
  background: #f0faf7; border: 1px solid #c5ddd6; color: var(--ink); margin: 4px 0 8px;
}
.rubric-live.muted { background: var(--cream); border-color: var(--line); color: var(--muted); }

.challenge-drawer { width: min(420px, 100vw); }
.challenge-panel .ch-card {
  padding: 14px; border-radius: 12px; background: var(--cream);
  border: 1px solid var(--line); margin: 12px 0;
}
.challenge-panel .ch-card h3 { margin: 8px 0 6px; }
.ch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.ch-rubric { font-size: 0.86rem; line-height: 1.45; }

.dash-certs-inline { margin-top: 16px; }

@media (max-width: 900px) {
  .story-cards { grid-template-columns: 1fr; }
  .mini-radar-wrap { grid-template-columns: 1fr; justify-items: center; }
  .story-level-strip { max-width: none; justify-content: flex-start; }
}



/* —— v4.1 儿童友好 · 一流交互（降密度不删功能） —— */
:root {
  --soft-warn: #e9a84c;
  --soft-warn-bg: #fff6e8;
  --soft-warn-border: #f0d4a8;
  --touch-min: 44px;
}

/* 演示保留三角色切换；离开孩子仍走确认闸门（JS） */
body[data-role="child"] .topbar-roles {
  padding: 3px;
}
body[data-role="child"] #role-hint {
  display: none !important;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.settings-tip {
  margin: 0 0 10px;
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--ink-soft);
  background: linear-gradient(135deg, #fff8f0, #f0faf7);
  border-radius: 12px;
  border: 1px solid var(--line);
  line-height: 1.45;
}
.drawer-roles {
  display: inline-flex;
  width: 100%;
  justify-content: stretch;
}
.drawer-roles .role-btn {
  flex: 1;
  min-height: var(--touch-min);
  padding: 10px 12px;
  font-size: 0.9rem;
}

/* 证据卡：标题一行、正文两行、统一 CTA */
.story-card {
  flex-direction: column;
  min-height: 148px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.story-card .sc-top {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.sc-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sc-body p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 6px;
}
.sc-cta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--coral);
  letter-spacing: 0.02em;
}
.story-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 14px 32px rgba(44, 36, 25, 0.12);
  border-color: #e0c8b0;
}
.story-card:active {
  transform: translateY(-1px) scale(0.99);
}

/* 弱项：暖琥珀，非惩罚红 */
.lvl-pill.weak {
  border-color: var(--soft-warn-border);
  background: var(--soft-warn-bg);
  color: #a67c2d;
}
.lvl-pill {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.78rem;
}
.radar-legend li.weak .score {
  color: var(--soft-warn);
  font-weight: 700;
}
.radar-legend.compact li {
  min-height: var(--touch-min);
  align-items: center;
  padding: 8px 4px;
  gap: 10px;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.radar-legend.compact li:hover,
.radar-legend.compact li:focus-within {
  background: rgba(255, 255, 255, 0.7);
}
.radar-legend .legend-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.ch-gen-btn,
.legend-ch-btn {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: 999px;
  white-space: nowrap;
}
.legend-ch-btn {
  background: linear-gradient(135deg, var(--soft-warn), var(--peach));
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
}
.legend-ch-btn:hover { filter: brightness(1.05); }
.legend-ch-btn:active { transform: scale(0.97); }

.story-weak-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.story-weak-head .subhead { margin: 0; }

.story-level-strip:empty { display: none; }

/* 雷达热区视觉辅助（透明仍可点） */
#mini-radar-svg .radar-hit {
  cursor: pointer;
}
#mini-radar-svg .radar-hit:hover {
  fill: rgba(233, 168, 76, 0.12);
}

.btn.icon-btn {
  width: var(--touch-min);
  height: var(--touch-min);
  color: var(--ink-soft);
}
.btn.icon-btn svg { display: block; }

.kid-archive-chip-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.kid-archive-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--touch-min);
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px dashed var(--peach);
  background: linear-gradient(135deg, #fff8f0, #ffe8d6);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 14px rgba(244, 162, 97, 0.2);
}
.kid-archive-chip:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(244, 162, 97, 0.28);
}
.kid-archive-chip:active { transform: scale(0.98); }

body.lowage-mode .story-card { min-height: 160px; }
body.lowage-mode .sc-cta { font-size: 0.95rem; }
body.lowage-mode .nav-btn,
body.lowage-mode .lvl-pill,
body.lowage-mode .legend-ch-btn {
  min-height: var(--touch-min);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .story-card,
  .work-card,
  .kid-archive-chip,
  .kid-type-btn,
  .nav-btn,
  .btn,
  .legend-ch-btn {
    transition: none !important;
  }
  .story-card:hover,
  .work-card:hover,
  .kid-archive-chip:hover,
  .kid-type-btn:hover {
    transform: none !important;
  }
  .tl-flash, .tl-enter, .kid-pop-anim {
    animation: none !important;
  }
}


/* —— BENCH C2.2 / Top1 / C3.3 / C4.1 / §0.1·§2.6 —— */
.story-hero-cta {
  display: flex;
  justify-content: center;
  margin: 4px 0 18px;
}
.story-play-cta,
#btn-gen-challenge.story-play-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  min-width: min(100%, 320px);
  padding: 14px 28px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  background: linear-gradient(135deg, #2a9d8f, #4ecdc4);
  color: #fff;
  border: none;
  box-shadow: 0 10px 28px rgba(42, 157, 143, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.story-play-cta:hover,
#btn-gen-challenge.story-play-cta:hover {
  filter: brightness(1.06);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 32px rgba(42, 157, 143, 0.42);
}
.story-play-cta:active {
  transform: scale(0.98);
}

/* 三证据卡主舞台 */
.story-cards {
  gap: 16px;
  margin: 8px 0 22px;
}
.story-card {
  min-height: 168px;
  min-width: 0;
}
.story-card .sc-cta {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* 弱项区次级（不与三卡同权） */
.story-weak {
  padding: 12px 14px;
  background: #f9fbfa;
  border: 1px solid #dce8e4;
  border-style: solid;
  opacity: 0.98;
}
.story-weak .mini-radar-wrap {
  grid-template-columns: 200px 1fr;
  gap: 12px;
}
#mini-radar-svg { width: 200px; height: 200px; max-width: 100%; }

.ability-overview-link {
  border: none;
  background: transparent;
  color: var(--sage);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ability-overview-link:hover {
  background: rgba(42, 157, 143, 0.08);
}

.story-back-chip {
  position: relative;
  z-index: 2;
  margin: 10px 14px 0;
  align-self: flex-start;
}

/* Khan 式色点进度（自有色） */
.level-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.level-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e8dfd3;
  display: inline-block;
}
.level-dot.on.dot-developing { background: var(--soft-warn); }
.level-dot.on.dot-progress { background: #e9c46a; }
.level-dot.on.dot-mastered { background: var(--sage); }

.legend-ch-btn {
  min-height: 44px;
  min-width: 72px;
  padding: 8px 14px;
  font-size: 0.82rem;
}
.ch-start-cta {
  min-height: 48px;
  min-width: 140px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 999px;
  background: linear-gradient(135deg, #2a9d8f, #4ecdc4) !important;
}

/* C4.1 主可点 ≥44px */
.nav-btn {
  min-height: var(--touch-min);
  padding: 10px 14px;
}
.role-btn {
  min-height: var(--touch-min);
}
.lvl-pill {
  min-height: var(--touch-min);
}

/* C3.3 短庆祝 */
.celebrate-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
#view-story {
  position: relative;
}
#view-story.celebrate-burst::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 8% 12%;
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 30%, rgba(233, 168, 76, 0.55) 0 4px, transparent 5px),
    radial-gradient(circle at 70% 25%, rgba(42, 157, 143, 0.5) 0 5px, transparent 6px),
    radial-gradient(circle at 40% 70%, rgba(244, 162, 97, 0.55) 0 4px, transparent 5px),
    radial-gradient(circle at 80% 60%, rgba(78, 205, 196, 0.5) 0 6px, transparent 7px),
    radial-gradient(circle at 55% 40%, rgba(233, 196, 106, 0.5) 0 3px, transparent 4px);
  animation: celebrate-sparkle 0.85s ease-out forwards;
  z-index: 5;
}
.cta-sparkle {
  animation: cta-pop 0.7s ease-out;
}
@keyframes celebrate-sparkle {
  0% { opacity: 0; transform: scale(0.85); }
  35% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.15); }
}
@keyframes cta-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@media (max-width: 900px) {
  .story-weak .mini-radar-wrap { grid-template-columns: 1fr; }
  .story-play-cta,
  #btn-gen-challenge.story-play-cta {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #view-story.celebrate-burst::after,
  .cta-sparkle,
  .story-play-cta {
    animation: none !important;
  }
}

/* —— P0+P1 体验优化（功能不删） —— */

/* P0.1 开场仪式 */
.story-hero-cta.story-enter,
.story-cards .story-card.story-enter,
.story-empty.story-enter {
  animation: story-rise 0.55s ease-out both;
}
.story-cards .story-card.story-enter:nth-child(1) { animation-delay: 0.08s; }
.story-cards .story-card.story-enter:nth-child(2) { animation-delay: 0.2s; }
.story-cards .story-card.story-enter:nth-child(3) { animation-delay: 0.32s; }
.story-hero-cta.story-enter { animation-delay: 0s; }
@keyframes story-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* P0.2 主 CTA 脉冲 */
#btn-gen-challenge.story-play-cta:not([hidden]) {
  animation: cta-pulse 2.2s ease-in-out infinite;
}
@keyframes cta-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 10px 28px rgba(42, 157, 143, 0.35); }
  50% { transform: scale(1.035); box-shadow: 0 14px 36px rgba(42, 157, 143, 0.5), 0 0 0 6px rgba(42, 157, 143, 0.12); }
}
#btn-gen-challenge.story-play-cta:hover {
  animation: none;
}

/* P0.3 点卡短亮 */
.story-card.card-flash {
  animation: card-flash 0.45s ease-out;
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}
@keyframes card-flash {
  0% { box-shadow: 0 0 0 0 rgba(42, 157, 143, 0.45); }
  40% { box-shadow: 0 0 0 8px rgba(42, 157, 143, 0.18); background: #f0faf7; }
  100% { box-shadow: var(--shadow); }
}
.drawer.drawer-slide-in {
  animation: drawer-in 0.32s ease-out;
}
@keyframes drawer-in {
  from { transform: translateX(18px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

/* P0.4 Confetti + toast */
.confetti-host {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-fly 0.95s ease-out forwards;
}
@keyframes confetti-fly {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.6); }
}
.celebrate-toast {
  position: fixed;
  left: 50%;
  top: 28%;
  transform: translate(-50%, -50%);
  z-index: 81;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff8f0, #ffffff);
  border: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(44, 36, 25, 0.16);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--sage);
  pointer-events: none;
  animation: toast-pop 1.1s ease-out forwards;
}
@keyframes toast-pop {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.98); }
}

/* P0.5 弱项关卡卡 */
.story-weak-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: start;
}
.quest-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.quest-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(165deg, #fff6e8, #ffffff);
  border: 1px solid var(--soft-warn-border, #f0d4a8);
  min-height: 132px;
}
.quest-card .qc-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}
.quest-card .qc-meta {
  font-size: 0.8rem;
  color: #a67c2d;
}
.quest-card .qc-start {
  margin-top: auto;
  min-height: 48px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #e9a84c, #f4a261);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(233, 168, 76, 0.35);
}
.quest-card .qc-start:hover { filter: brightness(1.05); }
.quest-card .qc-start:active { transform: scale(0.97); }
.all-abilities-fold {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 12px;
}
.all-abilities-fold summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--sage);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.all-abilities-fold[open] summary { margin-bottom: 8px; }
.all-abilities-fold .radar-legend { margin: 0 0 8px; }


/* 故事页：六维速览 + 档案能力入口（完整雷达已迁入成长档案） */
.story-ability-legend {
  margin: 10px 0 0;
  gap: 0;
}
.story-ability-legend li {
  min-height: 36px;
  padding: 4px 6px;
  gap: 8px;
  font-size: 0.8rem;
  border-radius: 8px;
}
.story-ability-jump {
  margin: 8px 0 0;
  text-align: right;
}
.story-ability-jump .ability-overview-link {
  min-height: 36px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* P0.9 / P1.9 大空状态 */
.story-empty-hero {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 36px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff8f0, #ffffff);
  border: 1px dashed #e0c8b0;
  min-height: 200px;
}
.story-empty-hero .seh-art {
  width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #ffe0c2, #e8f4f0);
  font-size: 2rem;
}
.story-empty-hero .seh-title { margin: 0; font-size: 1.15rem; font-weight: 700; }
.story-empty-hero .seh-sub { margin: 0; color: var(--ink-soft); font-size: 0.9rem; }
.story-empty-hero .seh-cta {
  min-height: 52px;
  min-width: 200px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #2a9d8f, #4ecdc4);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(42, 157, 143, 0.32);
}

/* P1.6 作品绿 + FAB */
#view-explore {
  position: relative;
}
.fab-add {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 45;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #2a9d8f, #3cb89a);
  color: #fff;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(42, 157, 143, 0.4);
  z-index: 5;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fab-add:hover {
  transform: scale(1.06);
  box-shadow: 0 16px 32px rgba(42, 157, 143, 0.48);
}
.fab-add:active { transform: scale(0.96); }

/* P1.7 时间线图标徽章 */
.tl-icon-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
  margin-right: 4px;
}
.tl-icon-chip .tic-glyph { font-size: 0.95rem; line-height: 1; }
.tl-icon-chip.tic-challenge { background: #fff6e8; color: #a67c2d; border-color: #f0d4a8; }
.tl-icon-chip.tic-teacher,
.tl-icon-chip.tic-review { background: #eef6fa; color: var(--sky); border-color: #c5dce6; }
.tl-icon-chip.tic-certificate { background: #e8f4f0; color: var(--sage); border-color: #b8d9d0; }
.tl-icon-chip.tic-version,
.tl-icon-chip.tic-work { background: #fff0e6; color: #c46b2f; border-color: #f0c9a8; }
.tl-icon-chip.tic-peer,
.tl-icon-chip.tic-relation { background: #f3eef8; color: var(--lavender); border-color: #dccfe8; }
.tl-icon-chip.tic-self { background: #f7f3ec; color: var(--ink-soft); border-color: var(--line); }
.tl-icon-chip.tic-parent { background: #fcefe8; color: var(--coral); border-color: #f0cfc4; }
.tl-item .tl-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* P1.8 角色确认 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(44, 36, 25, 0.35); z-index: 90;
}
.role-confirm-modal {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 91;
  width: min(360px, calc(100vw - 32px));
  padding: 22px 20px 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 20px 48px rgba(44, 36, 25, 0.2);
}
.role-confirm-modal h3 { margin: 0 0 8px; font-size: 1.1rem; }
.role-confirm-modal p { margin: 0 0 16px; }
.role-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 900px) {
  .story-weak-body { grid-template-columns: 1fr; }
  .story-weak-body .mini-radar-wrap { justify-items: center; }
  #mini-radar-svg { width: 200px; height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
  .story-hero-cta.story-enter,
  .story-cards .story-card.story-enter,
  .story-empty.story-enter,
  #btn-gen-challenge.story-play-cta:not([hidden]),
  .story-card.card-flash,
  .drawer.drawer-slide-in,
  .confetti-piece,
  .celebrate-toast,
  .fab-add {
    animation: none !important;
    transition: none !important;
  }
  .story-hero-cta.story-enter,
  .story-cards .story-card.story-enter,
  .story-empty.story-enter {
    opacity: 1;
    transform: none;
  }
  .celebrate-toast {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

#view-explore .works-grid { padding-bottom: 72px; }

/* —— 视觉优先 · 游戏场景感（功能不删，只改呈现） —— */

.story-world {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, #b8e4f0 0%, #d4f0fa 28%, #e8f6e8 55%, #f3e6c8 78%, #e8d4a8 100%) !important;
  border: 1px solid #c5ddd6;
  box-shadow: 0 12px 36px rgba(42, 100, 120, 0.12);
}

.world-sky {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.world-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 40px;
  filter: blur(0.5px);
}
.world-cloud.c1 { width: 90px; height: 28px; top: 18px; left: 8%; }
.world-cloud.c1::after {
  content: ""; position: absolute; width: 48px; height: 36px; border-radius: 50%;
  background: inherit; top: -16px; left: 18px;
}
.world-cloud.c2 { width: 70px; height: 22px; top: 48px; right: 14%; opacity: 0.85; }
.world-cloud.c2::after {
  content: ""; position: absolute; width: 36px; height: 28px; border-radius: 50%;
  background: inherit; top: -12px; left: 12px;
}
.world-cloud.c3 { width: 56px; height: 18px; top: 28px; left: 42%; opacity: 0.65; }
.world-hill {
  position: absolute;
  bottom: -20px;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, #7bc47a 0%, #5aaa68 100%);
  opacity: 0.35;
}
.world-hill.h1 { width: 55%; height: 120px; left: -8%; }
.world-hill.h2 { width: 48%; height: 100px; right: -6%; background: linear-gradient(180deg, #6bb86a, #4a9a58); opacity: 0.28; }
.world-path {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 120px;
  height: 40%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(232, 196, 140, 0.45));
  border-radius: 40% 40% 0 0;
  clip-path: polygon(35% 0, 65% 0, 90% 100%, 10% 100%);
}

.story-world > *:not(.world-sky) {
  position: relative;
  z-index: 1;
}

.story-head-world h2 {
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}
.story-head-world .story-sub {
  font-size: 0.78rem;
  opacity: 0.85;
}

/* 关卡起点路牌 */
.story-signpost {
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 8px 0 20px;
}
.signpost-pole {
  width: 10px;
  height: 28px;
  background: linear-gradient(90deg, #c4a574, #a8874e);
  border-radius: 3px;
  box-shadow: 2px 0 0 rgba(0, 0, 0, 0.06);
  margin-bottom: -4px;
}
.story-signpost .story-play-cta,
.story-signpost #btn-gen-challenge.story-play-cta {
  border-radius: 14px;
  min-height: 58px;
  padding: 14px 32px;
  box-shadow:
    0 4px 0 #1f7a70,
    0 12px 28px rgba(42, 157, 143, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.35);
  transform: perspective(400px) rotateX(2deg);
}
.story-signpost #btn-gen-challenge.story-play-cta:hover {
  transform: perspective(400px) rotateX(0deg) translateY(-2px) scale(1.02);
}

/* —— 证据卡：默认大场景，字层悬停/焦点/点按 —— */
.story-cards {
  gap: 18px;
  margin: 4px 0 24px;
}

.story-card.scene-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 0;
  height: auto;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.65);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(44, 36, 25, 0.14);
  background: #fff;
}

.sc-scene {
  position: relative;
  inset: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  height: 132px;
  min-height: 132px;
  overflow: hidden;
}
.sc-scene-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.sc-scene-emoji {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  font-size: 4.2rem;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.12));
  z-index: 2;
}
.sc-scene-deco {
  position: absolute;
  border-radius: 50%;
  opacity: 0.55;
  z-index: 1;
}
.sc-scene-deco.d1 { width: 80px; height: 80px; top: 12%; left: 8%; }
.sc-scene-deco.d2 { width: 56px; height: 56px; bottom: 18%; right: 10%; }
.sc-scene-deco.d3 { width: 36px; height: 36px; top: 22%; right: 22%; }

.story-card.kind-work .sc-scene-art {
  background:
    radial-gradient(circle at 30% 70%, rgba(255, 255, 255, 0.5) 0 12%, transparent 13%),
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.35) 0 8%, transparent 9%),
    linear-gradient(145deg, #ff9a7a 0%, #ffc857 35%, #7ec8e3 70%, #c9a0dc 100%);
}
.story-card.kind-work .sc-scene-deco.d1 { background: rgba(255, 255, 255, 0.35); }
.story-card.kind-work .sc-scene-deco.d2 { background: rgba(255, 200, 100, 0.4); }
.story-card.kind-work .sc-scene-deco.d3 { background: rgba(126, 200, 227, 0.45); }

.story-card.kind-review .sc-scene-art {
  background:
    radial-gradient(ellipse at 50% 80%, rgba(255, 255, 255, 0.5) 0 30%, transparent 31%),
    linear-gradient(160deg, #6eb5d8 0%, #a8d8ea 45%, #e8f4fa 100%);
}
.story-card.kind-review .sc-scene-deco.d1 {
  width: 70px; height: 52px; border-radius: 18px; background: rgba(255, 255, 255, 0.55);
  top: 18%; left: 12%;
}
.story-card.kind-review .sc-scene-deco.d2 {
  width: 48px; height: 36px; border-radius: 14px; background: rgba(255, 255, 255, 0.4);
  bottom: 22%; right: 14%;
}
.story-card.kind-review .sc-scene-deco.d3 { background: rgba(110, 181, 216, 0.35); }

.story-card.kind-progress .sc-scene-art,
.story-card.kind-event .sc-scene-art {
  background:
    linear-gradient(180deg, #87ceeb 0%, #b8e0a8 42%, #7cb86a 70%, #5a9a4e 100%);
}
.story-card.kind-progress .sc-scene-deco.d1,
.story-card.kind-event .sc-scene-deco.d1 {
  width: 100%; height: 40%; bottom: 0; top: auto; left: 0; border-radius: 40% 40% 0 0;
  background: rgba(90, 154, 78, 0.5); opacity: 0.7;
}
.story-card.kind-progress .sc-scene-deco.d2,
.story-card.kind-event .sc-scene-deco.d2 {
  width: 18px; height: 55%; top: 20%; right: 28%; border-radius: 4px;
  background: linear-gradient(180deg, #e74c3c, #c0392b); opacity: 0.85;
}
.story-card.kind-progress .sc-scene-deco.d3,
.story-card.kind-event .sc-scene-deco.d3 {
  width: 36px; height: 24px; top: 18%; right: 22%;
  background: #f1c40f; clip-path: polygon(0 0, 100% 50%, 0 100%);
  border-radius: 0; opacity: 0.95;
}

.sc-chip-title {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}
.sc-chip-ico { font-size: 1.1rem; }

/* 信息层：默认图文并茂（场景图 + 短标题/摘要）；悬停可加深 */
.story-card.scene-card.rich-card,
.story-card.scene-card {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  overflow: hidden;
}
.sc-scene {
  position: relative;
  inset: auto;
  height: 132px;
  min-height: 132px;
  flex-shrink: 0;
}
.sc-chip-title {
  bottom: 10px;
  opacity: 1;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.sc-info {
  position: relative;
  inset: auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 12px 14px 12px;
  background: #fff;
  color: var(--ink);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  flex: 1;
}
.sc-info .sc-title {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-info .sc-eye {
  color: var(--muted);
  font-size: 0.72rem;
  margin-bottom: 4px;
}
.sc-info .sc-body-text,
.sc-info p {
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sc-info .sc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.sc-info .sc-date {
  color: var(--muted);
  font-size: 0.7rem;
  margin: 0;
}
.sc-info .sc-cta {
  margin: 0;
  padding: 0;
  color: var(--coral);
  font-weight: 700;
  font-size: 0.85rem;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
}
.sc-info .level-dots .level-dot { box-shadow: none; }

.story-card.scene-card:hover .sc-info,
.story-card.scene-card:focus-within .sc-info,
.story-card.scene-card.revealed .sc-info {
  background: #fffdf8;
}
.story-card.scene-card:hover .sc-body-text,
.story-card.scene-card:focus-within .sc-body-text,
.story-card.scene-card.revealed .sc-body-text {
  -webkit-line-clamp: 3;
}
.story-card.scene-card:hover .sc-scene-emoji,
.story-card.scene-card:focus-within .sc-scene-emoji {
  transform: translate(-50%, -50%) scale(1.06);
}
.story-card.scene-card:hover,
.story-card.scene-card:focus-within,
.story-card.scene-card.revealed {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(44, 36, 25, 0.14);
}

/* —— 关卡地图格 —— */
.story-quest-map {
  background:
    linear-gradient(180deg, rgba(232, 246, 232, 0.85), rgba(243, 230, 200, 0.9)) !important;
  border: 2px dashed rgba(90, 154, 78, 0.35) !important;
  border-radius: 20px !important;
  padding: 16px !important;
  position: relative;
}
.story-quest-map::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 8px;
  border-radius: 14px;
  background:
    repeating-linear-gradient(
      -12deg,
      transparent,
      transparent 18px,
      rgba(90, 154, 78, 0.06) 18px,
      rgba(90, 154, 78, 0.06) 20px
    );
  z-index: 0;
}
.story-quest-map > * { position: relative; z-index: 1; }

.quest-card.scene-quest {
  position: relative;
  min-height: 168px;
  padding: 0 0 56px;
  overflow: hidden;
  border-radius: 18px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  background:
    linear-gradient(165deg, #c8e6a0 0%, #8fbf6a 40%, #6a9e4e 100%);
  box-shadow: 0 8px 20px rgba(74, 120, 50, 0.22);
  cursor: pointer;
}
.quest-card.scene-quest.quest-ok {
  background: linear-gradient(165deg, #a8e6d8, #5eb8a8 50%, #3a9a8a);
}
.qc-scene {
  position: absolute;
  inset: 0 0 52px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.qc-big-ico {
  font-size: 2.8rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}
.qc-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #a67c2d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.quest-ok .qc-badge { color: var(--sage); }
.qc-gate {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 28px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #c4a574, #8b6914);
  opacity: 0.55;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.25);
}
.quest-card.scene-quest {
  display: flex;
  flex-direction: column;
  padding: 0 0 56px;
  min-height: 200px;
}
.qc-scene {
  position: relative;
  inset: auto;
  height: 88px;
  min-height: 88px;
  flex-shrink: 0;
}
.qc-info {
  position: relative;
  inset: auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 10px 12px 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  text-align: left;
  flex: 1;
}
.qc-info .qc-title {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 2px;
}
.qc-info .qc-meta {
  color: var(--ink-soft);
  font-size: 0.75rem;
}
.quest-card.scene-quest:hover .qc-info,
.quest-card.scene-quest:focus-within .qc-info,
.quest-card.scene-quest.revealed .qc-info {
  background: #fff;
}
.quest-card.scene-quest .qc-start {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 5;
  margin: 0;
  min-height: 44px;
  pointer-events: auto;
}
.quest-card.scene-quest:hover,
.quest-card.scene-quest:focus-within,
.quest-card.scene-quest.revealed {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(74, 120, 50, 0.3);
}

/* 空状态场景 */
.story-empty-hero.scene-empty {
  background:
    linear-gradient(180deg, #b8e4f0 0%, #e8f6e8 60%, #f3e6c8 100%);
  border: 3px solid rgba(255, 255, 255, 0.6);
  min-height: 240px;
  position: relative;
  overflow: hidden;
}
.seh-scene {
  position: relative;
  width: 100%;
  height: 100px;
  display: grid;
  place-items: center;
}
.seh-scene .seh-art {
  position: relative;
  z-index: 2;
  width: 80px; height: 80px;
  font-size: 2.4rem;
}
.seh-hill {
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 40px;
  border-radius: 50% 50% 0 0;
  background: rgba(90, 154, 78, 0.35);
}
.scene-empty .seh-sub { display: none; }

@media (hover: hover) and (pointer: fine) {
  .story-card.scene-card:hover .sc-info { pointer-events: auto; }
}

@media (hover: none) {
  /* 图文默认可见；revealed 仅加深，不隐藏正文 */
  .story-card.scene-card .sc-info,
  .quest-card.scene-quest .qc-info {
    opacity: 1;
    visibility: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .world-cloud,
  .sc-scene-emoji,
  .qc-big-ico {
    animation: none !important;
  }
  .sc-info,
  .qc-info {
    transition: none !important;
  }
  .story-card.scene-card:hover,
  .story-card.scene-card:focus-within,
  .story-card.scene-card.revealed,
  .quest-card.scene-quest:hover,
  .quest-card.scene-quest:focus-within,
  .quest-card.scene-quest.revealed {
    transform: none;
  }
}

@media (max-width: 900px) {
  .story-card.scene-card .sc-scene {
    height: 120px;
    min-height: 120px;
  }
  .sc-scene-emoji { font-size: 3.4rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .world-cloud.c1 { animation: cloud-drift 18s ease-in-out infinite alternate; }
  .world-cloud.c2 { animation: cloud-drift 22s ease-in-out infinite alternate-reverse; }
  .world-cloud.c3 { animation: cloud-drift 16s ease-in-out infinite alternate; }
  @keyframes cloud-drift {
    from { transform: translateX(0); }
    to { transform: translateX(18px); }
  }
  .sc-scene-emoji {
    animation: emoji-bob 3.2s ease-in-out infinite;
  }
  @keyframes emoji-bob {
    0%, 100% { transform: translate(-50%, -50%); }
    50% { transform: translate(-50%, calc(-50% - 6px)); }
  }
}

.sc-info .ability-tag.level {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  align-self: flex-start;
  margin-bottom: 6px;
}


/* ============================================================
   Apple / Figma chrome × refined game stage
   Chrome stays quiet; only #view-story / evidence / quest play.
   ============================================================ */

.card-head h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.chip {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--hairline);
  color: var(--ink-soft);
  border-radius: 6px;
  font-weight: 500;
}
.muted { color: var(--muted); }

.filter-btn {
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 7px;
  color: var(--ink-soft);
}
.filter-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn.icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: #fff;
  color: var(--ink-soft);
  box-shadow: none;
}
.btn.icon-btn:hover {
  border-color: var(--line);
  background: #fafafa;
  color: var(--ink);
}

.more-menu {
  min-width: 180px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: var(--shadow-float);
}
.more-item {
  border-radius: 6px;
  font-size: 0.8125rem;
  padding: 9px 12px;
  color: var(--ink);
}
.more-item:hover, .more-item.active {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink);
}

.process-banner {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--ink-soft);
  box-shadow: none;
}
.process-banner strong { color: var(--accent); font-weight: 600; }

.drawer {
  box-shadow: -1px 0 0 var(--hairline), -12px 0 40px rgba(0, 0, 0, 0.06);
  border-left: none;
}
.drawer-backdrop { background: rgba(0, 0, 0, 0.28); }
.drawer-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
}
.drawer-head h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.settings-drawer .card.nested,
.card.nested {
  box-shadow: none;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: #fafafa;
  padding: 14px 14px;
}
.settings-tip {
  background: #fafafa;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--ink-soft);
}
.drawer-roles {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 9px;
  padding: 3px;
  border: 1px solid var(--hairline);
}
.modal-backdrop { background: rgba(0, 0, 0, 0.28); }
.role-confirm-modal {
  border-radius: 14px;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-float);
  padding: 20px;
}
.role-confirm-modal h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.work-card {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: none;
}
.work-card:hover, .work-card:focus {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.tl-item {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.tl-item:hover { border-color: var(--line); }
.stat-tile:not(.stat-secondary) {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: none;
}
.stat-tile:not(.stat-secondary) .num { color: var(--accent); font-weight: 600; letter-spacing: -0.03em; }
.teacher-bubble {
  background: #fafafa;
  border: 1px solid var(--hairline);
  border-radius: 12px;
}
.tb-work { color: var(--accent); }
.cert-card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.cert-card h3 { color: var(--ink); }

.fab-add {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 4px 16px rgba(29, 158, 117, 0.35);
  border: none;
  font-size: 1.75rem;
  font-weight: 400;
}
.fab-add:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(29, 158, 117, 0.4);
}

.layout-focus .col-main.full { max-width: none; }

/* —— Stage: quiet world, large playfield —— */
.story-world {
  position: relative;
  overflow: hidden;
  padding: 22px 22px 28px !important;
  background:
    linear-gradient(180deg, #eef6f8 0%, #f3f7f4 42%, #f7f5ef 100%) !important;
  border: 1px solid var(--hairline) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
}
.world-sky { opacity: 0.85; }
.world-cloud {
  background: rgba(255, 255, 255, 0.55);
  filter: blur(1px);
  opacity: 0.7;
}
.world-cloud.c1 { width: 72px; height: 22px; top: 22px; left: 10%; }
.world-cloud.c2 { width: 56px; height: 18px; top: 40px; right: 12%; opacity: 0.5; }
.world-cloud.c3 { width: 44px; height: 14px; top: 28px; left: 48%; opacity: 0.4; }
.world-hill {
  opacity: 0.18;
  background: linear-gradient(180deg, #9cc9b8 0%, #7aaf9a 100%);
}
.world-hill.h1 { height: 100px; }
.world-hill.h2 { height: 84px; opacity: 0.14; background: linear-gradient(180deg, #8bb8a8, #6a9e8e); }
.world-path {
  width: 96px;
  height: 36%;
  background: linear-gradient(180deg, transparent, rgba(210, 196, 160, 0.28));
  opacity: 0.8;
}

.story-head-world h2 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-shadow: none;
  color: var(--ink);
}
.story-head-world .story-sub {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 1;
}

/* Signpost CTA — game entry, still clean */
.story-signpost { margin: 6px 0 22px; }
.signpost-pole {
  width: 6px;
  height: 20px;
  background: #c9c9cc;
  border-radius: 2px;
  box-shadow: none;
  margin-bottom: -2px;
}
.story-signpost .story-play-cta,
.story-signpost #btn-gen-challenge.story-play-cta,
#btn-gen-challenge.story-play-cta {
  border-radius: 14px;
  min-height: 52px;
  min-width: min(100%, 280px);
  padding: 12px 28px;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 8px 20px rgba(29, 158, 117, 0.28);
  transform: none;
}
.story-signpost #btn-gen-challenge.story-play-cta:hover,
#btn-gen-challenge.story-play-cta:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(29, 158, 117, 0.34);
}
@keyframes cta-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 20px rgba(29, 158, 117, 0.28); }
  50% { transform: scale(1.02); box-shadow: 0 10px 26px rgba(29, 158, 117, 0.38), 0 0 0 4px rgba(29, 158, 117, 0.1); }
}

/* Evidence cards — larger stage tiles, restrained borders */
.story-cards {
  gap: 16px;
  margin: 8px 0 28px;
}
.story-card.scene-card {
  height: 236px;
  min-height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 12px 28px rgba(0, 0, 0, 0.06);
  border-top: none;
}
.story-card.kind-work,
.story-card.kind-review,
.story-card.kind-progress,
.story-card.kind-event {
  border-top: none;
}
.sc-scene-emoji {
  font-size: 3.6rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.1));
}
.sc-chip-title {
  bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
/* Calmer scene palettes — fewer candy stops */
.story-card.kind-work .sc-scene-art {
  background:
    radial-gradient(circle at 28% 72%, rgba(255,255,255,0.35) 0 10%, transparent 11%),
    linear-gradient(150deg, #f0a58a 0%, #e8c07a 48%, #7eb8c9 100%);
}
.story-card.kind-review .sc-scene-art {
  background:
    radial-gradient(ellipse at 50% 85%, rgba(255,255,255,0.4) 0 28%, transparent 29%),
    linear-gradient(165deg, #6aa8c4 0%, #b5d6e4 55%, #eaf3f7 100%);
}
.story-card.kind-progress .sc-scene-art,
.story-card.kind-event .sc-scene-art {
  background: linear-gradient(180deg, #9ec9dc 0%, #b5d4a8 48%, #7aaf6a 100%);
}
.sc-info {
  background: linear-gradient(180deg, rgba(20, 20, 22, 0.08) 0%, rgba(20, 20, 22, 0.72) 52%, rgba(20, 20, 22, 0.88) 100%);
  border-radius: 0 0 13px 13px;
}
.sc-info .sc-cta { color: #a8f0d4; }
.story-card.scene-card:hover,
.story-card.scene-card:focus-within,
.story-card.scene-card.revealed {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 16px 36px rgba(0, 0, 0, 0.08);
}

/* Quest map — refined board, not sticker wall */
.story-quest-map {
  background: rgba(255, 255, 255, 0.55) !important;
  border: 1px solid var(--hairline) !important;
  border-radius: 14px !important;
  padding: 16px 16px 14px !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.story-quest-map::before {
  inset: 0;
  border-radius: 14px;
  background:
    radial-gradient(circle at 12% 20%, rgba(29, 158, 117, 0.05) 0 40%, transparent 41%),
    radial-gradient(circle at 88% 70%, rgba(90, 154, 78, 0.04) 0 35%, transparent 36%);
  opacity: 1;
}
.story-weak-head .subhead {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.quest-card.scene-quest {
  min-height: 176px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: linear-gradient(165deg, #c5dfb0 0%, #8fbf72 55%, #6a9e55 100%);
  box-shadow: 0 2px 8px rgba(60, 100, 50, 0.12), 0 10px 22px rgba(60, 100, 50, 0.1);
}
.quest-card.scene-quest.quest-ok {
  background: linear-gradient(165deg, #b0e0d4, #5eb8a4 55%, #3a9a88);
}
.qc-badge {
  background: rgba(255, 255, 255, 0.94);
  font-weight: 650;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.qc-gate {
  width: 40px;
  height: 22px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #d4c4a0, #a89060);
  opacity: 0.45;
}
.quest-card.scene-quest .qc-start {
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.9);
}
.quest-card.scene-quest .qc-start:hover {
  filter: none;
  background: #fafafa;
}
.quest-card.scene-quest:hover,
.quest-card.scene-quest:focus-within,
.quest-card.scene-quest.revealed {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(60, 100, 50, 0.16), 0 14px 28px rgba(60, 100, 50, 0.12);
}

.all-abilities-fold {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
}
.all-abilities-fold summary {
  color: var(--accent);
  font-weight: 560;
}
.ability-overview-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 560;
}
.ability-overview-link:hover {
  background: rgba(29, 158, 117, 0.08);
}

.kid-archive-chip {
  border: 1px dashed var(--line);
  background: #fff;
  box-shadow: none;
  font-weight: 560;
  border-radius: 12px;
}
.kid-archive-chip:hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.story-empty-hero,
.story-empty-hero.scene-empty {
  background: linear-gradient(180deg, #eef6f8 0%, #f7f5ef 100%);
  border: 1px dashed var(--line);
  border-radius: 14px;
  min-height: 220px;
}
.story-empty-hero .seh-cta {
  background: var(--accent);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(29, 158, 117, 0.28);
  font-weight: 650;
}

.celebrate-toast {
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-float);
  color: var(--accent);
  font-weight: 650;
}

.nav-btn { min-height: 36px; }
.role-btn { min-height: 36px; }
.btn.primary:hover { filter: brightness(1.03); }

@media (max-width: 900px) {
  .app { padding: 10px 14px 56px; }
  .topbar { gap: 10px; margin-bottom: 14px; }
  .story-card.scene-card { height: 200px; min-height: 188px; }
  .story-world { padding: 16px 14px 20px !important; }
}


/* —— 图文并茂：左图右文通用行 —— */
.rich-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: start;
}
.rich-thumb {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
  overflow: hidden;
  position: relative;
}
.rich-thumb .rt-ico {
  font-size: 1.65rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}
.rich-thumb.kind-thumb.tic-challenge { background: linear-gradient(145deg, #ffe8b8, #ffc857); }
.rich-thumb.kind-thumb.tic-teacher,
.rich-thumb.kind-thumb.tic-review { background: linear-gradient(145deg, #c8e6f5, #6eb5d8); }
.rich-thumb.kind-thumb.tic-certificate { background: linear-gradient(145deg, #c8e8d8, #6ab08a); }
.rich-thumb.kind-thumb.tic-version,
.rich-thumb.kind-thumb.tic-work { background: linear-gradient(145deg, #ffd4b8, #f0a070); }
.rich-thumb.kind-thumb.tic-peer,
.rich-thumb.kind-thumb.tic-relation { background: linear-gradient(145deg, #e4d4f5, #b08fd4); }
.rich-thumb.kind-thumb.tic-self { background: linear-gradient(145deg, #f0e8dc, #d4c4b0); }
.rich-thumb.kind-thumb.tic-parent { background: linear-gradient(145deg, #ffd8cc, #f0a090); }
.rich-body { min-width: 0; }
.rich-body .ai-title {
  font-size: 0.9rem;
  margin-bottom: 2px;
  line-height: 1.35;
}
.rich-body .ai-snip {
  font-size: 0.8rem;
  color: var(--ink-soft);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.activity-item.rich-row,
.parent-sum-item.rich-row {
  padding: 12px;
  border-left: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 10px;
}
.parent-sum-item .parent-sum-text {
  margin: 4px 0 8px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 师评：作品类型场景块 + 头像叠角 */
.teacher-bubble.rich-row {
  grid-template-columns: 72px 1fr;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
}
.tb-visual {
  position: relative;
  width: 72px;
}
.tb-visual .rich-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
}
.tb-visual .tb-avatar {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* 时间线：左场景右文 */
.tl-item.rich-row {
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: start;
  background: #fff;
  padding: 12px;
}
.tl-item.rich-row .rich-thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}
.tl-item.rich-row .tl-content { min-width: 0; }
.tl-item.rich-row .tl-body {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 520px) {
  .rich-row,
  .teacher-bubble.rich-row,
  .tl-item.rich-row {
    grid-template-columns: 52px 1fr;
    gap: 10px;
  }
  .rich-thumb,
  .tb-visual .rich-thumb {
    width: 52px;
    height: 52px;
  }
  .tb-visual { width: 52px; }
}

.work-card .wc-thumb { min-height: 112px; }
.work-card .wc-body h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* —— 评价区：先看作品再评（Seesaw / Scratch 式） —— */
.review-work-preview {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: start;
  margin: 8px 0 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--cream);
}
.review-work-preview[hidden] { display: none !important; }
.rwp-thumb {
  width: 96px;
  height: 72px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}
.rwp-body { min-width: 0; }
.rwp-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  margin: 0 0 4px;
  line-height: 1.3;
}
.rwp-meta {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-bottom: 6px;
  line-height: 1.35;
}
.rwp-note {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rwp-tags { margin-bottom: 8px; }
.rwp-empty {
  margin: 0;
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
  padding: 8px 4px;
}

.drawer-teacher-snip {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f4f9fc;
  border: 1px solid #d0e4f0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.4;
}
.drawer-teacher-snip strong { color: var(--sky); font-weight: 650; }
.wc-eval-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--sky);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  margin: 6px 0 2px;
  line-height: 1.2;
}
.wc-eval-btn:hover {
  border-color: var(--sky);
  background: #fff;
  color: var(--ink);
}
@media (max-width: 520px) {
  .review-work-preview {
    grid-template-columns: 1fr;
  }
  .rwp-thumb {
    width: 100%;
    height: 88px;
  }
}

/* —— 家长看板：作品英雄卡（先见作品再看师评） —— */
.parent-sum-item.work-hero {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  margin-bottom: 14px;
  cursor: pointer;
  border-left: none;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.parent-sum-item.work-hero:hover,
.parent-sum-item.work-hero:focus-within {
  box-shadow: 0 8px 22px rgba(40, 60, 80, 0.1);
  transform: translateY(-1px);
}
.parent-sum-item.work-hero:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}

.work-cover {
  position: relative;
  width: 100%;
  height: 132px;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}
.work-cover.compact {
  width: 100%;
  height: 72px;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.wk-cover-art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.wk-cover-emoji {
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.14));
  z-index: 1;
}
.work-cover.compact .wk-cover-emoji {
  font-size: 1.85rem;
}
.wk-cover-deco {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}
.wk-cover-deco.d1 {
  width: 88px;
  height: 88px;
  top: -18%;
  left: -6%;
}
.wk-cover-deco.d2 {
  width: 56px;
  height: 56px;
  bottom: -10%;
  right: 8%;
  background: rgba(255, 255, 255, 0.22);
}
.wk-cover-deco.d3 {
  width: 32px;
  height: 32px;
  top: 28%;
  right: 18%;
  background: rgba(255, 255, 255, 0.35);
}
.work-cover.compact .wk-cover-deco.d1 {
  width: 44px;
  height: 44px;
}
.work-cover.compact .wk-cover-deco.d2 {
  width: 28px;
  height: 28px;
}
.wk-cover-chip {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 20px);
}
.work-cover.compact .wk-cover-chip {
  left: 6px;
  bottom: 6px;
  gap: 4px;
}
.wk-cover-scene,
.wk-cover-short {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  backdrop-filter: blur(4px);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.work-cover.compact .wk-cover-scene,
.work-cover.compact .wk-cover-short {
  font-size: 0.58rem;
  padding: 2px 6px;
}
.wk-cover-short {
  background: rgba(30, 40, 50, 0.45);
  color: #fff;
}

.ps-body {
  padding: 12px 14px 14px;
  min-width: 0;
}
.ps-title {
  font-size: 0.98rem;
  line-height: 1.35;
  margin: 0 0 4px;
  color: var(--ink);
}
.ps-meta {
  font-size: 0.75rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
  line-height: 1.35;
}
.ps-work-note {
  margin: 0 0 10px;
  font-size: 0.84rem;
  color: var(--ink);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.parent-sum-item.work-hero .parent-sum-text {
  margin: 0 0 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  -webkit-line-clamp: unset;
  overflow: visible;
  line-height: 1.45;
}
.parent-sum-item.work-hero .ps-label {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 999px;
  background: #c8eadf;
  color: #2f6b56;
  line-height: 1.4;
  margin-top: 1px;
}
.parent-sum-item.work-hero .sum-open {
  font-weight: 600;
}

.activity-item.rich-row.has-work-cover {
  grid-template-columns: 96px 1fr;
  align-items: stretch;
}
.activity-item.rich-row.has-work-cover .work-cover.compact {
  align-self: stretch;
  height: 100%;
  min-height: 72px;
  max-height: 88px;
}

@media (max-width: 520px) {
  .work-cover { height: 112px; }
  .wk-cover-emoji { font-size: 2.6rem; }
  .activity-item.rich-row.has-work-cover {
    grid-template-columns: 76px 1fr;
  }
}

/* —— 作品封面原图（源站公开缩略图本地副本） —— */
.wk-cover-img,
.wc-thumb-img,
.rwp-thumb-img,
.drawer-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.work-cover.has-img {
  background: #e8eef5;
  padding: 0;
}
.work-cover.has-img .wk-cover-chip {
  background: transparent;
}
.wk-cover-chip {
  /* 半透明底已在 chip 子项；叠层可读 */
  pointer-events: none;
}
.wc-thumb {
  overflow: hidden;
}
.wc-thumb.has-img {
  background: #e8eef5;
}
.wc-thumb-img {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.wc-thumb .wc-type-pill,
.wc-thumb .wc-remix-pill,
.wc-thumb .wc-vis-pill {
  z-index: 2;
  backdrop-filter: blur(4px);
  background: rgba(255, 255, 255, 0.88);
}
.wc-thumb .wc-remix-pill {
  background: rgba(44, 36, 25, 0.55);
  color: #fff;
}
.rwp-thumb {
  position: relative;
  overflow: hidden;
}
.rwp-thumb.has-img {
  background: #e8eef5;
  padding: 0;
}
.rwp-thumb-img {
  border-radius: 12px;
}
.drawer-cover {
  margin: 0 0 14px;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  max-height: 220px;
  background: #e8eef5;
  border: 1px solid var(--line);
}
.drawer-cover img {
  border-radius: 14px;
}

/* 源站预览角标 + artifact 内原图 */
.wk-source-hint {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(20, 28, 40, 0.62);
  color: #fff;
  line-height: 1.2;
  pointer-events: none;
}
.work-cover.has-img,
.wc-thumb.has-img,
.art-img-wrap {
  position: relative;
}
.art-img-wrap {
  margin: 0 0 8px;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: 220px;
  background: #e8eef5;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.artifact.compact .art-img-wrap {
  max-height: 120px;
  margin-bottom: 6px;
}
.art-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.art-src-hint {
  bottom: 4px;
  right: 4px;
}
.museum-work-tile .work-cover.has-img {
  border-radius: 12px;
  overflow: hidden;
}


/* —— 作品本体 artifact：按类型差异化（Seesaw Journal） —— */
.artifact {
  margin: 0;
  border-radius: 12px;
  padding: 10px 12px;
  line-height: 1.5;
}
.artifact.compact {
  padding: 8px 10px;
  border-radius: 10px;
}
.art-caption {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.art-fallback-text {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-soft);
}

/* 写作：米黄引文块 */
.artifact.art-writing {
  background: #fff6e0;
  border: 1px solid #f0dfb0;
  border-left: 4px solid #e0b84a;
}
.art-quote {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink);
  font-style: normal;
  white-space: pre-wrap;
}
.artifact.art-writing.compact .art-quote {
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 绘画/手工：caption + chips */
.artifact.art-visual {
  background: #f3f7fb;
  border: 1px solid #d5e3f0;
}
.art-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.art-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #c9dae8;
  color: var(--ink);
}

/* 编程：浅灰规则条 */
.artifact.art-code {
  background: #f2f3f6;
  border: 1px solid #dde0e8;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.art-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-family: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.art-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.art-rule {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--ink);
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  border: 1px solid #e4e7ef;
  font-family: inherit;
}
.art-rule-bar {
  width: 4px;
  min-height: 1.1em;
  border-radius: 2px;
  background: linear-gradient(180deg, #6cb4ee, #4a8fd4);
  flex-shrink: 0;
  margin-top: 2px;
}
.art-code-note {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-family: system-ui, sans-serif;
}

/* 项目：checklist */
.artifact.art-project {
  background: #eef8f2;
  border: 1px solid #c5e4d2;
}
.art-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.art-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--ink);
  padding: 4px 0;
}
.art-step.done { color: #2f6b56; }
.art-step.done .art-check { color: #2f6b56; font-weight: 700; }
.art-check {
  flex-shrink: 0;
  width: 1.1em;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* 家长卡：artifact 主体；标题降为小标题 */
.parent-sum-item.work-hero .ps-meta {
  margin-bottom: 4px;
  font-size: 0.72rem;
}
.parent-sum-item.work-hero .ps-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 8px;
  line-height: 1.3;
}
.parent-sum-item.work-hero .ps-artifact { margin: 0 0 12px; }
.parent-sum-item.work-hero .ps-artifact .artifact {
  box-shadow: 0 1px 0 rgba(40, 60, 80, 0.04);
}
.parent-sum-item.work-hero.kind-writing .work-cover { height: 100px; }
.parent-sum-item.work-hero.kind-writing .ps-artifact .art-quote {
  font-size: 0.98rem;
  line-height: 1.58;
}
.parent-sum-item.work-hero .ps-work-note { display: none; }
.parent-sum-item.work-hero .parent-sum-text {
  opacity: 0.92;
  font-size: 0.82rem;
}

/* 作品柜一行摘要 */
.wc-artifact {
  margin: 4px 0 6px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wc-art-writing {
  font-style: italic;
  color: var(--ink);
  background: #fff6e0;
  border-radius: 6px;
  padding: 4px 6px;
}
.wc-art-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  background: #f2f3f6;
  border-radius: 6px;
  padding: 4px 6px;
}
.wc-art-project { color: #2f6b56; font-weight: 600; }
.wc-art-visual { color: var(--ink); }

.rwp-artifact { margin: 6px 0 8px; }
.rwp-artifact .artifact { padding: 6px 8px; }
.rwp-artifact .art-quote { font-size: 0.8rem; }

.drawer-artifact .artifact { margin-top: 4px; }
.drawer-artifact .art-quote { font-size: 1rem; line-height: 1.6; }


/* 顶栏已有端口切换+主栏，壳层眉题/芯片/说明重复 → 默认不展示 */
#shell-eyebrow,
#port-chip,
#role-hint,
#parent-shell-label,
#teacher-shell-label {
  display: none !important;
}

/* —— 角色壳隔离 · Seesaw/Khan Kids/ClassDojo 同产品多入口 —— */
.shell-eyebrow {
  margin: -8px 0 12px;
  padding: 0 2px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.shell-page-label {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--accent);
}

body[data-role="child"] {
  /* 保留现有 story-world 游戏感 */
}
body[data-role="child"] .shell-eyebrow {
  color: var(--coral);
}

body[data-role="parent"] {
  --accent: #2a7a66;
  --sage: #2a7a66;
}
body[data-role="parent"] .shell-eyebrow {
  color: #2a7a66;
}
body[data-role="parent"] .topbar {
  border-bottom-color: rgba(42, 122, 102, 0.12);
}
body[data-role="parent"] #view-parent {
  border-top: 3px solid var(--accent);
}

body[data-role="teacher"] {
  --accent: #3d6b9a;
  --sage: #3d6b9a;
}
body[data-role="teacher"] .shell-eyebrow {
  color: #3d6b9a;
}
body[data-role="teacher"] .process-banner {
  display: flex !important;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, #eef5fb, #f7fafc);
  border: 1px solid rgba(61, 107, 154, 0.22);
}
body[data-role="teacher"] #view-teacher {
  border-top: 3px solid var(--accent);
}

.main-nav > .nav-btn[hidden] {
  display: none !important;
}
.more-item[hidden] {
  display: none !important;
}

/* —— 儿童成长档案馆 · 童话地图分区 —— */
.museum-panel,
.card.museum-panel {
  position: relative;
  overflow: visible;
  width: 100%;
  max-width: none;
  padding: 4px 0 24px;
  margin-bottom: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}
.museum-sky {
  position: absolute; inset: 0 0 auto 0; height: 36px; pointer-events: none;
  opacity: 0.2;
  /* museum-sky-hidden-fullwidth: kept soft on canvas */
}
.museum-star {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  background: #ffd78a; box-shadow: 0 0 8px #ffd78a;
}
.museum-star.s1 { top: 10px; left: 12%; background: #ffd78a; box-shadow: 0 0 6px rgba(255, 200, 80, 0.55); }
.museum-star.s2 { top: 16px; right: 18%; width: 5px; height: 5px; background: #9ad0ff; box-shadow: 0 0 6px rgba(120, 180, 255, 0.5); }
.museum-star.s3 { top: 8px; left: 48%; width: 4px; height: 4px; background: #ffb4a2; }

.museum-head { position: relative; z-index: 1; margin-bottom: 14px; padding: 0 2px; /* museum-head-as-page-title */ }
.museum-head .chip.museum-chip { margin-left: auto; }
.museum-head h2 { font-size: 1.05rem; margin: 0; }
.museum-head .shell-page-label { margin-bottom: 2px; }

.museum-chip { background: #fff3e0; color: #c45c26; border: 1px solid rgba(196, 92, 38, 0.2); font-size: 0.7rem; }

/* 档案页内锚点：轻量 chip，窄屏可横滑 */
.museum-anchors {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: -4px 0 12px;
  padding: 2px 2px 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.museum-anchor-chip {
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(120, 140, 160, 0.22);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-soft, #5a6570);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}
.museum-anchor-chip:hover,
.museum-anchor-chip:focus-visible {
  border-color: rgba(232, 140, 90, 0.45);
  color: var(--ink, #243039);
  background: #fff;
  outline: none;
}
.museum-anchor-chip:active {
  transform: translateY(1px);
}

/* 可折叠分区 */
.museum-zone.zone-foldable.is-collapsed {
  padding-top: 10px;
  padding-bottom: 10px;
}
.zone-head-fold {
  margin-bottom: 0;
}
.zone-fold-btn {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.zone-fold-btn:focus-visible {
  outline: 2px solid rgba(232, 140, 90, 0.55);
  outline-offset: 2px;
  border-radius: 10px;
}
.zone-fold-titles {
  flex: 1;
  min-width: 0;
}
.zone-fold-label {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(120, 140, 160, 0.2);
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ink-soft, #5a6570);
  line-height: 1.4;
}
.museum-zone.zone-foldable:not(.is-collapsed) .zone-fold-label {
  border-color: rgba(232, 140, 90, 0.35);
  color: #c45c26;
  background: #fff7ef;
}
.zone-fold-summary {
  margin: 6px 0 0;
  padding: 0 2px;
  font-size: 0.68rem;
  color: var(--ink-soft, #5a6570);
  line-height: 1.45;
}
.museum-zone.zone-foldable:not(.is-collapsed) .zone-fold-summary {
  display: none;
}
.zone-fold-panel {
  margin-top: 8px;
}
.museum-story-jump-wrap {
  margin: 8px 0 0;
  text-align: right;
}
.museum-story-jump {
  font-size: 0.72rem;
  font-weight: 700;
}


/* 成长档案：人设|作品 双英雄 · 能力/动态折叠 · 设置沉底 */
.museum-map.museum-dash,
.museum-map {
  position: relative; z-index: 1;
  display: grid;
  width: 100%;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.6fr);
  grid-template-areas:
    "hero works"
    "ability ability"
    "feed feed"
    "prefs data";
  gap: 14px 16px;
  align-items: stretch;
}
.zone-hero { grid-area: hero; }
.zone-works { grid-area: works; }
.zone-ability { grid-area: ability; }
.zone-feed { grid-area: feed; }
.zone-prefs { grid-area: prefs; }
.zone-data { grid-area: data; }

.museum-zone {
  position: relative;
  padding: 14px 16px 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--hairline, rgba(0, 0, 0, 0.08));
  box-shadow: 0 1px 2px rgba(20, 30, 40, 0.04), 0 8px 24px rgba(20, 30, 40, 0.06);
  min-height: 0;
  min-width: 0;
  isolation: isolate;
}
.museum-zone.zone-hero {
  border-color: rgba(232, 168, 98, 0.55);
  background: linear-gradient(135deg, #fff4dc, #fffdf8 55%, #fff);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 0 rgba(232, 168, 98, 0.18), 0 10px 28px rgba(232, 160, 80, 0.1);
}
.museum-zone.zone-hero .museum-name-row strong {
  font-size: 1.12rem;
}
.museum-sublabel {
  margin: 10px 0 6px;
  padding: 0 1px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-soft, #5a6570);
}
.museum-hero-medals,
.museum-hero-life {
  margin-top: 2px;
  min-width: 0;
}
.museum-certs-strip {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  grid-template-columns: none !important;
  padding-bottom: 2px;
  max-height: none;
}
.museum-certs-strip .museum-cert-card {
  flex: 0 0 auto;
  width: 118px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 30, 40, 0.04);
}
.museum-certs-strip .museum-cert-card:hover {
  box-shadow: 0 2px 8px rgba(20, 30, 40, 0.08);
}
.museum-certs-strip .museum-cert-card strong { font-size: 0.7rem; }
.museum-certs-strip .museum-cert-meta { font-size: 0.58rem; }
.museum-life-compact {
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)) !important;
  gap: 4px !important;
}
.museum-life-compact .museum-hotspot {
  padding: 5px 6px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-style: solid;
  background: rgba(255, 255, 255, 0.85);
}
.museum-life-compact .museum-hotspot:hover,
.museum-life-compact .museum-hotspot.active {
  border-color: rgba(232, 140, 90, 0.45);
  background: #fff;
  transform: none;
}
.museum-life-compact .hotspot-emoji { font-size: 0.95rem; }
.museum-life-compact .hotspot-title { font-size: 0.64rem; }
.museum-life-note {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  color: var(--ink-soft, #5a6570) !important;
}
.museum-works-save {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.museum-works-actions {
  justify-content: space-between;
}
.museum-works-actions .museum-story-jump {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--ink-soft, #5a6570);
}
.museum-zone.zone-feed {
  border-color: rgba(0, 0, 0, 0.08);
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 30, 40, 0.04), 0 8px 24px rgba(20, 30, 40, 0.05);
}
.museum-feed-stack {
  display: grid;
  gap: 14px;
}
@media (min-width: 720px) {
  .museum-feed-stack {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }
}
.museum-feed-h {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft, #5a6570);
}
.museum-feed-block .card.nested {
  margin-top: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: none;
  background: #fafbfc;
}

.museum-zone.zone-works {
  border-color: rgba(0, 0, 0, 0.08);
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 30, 40, 0.04), 0 8px 24px rgba(20, 30, 40, 0.06);
}
.museum-zone.zone-ability {
  border-color: rgba(0, 0, 0, 0.08);
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 30, 40, 0.04), 0 8px 24px rgba(20, 30, 40, 0.05);
}
.museum-zone.zone-ability .zone-head h3 {
  font-size: 0.84rem;
  font-weight: 700;
}
.museum-zone.zone-ability .museum-ability-host,
.museum-zone.zone-ability #section-radar {
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}
.museum-zone.zone-ability #section-radar-body:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
  gap: 8px 18px;
  align-items: start;
}
.museum-zone.zone-ability #section-radar-body .radar-wrap {
  grid-column: 1;
  grid-row: 1 / span 4;
  margin: 0;
  align-self: start;
}
.museum-zone.zone-ability #radar-svg {
  max-width: 200px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
}
.museum-zone.zone-ability #section-radar-body .radar-legend {
  grid-column: 2;
  margin: 0;
  gap: 0;
}
.museum-zone.zone-ability #section-radar-body .radar-legend li {
  padding: 3px 0;
  font-size: 0.78rem;
  gap: 8px;
}
.museum-zone.zone-ability #section-radar-body .subhead {
  grid-column: 2;
  margin: 6px 0 4px;
  font-size: 0.82rem;
}
.museum-zone.zone-ability #section-radar-body .mastery-list {
  grid-column: 2;
  gap: 6px;
}
.museum-zone.zone-ability #section-radar-body .mastery-row {
  gap: 3px;
}
.museum-zone.zone-ability #section-radar-body .mastery-row .mr-top {
  font-size: 0.76rem;
}
.museum-zone.zone-ability #section-radar-body .mastery-bar {
  height: 6px;
}
.museum-zone.zone-ability #section-radar-body > .muted {
  grid-column: 1 / -1;
  margin: 8px 0 0;
}
@media (max-width: 640px) {
  .museum-zone.zone-ability #section-radar-body:not([hidden]) {
    grid-template-columns: 1fr;
  }
  .museum-zone.zone-ability #section-radar-body .radar-wrap {
    grid-column: 1;
    grid-row: auto;
    justify-self: center;
  }
  .museum-zone.zone-ability #section-radar-body .radar-legend,
  .museum-zone.zone-ability #section-radar-body .subhead,
  .museum-zone.zone-ability #section-radar-body .mastery-list {
    grid-column: 1;
  }
  .museum-zone.zone-ability #radar-svg {
    max-width: 168px;
  }
}
.museum-zone.zone-prefs,
.museum-zone.zone-footer.zone-prefs {
  border-color: rgba(120, 140, 180, 0.18);
  background: rgba(248, 250, 252, 0.92);
  box-shadow: none;
  padding: 8px 12px;
  border-radius: 12px;
}
.museum-zone.zone-data,
.museum-zone.zone-footer.zone-data {
  border-color: rgba(140, 160, 120, 0.18);
  background: rgba(248, 250, 246, 0.92);
  box-shadow: none;
  padding: 8px 12px;
  border-radius: 12px;
}
.museum-zone.zone-footer .zone-head h3 {
  font-size: 0.74rem;
  font-weight: 650;
}
.museum-zone.zone-footer .zone-desc {
  font-size: 0.6rem;
}
.museum-zone.zone-footer.is-collapsed {
  padding-top: 7px;
  padding-bottom: 7px;
}
.museum-inline-desk { margin-top: 4px; }
.museum-zone .card.nested.bare {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin: 0;
}
.museum-zone .privacy-hint { margin: 0 0 8px; }
.museum-tl-list,
.museum-rel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: min(280px, 42vh);
}
.museum-tl-row,
.museum-rel-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 5px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 4px 7px;
  border-radius: 9px;
  border: 1px solid rgba(100, 140, 180, 0.18);
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.museum-rel-row { border-color: rgba(220, 140, 100, 0.2); }
.museum-tl-row:hover,
.museum-rel-row:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 140, 90, 0.45);
}
.museum-tl-row .mtl-ico,
.museum-rel-row .mrl-ico {
  font-size: 0.85rem;
  line-height: 1;
}
.museum-tl-row .mtl-text,
.museum-rel-row .mrl-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.museum-tl-row .mtl-text strong,
.museum-rel-row .mrl-text strong {
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.museum-tl-row .mtl-text em,
.museum-rel-row .mrl-text em {
  font-style: normal;
  font-size: 0.6rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.museum-tl-row .mtl-date,
.museum-rel-row .mrl-go {
  font-size: 0.58rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.museum-story-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 118px;
}
.museum-story-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  border-radius: 10px;
  border: 1px solid rgba(150, 120, 220, 0.22);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.museum-story-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(120, 90, 180, 0.1);
}
.msr-ico { font-size: 0.95rem; line-height: 1; }
.msr-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.msr-text strong {
  font-size: 0.72rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msr-text em {
  font-style: normal;
  font-size: 0.62rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.msr-go {
  font-size: 0.72rem;
  color: #8a6cc0;
  font-weight: 700;
}

/* 人设卡：嵌在 zone 内，去掉外层大边距 */
.museum-hero {
  position: relative; z-index: 1;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 0; margin: 0;
  border: none; background: transparent; box-shadow: none;
  border-radius: 0;
  flex: 1;
}
.museum-avatar {
  flex: 0 0 48px; width: 48px; height: 48px;
  display: grid; place-items: center;
  font-size: 1.55rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe8c8, #ffd78a);
  border: 2.5px solid #fff;
  box-shadow: 0 3px 0 rgba(232, 168, 98, 0.3);
}
.museum-hero-text { flex: 1; min-width: 0; }
.museum-name-row {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.museum-name-row strong { font-size: 1.02rem; color: var(--ink); }
.museum-age {
  font-size: 0.68rem; font-weight: 700;
  padding: 1px 7px; border-radius: 999px;
  background: #e8f6ef; color: #2a7a66;
}
.museum-motto {
  margin: 2px 0 6px; font-size: 0.74rem; color: var(--ink-soft);
  font-style: italic;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.museum-chips, .museum-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.museum-chip-pill {
  font-size: 0.64rem; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
}
.museum-chip-pill.hobby {
  background: #fff0e0; color: #b85a1a; border: 1px solid rgba(184, 90, 26, 0.18);
}
.museum-chip-pill.trait {
  background: #eef4ff; color: #3d5a9a; border: 1px solid rgba(61, 90, 154, 0.16);
  margin-top: 0;
}

.zone-head {
  display: flex; align-items: flex-start; gap: 6px;
  margin-bottom: 6px;
}
.zone-head-compact { margin-bottom: 4px; }
.zone-emoji {
  font-size: 1.05rem; line-height: 1.2;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.06));
}
.zone-head h3 {
  margin: 0; font-size: 0.82rem; font-weight: 750; color: var(--ink);
}
.zone-desc {
  margin: 1px 0 0; font-size: 0.64rem; color: var(--ink-soft);
}
.zone-body { margin-top: 0; }

/* 作品廊：紧凑缩略图，约 6 列 × 2 行入镜 */
/* 档案馆作品分类：与柜面同类目，紧凑不撑破一屏 */
.museum-type-filters,
#museum-type-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0 0 6px;
  padding: 0 2px;
}
#museum-type-filters .filter-btn {
  padding: 2px 8px;
  font-size: 0.68rem;
  line-height: 1.35;
}

/* 档案作品墙：与柜面同一五列网格；字号略紧 */
.museum-works-wall,
.museum-thumb-grid {
  gap: 10px;
}
.museum-thumb-grid .thumb-card,
.museum-works-wall .thumb-card { gap: 6px; margin-bottom: 10px; }
.museum-thumb-grid .thumb-image,
.museum-works-wall .thumb-image { border-radius: 8px; }
.museum-thumb-grid .thumb-title,
.museum-works-wall .thumb-title { font-size: 0.78rem; line-height: 1.25; }
.museum-thumb-grid .thumb-by,
.museum-works-wall .thumb-by { font-size: 0.68rem; }
.museum-thumb-grid .thumb-avatar,
.museum-works-wall .thumb-avatar { width: 22px; height: 22px; font-size: 0.62rem; }
.museum-thumb-grid .thumb-info,
.museum-works-wall .thumb-info { grid-template-columns: 22px 1fr; gap: 6px; }
.museum-works-actions {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-top: 6px;
}
#btn-museum-expand-works {
  margin-top: 0; font-size: 0.72rem;
}

/* 旧 museum-work-tile 保留兼容 */
.museum-work-tile {
  display: flex; flex-direction: column; gap: 4px;
  padding: 0; border: none; background: transparent;
  cursor: pointer; text-align: left; font: inherit;
  border-radius: 12px;
  transition: transform 0.12s ease;
}
.museum-work-tile:hover { transform: translateY(-2px); }
.museum-work-tile .work-cover {
  border-radius: 12px; aspect-ratio: 1; min-height: 0;
  border: 2px solid rgba(232, 168, 98, 0.35);
  overflow: hidden;
}
.museum-work-tile .work-cover.compact { min-height: 64px; }
.museum-work-title {
  font-size: 0.68rem; font-weight: 650; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 2px;
}

/* 证书殿：横向卡片网格（同老师 cert-wall 精神） */
.museum-certs-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  align-items: stretch;
  overflow: visible;
  max-height: none;
  padding-right: 0;
}
.museum-cert-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  width: 100%;
  text-align: left;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(230, 180, 60, 0.4);
  background: linear-gradient(135deg, #fffdf5, #fff8e0);
  cursor: pointer;
  font: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.museum-cert-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(200, 150, 40, 0.14);
}
.museum-cert-medal {
  font-size: 1.1rem;
  line-height: 1;
}
.museum-cert-card strong {
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  width: 100%;
}
.museum-cert-meta {
  font-size: 0.62rem;
  color: var(--ink-soft);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 生活足迹：2×2 更小卡 */
.museum-life-hotspots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.museum-hotspot {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 6px 7px; border-radius: 10px;
  border: 1.5px dashed rgba(90, 170, 130, 0.45);
  background: #fff;
  cursor: pointer; font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  min-width: 0;
}
.museum-hotspot:hover, .museum-hotspot.active {
  border-style: solid;
  border-color: #3d9a72;
  background: #eefaf4;
  transform: scale(1.02);
}
.hotspot-emoji { font-size: 1.05rem; line-height: 1; }
.hotspot-title {
  font-size: 0.7rem; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.hotspot-when { font-size: 0.58rem; color: var(--ink-soft); }
.museum-life-note {
  margin: 5px 0 0; padding: 5px 8px; border-radius: 8px;
  font-size: 0.68rem; color: #2a5c48;
  background: #e8f6ef; border: 1px solid rgba(61, 154, 114, 0.25);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 项目工坊：过程条更扁 */
.museum-projects { display: grid; gap: 5px; }
.museum-project-card {
  padding: 6px 8px; border-radius: 10px;
  border: 1px solid rgba(100, 140, 200, 0.3);
  background: #fff;
}
.museum-proj-top {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.museum-proj-top > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.museum-proj-top strong { font-size: 0.76rem; }
.proj-emoji { font-size: 1rem; }
.museum-proj-status {
  font-size: 0.6rem; font-weight: 650; color: #3d6b9a;
}
.museum-steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.museum-step {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 4px; align-items: center;
  font-size: 0.64rem;
}
.step-dot {
  width: 15px; height: 15px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.55rem; font-weight: 700;
  background: #dce8f8; color: #3d6b9a;
}
.step-label { color: var(--ink); font-weight: 600; }
.step-at { color: var(--ink-soft); font-size: 0.58rem; }

/* 存档台：默认折叠，summary 一行 */
.museum-save-desk {
  border-radius: 10px;
  background: #fafbfc;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.museum-save-summary {
  cursor: pointer; list-style: none;
  padding: 7px 10px; font-weight: 700; font-size: 0.78rem;
  color: var(--ink, #243039);
  user-select: none;
}
.museum-save-summary::-webkit-details-marker { display: none; }
.museum-save-summary::before {
  content: "▸ "; font-size: 0.72rem;
}
.museum-save-desk[open] .museum-save-summary::before { content: "▾ "; }
.museum-save-body { padding: 0 10px 10px; }
.museum-save-body .kid-intro { font-size: 0.72rem; margin: 0 0 6px; }
.museum-save-body .kid-type-grid {
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.museum-save-body .kid-type-btn {
  padding: 8px 4px; font-size: 0.72rem;
}
.museum-save-body .kid-emoji { font-size: 1.2rem; }
.museum-save-body .kid-form label { font-size: 0.72rem; }
.museum-save-body .kid-input { padding: 6px 8px; font-size: 0.8rem; }
.museum-save-body .kid-save { padding: 8px 12px; font-size: 0.82rem; }

.museum-spark {
  position: absolute; pointer-events: none; z-index: 5;
  font-size: 0.9rem;
  animation: museumSparkFly 0.7s ease forwards;
}
@keyframes museumSparkFly {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-28px) scale(1.4); }
}
.pulse-once { animation: museumPulse 0.55s ease; }
@keyframes museumPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.empty-state.tiny {
  font-size: 0.72rem; padding: 6px; text-align: center; color: var(--ink-soft);
}

body[data-role="child"] .museum-panel {
  box-shadow: none;
}
body[data-role="child"] .museum-zone {
  box-shadow: 0 1px 2px rgba(20, 30, 40, 0.04), 0 8px 24px rgba(200, 120, 60, 0.08);
}

/* 家长/老师：作品区隐藏存档入口 */
.museum-readonly .museum-map {
  grid-template-areas:
    "hero works"
    "ability ability"
    "feed feed"
    "prefs data";
}
.museum-readonly .museum-works-save,
.museum-readonly #museum-zone-save {
  display: none;
}

@media (max-width: 900px) {
  .museum-works-wall, .museum-thumb-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .museum-map.museum-dash,
  .museum-map {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "works"
      "ability"
      "feed"
      "prefs"
      "data";
  }
  .museum-readonly .museum-map {
    grid-template-areas:
      "hero"
      "works"
      "ability"
      "feed"
      "prefs"
      "data";
  }
  .museum-works-wall, .museum-thumb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .museum-life-compact { grid-template-columns: 1fr 1fr !important; }
  .museum-save-body .kid-type-grid { grid-template-columns: repeat(3, 1fr); }
  .museum-avatar { flex-basis: 44px; width: 44px; height: 44px; font-size: 1.4rem; }
  .museum-feed-stack { grid-template-columns: 1fr; }
}

/* ========== 作品全页（对齐 Scratch 项目页信息架构，不抄品牌色） ========== */
.project-panel {
  padding: 12px 16px 28px;
  background: linear-gradient(180deg, #f7f4ef 0%, #fff 48%);
}
.project-page { max-width: none; width: 100%; margin: 0; }
.project-toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.proj-crumb { font-size: 0.78rem; }
.project-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}
.project-layout-stack {
  max-width: 860px;
  margin: 0 auto;
}
.project-body-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.proj-fold {
  margin-top: 10px;
  border-top: 1px dashed rgba(44, 36, 25, 0.1);
  padding-top: 8px;
}
.proj-fold > summary {
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 650;
  color: #4a90a4;
  list-style: none;
}
.proj-fold > summary::-webkit-details-marker { display: none; }
.proj-version-form { margin-top: 10px; }
.proj-block-flash {
  outline: 2px solid rgba(74, 144, 164, 0.55);
  box-shadow: 0 0 0 4px rgba(74, 144, 164, 0.15);
  transition: outline 0.3s ease, box-shadow 0.3s ease;
}
.proj-peer.proj-block h3 { margin-top: 0; }
.proj-stage {
  background: #1c2430;
  border-radius: 12px;
  padding: 10px 10px 8px;
  box-shadow: 0 10px 28px rgba(28, 36, 48, 0.22);
}
.proj-stage-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  background: #0f141c;
  display: grid;
  place-items: center;
}
.proj-stage-img {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #111820;
  display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
}
.proj-stage-img.is-playing {
  filter: brightness(1.06) saturate(1.08);
  transform: scale(1.02);
}
.proj-stage-fallback {
  font-size: 4rem; opacity: 0.7;
}
.proj-source-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 0.62rem; font-weight: 650;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.9); color: #3a4a58;
}
.proj-run-overlay {
  position: absolute; inset: auto 0 0 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 12px 14px;
  background: linear-gradient(180deg, transparent, rgba(8,12,20,0.78));
  color: #fff; font-size: 0.85rem; font-weight: 600;
}
.proj-run-overlay .tiny { font-weight: 400; opacity: 0.85; margin: 0; font-size: 0.68rem; }
.proj-run-pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: #7dcea0;
  box-shadow: 0 0 0 0 rgba(125, 206, 160, 0.7);
  animation: projPulse 1.2s ease infinite;
}
@keyframes projPulse {
  0% { box-shadow: 0 0 0 0 rgba(125, 206, 160, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(125, 206, 160, 0); }
  100% { box-shadow: 0 0 0 0 rgba(125, 206, 160, 0); }
}
.proj-stage-controls {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 4px 2px;
}
.proj-flag, .proj-stop, .proj-fs {
  border: none; cursor: pointer; font: inherit;
  border-radius: 8px; padding: 6px 12px;
  font-size: 0.82rem; font-weight: 650;
}
.proj-flag {
  background: #e8f6ee; color: #1f6b45;
}
.proj-flag.on { background: #ffe8d6; color: #8a4b12; }
.proj-stop {
  background: #2a3340; color: #f0f3f7; min-width: 36px;
}
.proj-fs {
  margin-left: auto;
  background: transparent; color: #c5d0dc;
}
.proj-fs:hover { color: #fff; }
.proj-stage.proj-stage-zoom .proj-stage-frame {
  aspect-ratio: 4 / 3; /* was 16/10, unify */
}
.proj-stage.proj-stage-zoom .proj-stage-img { object-fit: cover; }

.proj-title-row { margin-top: 14px; }
.proj-title {
  margin: 0 0 8px; font-size: 1.35rem; line-height: 1.25;
  color: var(--ink, #2c2419);
}
.proj-author-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 0.88rem; color: var(--ink-soft, #5c5346);
  margin-bottom: 6px;
}
.proj-avatar { width: 28px; height: 28px; font-size: 0.75rem; }
.proj-stats {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin: 10px 0 12px;
  font-size: 0.86rem; color: var(--ink-soft, #5c5346);
}
.proj-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
}
.proj-act {
  border: 1px solid rgba(44, 36, 25, 0.12);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; color: var(--ink, #2c2419);
}
.proj-act:hover { border-color: rgba(74, 144, 164, 0.45); }
.proj-act.love.is-on { color: #c0392b; border-color: #f5b7b1; background: #fdf2f0; }
.proj-act.fav.is-on { color: #b7950b; border-color: #f9e79f; background: #fef9e7; }

.project-side-col {
  display: flex; flex-direction: column; gap: 12px;
}
.proj-block {
  background: #fff;
  border: 1px solid rgba(44, 36, 25, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(44, 36, 25, 0.04);
}
.proj-block h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}
.proj-instructions {
  font-size: 0.88rem; line-height: 1.55;
  color: var(--ink, #2c2419);
}
.proj-teacher {
  font-size: 0.86rem; line-height: 1.5;
  padding: 8px 10px;
  background: #f3f8fb;
  border-radius: 8px;
}
.proj-teacher strong { display: block; margin-bottom: 4px; font-size: 0.78rem; color: #3a6a7c; }
.proj-ver-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.proj-ver {
  display: grid; grid-template-columns: 36px 1fr; gap: 8px;
  align-items: start; font-size: 0.84rem;
}
.proj-ver-num {
  font-weight: 700; font-size: 0.72rem;
  color: #4a90a4; padding-top: 2px;
}
.proj-comments { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow: auto; }
.proj-comment {
  padding: 8px 10px; border-radius: 8px;
  background: #faf8f4; font-size: 0.84rem;
}
.proj-comment.peer { background: #f5f9f6; }
.proj-comment-head {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 4px;
}
.proj-comment p { margin: 0; line-height: 1.45; }
.project-missing { padding: 40px 16px; text-align: center; }

body[data-role="child"] .project-panel {
  box-shadow: 0 10px 28px rgba(200, 120, 60, 0.08);
}


/* —— 三端口隔离壳 —— */
.port-chip {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 200, 87, 0.35);
  color: var(--ink, #2b2a28);
}
body[data-port="parent"] .port-chip,
body[data-role="parent"] .port-chip {
  background: rgba(120, 170, 220, 0.35);
}
body[data-port="teacher"] .port-chip,
body[data-role="teacher"] .port-chip {
  background: rgba(140, 190, 150, 0.4);
}
body[data-port="child"] .role-hint.slim:empty {
  display: none;
}
#port-demo-tools .settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}


/* —— 三端口同构卡面：看板/师评流内嵌缩略图 —— */
.dash-works-wall {
  margin: 16px 0 20px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(74, 144, 164, 0.12);
}
.dash-works-wall h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-works-wall .chip.tiny {
  font-size: 0.72rem;
  padding: 2px 8px;
}
.dash-works-wall .thumb-grid {
  margin-top: 10px;
}
/* legacy wrappers — 渲染已改为裸 thumb-card，不再套边框行 */
.parent-sum-with-thumb,
.parent-act-with-thumb,
.teacher-bubble-with-thumb {
  display: contents;
}
.thumb-in-sum .thumb-info,
.thumb-in-activity .thumb-info,
.thumb-in-feed .thumb-info {
  /* 保持默认 thumb-info */
}
.proj-act.secondary {
  opacity: 0.85;
  font-size: 0.82rem;
  border-style: dashed;
}
.museum-readonly .museum-works-save,
.museum-readonly #museum-zone-save {
  display: none;
}
.museum-readonly .museum-chip::after {
  content: " · 只读";
}
body[data-role="parent"] #explore-visible-count,
body[data-role="teacher"] #explore-visible-count,
body[data-role="child"] #explore-visible-count {
  display: inline-block;
  margin-top: 4px;
}



/* 看板/师评：成长档案入口已迁顶栏；残留 CTA 隐藏 */
.teacher-pending {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.9);
  border: 1px solid rgba(240, 180, 100, 0.35);
  box-shadow: 0 2px 0 rgba(210, 170, 120, 0.12);
}
.teacher-pending h3 {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
}
.teacher-pending-list {
  margin-top: 10px;
}
.teacher-feed-head {
  margin: 8px 0 6px;
}
.teacher-feed-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

/* —— 设置块迁入对应板块后的内联工具 —— */
.inline-tool-host {
  margin-top: 12px;
}
.inline-tool-host > .card.nested {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(60, 40, 20, 0.12);
  box-shadow: none;
  margin: 0 0 10px;
}
.story-panel .inline-tool-host > .card.nested {
  background: rgba(255, 252, 245, 0.9);
}
/* .teacher-certs-host margin handled in teacher-top medals col */

.museum-add-host {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(60, 40, 20, 0.15);
}
.museum-rel-tools {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-review-host {
  margin-top: 16px;
  padding: 0 4px 20px;
}
.settings-moved {
  margin: 4px 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(120, 100, 60, 0.08);
}
.inline-tool-flash {
  outline: 2px solid #f0a020;
  outline-offset: 3px;
  border-radius: 14px;
  transition: outline-color 0.3s;
}
.all-abilities-fold #section-radar .card-head h3 {
  font-size: 0.9rem;
}
.all-abilities-fold #radar-svg {
  max-width: 168px;
  margin: 0 auto;
  display: block;
}

/* —— 看全部能力 · 紧凑：少留白、雷达旁挂图例 —— */
.all-abilities-fold[open] summary {
  margin-bottom: 4px;
  min-height: 36px;
}
.all-abilities-fold .radar-legend.compact {
  gap: 0;
  margin: 0 0 6px;
}
.all-abilities-fold .radar-legend.compact li {
  min-height: 34px;
  padding: 3px 6px;
  gap: 8px;
  font-size: 0.78rem;
  border-radius: 8px;
}
.all-abilities-fold .legend-actions {
  gap: 6px;
}
.all-abilities-fold .level-dot {
  width: 8px;
  height: 8px;
}
.all-abilities-fold .legend-ch-btn {
  min-height: 30px;
  min-width: 52px;
  padding: 3px 10px;
  font-size: 0.72rem;
}
.all-abilities-fold #host-radar,
.all-abilities-fold #section-radar {
  margin: 4px 0 0;
  padding: 8px 10px 10px;
  border-radius: 12px;
  box-shadow: none;
}
.all-abilities-fold #section-radar .card-head {
  margin-bottom: 6px;
  align-items: center;
}
.all-abilities-fold #section-radar .card-head h3 {
  font-size: 0.84rem;
  margin: 0;
}
.all-abilities-fold #section-radar-body:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(120px, 168px) minmax(0, 1fr);
  gap: 6px 14px;
  align-items: start;
}
.all-abilities-fold #section-radar-body .radar-wrap {
  grid-column: 1;
  grid-row: 1 / span 4;
  margin: 0;
  align-self: start;
}
.all-abilities-fold #section-radar-body .radar-legend {
  grid-column: 2;
  margin: 0;
  gap: 0;
}
.all-abilities-fold #section-radar-body .radar-legend li {
  padding: 2px 0;
  font-size: 0.72rem;
  gap: 6px;
}
.all-abilities-fold #section-radar-body .subhead {
  grid-column: 2;
  margin: 4px 0 2px;
  font-size: 0.78rem;
}
.all-abilities-fold #section-radar-body .mastery-list {
  grid-column: 2;
  gap: 4px;
}
.all-abilities-fold #section-radar-body .mastery-row {
  gap: 2px;
}
.all-abilities-fold #section-radar-body .mastery-row .mr-top {
  font-size: 0.72rem;
}
.all-abilities-fold #section-radar-body .mastery-bar {
  height: 5px;
}
.all-abilities-fold #section-radar-body > .muted {
  grid-column: 1 / -1;
  margin: 4px 0 0;
}
.all-abilities-fold .ability-overview-link {
  margin-top: 6px;
  min-height: 32px;
  padding: 4px 0;
  font-size: 0.78rem;
}
@media (max-width: 640px) {
  .all-abilities-fold #section-radar-body:not([hidden]) {
    grid-template-columns: 1fr;
  }
  .all-abilities-fold #section-radar-body .radar-wrap {
    grid-column: 1;
    grid-row: auto;
    justify-self: center;
  }
  .all-abilities-fold #section-radar-body .radar-legend,
  .all-abilities-fold #section-radar-body .subhead,
  .all-abilities-fold #section-radar-body .mastery-list {
    grid-column: 1;
  }
  .all-abilities-fold #radar-svg {
    max-width: 150px;
  }
}



/* —— 首页意图：最新摘要标记 · 老师端提示 —— */
.thumb-newest {
  vertical-align: middle;
  margin-right: 4px;
  background: rgba(231, 111, 81, 0.14);
  color: #c24a2e;
  border: 1px solid rgba(231, 111, 81, 0.28);
  font-weight: 700;
}
.thumb-card.is-newest {
  box-shadow: 0 0 0 1.5px rgba(231, 111, 81, 0.22);
}
.teacher-home-hint {
  margin: 0 0 12px;
  padding: 0 2px;
}

/* —— 老师端顶栏：班级 | 已获证书 | 颁发（三列并列 · 国际产品风） —— */
.teacher-top {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  align-items: stretch;
  margin: 8px 0 16px;
  min-height: 0;
}
.teacher-panel,
.teacher-top .class-roster,
.teacher-earned,
.teacher-issue-col > .card.nested.cert-in-medals {
  background: var(--bg-elevated, #fff);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
}
.teacher-panel-eyebrow {
  margin: 0 0 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #86868b);
  line-height: 1.2;
}
.teacher-panel-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex-shrink: 0;
  min-height: 44px;
  margin-bottom: 2px;
}
.teacher-top .class-roster {
  margin: 0;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  align-self: stretch;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  /* drop teal gradient — peer white module */
  background: var(--bg-elevated, #fff);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
}
.teacher-top .class-roster-label {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft, #6e6e73);
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.teacher-top .class-roster-track {
  gap: 8px;
  flex: 1 1 auto;
  align-content: start;
}
.teacher-medals,
.teacher-medals-compact,
.teacher-medals-col,
.teacher-earned {
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 14px 14px 16px;
  border-radius: 14px;
  background: var(--bg-elevated, #fff);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-left: 3px solid rgba(29, 158, 117, 0.45);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  max-height: none;
  overflow: visible;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  align-self: stretch;
}
.teacher-medals-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex-shrink: 0;
  min-height: 44px;
}
.teacher-medals-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink, #1d1d1f);
  letter-spacing: -0.015em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.teacher-medals-title::before {
  content: "🏅 ";
  font-size: 0.85em;
}
.teacher-medals-track {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  flex: 1 1 auto;
  min-height: 0;
}
.teacher-medals-track[hidden] {
  display: none !important;
}
/* 中栏：已获证书 — compact list-cards */
.teacher-earned .cert-wall,
.teacher-medals .cert-wall {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: none;
  overflow: visible;
  margin: 0;
  flex: 1 1 auto;
  align-content: start;
}
.teacher-earned .cert-card,
.teacher-medals .cert-card {
  padding: 10px 12px;
  border-radius: 10px;
  gap: 4px;
  background: #fafafa;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: none;
}
.teacher-earned .cert-card:hover,
.teacher-medals .cert-card:hover {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.teacher-earned .cert-card h3,
.teacher-medals .cert-card h3 {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink, #1d1d1f);
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
}
.teacher-earned .cert-card > p:not(.cert-meta),
.teacher-medals .cert-card > p:not(.cert-meta) {
  display: none; /* meta + actions carry the scan; keep cards calm */
}
.teacher-earned .cert-card .cert-meta,
.teacher-medals .cert-card .cert-meta {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted, #86868b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.teacher-earned .cert-card .cert-actions,
.teacher-medals .cert-card .cert-actions {
  gap: 8px;
  margin-top: 2px;
  padding-top: 0;
}
.teacher-earned .cert-card .linkish,
.teacher-medals .cert-card .linkish {
  display: inline;
  font-size: 0.75rem;
  font-weight: 500;
  margin: 0;
  color: var(--accent, #1d9e75);
  background: none;
  border: none;
  padding: 0;
  opacity: 0.9;
}
.teacher-earned .cert-card .linkish:hover,
.teacher-medals .cert-card .linkish:hover {
  opacity: 1;
  text-decoration: underline;
}
.teacher-earned .cert-more,
.teacher-medals .cert-more {
  margin: 0;
  border: none;
  padding: 0;
}
.teacher-earned .cert-more > summary,
.teacher-medals .cert-more > summary {
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent, #1d9e75);
  padding: 4px 0;
  list-style: none;
}
.teacher-earned .cert-more > summary::-webkit-details-marker,
.teacher-medals .cert-more > summary::-webkit-details-marker { display: none; }
.teacher-earned .cert-more[open] > summary,
.teacher-medals .cert-more[open] > summary { margin-bottom: 8px; }
.teacher-earned .cert-more-list,
.teacher-medals .cert-more-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.teacher-earned .cert-wall > .empty-state,
.teacher-medals .cert-wall > .empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  padding: 24px 16px;
  font-size: 0.8125rem;
  color: var(--muted, #86868b);
  background: transparent;
  border: none;
}
.teacher-earned .cert-wall > .empty-state::before,
.teacher-medals .cert-wall > .empty-state::before {
  content: "🏅";
  font-size: 1.5rem;
  opacity: 0.35;
  line-height: 1;
}
/* 右栏：颁发表单 */
.teacher-certs-host,
.teacher-issue-col {
  margin-top: 0;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.teacher-certs-host > .card.nested.cert-in-medals {
  margin: 0;
  padding: 14px 14px 16px;
  border-radius: 14px;
  background: var(--bg-elevated, #fff);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  overflow: visible;
  flex: 1 1 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.teacher-certs-host .card-head.teacher-panel-head {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 44px;
}
.teacher-issue-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.teacher-certs-host .card-head h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink, #1d1d1f);
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.teacher-certs-host .card-head .chip {
  flex-shrink: 0;
  margin-top: 14px;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  background: rgba(29, 158, 117, 0.08);
  border-color: rgba(29, 158, 117, 0.18);
  color: var(--accent, #1d9e75);
}
.cert-issue-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.teacher-certs-host .cert-issue {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  gap: 10px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.teacher-certs-host .form.compact {
  gap: 10px;
}
.teacher-certs-host .form.compact label {
  margin-bottom: 0;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft, #6e6e73);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.teacher-certs-host .form.compact .field-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted, #86868b);
  letter-spacing: 0;
}
.teacher-certs-host .form.compact input,
.teacher-certs-host .form.compact select {
  padding: 8px 10px;
  font-size: 0.8125rem;
  border-radius: 8px;
  min-height: 36px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  color: var(--ink, #1d1d1f);
}
.teacher-certs-host .form.compact input:focus,
.teacher-certs-host .form.compact select:focus {
  outline: none;
  border-color: var(--accent, #1d9e75);
  box-shadow: 0 0 0 3px rgba(29, 158, 117, 0.15);
}
.teacher-certs-host .form.compact .btn.cert-issue-cta,
.teacher-certs-host .cert-issue-cta {
  width: 100%;
  min-height: 42px;
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: auto;
  border-radius: 10px;
  letter-spacing: -0.01em;
}
.teacher-certs-host .rubric-live {
  font-size: 0.75rem;
  padding: 8px 10px;
  margin: 0;
  line-height: 1.4;
  border-radius: 8px;
  max-height: none;
  overflow: visible;
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--ink-soft, #6e6e73);
}
.teacher-certs-host .muted.tiny,
.teacher-certs-host .cert-issue-help {
  font-size: 0.6875rem;
  margin: 0;
  line-height: 1.4;
  color: var(--muted, #86868b);
  text-align: center;
}

/* —— 老师端班级花名册 —— */
.class-roster {
  margin: 10px 0 14px;
  padding: 14px 14px 16px;
  border-radius: 14px;
  background: var(--bg-elevated, #fff);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
}
.class-roster-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft, #6e6e73);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.class-roster-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  overflow: visible;
  padding-bottom: 2px;
}
.roster-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  color: var(--ink, #1d1d1f);
}
.roster-chip:hover {
  border-color: var(--accent, #1d9e75);
  background: rgba(29, 158, 117, 0.04);
}
.roster-chip.active {
  background: var(--accent, #1d9e75);
  border-color: var(--accent, #1d9e75);
  color: #fff;
}
.roster-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px 8px;
  min-height: 88px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  color: var(--ink, #1d1d1f);
  box-shadow: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.roster-card:hover {
  border-color: rgba(29, 158, 117, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.roster-card.active {
  background: #fff;
  border-color: var(--accent, #1d9e75);
  color: var(--ink, #1d1d1f);
  box-shadow: 0 0 0 2px rgba(29, 158, 117, 0.22);
}
.roster-card .roster-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  line-height: 1;
  background: var(--roster-av-bg, rgba(29, 158, 117, 0.1));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.roster-card.active .roster-avatar {
  background: rgba(29, 158, 117, 0.14);
  box-shadow: none;
}
.roster-card .roster-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.roster-emoji { font-size: 1.05rem; line-height: 1; }
.roster-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--coral, #e76f51);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(231, 111, 81, 0.35);
}
.roster-card .roster-badge {
  top: 4px;
  right: 4px;
}
@media (max-width: 1100px) {
  .teacher-top {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    min-height: 0;
  }
  .teacher-top .class-roster,
  .teacher-earned,
  .teacher-certs-host > .card.nested.cert-in-medals {
    padding: 12px;
  }
  .class-roster-track {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
  }
  .roster-card {
    min-height: 78px;
    padding: 8px 4px 6px;
  }
}
@media (max-width: 900px) {
  .teacher-top {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .teacher-top .class-roster {
    grid-column: auto;
  }
  .teacher-medals,
  .teacher-earned {
    border-left-width: 3px;
  }
}
@media (max-width: 720px) {
  .teacher-top {
    min-height: 0;
    gap: 12px;
  }
  .class-roster-track {
    grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
    gap: 8px;
  }
  .roster-card {
    min-height: 84px;
    padding: 10px 6px 8px;
  }
  .roster-card .roster-avatar {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
  .cert-issue-row {
    grid-template-columns: 1fr;
  }
}

.archive-child-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 8px 14px 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(69, 123, 157, 0.08);
  border: 1px solid rgba(69, 123, 157, 0.18);
  position: relative;
  z-index: 2;
}
.archive-watching {
  font-weight: 700;
  font-size: 0.92rem;
}
.archive-roster-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
  max-height: 88px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.roster-chip.mini {
  min-height: 36px;
  padding: 4px 10px;
  font-size: 0.8rem;
}

/* —— 师评流 / 待点评：与作品集同一五列瀑布流（弃用矩阵边框卡） —— */
#view-teacher.card {
  width: 100%;
  max-width: none;
}
.teacher-feed,
.teacher-pending-list {
  /* 与统一五列 grid 瀑布流一致 */
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) {
  .teacher-feed,
  .teacher-pending-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px;
  }
}
@media (max-width: 560px) {
  .teacher-feed,
  .teacher-pending-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
}
.teacher-bubble,
.teacher-bubble.rich-row,
.teacher-bubble.teacher-bubble-with-thumb,
.teacher-pending-row {
  display: none !important; /* 渲染已改为裸 thumb-card */
}
.teacher-pending-list .empty-state,
.teacher-feed .empty-state {
  grid-column: 1 / -1;
  display: block;
}

/* —— 家长看板：进度 + 勋章矩阵 —— */
.dash-progress-hint { margin: 0; }
#progress-tracker.progress-matrix,
.progress-matrix {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px 14px;
}
/* 右栏半宽：2–3 列可读，避免挤成 5 */
.dash-overview-right #progress-tracker.progress-matrix,
.dash-overview-right .progress-matrix {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 10px;
}
.progress-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  min-width: 0;
}
.progress-card .pc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 10px;
}
.progress-card .pc-type {
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--ink);
}
.progress-card .pc-stat {
  font-size: 0.78rem;
  color: var(--muted);
}
.progress-card .pc-bar.mastery-bar,
.progress-card .mastery-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.06);
  overflow: hidden;
}
.progress-card .mastery-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--peach), var(--coral));
}
.progress-card .pc-medals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.medal-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  border: 1px solid rgba(196, 150, 40, 0.35);
  background: linear-gradient(180deg, #fff8e4, #fff);
  color: #8a6d1d;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  text-align: left;
}
.medal-chip:hover {
  border-color: rgba(196, 120, 40, 0.55);
  background: #fff3d0;
}
.medal-chip .medal-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 11em;
}
.pc-medal-empty { display: inline-block; padding: 2px 0; }
.progress-card-orphan {
  background: linear-gradient(180deg, #fffced, #fff);
}
@media (max-width: 900px) {
  #progress-tracker.progress-matrix,
  .progress-matrix { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dash-overview-right #progress-tracker.progress-matrix,
  .dash-overview-right .progress-matrix {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .dash-overview-right #progress-tracker.progress-matrix,
  .dash-overview-right .progress-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  #progress-tracker.progress-matrix,
  .progress-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dash-certs-inline[hidden] { display: none !important; }

/* —— 家长摘要：强制五列，与进度条同宽同轨（防旧 column-count / 缓存覆盖） —— */
#view-parent .parent-dash,
#view-parent .dash-parent-summaries,
#view-parent #parent-summaries {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
#parent-summaries,
#parent-summaries.thumb-grid,
#parent-summaries.ix-matrix {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 14px;
  align-items: start;
  justify-items: stretch;
  columns: auto !important;
  column-count: auto !important;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
@media (max-width: 900px) {
  #parent-summaries,
  #parent-summaries.thumb-grid,
  #parent-summaries.ix-matrix {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px;
  }
}
@media (max-width: 560px) {
  #parent-summaries,
  #parent-summaries.thumb-grid,
  #parent-summaries.ix-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px;
  }
}

/* —— 作品点评 / 互动：与作品集同一 thumb 瀑布流；弃用边框矩阵卡 —— */
.ix-matrix,
#activity-updates .day-items.ix-matrix,
.museum-tl-list.ix-matrix,
.museum-rel-list.ix-matrix {
  /* 类名保留兼容；布局由统一 .thumb-grid 五列 grid 接管 */
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
@media (max-width: 900px) {
  .ix-matrix,
  #activity-updates .day-items.ix-matrix {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-width: 560px) {
  .ix-matrix,
  #activity-updates .day-items.ix-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}
#activity-updates.ix-matrix-days,
#activity-updates.thumb-days {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
#activity-updates .day-label {
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink-soft);
}

/* 彻底关掉旧气泡 / 待点评行 / 摘要行的白底边框壳 */
.teacher-bubble,
.teacher-bubble.rich-row,
.teacher-bubble.teacher-bubble-with-thumb,
.teacher-pending-row,
.parent-sum-with-thumb,
.parent-act-with-thumb,
.parent-sum-item,
.activity-item.rich-row,
.museum-tl-row,
.museum-rel-row {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  display: contents; /* 若残留包装，不参与布局 */
}

/* 嵌套 thumb 保持 4/3 与可见 info——禁止 16/10、禁止藏 info */
.teacher-bubble-with-thumb .thumb-card,
.teacher-pending-row .thumb-card,
.parent-sum-with-thumb .thumb-card,
.parent-act-with-thumb .thumb-card,
#parent-summaries .thumb-card,
#activity-updates .thumb-card,
.teacher-feed .thumb-card,
.teacher-pending-list .thumb-card {
  width: 100% !important;
  max-width: none !important;
  aspect-ratio: auto !important;
  border-radius: 8px !important;
  pointer-events: auto;
}
.teacher-feed .thumb-image,
.teacher-pending-list .thumb-image,
#parent-summaries .thumb-image,
#activity-updates .thumb-image,
.museum-tl-list .thumb-image,
.museum-rel-list .thumb-image {
  aspect-ratio: 4 / 3 !important;
  border-radius: 8px !important;
}
.thumb-in-feed .thumb-info,
.thumb-in-sum .thumb-info,
.thumb-in-activity .thumb-info,
.thumb-pending .thumb-info,
.museum-tl-thumb .thumb-info,
.museum-rel-thumb .thumb-info {
  display: grid !important;
}

/* 待点评区外壳保留轻提示，内部已是瀑布流 */
.teacher-pending {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.9);
  border: 1px solid rgba(240, 180, 100, 0.35);
}
.teacher-pending h3 {
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
}
.teacher-feed-head {
  margin: 8px 0 6px;
}
.teacher-feed-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.dash-certs-inline[hidden] { display: none !important; }

.museum-tl-list,
.museum-rel-list {
  max-height: none !important;
  overflow: visible;
}


/* 档案半宽区：同卡样式，固定 2 列（容器较窄） */
.museum-tl-list.thumb-grid,
.museum-rel-list.thumb-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 720px) {
  .museum-tl-list.thumb-grid,
  .museum-rel-list.thumb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
