:root {
  --sand-bg: #F4F2EC;
  --sand-card: #FAF8F4;
  --sand-border: #DDD7C9;
  --sand-shadow: #D6CFC0;
  --ink: #292524;
  --ink-muted: #57534E;

  --forest: #2E8B57;
  --forest-soft: #ECF7F0;
  --forest-border: #A7DFBE;
  --amber: #D97706;
  --amber-soft: #FEF6E7;
  --amber-border: #FCD34D;

  --optic: #0284C7;
  --optic-hover: #0369A1;
  --optic-soft: #E0F2FE;

  --toy-orange: #FF6600;
  --toy-orange-hover: #E65C00;
  --toy-orange-shadow: #CC4E00;

  --rose: #BE123C;
  --rose-soft: #FFF1F2;
  --rose-border: #FECDD3;
  --radius: 16px;
  --radius-sm: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background-color: var(--sand-bg);
  background-image: radial-gradient(rgba(41, 37, 36, 0.055) 1.2px, transparent 1.2px);
  background-size: 20px 20px;
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.app-shell { max-width: 1180px; margin: 0 auto; padding: 16px 16px 40px; }

.top-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.brand-block { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.phase-pill { font-size: 11px; font-weight: 800; color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber-border); padding: 3px 9px; border-radius: 999px; }
.brand-title { margin: 0; font-size: 22px; }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.local-badge { font-size: 12px; font-weight: 600; color: var(--forest); background: var(--forest-soft); border: 1px solid var(--forest-border); padding: 4px 10px; border-radius: 999px; }

.jump-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: var(--radius-sm); background: #FFFFFF; border: 1.5px solid var(--sand-border);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.jump-toggle input { accent-color: var(--optic); width: 16px; height: 16px; }

.action-marquee {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; margin-bottom: 14px; border-radius: var(--radius-sm);
  background: #292524; color: #FAF8F4; font-size: 17px; font-weight: 800;
  box-shadow: 0 4px 0 #1C1917, 0 8px 18px rgba(41, 37, 36, 0.14);
}

/* file:// 协议黄色兼容提示条 */
.file-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius-sm);
  background: var(--amber-soft); border: 1.5px solid var(--amber-border);
  font-size: 13px; color: #78350F;
}
.file-banner[hidden] { display: none; }
.file-banner-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-feedback { font-size: 12px; font-weight: 800; color: var(--forest); }

