/* ==========================================================
   Ciallo 弹幕站 - 样式表
   ========================================================== */

/* ---------- 基础变量 ---------- */
:root {
  --c-bg-deep: #0a0618;
  --c-bg-mid: #150a2e;
  --c-pink: #ff8ec7;
  --c-pink-soft: #ffb3dc;
  --c-purple: #a065ff;
  --c-cyan: #6fe3ff;
  --c-yellow: #ffe08a;
  --c-text: #f6f0ff;
  --c-text-dim: #a99cc7;
  --c-card: rgba(30, 16, 58, 0.72);
  --c-border: rgba(160, 101, 255, 0.28);
  --radius: 16px;
  --font-ui: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", "WenQuanYi Micro Hei", system-ui, -apple-system, sans-serif;

  /* 可调节项（JS 会覆盖） */
  --danmaku-speed: 9s;
  --danmaku-size: 30px;
}

/* ---------- 重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-ui);
  color: var(--c-text);
  background: var(--c-bg-deep);
  user-select: none;
  cursor: crosshair;
  /* 适配刘海屏 / 手势条：为安全区预留内边距 */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  overscroll-behavior: none;
}

/* ==========================================================
   背景
   ========================================================== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, #2a1150 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 80% 100%, #1b0a3d 0%, transparent 65%),
    linear-gradient(160deg, var(--c-bg-mid) 0%, var(--c-bg-deep) 55%, #05030f 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  will-change: transform;
}

.orb-1 {
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  background: radial-gradient(circle, rgba(255, 142, 199, 0.65), transparent 65%);
  top: -12%;
  left: -8%;
  animation: float1 22s ease-in-out infinite;
}

.orb-2 {
  width: 40vw;
  height: 40vw;
  min-width: 280px;
  min-height: 280px;
  background: radial-gradient(circle, rgba(160, 101, 255, 0.6), transparent 65%);
  bottom: -14%;
  right: -6%;
  animation: float2 26s ease-in-out infinite;
}

.orb-3 {
  width: 30vw;
  height: 30vw;
  min-width: 220px;
  min-height: 220px;
  background: radial-gradient(circle, rgba(111, 227, 255, 0.42), transparent 65%);
  top: 45%;
  left: 55%;
  animation: float3 30s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(6vw, 5vh) scale(1.12); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-7vw, -4vh) scale(1.15); }
}
@keyframes float3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-8vw, 4vh) scale(0.9); }
  66%      { transform: translate(5vw, -6vh) scale(1.1); }
}

.bg-grid {
  position: absolute;
  inset: -50%;
  background-image:
    linear-gradient(rgba(160, 101, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(160, 101, 255, 0.07) 1px, transparent 1px);
  background-size: 62px 62px;
  transform: perspective(500px) rotateX(58deg);
  animation: gridMove 18s linear infinite;
  opacity: 0.55;
}

@keyframes gridMove {
  from { background-position: 0 0; }
  to   { background-position: 0 62px; }
}

/* ==========================================================
   舞台 / 主内容
   ========================================================== */
.stage {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none; /* 点击穿透到 body，由 JS 统一处理 */
}

