/* ============================================================
 * 《二十一天》军训攻略 —— 样式表
 * 画风：明亮温馨（天空蓝 + 奶油白 + 橘黄阳光 + 薄荷绿）
 * 结构：背景装饰 / 标题页 / 游戏页 / 结算页 / 剧情弹层 / 飘字
 * ============================================================ */

/* ---------- 0. 变量与基础重置 ---------- */
:root {
  --sky: #7fc4ff;
  --sky-deep: #4aa8ff;
  --cream: #fffaf0;
  --sun: #ffb340;
  --sun-deep: #ff8a5c;
  --mint: #7bd389;
  --grass: #a8e6a3;
  --ink: #35424f;
  --ink-soft: #7b8794;
  --line: #e8e2d6;
  --white: #ffffff;
  --lu: #3f6fa8;
  --zhou: #e0863f;
  --han: #2f9e75;
  --danger: #ff6b81;
  --radius: 18px;
  --shadow: 0 10px 26px rgba(80, 110, 150, 0.14);
  --shadow-deep: 0 18px 44px rgba(70, 100, 140, 0.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(170deg, #dff1ff 0%, #fff7e9 45%, #ffeef0 100%);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- 1. 背景装饰（太阳 / 云 / 地面） ---------- */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.sun {
  position: absolute; top: -70px; right: -60px; width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe9a8 0%, #ffd166 45%, rgba(255, 209, 102, 0) 70%);
  animation: sunBreath 7s ease-in-out infinite;
}

.cloud {
  position: absolute; height: 60px; width: 160px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 60px;
  filter: blur(0.4px);
  box-shadow: 40px 12px 0 -6px rgba(255, 255, 255, 0.85),
              -46px 14px 0 -10px rgba(255, 255, 255, 0.85);
  opacity: 0.9;
}
.cloud.c1 { top: 12%; left: -200px; animation: drift 46s linear infinite; }
.cloud.c2 { top: 30%; left: -320px; transform: scale(0.7); animation: drift 62s linear infinite 6s; }
.cloud.c3 { top: 5%;  left: -260px; transform: scale(0.5); animation: drift 80s linear infinite 14s; }

.ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26vh;
  background: linear-gradient(180deg, rgba(168, 230, 163, 0.55), rgba(123, 211, 137, 0.28) 60%, rgba(255, 255, 255, 0));
}

@keyframes drift { from { transform: translateX(0) } to { transform: translateX(140vw) } }
@keyframes sunBreath {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* ---------- 2. 屏幕切换 ---------- */
.screen {
  position: fixed; inset: 0; z-index: 1;
  display: none;
  overflow-y: auto;
  padding: 18px;
}
.screen.active { display: block; animation: fadeUp 0.45s ease both; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.92) translateY(10px) } 60% { transform: scale(1.02) } 100% { opacity: 1; transform: none } }
.pop-in { animation: popIn 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.3) both; }

/* ---------- 3. 通用面板与按钮 ---------- */
.panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  backdrop-filter: blur(6px);
}
.panel h3 {
  font-size: 14px; font-weight: 700; color: var(--ink-soft);
  letter-spacing: 1px; margin: 2px 0 10px;
  display: flex; align-items: center; gap: 6px;
}
.panel h3::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--sun); box-shadow: 0 0 0 3px rgba(255, 179, 64, 0.22);
}
.panel h3 + h3, .stat-list + h3, .end-aff + h3 { margin-top: 16px; }

