/* 音脉测试 · 暗色沉浸样式（Chrome 61 基线） */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #070b1a; overflow: hidden; }
body {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: #fff;
  display: flex; justify-content: center;
}
#app {
  position: relative; width: 100%; max-width: 480px; height: 100%;
  background: radial-gradient(120% 90% at 50% 20%, #0c1630 0%, #070b1a 62%);
  overflow: hidden;
}
.view {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 20px calc(env(safe-area-inset-bottom, 0px) + 16px);
  text-align: center;
}
.hidden { display: none !important; }

/* —— 通用按钮 —— */
button { font-family: inherit; cursor: pointer; border: none; }
.btn-primary, .btn-gold {
  background: linear-gradient(135deg, #E8C87A, #C9973F);
  color: #0A0E1A; font-size: 17px; font-weight: 600;
  padding: 15px 42px; border-radius: 26px; letter-spacing: 1px;
  box-shadow: 0 4px 24px rgba(232, 200, 122, 0.28);
}
.btn-gold:active { transform: scale(0.97); }
.btn-ghost {
  background: transparent; color: rgba(255,255,255,0.75);
  border: 1px solid rgba(232, 200, 122, 0.45);
  font-size: 15px; padding: 12px 34px; border-radius: 24px; letter-spacing: 1px;
}
.btn-ghost:active { background: rgba(232,200,122,0.08); }

/* —— 第 1 幕 入场 —— */
#intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.intro-line { width: 52%; height: 1px; background: rgba(120,220,255,0.35); margin-bottom: 34px; }
.intro-title { font-size: 40px; font-weight: 700; letter-spacing: 10px; text-indent: 10px;
  font-family: "Songti SC","Noto Serif SC",serif; text-shadow: 0 0 30px rgba(120,200,255,0.35); }
.intro-sub { font-size: 15px; color: rgba(255,255,255,0.6); letter-spacing: 6px; margin: 14px 0 30px; }
.intro-desc { font-size: 14px; line-height: 2; color: rgba(255,255,255,0.55); margin-bottom: 44px; }
.intro-tip { font-size: 12px; color: rgba(255,255,255,0.35); margin-top: 22px; }

/* —— 第 2 幕 答题 —— */
#view-test { justify-content: flex-start; padding-top: calc(env(safe-area-inset-top, 0px) + 14px); }
.exit-btn {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 16px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.55);
  font-size: 15px; line-height: 1; z-index: 5;
}
.progress-wrap { width: 56%; height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
#progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg,#7ADCFF,#E8C87A);
  box-shadow: 0 0 8px rgba(122,220,255,0.7); transition: width 0.4s ease-out; }
#wave-circle { width: min(62vw, 270px); height: min(62vw, 270px); margin-top: 7vh; }
.q-prompt { font-size: 17px; font-weight: 500; color: rgba(255,255,255,0.88); margin-top: 5vh; letter-spacing: 1px; }
.q-mutehint { font-size: 13px; color: rgba(255,255,255,0.42); margin-top: 10px; min-height: 18px; }
.q-options {
  display: flex; flex-wrap: wrap; justify-content: center;
  width: 100%; max-width: 400px; margin-top: 4.5vh; gap: 14px 14px;
}
.q-opt {
  width: calc(50% - 7px); padding: 15px 6px; border-radius: 18px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.9); font-size: 15px; letter-spacing: 1px;
}
.q-opt .em { display: block; font-size: 24px; margin-bottom: 6px; }
.q-opt:active { background: rgba(232,200,122,0.14); border-color: rgba(232,200,122,0.6); }
.q-count { margin-top: auto; font-size: 12px; color: rgba(255,255,255,0.3); letter-spacing: 2px; }

/* —— 第 3 幕 解析 —— */
#analyzing-canvas { width: min(70vw, 300px); height: min(70vw, 300px); }
.analyzing-text { margin-top: 30px; font-size: 14px; color: rgba(255,255,255,0.55); letter-spacing: 2px; }

/* —— 第 4 幕 结果 —— */
#view-result { justify-content: flex-start; padding: 0; }
.result-scroll {
  width: 100%; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 18px calc(env(safe-area-inset-bottom, 0px) + 26px);
}
.result-scroll > * { flex-shrink: 0; }   /* 内容超高时滚动，禁止 flex 压扁卡片 */
.card-frame { width: min(88%, 400px); border-radius: 12px; overflow: hidden;
  background: #0a1226;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(232,200,122,0.25); }
.card-frame .card-canvas { display: block; width: 100%; height: auto; }
button:disabled { opacity: 0.55; }
.result-caption { font-size: 13px; color: rgba(255,255,255,0.45); margin: 12px 0 2px; letter-spacing: 1px; }
.quote-toggle { display: flex; gap: 8px; margin-top: 14px; }
.qt-btn {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.55); font-size: 13px; padding: 7px 20px; border-radius: 16px;
}
.qt-btn.active {
  border-color: rgba(232,200,122,0.75); color: #E9CE8C; background: rgba(232,200,122,0.1);
}
.btn-group { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; width: min(88%, 360px); }
.btn-group button { width: 100%; }
.gallery-title { margin-top: 30px; font-size: 15px; color: rgba(232,200,122,0.85); letter-spacing: 2px; }
#gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; width: 100%; max-width: 320px; }
.g-cell {
  width: calc(25% - 8px); height: 64px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.g-cell .g-no { font-size: 10px; color: rgba(255,255,255,0.35); }
.g-cell .g-name { font-size: 12px; margin-top: 4px; color: rgba(232,200,122,0.9);
  font-family: "Songti SC","Noto Serif SC",serif; }
.g-cell.locked .g-name { color: rgba(255,255,255,0.25); }
.g-cell.mine { border-color: rgba(232,200,122,0.7); background: rgba(232,200,122,0.08); }
.result-bottom-tip { margin: 26px 0 8px; font-size: 12px; color: rgba(255,255,255,0.3); letter-spacing: 2px; }

/* —— 合拍 —— */
#view-duet { justify-content: flex-start; padding-top: calc(env(safe-area-inset-top, 0px) + 26px); overflow-y: auto; }
.duet-head { font-size: 16px; color: rgba(255,255,255,0.8); margin-bottom: 20px; letter-spacing: 1px; }
.duet-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.duet-cell {
  width: calc(25% - 8px); padding: 12px 2px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.85); font-size: 14px;
}
.duet-cell .r { display: block; font-size: 10px; color: rgba(232,200,122,0.6); margin-top: 4px; letter-spacing: 1px; }
.duet-cell:active { border-color: rgba(232,200,122,0.7); }
.duet-result { margin-top: 22px; width: 100%; display: flex; flex-direction: column; align-items: center; }
#btn-duet-back { margin: 20px 0 30px; }

/* —— 长按浮层 / toast —— */
.longpress-layer { position: fixed; inset: 0; background: rgba(0,0,0,0.82); z-index: 50;
  display: flex; align-items: center; justify-content: center; }
.longpress-box { width: min(86%, 400px); text-align: center; }
.longpress-tip { font-size: 15px; color: rgba(232,200,122,0.9); margin-bottom: 14px; letter-spacing: 1px; }
#longpress-img { width: 100%; border-radius: 10px; }
#btn-longpress-close { margin-top: 16px; }
.toast {
  position: fixed; left: 50%; bottom: 12%; transform: translateX(-50%);
  background: rgba(20,26,48,0.95); border: 1px solid rgba(232,200,122,0.4);
  color: #fff; font-size: 14px; padding: 12px 26px; border-radius: 24px; z-index: 60;
  letter-spacing: 1px; white-space: nowrap;
}