.hero {
  text-align: center;
  animation: heroIn 0.9s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* 工具栏专用入场动画：必须保留 translateX(-50%) 的居中，否则会向右溢出 */
@keyframes toolbarIn {
  from { opacity: 0; transform: translateX(-50%) translateY(18px) scale(0.96); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.hero-title {
  font-size: clamp(40px, 9vw, 110px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 0.12em;
}

.title-main {
  background: linear-gradient(100deg, #fff 0%, var(--c-pink-soft) 28%, var(--c-pink) 48%, var(--c-purple) 72%, var(--c-cyan) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 5s linear infinite;
  filter: drop-shadow(0 4px 26px rgba(255, 142, 199, 0.4));
}

@keyframes shimmer {
  to { background-position: 220% center; }
}

.title-mark {
  font-size: 0.38em;
  font-weight: 700;
  color: var(--c-pink-soft);
  opacity: 0.9;
  white-space: nowrap;
  text-shadow: 0 0 22px rgba(255, 142, 199, 0.55);
}

.hero-sub {
  margin-top: 18px;
  font-size: clamp(14px, 2.1vw, 19px);
  color: var(--c-text-dim);
  letter-spacing: 0.06em;
}

.hero-sub::before,
.hero-sub::after {
  content: "";
  display: inline-block;
  width: 34px;
  height: 1px;
  vertical-align: middle;
  margin: 0 12px;
  background: linear-gradient(90deg, transparent, var(--c-purple), transparent);
}

.hero-tip {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--c-text-dim);
  opacity: 0.72;
  letter-spacing: 0.03em;
  transition: color 0.3s;
}

.hero-tip.is-warn { color: var(--c-yellow); opacity: 0.95; }
.hero-tip.is-ok   { color: var(--c-cyan);   opacity: 0.85; }

/* ---------- 中央"点我"提示 ---------- */
.click-hint {
  position: absolute;
  top: 62%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 118px;
  height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: hintPulse 2.4s ease-in-out infinite;
  transition: opacity 0.5s;
}

.click-hint.is-hidden { opacity: 0; }

@keyframes hintPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 0.75; }
  50%      { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

.click-hint-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 142, 199, 0.5);
  box-shadow: 0 0 26px rgba(255, 142, 199, 0.22), inset 0 0 26px rgba(160, 101, 255, 0.16);
}

.click-hint-ring::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px dashed rgba(111, 227, 255, 0.42);
  animation: spin 11s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.click-hint-text {
  position: relative;
  font-size: 15px;
  font-weight: 700;
  color: var(--c-pink-soft);
  letter-spacing: 0.14em;
  text-shadow: 0 0 14px rgba(255, 142, 199, 0.6);
}

/* ==========================================================
   弹幕层
   ========================================================== */
.danmaku-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  contain: layout style paint;
}

.danmaku {
  position: absolute;
  white-space: nowrap;
  font-weight: 900;
  font-size: var(--danmaku-size);
  font-family: var(--font-ui);
  letter-spacing: 0.01em;
  line-height: 1.2;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.75),
    0 0 3px rgba(0, 0, 0, 0.9);
  padding: 0 2px;
  pointer-events: none;
}

/* 描边效果（可选） */
.danmaku.is-stroke {
  -webkit-text-stroke: 1.2px rgba(10, 6, 24, 0.92);
  paint-order: stroke fill;
}

/* 飘出动画：由 JS 设置 --dx 位移与时长 */
.danmaku.is-flying {
  animation: danmakuFly var(--dur, 9s) linear forwards;
}

@keyframes danmakuFly {
  from { transform: translate(-50%, -50%) translate(0, 0) scale(0.72); opacity: 0; }
  8%   { opacity: 1; }
  20%  { transform: translate(-50%, -50%) translate(calc(var(--dx) * 0.2), calc(var(--dy) * 0.2)) scale(1); }
  78%  { opacity: 1; }
  to   { transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(1); opacity: 0; }
}

