/* ==========================================================================
   勇者之路 · 鬼灭之刃全集中英语闯关平台 样式表
   严格遵循 CSP style-src 'self' 规范，不使用任何内联样式
   ========================================================================== */

:root {
  --bg-dark: #090d16;
  --bg-card: #131c2e;
  --bg-card-elevated: #1e293b;
  --bg-input: #0b1120;
  --border-subtle: #334155;
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent-green: #10b981;
  --accent-green-hover: #059669;
  --accent-blue: #38bdf8;
  --accent-blue-hover: #0284c7;
  --accent-orange: #f97316;
  --accent-orange-hover: #ea580c;
  --accent-purple: #a855f7;
  --accent-purple-hover: #9333ea;
  --accent-danger: #ef4444;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 12px 28px -6px rgba(0, 0, 0, 0.65);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 88% 8%, rgba(168, 85, 247, 0.22), transparent 38%),
    radial-gradient(circle at 12% 18%, rgba(16, 185, 129, 0.18), transparent 42%),
    radial-gradient(circle at 50% 90%, rgba(249, 115, 22, 0.14), transparent 45%),
    #090d16;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.app-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 24px 60px;
}

/* ==========================================================================
   登录视图样式 (多角色勇者营地入口)
   ========================================================================== */
.login-wrapper {
  min-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
}

.login-badge {
  display: inline-block;
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.45);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.login-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffffff;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-main);
  font-size: 0.96rem;
  transition: border-color 0.2s ease;
}

.form-textarea {
  min-height: 82px;
  resize: vertical;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.2s ease, opacity 0.2s ease;
  color: #ffffff;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent-blue);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-blue-hover);
}

.btn-success {
  background: var(--accent-green);
}

.btn-success:hover:not(:disabled) {
  background: var(--accent-green-hover);
}

.btn-warning {
  background: var(--accent-orange);
  color: #0f172a;
}

.btn-warning:hover:not(:disabled) {
  background: var(--accent-orange-hover);
  color: #ffffff;
}

.btn-purple {
  background: var(--accent-purple);
}

.btn-purple:hover:not(:disabled) {
  background: var(--accent-purple-hover);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--bg-card-elevated);
  color: #ffffff;
}

.btn-danger {
  background: var(--accent-danger);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.84rem;
}

.quick-login-box {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-subtle);
}

.quick-login-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.quick-login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ==========================================================================
   顶部勇者状态栏 & 全局导航
   ========================================================================== */
.top-navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar-orb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  border: 2px solid #93c5fd;
}

.hero-meta h1 {
  font-size: 1.25rem;
  font-weight: 800;
}

.hero-meta p {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.stats-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.stat-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.stat-pill-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-pill-value {
  font-size: 1.02rem;
  font-weight: 800;
  color: #fde047;
}

.xp-progress-native {
  width: 140px;
  height: 10px;
  margin-top: 4px;
  accent-color: var(--accent-green);
}

/* 番茄钟计时器 */
.timer-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 8px 14px;
  border-radius: var(--radius-md);
}

.timer-digits {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.3rem;
  font-weight: 800;
  color: #34d399;
}

/* 导师锦囊横幅 */
.mentor-banner {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.18), rgba(139, 92, 246, 0.18));
  border: 1px solid rgba(96, 165, 250, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mentor-banner-text {
  font-size: 0.94rem;
  color: #e2e8f0;
}

.update-alert-pill {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fde68a;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

/* ==========================================================================
   闯关地图标签页导航 (20-20-20 + 6天周测 BOSS 关)
   ========================================================================== */
.quest-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.quest-tab-btn {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.quest-tab-btn:hover {
  border-color: #64748b;
  background: var(--bg-card-elevated);
}

.quest-tab-btn.active-green {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.15);
  color: #ffffff;
}

.quest-tab-btn.active-blue {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.15);
  color: #ffffff;
}

.quest-tab-btn.active-orange {
  border-color: var(--accent-orange);
  background: rgba(245, 158, 11, 0.15);
  color: #ffffff;
}

.quest-tab-btn.active-purple {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.18);
  color: #ffffff;
}

.tab-step-tag {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
  color: #93c5fd;
}

