/* ============================================================
   破冰大作战 · 全局设计系统（Neubrutalism 活力综艺风）
   依据 design-system/MASTER.md —— 唯一视觉事实源
   ============================================================ */
:root {
  --ink: #141414;
  --paper: #FFF7E8;
  --card: #FFFFFF;
  --yellow: #FFD93D;
  --blue: #4D96FF;
  --red: #FF5A5F;
  --green: #06D6A0;
  --orange: #FF9F1C;
  --purple: #9B5DE5;
  --pink: #F15BB5;
  --muted: #6B6558;

  --font: 'Nunito', 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans SC', system-ui, sans-serif;
  --bw: 4px;                                   /* 描边宽 */
  --shadow: 8px 8px 0 var(--ink);              /* 卡片硬投影 */
  --shadow-btn: 5px 5px 0 var(--ink);          /* 按钮硬投影 */
  --radius: 20px;
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.25, 0.8, 0.3, 1);
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--paper);
  /* 波点+斜纹综艺背景 */
  background-image:
    radial-gradient(rgba(20, 20, 20, 0.055) 2.6px, transparent 2.6px),
    radial-gradient(rgba(255, 90, 95, 0.07) 2.6px, transparent 2.6px);
  background-size: 46px 46px, 46px 46px;
  background-position: 0 0, 23px 23px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

::selection { background: var(--yellow); color: var(--ink); }

/* ---------- 顶部导航 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: var(--bw) solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}
.topbar .spacer { flex: 1; }

.brand-sticker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--yellow);
  border: var(--bw) solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  border-radius: 14px;
  padding: 6px 18px;
  font-weight: 900;
  font-size: clamp(18px, 1.6vw, 24px);
  transform: rotate(-1.2deg);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s var(--bounce);
}
.brand-sticker:hover { transform: rotate(0deg) scale(1.04); }

.page-title {
  font-weight: 900;
  font-size: clamp(20px, 2vw, 30px);
  letter-spacing: 1px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  padding: 6px 16px;
  font-weight: 800;
  font-size: clamp(14px, 1.2vw, 18px);
  box-shadow: 3px 3px 0 var(--ink);
}
.pill.tone-green { background: var(--green); }
.pill.tone-yellow { background: var(--yellow); }

/* ---------- 按钮 ---------- */
.btn {
  --btn-bg: var(--yellow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(17px, 1.5vw, 24px);
  color: var(--ink);
  background: var(--btn-bg);
  border: var(--bw) solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-btn);
  padding: 12px 28px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s var(--bounce), box-shadow 0.16s var(--bounce);
  user-select: none;
  line-height: 1.25;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: var(--shadow-btn); }