/* 连击 / 特殊样式 */
.danmaku.style-rainbow {
  background: linear-gradient(92deg, #ff8ec7, #ffe08a, #6fe3ff, #a065ff, #ff8ec7);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: danmakuFly var(--dur, 9s) linear forwards, shimmer 1.6s linear infinite;
  filter: drop-shadow(0 0 12px rgba(255, 142, 199, 0.65));
  text-shadow: none;
}

.danmaku.style-glow {
  color: #fff;
  text-shadow:
    0 0 8px rgba(255, 142, 199, 0.95),
    0 0 20px rgba(255, 142, 199, 0.7),
    0 0 38px rgba(160, 101, 255, 0.55);
}

.danmaku.style-outline {
  color: transparent;
  -webkit-text-stroke: 1.8px var(--c-cyan);
  text-shadow: 0 0 14px rgba(111, 227, 255, 0.6);
}

.danmaku.style-small {
  font-size: calc(var(--danmaku-size) * 0.72);
  font-weight: 700;
  opacity: 0.92;
}

/* ---------- 点击涟漪 ---------- */
.ripple-layer {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.ripple {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  border: 2px solid rgba(255, 142, 199, 0.85);
  box-shadow: 0 0 18px rgba(255, 142, 199, 0.55);
  animation: rippleOut 0.72s cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
}

.ripple.r2 {
  border-color: rgba(111, 227, 255, 0.7);
  box-shadow: 0 0 18px rgba(111, 227, 255, 0.45);
  animation-delay: 0.1s;
}

@keyframes rippleOut {
  from { transform: scale(1);   opacity: 0.95; }
  to   { transform: scale(9);   opacity: 0; }
}

/* ---------- 分数飘字 ---------- */
.float-score {
  position: absolute;
  z-index: 6;
  font-size: 17px;
  font-weight: 900;
  color: var(--c-yellow);
  text-shadow: 0 0 12px rgba(255, 224, 138, 0.8), 0 2px 6px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: floatScore 0.95s ease-out forwards;
}

@keyframes floatScore {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  25%  { opacity: 1; transform: translate(-50%, -110%) scale(1.18); }
  to   { opacity: 0; transform: translate(-50%, -220%) scale(1); }
}

/* ---------- 连击提示 ---------- */
.combo-badge {
  position: absolute;
  z-index: 6;
  font-size: 40px;
  font-weight: 900;
  font-style: italic;
  color: var(--c-pink);
  text-shadow: 0 0 20px rgba(255, 142, 199, 0.9), 0 0 40px rgba(160, 101, 255, 0.6);
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-7deg);
  animation: comboPop 1.05s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
  animation-fill-mode: both;
}

@keyframes comboPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(0.3); }
  35%  { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(1.25); }
  60%  { transform: translate(-50%, -50%) rotate(-7deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -160%) rotate(-7deg) scale(0.95); }
}

/* ==========================================================
   底部工具栏
   ========================================================== */
.toolbar {
  position: absolute;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  pointer-events: auto;
  animation: toolbarIn 0.9s 0.25s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.14s, box-shadow 0.2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex: 0 0 auto;
}

.tb-btn:hover {
  background: rgba(255, 142, 199, 0.16);
  border-color: rgba(255, 142, 199, 0.45);
  box-shadow: 0 0 16px rgba(255, 142, 199, 0.22);
}

.tb-btn:active { transform: scale(0.94); }

.tb-btn.is-off {
  opacity: 0.5;
  color: var(--c-text-dim);
}

.tb-btn.is-off:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

.tb-icon { font-size: 14px; line-height: 1; }

.counter {
  font-size: 11.5px;
  color: var(--c-text-dim);
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.counter span {
  color: var(--c-pink-soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================
   设置面板
   ========================================================== */
.panel-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(5, 3, 12, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.panel-mask.is-open { opacity: 1; visibility: visible; }

.panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 21;
  width: min(420px, 92vw);
  height: 100%;
  padding: calc(22px + env(safe-area-inset-top)) calc(22px + env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) 22px;
  background: linear-gradient(180deg, rgba(26, 14, 52, 0.97), rgba(12, 7, 28, 0.98));
  border-left: 1px solid var(--c-border);
  box-shadow: -14px 0 48px rgba(0, 0, 0, 0.6);
  overflow-y: auto;
  transform: translateX(102%);
  transition: transform 0.38s cubic-bezier(0.3, 1, 0.35, 1);
  pointer-events: auto;
}

.panel.is-open { transform: translateX(0); }

.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-track { background: transparent; }
.panel::-webkit-scrollbar-thumb {
  background: rgba(160, 101, 255, 0.3);
  border-radius: 4px;
}
.panel::-webkit-scrollbar-thumb:hover { background: rgba(160, 101, 255, 0.5); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--c-border);
}

.panel-head h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(95deg, var(--c-pink-soft), var(--c-purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.panel-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--c-text-dim);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.panel-close:hover {
  color: var(--c-pink);
  background: rgba(255, 142, 199, 0.15);
  border-color: rgba(255, 142, 199, 0.4);
}

.panel-sec { margin-bottom: 26px; }

.panel-sec h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--c-pink-soft);
  letter-spacing: 0.08em;
  margin-bottom: 9px;
}

.panel-desc {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--c-text-dim);
  margin-bottom: 11px;
}