.tab-main-title {
  font-size: 1.02rem;
  font-weight: 800;
  display: block;
}

/* ==========================================================================
   通用卡片与双栏网格布局
   ========================================================================== */
.grid-2col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
}

.grid-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 980px) {
  .grid-2col,
  .grid-equal {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: #ffffff;
}

.stage1-subtitle {
  font-size: 1.04rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px 0;
  line-height: 1.4;
}

.badge-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-card-elevated);
  color: #93c5fd;
  border: 1px solid var(--border-subtle);
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.medal-chip {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde047;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

/* ==========================================================================
   第一关：YouTube 视频播放器与三步闯关清单
   ========================================================================== */
.video-frame-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-subtle);
  margin-bottom: 14px;
}

.video-iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* 盲听模式：遮挡视频内嵌硬字幕与底部字幕区，保留底部播放控制栏可点击 */
.blind-subtitle-shield {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 42px;
  height: 21%;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), #0f172a);
  border-top: 1px solid rgba(16, 185, 129, 0.45);
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #a7f3d0;
  font-size: 0.88rem;
  font-weight: 700;
  pointer-events: none;
  z-index: 10;
}

.blind-subtitle-shield.shield-tall {
  bottom: 0;
  height: 27%;
}

.video-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.step-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.step-card.completed {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.1);
}

.step-info h4 {
  font-size: 0.98rem;
  margin-bottom: 4px;
  color: #f8fafc;
}

.step-info p {
  font-size: 0.86rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   第二关：分级阅读即点即读与高亮文本
   ========================================================================== */
.book-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.sentence-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 12px;
  font-size: 1.22rem;
  line-height: 1.75;
  transition: all 0.2s ease;
}

.sentence-box.speaking-active {
  border-color: var(--accent-orange);
  background: rgba(245, 158, 11, 0.15);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.sentence-box.reading-pause-active {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.16);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.32);
}

.reading-pause-banner {
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.55);
  color: #a7f3d0;
  font-size: 0.92rem;
  font-weight: 700;
}

.clickable-word {
  display: inline-block;
  padding: 2px 5px;
  margin: 0 2px;
  border-radius: 6px;
  cursor: pointer;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.clickable-word:hover {
  background: rgba(59, 130, 246, 0.28);
  color: #93c5fd;
}

.clickable-word.word-clicked {
  background: rgba(245, 158, 11, 0.25);
  color: #fde047;
  border-bottom-color: #f59e0b;
}

.shield-indicator {
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #93c5fd;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
}

/* ==========================================================================
   第三关：影子跟读工作台 & 3D 翻转单词卡
   ========================================================================== */
.shadow-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.shadow-sentence-en {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fde047;
  margin-bottom: 4px;
}

.shadow-sentence-cn {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.shadow-tip {
  font-size: 0.84rem;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.flashcard-box {
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.flashcard-box.mastered {
  border-color: var(--accent-green);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.18), #0f172a);
}

.flashcard-word {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
}

.flashcard-pos {
  font-size: 0.82rem;
  color: #93c5fd;
  margin-bottom: 8px;
}

.flashcard-meaning {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fde047;
  margin: 8px 0;
}

.flashcard-example {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 12px;
}

/* ==========================================================================
   周度小测验 (满6天触发：词汇听写 + 阅读理解选择题)
   ========================================================================== */
.quiz-question-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.mcq-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.mcq-option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.mcq-option-label:hover {
  border-color: var(--accent-blue);
}

/* ==========================================================================
   管理员后台表格与列表
   ========================================================================== */
.data-list-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   非阻塞 Toast 通知与 Modal 弹窗
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.toast-item {
  background: #1e293b;
  border-left: 5px solid var(--accent-green);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 0.92rem;
  font-weight: 600;
}

.toast-item.toast-error {
  border-left-color: var(--accent-danger);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: var(--bg-card);
  border: 2px solid var(--accent-purple);
  border-radius: var(--radius-lg);
  max-width: 720px;
  width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  box-shadow: var(--shadow-card);
}

.modal-header-sticky {
  flex-shrink: 0;
  margin-bottom: 12px;
}

.modal-body-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 14px;
}

.modal-footer-sticky {
  flex-shrink: 0;
  justify-content: flex-end;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.rank-ladder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 700px) {
  .rank-ladder-grid {
    grid-template-columns: 1fr;
  }
}

.rank-ladder-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rank-ladder-card.completed {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.14);
}

/* ==========================================================================
   角落登录用户与经验角标（最上方右上角） + 鬼灭之刃风格独立分关闯关顶栏与底栏
   ========================================================================== */
.top-most-corner-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  margin-bottom: 14px;
  padding: 4px 0 12px;
  border-bottom: 1px solid rgba(249, 115, 22, 0.28);
}