.btn-amber { background: #FEF3C7; color: #92400E; border-color: var(--amber-border); }
.cmd-box {
  margin: 6px 0 0; padding: 8px 10px; border-radius: 8px;
  background: #292524; color: #FAF8F4; font-size: 11px; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}

/* 沙盘顶部：阿序迎宾 + 勋章陈列架 */
.hub-top-grid { display: grid; grid-template-columns: 0.88fr 1.12fr; gap: 14px; margin-bottom: 16px; align-items: stretch; }

.welcome-card, .medal-rack {
  background: var(--sand-card); border: 2px solid var(--sand-border);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 0 var(--sand-shadow), 0 10px 22px rgba(41, 37, 36, 0.08);
}
.welcome-card { display: flex; flex-direction: column; justify-content: center; }

.axu-welcome { display: flex; align-items: center; gap: 12px; }
.axu-speech { font-size: 15px; font-weight: 700; }
.axu-tag { display: inline-block; font-size: 11px; font-weight: 800; color: var(--optic); background: var(--optic-soft); padding: 2px 8px; border-radius: 999px; margin-bottom: 4px; }

.medal-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.medal-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center; gap: 6px; padding: 10px 6px 9px;
  border-radius: var(--radius-sm); background: #EFECE4; border: 1.5px dashed #C7C2B6;
  min-width: 0; overflow: hidden;
}
.medal-slot > div {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
}
.medal-slot > div > div {
  font-size: 11.5px !important; line-height: 1.25; font-weight: 800;
  word-break: keep-all; overflow-wrap: break-word;
}
.medal-slot .badge {
  font-size: 10.5px; padding: 2px 7px; white-space: nowrap;
}
.medal-slot .diorama-3d-badge .diorama-3d-img {
  width: 48px !important; height: 48px !important;
}
.medal-slot.is-earned { background: #FFFFFF; border-style: solid; border-color: var(--forest-border); }

/* 全幅微缩沙盘地图 */
.sandtable-board {
  background: linear-gradient(180deg, #FAF8F4 0%, #EFECE4 100%);
  border: 2px solid var(--sand-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 6px 0 var(--sand-shadow), 0 16px 32px rgba(41, 37, 36, 0.1);
}

.sandtable-rail {
  height: 10px;
  border-radius: 999px;
  background: #DFD9CC;
  border: 1.5px solid #C7C2B6;
  margin: 0 28px 14px;
  overflow: hidden;
  box-shadow: inset 0 2px 3px rgba(41, 37, 36, 0.12);
}
.sandtable-rail-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2E8B57 0%, #FF6600 100%);
  transition: width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sandtable-nodes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  position: relative;
}

.node-card {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  text-align: center; padding: 14px 10px; border-radius: 14px;
  background: #FFFFFF; border: 2px solid var(--sand-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 5px 0 var(--sand-shadow), 0 8px 18px rgba(41, 37, 36, 0.08);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.node-card.is-open-active {
  border-color: var(--toy-orange);
  box-shadow: inset 0 1px 0 #fff, 0 5px 0 #FDBA74, 0 0 0 3px rgba(255, 102, 0, 0.16);
}
.node-card.is-open-active:hover { transform: translateY(-2px); }
.node-card.is-done {
  border-color: var(--forest-border);
  background: var(--forest-soft);
  box-shadow: 0 4px 0 var(--forest-border);
}
.node-card.is-upcoming {
  background: #F4F2EC;
  border-style: dashed;
  box-shadow: none;
  opacity: 0.86;
}
.node-card.is-locked-soft {
  background: #F8F6F1;
  opacity: 0.78;
}

.node-num { font-size: 11px; font-weight: 800; color: var(--ink-muted); margin-bottom: 4px; }
.node-title { font-size: 15px; font-weight: 800; margin: 6px 0 3px; }
.node-sub { font-size: 12px; color: var(--ink-muted); margin-bottom: 10px; min-height: 34px; }

/* Buttons & Badges */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; border-radius: var(--radius-sm); border: 1.5px solid transparent; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-primary { background: var(--toy-orange); color: #fff; box-shadow: 0 4px 0 var(--toy-orange-shadow), 0 6px 14px rgba(255, 102, 0, 0.22); }
.btn-primary:hover:not(:disabled) { background: var(--toy-orange-hover); }
.btn-primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--toy-orange-shadow); }
.btn-teal { background: var(--forest); color: #fff; box-shadow: 0 4px 0 #1E633D, 0 6px 14px rgba(46, 139, 87, 0.2); }
.btn-teal:active:not(:disabled) { box-shadow: 0 1px 0 #1E633D; }
.btn-secondary { background: #FFFFFF; color: var(--ink); border-color: var(--sand-border); box-shadow: inset 0 1px 0 #fff, 0 3px 0 var(--sand-shadow); }
.btn-secondary:active:not(:disabled) { box-shadow: 0 1px 0 var(--sand-shadow); }
.btn-danger { background: var(--rose); color: #fff; }
.btn-ghost-danger { background: transparent; color: var(--rose); border-color: var(--rose-border); padding: 6px 12px; font-size: 13px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-ok { background: var(--forest-soft); color: var(--forest); border: 1px solid var(--forest-border); }
.badge-neutral { background: #EDEAE1; color: var(--ink-muted); border: 1px solid var(--sand-border); }

/* 合并版《综合能力实践档案卡》 */
.portfolio-sheet { background: #FFFFFF; border: 2px solid var(--sand-border); border-radius: var(--radius); padding: 24px; box-shadow: 0 5px 0 var(--sand-shadow); }
.portfolio-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 2px solid var(--sand-border); padding-bottom: 14px; margin-bottom: 16px; }
.archive-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.archive-col { background: var(--sand-card); border: 1.5px solid var(--sand-border); border-radius: var(--radius-sm); padding: 16px; break-inside: avoid; }
.archive-col h3 { margin: 0 0 8px; font-size: 16px; color: var(--optic); }
.portfolio-section { margin-bottom: 14px; padding-top: 12px; border-top: 1px dashed var(--sand-border); break-inside: avoid; }
.portfolio-section h3 { margin: 0 0 6px; font-size: 16px; color: var(--forest); }

.app-footer { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--sand-border); font-size: 12px; color: var(--ink-muted); }

dialog { max-width: 460px; width: calc(100% - 32px); border: 1.5px solid var(--sand-border); border-radius: var(--radius); padding: 20px; box-shadow: 0 20px 45px rgba(41, 37, 36, 0.24); background: var(--sand-card); }
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgba(41, 37, 36, 0.48); overflow: hidden; overscroll-behavior: contain; }
dialog h2 { margin: 0 0 10px; font-size: 18px; }
.dialog-body { font-size: 14px; color: var(--ink-muted); margin: 0 0 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.guide-steps { margin: 0; padding-left: 20px; }

/* 随身 AI 知识图鉴收集册 */
.codex-banner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 12px 16px; margin-bottom: 14px; border-radius: var(--radius-sm);
  background: var(--sand-card); border: 1.5px solid var(--sand-border); box-shadow: 0 3px 0 var(--sand-shadow);
}
.codex-shell { background: var(--sand-card); border: 2px solid var(--sand-border); border-radius: var(--radius); padding: 20px; box-shadow: 0 5px 0 var(--sand-shadow); }
.codex-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.codex-card {
  background: #FFFFFF; border: 2px solid var(--sand-border); border-radius: var(--radius-sm);
  padding: 14px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
}
.codex-card.is-unlocked { border-color: var(--forest-border); background: linear-gradient(180deg, #FFFFFF 0%, #ECF7F0 100%); }
.codex-card.is-locked { background: #EFECE4; opacity: 0.78; }
.codex-case { font-size: 12px; padding: 8px 10px; border-radius: 8px; background: #F4F2EC; border: 1px solid var(--sand-border); color: var(--ink); }
.concept-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.concept-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px;
  background: var(--forest-soft); border: 1px solid var(--forest-border); font-size: 12px; font-weight: 700; color: var(--forest);
}
.blueprint-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 10px 0 14px; }
.blueprint-step {
  background: #FFFFFF; border: 1.5px solid var(--sand-border); border-radius: 10px; padding: 8px 6px; text-align: center;
}
.blueprint-step strong { display: block; font-size: 13px; color: var(--optic); margin-bottom: 2px; }
.blueprint-step span { font-size: 11px; color: var(--ink-muted); line-height: 1.3; display: block; }
.shift-list { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink); }
.shift-list li { margin-bottom: 4px; }

@media (max-width: 980px) {
  .sandtable-nodes, .medal-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-top-grid, .archive-grid, .codex-grid, .blueprint-steps { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .sandtable-nodes, .medal-row { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; color: #000; }
  .no-print { display: none !important; }
  .app-shell { max-width: 100%; padding: 0; }
  .portfolio-sheet { border: 1px solid #ccc; box-shadow: none; padding: 16px; }
  .archive-col, .portfolio-section { break-inside: avoid; }
}

/* === 3D 哑光硬表面资产软阴影、光环与动效微调 === */
.diorama-3d-building .diorama-3d-img {
  filter: drop-shadow(0 8px 12px rgba(41, 37, 36, 0.22)) drop-shadow(0 2px 3px rgba(41, 37, 36, 0.12));
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), filter 0.22s ease;
}
.diorama-3d-building:hover .diorama-3d-img {
  transform: translateY(-4px) scale(1.04);
  filter: drop-shadow(0 12px 16px rgba(41, 37, 36, 0.26)) drop-shadow(0 3px 5px rgba(255, 102, 0, 0.18));
}
.diorama-3d-axu .diorama-3d-img {
  filter: drop-shadow(0 6px 10px rgba(41, 37, 36, 0.2));
  animation: axuGentleFloat 3.2s ease-in-out infinite;
}
.diorama-3d-axu.is-grand-slam .diorama-3d-img,
.diorama-3d-axu.is-celebrate .diorama-3d-img {
  filter: drop-shadow(0 6px 12px rgba(46, 139, 87, 0.38)) drop-shadow(0 0 10px rgba(52, 211, 153, 0.35));
}
.diorama-3d-badge.is-earned .diorama-3d-img {
  filter: drop-shadow(0 5px 10px rgba(255, 102, 0, 0.32)) drop-shadow(0 0 8px rgba(250, 204, 21, 0.42));
  animation: badgeGlowPulse 2.8s ease-in-out infinite;
}
.diorama-3d-badge.is-locked .diorama-3d-img {
  filter: grayscale(0.92) opacity(0.42) drop-shadow(0 2px 4px rgba(41, 37, 36, 0.12));
}
.diorama-3d-stage-device .diorama-3d-img {
  filter: drop-shadow(0 8px 12px rgba(41, 37, 36, 0.2));
}
.diorama-3d-stage-device.is-ok .diorama-3d-img {
  filter: drop-shadow(0 8px 14px rgba(46, 139, 87, 0.34));
}
.diorama-3d-stage-device.is-error .diorama-3d-img {
  filter: drop-shadow(0 8px 14px rgba(220, 38, 38, 0.34));
}
@keyframes axuGentleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes badgeGlowPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.045); }
}

/* 全站统一 Web Audio 顶部双控音频组 */
.theater-audio-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.theater-audio-btn {
  padding: 6px 10px;
  font-size: 12.5px;
  line-height: 1.2;
  white-space: nowrap;
}
.theater-audio-btn.is-audio-off {
  opacity: 0.65;
  background: #EDEAE1;
  color: #78716C;
  border-color: #D6D3CD;
}

/* === 少儿心理学 P1 护眼降焦虑配色与柔和动效微调 === */
:root {
  --rose: #C84B52;
  --rose-soft: #FDF2F2;
  --rose-border: #F2B8BC;
}
.action-marquee {
  background: #33302E !important;
  color: #FAF8F4 !important;
}
.action-marquee .marquee-guide-pill {
  background: #E67E22 !important;
}
[data-next-action="true"] {
  outline: 2.5px solid #E87A35 !important;
  animation: nextActionGentleBreath 2.8s ease-in-out infinite !important;
}
[data-next-action="true"]::after {
  background: #E87A35 !important;
}
@keyframes nextActionGentleBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 122, 53, 0.28); }
  50% { box-shadow: 0 0 0 6px rgba(232, 122, 53, 0.08); }
}
.parent-praise-box {
  background: linear-gradient(135deg, #FEF9EE 0%, #F0FAF4 100%);
  border: 1.5px solid #B7E4C7;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}
.parent-praise-box h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #1E633D;
}
.parent-praise-box p, .parent-praise-box li {
  font-size: 13px;
  line-height: 1.55;
  color: #3F3B37;
}