.btn {
  padding: 11px 22px; border-radius: 999px; font-size: 15px; font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.2s ease;
  border: 1px solid transparent;
}
.btn.primary {
  background: linear-gradient(135deg, var(--sun), var(--sun-deep));
  color: #fff; box-shadow: 0 8px 20px rgba(255, 138, 92, 0.35);
}
.btn.primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 12px 26px rgba(255, 138, 92, 0.45); }
.btn.ghost {
  background: #fff; color: var(--ink); border-color: var(--line);
  box-shadow: 0 6px 14px rgba(120, 140, 170, 0.12);
}
.btn.ghost:hover { transform: translateY(-2px); border-color: var(--sky); color: var(--sky-deep); }
.btn.mini { padding: 7px 14px; font-size: 13px; background: #fff; border-color: var(--line); }
.btn.mini:hover { color: var(--danger); border-color: #ffd0d7; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

.tiny { font-size: 12px; color: var(--ink-soft); }
.c-lu { color: var(--lu); } .c-zhou { color: var(--zhou); } .c-han { color: var(--han); }

/* ---------- 4. 标题页 ---------- */
#screen-title { display: none; }
#screen-title.active { display: flex; align-items: center; justify-content: center; }

.title-card {
  width: min(560px, 94vw);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-deep);
  padding: 34px 30px 26px;
  text-align: center;
}
.badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--sun-deep); background: #fff3e2;
  padding: 5px 14px; border-radius: 999px; margin-bottom: 14px;
}
.title-card h1 {
  font-size: 46px; letter-spacing: 6px; line-height: 1.15;
  background: linear-gradient(135deg, var(--sky-deep), var(--sun));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.title-card .sub { margin-top: 10px; font-size: 16px; color: var(--ink); }
.title-card .hint { margin-top: 16px; font-size: 14px; line-height: 1.9; color: var(--ink-soft); }
.title-actions { margin: 22px 0 14px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 5. 游戏页：顶栏 ---------- */
#screen-game { padding: 14px; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 16px; margin-bottom: 12px;
}
.day-chip {
  display: flex; align-items: baseline; gap: 3px; font-size: 13px; color: var(--ink-soft);
  background: linear-gradient(135deg, #eaf6ff, #fff3e2);
  padding: 6px 14px; border-radius: 999px; font-weight: 700;
}
.day-chip b { font-size: 22px; color: var(--sky-deep); padding: 0 3px; }
.progress-wrap { flex: 1; min-width: 120px; }
.progress { height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--sky), var(--mint), var(--sun));
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.progress-label { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.praise-chip {
  font-size: 13px; font-weight: 700; color: #b8801f;
  background: #fff7e0; border: 1px solid #ffe6ae;
  padding: 6px 12px; border-radius: 999px;
}

/* ---------- 6. 游戏页：三栏布局 ---------- */
.layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 280px;
  gap: 12px; align-items: start;
}
.layout > .panel { max-height: calc(100vh - 110px); overflow-y: auto; }

/* 数值条 */
.stat-list { display: flex; flex-direction: column; gap: 9px; }
.stat-row { font-size: 13px; }
.stat-row .stat-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.stat-row .stat-name { font-weight: 700; }
.stat-row .stat-val { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.stat-bar { height: 9px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.stat-bar > i {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.stat-row.bad .stat-name { color: var(--danger); }

/* 性格倾向：双向条 */
.pers-list { display: flex; flex-direction: column; gap: 10px; }
.pers-row { font-size: 12px; }
.pers-head { display: flex; justify-content: space-between; margin-bottom: 4px; color: var(--ink-soft); }
.pers-head b { color: var(--ink); }
.pers-track { position: relative; height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.pers-track > i {
  position: absolute; top: 0; bottom: 0; width: 0%;
  transition: width 0.5s ease, left 0.5s ease;
}
.pers-track > i.pos { left: 50%; background: linear-gradient(90deg, var(--mint), var(--sky)); }
.pers-track > i.neg { right: 50%; background: linear-gradient(270deg, #ffc9a3, var(--danger)); }

/* 行动卡片 */
.action-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.action-card {
  text-align: left; padding: 11px 13px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(120, 140, 170, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  position: relative; overflow: hidden;
}
.action-card::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--sky);
  opacity: 0.75;
}
.action-card[data-ins="lu"]::after { background: var(--lu); }
.action-card[data-ins="zhou"]::after { background: var(--zhou); }
.action-card[data-ins="han"]::after { background: var(--han); }
.action-card[data-ins="none"]::after { background: var(--mint); }
.action-card:hover { transform: translateY(-3px); box-shadow: 0 12px 24px rgba(110, 140, 180, 0.18); border-color: #cfe6ff; }
.action-card:disabled { opacity: 0.5; }
.action-title { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.action-who { font-size: 11px; font-weight: 700; color: var(--ink-soft); margin-left: auto; }
.action-desc { font-size: 12px; color: var(--ink-soft); margin: 5px 0 7px; line-height: 1.5; }
.action-eff { display: flex; flex-wrap: wrap; gap: 5px; }
.eff-tag {
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: #f2f7fd; color: #4a6b8a; font-weight: 700;
}
.eff-tag.up { background: #eafaf0; color: #2f9e75; }
.eff-tag.down { background: #ffeef1; color: #d8495f; }

/* 教官好感卡 */
.ins-list { display: flex; flex-direction: column; gap: 10px; }
.ins-card {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 11px; border-radius: 14px; background: #fff;
  border: 1px solid var(--line);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.ins-card:hover { transform: translateX(3px); box-shadow: 0 8px 18px rgba(110, 140, 180, 0.14); }
.ins-avatar {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 22px;
  background: #f3f8ff; border: 1px solid var(--line);
}
.ins-main { flex: 1; min-width: 0; }
.ins-name { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.ins-tag { font-size: 10px; color: #fff; padding: 1px 6px; border-radius: 999px; }
.ins-tier { font-size: 11px; color: var(--ink-soft); float: right; }
.ins-bar { height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; margin-top: 5px; }
.ins-bar > i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 0.55s cubic-bezier(0.2, 0.8, 0.3, 1); }
.ins-hint { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }

/* 日志 */
.log-list { display: flex; flex-direction: column; gap: 7px; font-size: 12px; }
.log-item {
  background: #f8fbff; border-left: 3px solid var(--sky);
  padding: 6px 9px; border-radius: 8px; color: #4d5b6a; line-height: 1.5;
  animation: fadeUp 0.3s ease both;
}
.log-item.gold { border-color: var(--sun); background: #fffaef; }
.log-item.warn { border-color: var(--danger); background: #fff6f7; }
.log-empty { font-size: 12px; color: #b3bcc7; }

/* ---------- 7. 剧情弹层 ---------- */
.scene {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(40, 60, 80, 0.42);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 18px;
  transition: opacity 0.25s ease;
}
.scene.hidden { opacity: 0; pointer-events: none; }
.scene-box {
  width: min(820px, 96vw);
  background: var(--cream);
  border: 2px solid #fff;
  border-radius: 22px;
  box-shadow: var(--shadow-deep);
  padding: 16px 18px 14px;
  position: relative;
}
.scene-title {
  position: absolute; top: -13px; left: 20px;
  background: linear-gradient(135deg, var(--sky-deep), var(--mint));
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  padding: 5px 14px; border-radius: 999px;
  box-shadow: 0 6px 14px rgba(74, 168, 255, 0.3);
}
.speaker { display: flex; align-items: center; gap: 12px; margin: 8px 0 10px; }
.portrait {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 16px;
  display: grid; place-items: center; font-size: 26px;
  background: #fff; border: 2px solid var(--line);
  box-shadow: 0 8px 16px rgba(120, 140, 170, 0.16);
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-4px) } }
.speaker-name { font-size: 17px; font-weight: 800; }
.speaker-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.scene-body {
  min-height: 104px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; position: relative;
}
.scene-text { font-size: 15px; line-height: 1.9; white-space: pre-wrap; }
.scene-next {
  position: absolute; right: 12px; bottom: 6px;
  font-size: 12px; color: var(--sky-deep); animation: blink 1.4s ease-in-out infinite;
}
.scene-next.hidden { display: none; }
@keyframes blink { 0%, 100% { opacity: 0.35 } 50% { opacity: 1 } }

.scene-choices { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.choice-btn {
  text-align: left; padding: 12px 16px 12px 44px; border-radius: 13px;
  background: #fff; border: 2px solid #e6eef8; font-size: 14px; font-weight: 600;
  position: relative; transition: all 0.16s ease;
  animation: fadeUp 0.3s ease both;
}
.choice-btn .choice-idx {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--sky), var(--sky-deep)); color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.choice-btn:hover {
  border-color: var(--sun); background: #fffaf0;
  transform: translateX(4px); box-shadow: 0 8px 18px rgba(255, 179, 64, 0.22);
}
.choice-btn:disabled { opacity: 0.45; }

/* ---------- 8. 飘字提示 ---------- */
.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  font-size: 13px; font-weight: 700; color: #33506b;
  background: #fff; border: 1px solid var(--line);
  border-left: 4px solid var(--sky);
  padding: 8px 14px; border-radius: 11px;
  box-shadow: 0 10px 22px rgba(90, 120, 160, 0.18);
  animation: toastIn 0.28s ease both;
}
.toast.good { border-left-color: var(--mint); color: #22795a; }
.toast.warn { border-left-color: var(--danger); color: #c0394f; }
.toast.gold { border-left-color: var(--sun); color: #a9750f; background: #fffdf5; }
.toast.out { animation: toastOut 0.3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px) scale(0.96) } to { opacity: 1; transform: none } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px) scale(0.96) } }

/* ---------- 9. 结算页 ---------- */
#screen-end { padding: 20px 18px 40px; }
.end-wrap { width: min(1080px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.end-card {
  text-align: center; padding: 26px 20px;
  border-radius: 24px; background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line); box-shadow: var(--shadow-deep);
  position: relative; overflow: hidden;
}
.end-card::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 150px;
  background: radial-gradient(ellipse at center, rgba(255, 209, 102, 0.4), rgba(255, 255, 255, 0));
}
.end-icon { font-size: 52px; animation: breathe 3s ease-in-out infinite; }
.end-card h2 { font-size: 30px; letter-spacing: 3px; margin: 6px 0; }
.end-rank {
  display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: 2px;
  color: #fff; background: linear-gradient(135deg, var(--sun), var(--sun-deep));
  padding: 4px 16px; border-radius: 999px; margin-bottom: 8px;
}
.end-score { font-size: 14px; color: var(--ink-soft); }
.end-score b { font-size: 26px; color: var(--sun-deep); }
.end-sub { font-size: 13px; color: var(--ink-soft); margin-top: 8px; line-height: 1.7; }

.end-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.end-aff { display: flex; flex-direction: column; gap: 9px; }
.end-aff-row { font-size: 13px; border-left: 3px solid var(--sky); padding-left: 9px; }
.end-aff-row b { font-size: 13px; }
.end-aff-row .v { float: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.end-aff-row p { font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.6; }
.end-pers { font-size: 12px; color: var(--ink-soft); line-height: 1.9; }
.end-pers b { color: var(--ink); }

.ach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ach {
  font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 999px;
  background: #eafaf1; color: #22795a; border: 1px solid #cdeedc;
  animation: popIn 0.4s ease both;
}
.ach.locked { background: #f4f6f9; color: #aeb7c2; border-color: #e7ebf0; }
.ach-empty { font-size: 12px; color: #b3bcc7; }

.end-text { font-size: 14px; line-height: 2; white-space: pre-wrap; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gal-item {
  font-size: 12px; padding: 8px 10px; border-radius: 10px; text-align: center;
  background: #f5f8fc; color: #aeb7c2; border: 1px dashed #dfe6ee;
}
.gal-item.on { background: #fff8e8; color: #a9750f; border: 1px solid #ffe6ae; font-weight: 700; }
.gal-item.now { box-shadow: 0 0 0 2px rgba(255, 179, 64, 0.5) inset; }
.end-actions { display: flex; gap: 12px; justify-content: center; padding-bottom: 10px; }

/* ---------- 10. 响应式 ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .layout > .panel { max-height: none; }
  .action-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .end-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .screen { padding: 10px; }
  .title-card h1 { font-size: 34px; letter-spacing: 4px; }
  .action-list { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .portrait { width: 36px; height: 36px; flex-basis: 36px; font-size: 18px; }
  .scene-text { font-size: 14px; }
}

/* ============================================================
 * 11. 新增模块：像素素材 / 姓名设置 / 人物面板 / 场景图鉴
 * ============================================================ */

/* ---------- 11.1 像素图统一锐利渲染 ---------- */
.pixel-portrait,
.ins-avatar,
.profile-portrait,
.gal-img,
.scene-art,
.portrait-pixel {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.pixel-portrait {
  width: 48px; height: 48px; border-radius: 12px;
  border: 2px solid #e8e2d6; background: #fff; object-fit: cover;
}
.pixel-portrait.big { width: 96px; height: 96px; border-radius: 16px; }

.player-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.player-head h3 { margin: 0; }

/* ---------- 11.2 标题页次级按钮 ---------- */
.title-actions.second { margin-top: -2px; gap: 8px; }
.btn.sm { padding: 8px 16px; font-size: 13px; }

/* ---------- 11.3 姓名设置页 ---------- */
#screen-name { display: none; }
#screen-name.active { display: flex; align-items: center; justify-content: center; }

.name-card {
  width: min(520px, 94vw);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow-deep);
  padding: 30px 28px 24px;
  text-align: center;
}
.name-card h2 { font-size: 24px; letter-spacing: 2px; margin-bottom: 8px; }
.name-tip { font-size: 13px; color: var(--ink-soft); }
.name-row {
  display: flex; align-items: center; gap: 14px;
  margin: 20px 0 6px; text-align: left;
}
.name-input-wrap { flex: 1; }
.name-input {
  width: 100%; padding: 13px 16px; font-size: 18px; font-weight: 700;
  color: var(--ink); background: #fff;
  border: 2px solid #e6eef8; border-radius: 14px; outline: none;
  font-family: inherit; letter-spacing: 2px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.name-input:focus { border-color: var(--sun); box-shadow: 0 0 0 4px rgba(255, 179, 64, 0.18); }
.name-under { font-size: 11px; color: var(--ink-soft); margin-top: 6px; }
.name-error { min-height: 18px; font-size: 12px; color: var(--danger); margin-top: 2px; }

/* ---------- 11.4 教官卡上的像素头像 ---------- */
.ins-avatar {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 12px;
  border: 2px solid var(--line); background: #fff; object-fit: cover;
}
.ins-card { cursor: pointer; }

/* ---------- 11.5 剧情弹层里的像素场景画 ---------- */
.scene-art {
  display: block; width: min(100%, 512px); margin: 10px auto 12px;
  border-radius: 14px; border: 2px solid #fff;
  box-shadow: 0 10px 22px rgba(110, 140, 180, 0.18);
  animation: fadeUp 0.35s ease both;
}
.scene-art.hidden { display: none; }
.portrait-pixel {
  width: 100%; height: 100%; border-radius: 14px; object-fit: cover;
}
.portrait-pixel.hidden { display: none; }
#scene-portrait { overflow: hidden; }
#scene-portrait-emoji.hidden { display: none; }

/* ---------- 11.6 通用弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(40, 60, 80, 0.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fadeUp 0.22s ease both;
}
.modal.hidden { display: none; }
.modal-box {
  width: min(920px, 96vw); max-height: 88vh; overflow-y: auto;
  background: var(--cream);
  border: 2px solid #fff; border-radius: 22px;
  box-shadow: var(--shadow-deep);
  padding: 18px 20px 22px;
  animation: popIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 2px dashed #ece4d4;
}
.modal-head h3 { font-size: 17px; letter-spacing: 1px; }
.modal-count {
  font-size: 12px; font-weight: 700; color: var(--sky-deep);
  background: #eaf6ff; padding: 3px 10px; border-radius: 999px; margin-left: 6px;
}
.modal-close {
  width: 32px; height: 32px; border-radius: 50%; font-size: 14px; font-weight: 700;
  background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
  transition: all 0.16s ease;
}
.modal-close:hover { color: #fff; background: var(--danger); border-color: var(--danger); transform: rotate(90deg); }
.modal-note { font-size: 12px; color: var(--ink-soft); line-height: 1.8; margin-bottom: 14px; }
.modal-note code { background: #f2f6fb; padding: 1px 6px; border-radius: 6px; }

/* ---------- 11.7 教官人物面板 ---------- */
.profile-body { display: flex; flex-direction: column; gap: 14px; }
.profile-card {
  display: flex; gap: 14px; padding: 14px 16px;
  background: #fff; border: 2px solid var(--line); border-left-width: 6px;
  border-radius: 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.profile-card.focus { box-shadow: 0 0 0 3px rgba(255, 179, 64, 0.35); }
.profile-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(110, 140, 180, 0.16); }
.profile-portrait {
  width: 96px; height: 96px; flex: 0 0 96px; border-radius: 16px;
  border: 2px solid var(--line); background: #fff; object-fit: cover;
}
.profile-main { flex: 1; min-width: 0; }
.profile-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-head b { font-size: 17px; letter-spacing: 1px; }
.profile-title { font-size: 12px; color: var(--ink-soft); }
.profile-aff { margin-left: auto; font-size: 12px; font-weight: 700; }
.profile-intro { font-size: 13px; color: var(--ink); margin: 8px 0 4px; font-weight: 700; }
.profile-text { font-size: 12.5px; color: var(--ink-soft); line-height: 1.85; }
.pref-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 8px; }
.pref-tag {
  font-size: 12px; font-weight: 700; color: #4a6b8a;
  background: #f7fbff; border: 1.5px solid var(--sky);
  padding: 3px 10px; border-radius: 999px;
}
.profile-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #5a6b7d; }
.profile-meta span { line-height: 1.7; }

/* ---------- 11.8 场景图鉴 ---------- */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px;
}
.gal-card {
  background: #fff; border: 2px solid var(--line); border-radius: 16px;
  padding: 10px; text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gal-card:hover { transform: translateY(-3px); box-shadow: 0 14px 26px rgba(110, 140, 180, 0.2); }
.gal-card.locked { background: #f6f8fb; border-style: dashed; }
.gal-img {
  width: 100%; aspect-ratio: 128 / 76; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); background: #eef2f7;
  display: block;
}
.locked-img {
  display: grid; place-items: center; font-size: 30px; font-weight: 800;
  color: #c3ccd8; background: repeating-linear-gradient(45deg, #f0f3f7 0 10px, #e7ecf3 10px 20px);
  border-radius: 10px; border: 1px solid var(--line); aspect-ratio: 128 / 76;
}
.gal-name { font-size: 13px; font-weight: 800; margin: 9px 0 4px; letter-spacing: 1px; }
.gal-card.locked .gal-name { color: #b3bcc7; }
.gal-desc { font-size: 11.5px; color: var(--ink-soft); line-height: 1.7; }

@media (max-width: 640px) {
  .profile-card { flex-direction: column; }
  .profile-portrait { width: 48px; height: 48px; flex-basis: 48px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .scene-art { width: 100%; }
}