.top-most-corner-row .btn-sm,
.top-most-corner-row .form-select-compact,
.top-most-corner-row .stage-center-badge {
  height: 38px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding-top: 0;
  padding-bottom: 0;
  white-space: nowrap;
}

.top-most-corner-row .btn-sm {
  padding-left: 12px;
  padding-right: 12px;
}

.top-most-corner-row .corner-user-widget .btn-sm {
  height: 28px;
  padding-left: 10px;
  padding-right: 10px;
  font-size: 0.8rem;
}

.top-most-corner-row .form-select-compact {
  display: inline-block;
  padding: 0 10px;
}

.top-row-left-group {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  min-width: 0;
  flex-shrink: 1;
}

.top-row-center-stage {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
  flex-shrink: 1;
}

.stage-center-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.22), rgba(56, 189, 248, 0.22));
  border: 1.5px solid #10b981;
  color: #ffffff;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.top-second-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.top-second-title-heading {
  margin: 0;
  padding: 8px 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), rgba(56, 189, 248, 0.2));
  border: 1.5px solid rgba(16, 185, 129, 0.75);
  color: #ffffff;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}

.website-brand-crest {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.website-brand-logo {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(90deg, #fde047, #f97316, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.website-brand-sub {
  font-size: 0.84rem;
  font-weight: 700;
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.45);
  padding: 3px 10px;
  border-radius: 999px;
}

.stage-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, rgba(19, 28, 46, 0.95), rgba(30, 27, 75, 0.85));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-left: 5px solid #10b981;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.stage-Adjust-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}

.stage-current-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(249, 115, 22, 0.16);
  border: 1px solid rgba(249, 115, 22, 0.5);
  color: #fed7aa;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.corner-user-widget {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  gap: 8px;
  height: 38px;
  box-sizing: border-box;
  background: linear-gradient(135deg, rgba(19, 28, 46, 0.98), rgba(46, 16, 101, 0.92));
  border: 1.5px solid rgba(250, 204, 21, 0.55);
  border-radius: var(--radius-lg);
  padding: 0 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}

.corner-user-avatar {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1.5px solid #fde047;
  cursor: pointer;
}

.corner-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.corner-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  line-height: 1.15;
  white-space: nowrap;
}

.corner-xp-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.corner-user-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
  text-align: left;
  white-space: nowrap;
}

.corner-level-trigger {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: background 0.18s ease;
}

.corner-level-trigger:hover {
  background: rgba(250, 204, 21, 0.14);
}

.corner-rank-clickable {
  color: #fde047;
  text-decoration: underline dashed rgba(250, 204, 21, 0.75);
  text-underline-offset: 3px;
}

.corner-level-trigger:hover .corner-rank-clickable {
  color: #fef08a;
  text-decoration-style: solid;
}

.corner-user-xp {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fde047;
  text-align: left;
  white-space: nowrap;
}

.corner-tts-controls {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.form-select-compact {
  display: inline-block;
  width: auto !important;
  min-width: 62px;
  padding: 5px 8px;
  font-size: 0.82rem;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .top-most-corner-row {
    flex-wrap: wrap;
    row-gap: 10px;
  }
}

.stage-stepper-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .stage-stepper-strip {
    grid-template-columns: 1fr 1fr;
  }
}

.stage-step-node {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.stage-step-node:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.stage-step-node.node-active {
  border-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.18);
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.stage-step-node.node-done {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.12);
}

.stage-footer-gate {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-card);
}

.stage-footer-gate.gate-unlocked {
  border-color: var(--accent-green);
}

.external-video-hero {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(59, 130, 246, 0.14));
  border: 2px dashed rgba(52, 211, 153, 0.55);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 18px;
}