.btn.bg-yellow { --btn-bg: var(--yellow); }
.btn.bg-blue { --btn-bg: var(--blue); }
.btn.bg-red { --btn-bg: var(--red); }
.btn.bg-green { --btn-bg: var(--green); }
.btn.bg-orange { --btn-bg: var(--orange); }
.btn.bg-purple { --btn-bg: var(--purple); }
.btn.bg-pink { --btn-bg: var(--pink); }
.btn.bg-ink { --btn-bg: var(--ink); color: #fff; }
.btn.big { font-size: clamp(20px, 2vw, 30px); padding: 16px 42px; border-radius: 20px; }
.btn.small { font-size: clamp(14px, 1.1vw, 17px); padding: 8px 16px; border-width: 3px; box-shadow: 3px 3px 0 var(--ink); border-radius: 12px; }
.btn.icon { padding: 8px 14px; font-size: 20px; }
.btn.ghost { --btn-bg: var(--card); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card.tilt-l { transform: rotate(-1.2deg); }
.card.tilt-r { transform: rotate(1.2deg); }

.section-label {
  display: inline-block;
  font-weight: 900;
  font-size: clamp(15px, 1.25vw, 20px);
  background: var(--ink);
  color: #fff;
  padding: 4px 16px;
  border-radius: 10px;
  transform: rotate(-1deg);
  margin-bottom: 14px;
}

/* ---------- 主内容区 ---------- */
.stage {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(20px, 3vh, 40px) 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---------- 步进器 ---------- */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: 16px;
  box-shadow: var(--shadow-btn);
  padding: 8px 12px;
}
.stepper button {
  width: 46px; height: 46px;
  font-size: 24px; font-weight: 900;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--yellow);
  cursor: pointer;
  transition: transform 0.15s var(--bounce);
  line-height: 1;
}
.stepper button:hover { transform: scale(1.12) rotate(-4deg); }
.stepper button:active { transform: scale(0.92); }
.stepper .stepper-val {
  min-width: 84px;
  text-align: center;
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.stepper-label { font-weight: 800; font-size: clamp(16px, 1.35vw, 22px); margin-right: 4px; }

/* ---------- 名牌 / 名字 chips ---------- */
.name-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 8px 16px;
  font-weight: 800;
  font-size: clamp(16px, 1.4vw, 22px);
}
.name-chip.used { background: #EDE6D6; color: var(--muted); text-decoration: line-through; box-shadow: none; border-style: dashed; }
.name-chip .chip-x {
  border: none; background: none; cursor: pointer;
  font-size: 18px; font-weight: 900; color: var(--ink); line-height: 1;
  padding: 0 2px;
}
.name-chip .chip-x:hover { color: var(--red); transform: scale(1.2); }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20, 20, 20, 0.55);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--card);
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 12px 12px 0 var(--ink);
  max-width: 760px;
  width: 100%;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  animation: modal-pop 0.38s var(--bounce);
  overflow: hidden;
}
@keyframes modal-pop { from { transform: scale(0.75) rotate(-2deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: var(--bw) solid var(--ink);
  background: var(--yellow);
}
.modal-head h2 { font-size: clamp(20px, 1.9vw, 28px); font-weight: 900; }
.modal-body { padding: 24px; overflow-y: auto; font-size: clamp(16px, 1.4vw, 21px); line-height: 1.7; white-space: pre-line; font-weight: 600; }
.modal-foot { padding: 14px 24px 20px; display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.modal-body textarea {
  width: 100%; min-height: 220px;
  font-family: var(--font);
  font-size: 17px; font-weight: 600; line-height: 1.6;
  border: 3px solid var(--ink); border-radius: 12px;
  padding: 14px; resize: vertical;
  background: var(--paper);
}
.modal-body textarea:focus-visible { outline: 4px dashed var(--ink); outline-offset: 2px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; top: 22px; left: 50%;
  transform: translateX(-50%) translateY(-140%);
  background: var(--ink); color: #fff;
  font-weight: 800; font-size: clamp(15px, 1.3vw, 20px);
  padding: 12px 26px; border-radius: 14px;
  border: 3px solid #fff;
  box-shadow: 6px 6px 0 rgba(20,20,20,0.35);
  z-index: 300;
  transition: transform 0.35s var(--bounce);
  max-width: 86vw; text-align: center;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- 礼花画布 / 震屏 ---------- */
#fx-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 250; }
.shake { animation: shake 0.5s linear; }
@keyframes shake {
  10%, 90% { transform: translate(-2px, 1px); }
  20%, 80% { transform: translate(4px, -2px); }
  30%, 50%, 70% { transform: translate(-7px, 2px); }
  40%, 60% { transform: translate(7px, -1px); }
}

/* ---------- 进度条 ---------- */
.bar {
  width: 100%; height: 34px;
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--ink);
}
.bar .bar-fill {
  height: 100%; width: 100%;
  background: var(--green);
  border-radius: 999px 0 0 999px;
  transition: width 0.25s linear, background-color 0.3s;
}
.bar.warn .bar-fill { background: var(--yellow); }
.bar.danger .bar-fill { background: var(--red); }

/* ---------- 通用工具 ---------- */
.row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.row.center { justify-content: center; }
.col { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; }
.hidden { display: none !important; }

.big-emoji { font-size: clamp(40px, 4.5vw, 72px); line-height: 1; }

footer.site-foot {
  text-align: center;
  padding: 18px;
  font-weight: 700;
  font-size: 15px;
  color: var(--muted);
  border-top: 3px dashed rgba(20, 20, 20, 0.25);
}

/* ---------- 焦点可见性 ---------- */
:focus-visible { outline: 4px dashed var(--ink); outline-offset: 3px; }
.btn:focus-visible, .stepper button:focus-visible { outline: 4px dashed var(--ink); outline-offset: 3px; }

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 小屏兼容（手机预览不破版） ---------- */
@media (max-width: 768px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .stage { padding: 18px 14px 36px; }
  .card { padding: 18px; }
  .stepper button { width: 40px; height: 40px; }
}