.panel-desc code {
  padding: 1px 6px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 11.5px;
  color: var(--c-cyan);
  background: rgba(111, 227, 255, 0.1);
  border: 1px solid rgba(111, 227, 255, 0.22);
  border-radius: 5px;
}

.panel-textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.8;
  color: var(--c-text);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.panel-textarea:focus {
  border-color: rgba(255, 142, 199, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 142, 199, 0.12);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.mini-btn:hover {
  color: var(--c-pink-soft);
  background: rgba(255, 142, 199, 0.14);
  border-color: rgba(255, 142, 199, 0.4);
}

.mini-btn:active { transform: scale(0.96); }

.file-btn { position: relative; overflow: hidden; }

.panel-hint {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--c-text-dim);
  opacity: 0.75;
}

/* ---------- 音频槽位 ---------- */
.audio-slots {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 4px;
}

.audio-slot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  font-size: 12.5px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  transition: border-color 0.25s;
}

.audio-slot.is-ready { border-color: rgba(111, 227, 255, 0.4); }

.audio-slot-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5a5270;
  transition: background 0.25s, box-shadow 0.25s;
}

.audio-slot.is-ready .audio-slot-dot {
  background: var(--c-cyan);
  box-shadow: 0 0 9px rgba(111, 227, 255, 0.9);
}

.audio-slot-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-text);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 11.5px;
}

.audio-slot-state {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--c-text-dim);
  letter-spacing: 0.04em;
}

.audio-slot.is-ready .audio-slot-state { color: var(--c-cyan); }

/* ==========================================================
   响应式
   ========================================================== */
@media (max-width: 620px) {
  .stage { padding: 16px; }

  .hero-sub::before,
  .hero-sub::after { width: 18px; margin: 0 8px; }

  .click-hint {
    top: 58%;
    width: 96px;
    height: 96px;
  }

  .click-hint-text { font-size: 13px; }

  /* 工具栏：固定在底部，左右留白，整体不超过视口 */
  .toolbar {
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    gap: 8px;
  }

  /* 五个按钮一行排开，等分宽度，靠图标区分 */
  .toolbar-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
    gap: 4px;
    padding: 6px;
    border-radius: 18px;
  }

  .tb-btn {
    width: 100%;
    min-width: 0;
    min-height: 46px;   /* 保证足够的触摸热区 */
    padding: 8px 4px;
    font-size: 11px;
    gap: 2px;
    flex-direction: column;
  }

  /* 小屏默认收起文字标签，只留图标，避免挤压换行 */
  .tb-btn .tb-label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1.1;
    opacity: 0.85;
  }

  .tb-icon { font-size: 18px; }

  .toolbar .counter { font-size: 10.5px; }

  .combo-badge { font-size: 30px; }

  /* 设置面板：小屏从底部弹出，铺满宽度 */
  .panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 88vh;
    border-left: none;
    border-top: 1px solid var(--c-border);
    border-radius: 20px 20px 0 0;
    padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
    transform: translateY(102%);
    box-shadow: 0 -14px 48px rgba(0, 0, 0, 0.6);
  }

  .panel.is-open { transform: translateY(0); }

  /* 面板底部的小按钮加大触摸热区 */
  .mini-btn {
    min-height: 40px;
    padding: 9px 14px;
    font-size: 12.5px;
  }

  .panel-close {
    width: 40px;
    height: 40px;
    font-size: 17px;
  }

  /* 输入框字号 >=16px，避免 iOS 聚焦时自动放大页面 */
  .panel-textarea { font-size: 16px; }
}

@media (max-width: 380px) {
  .tb-btn { min-height: 44px; font-size: 10px; }
  .tb-btn .tb-label { font-size: 9px; }
  .tb-icon { font-size: 17px; }
  .toolbar-row { gap: 3px; padding: 5px; }
}

/* 大屏降低弹幕字号以免过宽 */
@media (min-width: 1600px) {
  :root { --danmaku-size: 36px; }
}

/* ---------- 无障碍 / 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  .bg-orb,
  .bg-grid,
  .click-hint,
  .click-hint-ring::after,
  .title-main { animation: none !important; }

  .danmaku.is-flying,
  .danmaku.style-rainbow {
    animation: danmakuFly var(--dur, 9s) linear forwards !important;
  }
}