.timer-banner-large {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg-input);
  border: 2px solid var(--accent-green);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 18px;
}

.bottom-test-mode-bar {
  margin-top: 16px;
  padding: 12px 18px;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.recording-row-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recording-delete-btn {
  margin-left: auto;
}

/* ==========================================================================
   第四关：每句核心词拼写记忆强化练习（音节拆解、自然拼读规律、口诀、挖空与默写）
   ========================================================================== */
.spelling-reinforce-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.spelling-reinforce-card.card-reinforced {
  border-color: var(--accent-green);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.12), #131c2e);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35);
}

.spelling-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.spelling-word-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.spelling-hero-word {
  font-size: 2rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.spelling-phonetic-pill {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 2px 10px;
  border-radius: 999px;
}

.spelling-syllable-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.spelling-syllable-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.spelling-chunk-btn {
  background: rgba(245, 158, 11, 0.16);
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  color: #fde047;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.spelling-chunk-btn:hover {
  background: rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

.spelling-memory-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 820px) {
  .spelling-memory-grid {
    grid-template-columns: 1fr;
  }
}

.spelling-info-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.spelling-info-box strong {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 4px;
}

.box-phonics {
  border-left: 4px solid var(--accent-blue);
}

.box-phonics strong {
  color: #93c5fd;
}

.box-memory {
  border-left: 4px solid var(--accent-orange);
}

.box-memory strong {
  color: #fde047;
}

.box-caution {
  border-left: 4px solid var(--accent-danger);
}

.box-caution strong {
  color: #fca5a5;
}

.box-sentence {
  border-left: 4px solid var(--accent-purple);
}

.box-sentence strong {
  color: #c4b5fd;
}

.spelling-practice-flow {
  background: var(--bg-input);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 14px;
}

.spelling-step-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.spelling-masked-banner {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.5rem;
  font-weight: 900;
  color: #a7f3d0;
  letter-spacing: 3px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.45);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 10px;
}

.stage5-hint-banner {
  display: block;
  margin: 8px 0;
  padding: 8px 14px;
  background: #fffbeb;
  border: 1px dashed #f59e0b;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.spelling-input-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

/* ==========================================================================
   独立周 BOSS 关（弦月大考·第 6 天 BOSS 关卡）
   ========================================================================== */
.boss-hero-banner {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.35), rgba(15, 23, 42, 0.95)),
              radial-gradient(circle at 90% 10%, rgba(239, 68, 68, 0.25), transparent 50%);
  border: 2px solid #a855f7;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 12px 36px rgba(168, 85, 247, 0.25);
}

.boss-locked-card {
  background: var(--bg-card);
  border: 2px dashed rgba(168, 85, 247, 0.45);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 20px;
}

.boss-crest-icon {
  font-size: 3.2rem;
  margin-bottom: 12px;
}

/* ==========================================================================
   第四关：单词聚焦递进强化四步法样式
   ========================================================================== */
.spelling-word-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.spelling-substep-track {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.spelling-substep-pill {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.spelling-substep-pill.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fde047;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.spelling-substep-pill.completed {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #6ee7b7;
}

.spelling-step-block {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
}

.spelling-step-block.block-active {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.spelling-step-block.block-done {
  border-color: rgba(16, 185, 129, 0.35);
  opacity: 0.92;
}

.spelling-step-block.block-locked {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.6);
}

.spelling-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.spelling-step-badge {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--accent-orange);
  color: #ffffff;
}

.spelling-blur-cover {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  transition: filter 0.3s ease;
}

.spelling-cover-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px dashed rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  text-align: center;
  margin-bottom: 12px;
}






/* ========================================================================
   宝箱系统、2秒开箱小动画、武器合成工坊与我的资产页面（含Q版娃娃叠层）
   ======================================================================== */
.corner-assets-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(251, 191, 36, 0.48);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.86rem;
  font-weight: 800;
  color: #fef3c7;
}

.corner-asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.corner-asset-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.hub-page-wrapper {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

.hub-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.88);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  color: #f8fafc;
}

.hub-nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.chest-card {
  background: rgba(15, 23, 42, 0.86);
  color: #f8fafc;
  border-radius: 16px;
  padding: 18px;
  border: 2px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chest-card h3 {
  color: #f8fafc;
}

.chest-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.48);
}

.chest-card.tier-silver {
  border-color: #94a3b8;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92) 0%, rgba(51, 65, 85, 0.85) 100%);
}

.chest-card.tier-gold {
  border-color: #f59e0b;
  background: linear-gradient(180deg, rgba(41, 29, 14, 0.92) 0%, rgba(120, 53, 15, 0.45) 100%);
}

.chest-card.tier-diamond {
  border-color: #38bdf8;
  background: linear-gradient(180deg, rgba(14, 34, 54, 0.92) 0%, rgba(12, 74, 110, 0.5) 100%);
}

.chest-card.tier-legendary {
  border-color: #a855f7;
  background: linear-gradient(180deg, rgba(36, 18, 58, 0.94) 0%, rgba(88, 28, 135, 0.52) 100%);
}

.chest-card-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.chest-count-badge {
  font-size: 1.02rem;
  font-weight: 800;
  color: #fef3c7;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(251, 191, 36, 0.45);
  padding: 4px 14px;
  border-radius: 999px;
}

.chest-drop-desc {
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.45;
  min-height: 36px;
}

/* 2秒开箱小动画弹窗 */
.chest-anim-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  min-height: 220px;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: radial-gradient(circle at center, rgba(251, 191, 36, 0.16) 0%, rgba(15, 23, 42, 0.04) 70%);
}

.chest-anim-stage.tier-silver {
  background: radial-gradient(circle at center, rgba(148, 163, 184, 0.25) 0%, rgba(15, 23, 42, 0.04) 70%);
}

.chest-anim-stage.tier-diamond {
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.25) 0%, rgba(15, 23, 42, 0.04) 70%);
}

.chest-anim-icon {
  width: 112px;
  height: 112px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.chest-anim-icon.is-shaking {
  animation: chestShakeCharge 1.4s ease-in-out forwards;
}

.chest-anim-icon.is-bursting {
  animation: chestBurstOpen 0.6s ease-out forwards;
}

.chest-anim-flash {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(253, 224, 71, 0.65) 45%, transparent 75%);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.chest-anim-flash.is-flashing {
  animation: chestBurstFlash 0.65s ease-out forwards;
}

@keyframes chestShakeCharge {
  0% { transform: scale(1) rotate(0deg); }
  12% { transform: scale(1.04) rotate(-8deg); }
  24% { transform: scale(1.06) rotate(8deg); }
  36% { transform: scale(1.08) rotate(-10deg); }
  48% { transform: scale(1.1) rotate(10deg); }
  60% { transform: scale(1.12) rotate(-12deg); }
  72% { transform: scale(1.14) rotate(12deg); }
  84% { transform: scale(1.16) rotate(-14deg); }
  100% { transform: scale(1.2) rotate(0deg); }
}

@keyframes chestBurstOpen {
  0% { transform: scale(1.2); filter: brightness(1.4); }
  50% { transform: scale(1.36); filter: brightness(1.8); }
  100% { transform: scale(1.05); filter: brightness(1); }
}

@keyframes chestBurstFlash {
  0% { transform: scale(0.4); opacity: 0.2; }
  50% { transform: scale(2.1); opacity: 1; }
  100% { transform: scale(2.8); opacity: 0; }
}

.chest-rewards-reveal {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 12px;
  animation: rewardPopIn 0.35s ease-out;
}

@keyframes rewardPopIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.reward-drop-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
}

.reward-drop-icon {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}

/* 我的资产页面 & Q版娃娃叠层 */
.assets-hero-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

@media (max-width: 820px) {
  .assets-hero-layout {
    grid-template-columns: 1fr;
  }
}

.chibi-showcase-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid #cbd5e1;
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.chibi-avatar-stage {
  position: relative;
  width: 190px;
  height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chibi-base-img {
  width: 180px;
  height: 200px;
  object-fit: contain;
  display: block;
}

.chibi-weapon-overlay {
  position: absolute;
  right: 6px;
  top: 72px;
  width: 72px;
  height: 72px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.28));
  animation: rewardPopIn 0.3s ease-out;
}

.chibi-accessory-overlay {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: 68px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.28));
  animation: rewardPopIn 0.3s ease-out;
}

.asset-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.asset-item-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.asset-item-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
}

.asset-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.asset-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
}

.asset-item-qty {
  font-weight: 800;
  font-size: 1.08rem;
  color: #2563eb;
}

/* 武器合成 & 升级卡片网格 */
.weapons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.weapon-card {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.weapon-card.is-unlocked {
  border-color: #10b981;
  background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
}

.weapon-card.is-equipped {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.weapon-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weapon-card-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: #f1f5f9;
  border-radius: 12px;
  padding: 6px;
  border: 1px solid #e2e8f0;
}

.rarity-pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.rarity-pill.rarity-rare {
  background: #dbeafe;
  color: #1d4ed8;
}

.rarity-pill.rarity-epic {
  background: #fee2e2;
  color: #b91c1c;
}

.rarity-pill.rarity-legendary {
  background: #fef3c7;
  color: #b45309;
}

.shard-progress-bar-bg {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.shard-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* 武器合成 & 装备武器 2秒小动画 */
.weapon-forge-icon {
  width: 108px;
  height: 108px;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.weapon-forge-icon.is-forging {
  animation: weaponForgePulse 1.4s ease-in-out forwards;
}

.weapon-forge-icon.is-forged {
  animation: chestBurstOpen 0.6s ease-out forwards;
}

@keyframes weaponForgePulse {
  0% { transform: scale(0.75) rotate(-15deg); filter: grayscale(0.8) brightness(0.85); }
  25% { transform: scale(0.9) rotate(8deg); filter: grayscale(0.5) brightness(1.1); }
  50% { transform: scale(1.0) rotate(-8deg); filter: grayscale(0.2) brightness(1.25); }
  75% { transform: scale(1.1) rotate(6deg); filter: grayscale(0) brightness(1.4); }
  100% { transform: scale(1.15) rotate(0deg); filter: brightness(1.6); }
}

.equip-anim-stage {
  position: relative;
  width: 210px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.equip-anim-weapon {
  position: absolute;
  right: 10px;
  top: 74px;
  width: 76px;
  height: 76px;
  object-fit: contain;
  z-index: 3;
}

.equip-anim-weapon.is-equipping {
  animation: weaponEquipFlyIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.equip-anim-weapon.is-equipped-done {
  animation: chestBurstOpen 0.6s ease-out forwards;
}

@keyframes weaponEquipFlyIn {
  0% { transform: translate(90px, -70px) scale(1.35) rotate(45deg); opacity: 0.2; }
  60% { transform: translate(12px, -10px) scale(1.15) rotate(-10deg); opacity: 1; }
  85% { transform: translate(-4px, 2px) scale(1.08) rotate(4deg); opacity: 1; }
  100% { transform: translate(0, 0) scale(1) rotate(0deg); opacity: 1; }
}

.equip-anim-accessory {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  width: 72px;
  height: 48px;
  object-fit: contain;
  z-index: 3;
}

.equip-anim-accessory.is-equipping {
  animation: accessoryEquipFlyIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.equip-anim-accessory.is-equipped-done {
  animation: chestBurstOpen 0.6s ease-out forwards;
}

@keyframes accessoryEquipFlyIn {
  0% { transform: translate(-50%, 60px) scale(1.35); opacity: 0.2; }
  60% { transform: translate(-50%, -8px) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}


/* ==========================================================================
   👹 独立 BOSS 战模块样式（藤袭山试炼「手鬼」回合制竞技场）
   ========================================================================== */
.boss-arena,
.boss-arena-preview {
  background: linear-gradient(135deg, #1b112c 0%, #2b1844 55%, #191229 100%);
  border: 1px solid rgba(186, 148, 255, 0.28);
  border-radius: 16px;
  padding: 16px;
  margin: 12px 0;
  color: #f8f5ff;
}

.boss-arena-preview {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.boss-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.boss-fighter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 12px;
}

.boss-hp-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.hp-bar-track {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hp-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.hp-bar-fill.is-player {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.hp-bar-fill.is-player.is-low {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

.hp-bar-fill.is-boss {
  background: linear-gradient(90deg, #9333ea, #ec4899);
}

.boss-sprite-stage {
  position: relative;
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boss-fighter-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 14px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.boss-buff-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.boss-center-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.boss-round-pill {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(216, 180, 254, 0.45);
  color: #f3e8ff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.boss-round-pill.is-transition {
  animation: bossRoundPulse 0.6s ease-out;
}

.boss-question-enter {
  animation: bossQuestionSlideIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes bossRoundPulse {
  0% { transform: scale(0.85); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0.7); }
  50% { transform: scale(1.12); box-shadow: 0 0 0 10px rgba(168, 85, 247, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}

@keyframes bossQuestionSlideIn {
  0% { opacity: 0; transform: translateY(12px); border-color: #a855f7; }
  60% { opacity: 1; transform: translateY(-2px); border-color: #c084fc; }
  100% { opacity: 1; transform: translateY(0); }
}

.boss-vs-badge {
  font-size: 1.4rem;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
}

.boss-slash-fx {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  animation: bossSlashBurst 0.55s ease-out forwards;
}

.boss-slash-fx.is-water-slash {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.9), rgba(14, 165, 233, 0.1) 70%);
}

.boss-slash-fx.is-flame-slash {
  background: radial-gradient(circle, rgba(251, 146, 60, 0.95), rgba(239, 68, 68, 0.15) 70%);
}

.boss-float-dmg {
  position: absolute;
  top: 4px;
  right: -6px;
  font-weight: 900;
  font-size: 1.05rem;
  padding: 2px 8px;
  border-radius: 999px;
  pointer-events: none;
  animation: bossFloatUp 0.9s ease-out forwards;
}

.boss-float-dmg.is-crit,
.boss-float-dmg.is-hurt {
  background: #ef4444;
  color: #fff;
}

.boss-float-dmg.is-heal {
  background: #22c55e;
  color: #fff;
}

.boss-event-banner {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.94rem;
}

.boss-event-banner.is-success {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #15803d;
}

.boss-event-banner.is-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}

.letter-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.letter-slot {
  width: 34px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  font-weight: 800;
  font-size: 1.05rem;
  color: #94a3b8;
}

.letter-slot.is-revealed {
  border-color: #16a34a;
  background: #dcfce7;
  color: #15803d;
  animation: letterPopIn 0.35s ease-out;
}

/* 角色待机与战斗动画 */
.boss-fighter-img.is-idle {
  animation: bossIdleFloat 2.4s ease-in-out infinite;
}

.boss-fighter-img.is-attacking-right {
  animation: bossLungeRight 0.45s ease-out;
}

.boss-fighter-img.is-attacking-left {
  animation: bossLungeLeft 0.45s ease-out;
}

.boss-fighter-img.is-hit-shake {
  animation: bossHitShake 0.45s ease-in-out;
}

.boss-fighter-img.is-shield-block {
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.75);
  animation: bossHitShake 0.4s ease-in-out;
}

.boss-fighter-img.is-heal-glow {
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.85);
}

.boss-fighter-img.is-defeated {
  opacity: 0.35;
  filter: grayscale(85%);
}

@keyframes bossIdleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes bossLungeRight {
  0% { transform: translateX(0); }
  45% { transform: translateX(26px) scale(1.06); }
  100% { transform: translateX(0); }
}

@keyframes bossLungeLeft {
  0% { transform: translateX(0); }
  45% { transform: translateX(-26px) scale(1.06); }
  100% { transform: translateX(0); }
}

@keyframes bossHitShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); filter: brightness(1.3) saturate(1.5); }
  45% { transform: translateX(8px); }
  70% { transform: translateX(-5px); }
}

@keyframes bossSlashBurst {
  0% { transform: scale(0.3) rotate(-25deg); opacity: 1; }
  100% { transform: scale(1.5) rotate(20deg); opacity: 0; }
}

@keyframes bossFloatUp {
  0% { transform: translateY(8px); opacity: 0; }
  25% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-22px); opacity: 0; }
}

@keyframes letterPopIn {
  0% { transform: scale(0.6); }
  65% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@media (max-width: 720px) {
  .boss-hud,
  .boss-arena-preview {
    grid-template-columns: 1fr;
  }
}
