/* classroom-interaction.css — 课堂互动工具 (完整视觉版) */

#classroom-interaction { display: none; }
#classroom-interaction.active { display: block; }

.ci-inner { max-width: 1000px; margin: 0 auto; padding: 24px 16px; }

.ci-header { margin-bottom: 20px; }
.ci-header h2 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.ci-header p { font-size: 14px; color: var(--text-secondary); }

/* 子分类 tabs */
.ci-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.ci-tab { padding: 7px 18px; border-radius: 20px; font-size: 13px; font-weight: 500; cursor: pointer; background: white; border: 1px solid var(--border); color: var(--text-secondary); transition: all 0.2s var(--ease-out); }
.ci-tab:hover { border-color: var(--brand-300); color: var(--brand-600); }
.ci-tab.active { background: #D6F3EA; color: #2D7365; border-color: transparent; font-weight: 600; }

/* 工具卡片网格 */
.ci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

.ci-card { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 64px; background: rgba(255,255,255,0.92); border-radius: 16px; cursor: pointer; transition: all 0.2s var(--ease-out); border: 1px solid transparent; }
.ci-card:hover { background: white; border-color: var(--brand-300); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(79, 70, 229,0.12); }

.ci-card-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-50); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }

.ci-card-name { font-size: 14px; color: var(--text-primary); line-height: 1.4; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.ci-card-tag { position: absolute; right: 0; top: -6px; font-size: 11px; font-weight: 600; padding: 4px 0; width: 56px; text-align: center; line-height: 1; border-radius: 6px 0 6px 0; }
.ci-card-tag.tag-free { background: linear-gradient(180deg, #A7F3D0, #6EE7B7); color: #065F46; }
.ci-card-tag.tag-new { background: linear-gradient(180deg, #FEF3C7, #FDE68A); color: #92400E; }

/* ============ 通用面板 ============ */
.ci-panel { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 500; align-items: flex-start; justify-content: center; backdrop-filter: blur(4px); padding: 24px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ci-panel.active { display: flex !important; }

.ci-panel-box, .vb-full, .vb-challenge { background: white; border-radius: 20px; max-height: calc(100vh - 48px); overflow-y: auto; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.15); margin: auto; }
.ci-panel-box { width: 480px; }
.vb-full { width: 640px; }
.vb-challenge { width: 520px; }

.ci-panel-header { padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.ci-panel-header h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.ci-panel-close { width: 32px; height: 32px; border: none; background: var(--bg-subtle); border-radius: 50%; cursor: pointer; font-size: 16px; color: #999; display: flex; align-items: center; justify-content: center; transition: all 0.15s; }
.ci-panel-close:hover { background: #fee2e2; color: #dc2626; }

.ci-panel-body { padding: 24px; flex: 1; }

.ci-panel-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 12px; justify-content: center; }

/* 通用按钮 */
.ci-btn { padding: 12px 24px; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; border: none; }
.ci-btn-primary { background: linear-gradient(135deg, var(--brand-400), var(--brand-600)); color: #FFFFFF; box-shadow: 0 4px 12px rgba(79, 70, 229,0.3); }
.ci-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79, 70, 229,0.4); }
.ci-btn-secondary { background: white; border: 1px solid var(--border); color: var(--text-secondary); }
.ci-btn-secondary:hover { border-color: var(--brand-300); color: var(--brand-600); background: var(--brand-50); }

@keyframes ci-pop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* ============ 1. 随机点名 ============ */
.ci-random-name-display { text-align: center; min-height: 160px; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 20px 0; }
.ci-random-name-rolling { font-size: 48px; font-weight: 700; color: var(--brand-600); }
.ci-random-name-result { font-size: 56px; font-weight: 700; color: var(--brand-700); animation: ci-pop 0.4s ease; }
.ci-random-name-empty { font-size: 16px; color: var(--text-secondary); }

/* ============ 2. 倒计时计时器 ============ */
.ci-timer-mode { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.ci-timer-btn { padding: 8px 20px; border-radius: 20px; border: 1px solid var(--border); background: white; cursor: pointer; font-size: 13px; color: var(--text-secondary); transition: all 0.2s; }
.ci-timer-btn:hover { border-color: var(--brand-300); color: var(--brand-600); }
.ci-timer-btn.active { background: var(--brand-500); color: #FFFFFF; border-color: var(--brand-500); }

.ci-timer-presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0; }
.ci-timer-preset { padding: 6px 14px; border-radius: 16px; border: 1px solid var(--border); background: white; cursor: pointer; font-size: 12px; color: var(--text-secondary); transition: all 0.2s; }
.ci-timer-preset:hover { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-600); }

.ci-timer-display { text-align: center; padding: 20px 0; }
.ci-timer-time { font-size: 72px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: 2px; line-height: 1; }
.ci-timer-label { font-size: 14px; color: var(--text-secondary); margin-top: 8px; }

/* ============ 3. 抽奖大转盘 ============ */
.ci-wheel-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 10px 0; }
.ci-wheel-svg { width: 280px; height: 280px; border-radius: 50%; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

/* ============ 4. 知识抢答 ============ */
.ci-quiz-setup { display: flex; flex-direction: column; gap: 16px; }
.ci-quiz-field { display: flex; flex-direction: column; gap: 6px; }
.ci-quiz-field label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.ci-quiz-field input, .ci-quiz-field textarea { padding: 10px 14px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; outline: none; transition: border-color 0.2s; }
.ci-quiz-field input:focus, .ci-quiz-field textarea:focus { border-color: var(--brand-400); }

.ci-quiz-question { font-size: 22px; font-weight: 700; color: var(--text-primary); text-align: center; padding: 24px 0; }
.ci-quiz-waiting { text-align: center; color: var(--text-secondary); font-size: 16px; padding: 12px 0; }
.ci-quiz-students { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.ci-quiz-student { padding: 8px 20px; border-radius: 20px; border: 1px solid var(--brand-300); background: white; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--brand-600); transition: all 0.2s; }
.ci-quiz-student:hover { background: var(--brand-500); color: #FFFFFF; border-color: var(--brand-500); }

/* ============ 5. 随机分组 ============ */
.ci-group-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; justify-content: center; }
.ci-group-toolbar label { font-size: 14px; color: var(--text-secondary); }
.ci-group-toolbar input { width: 70px; padding: 8px 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; text-align: center; outline: none; }
.ci-group-toolbar input:focus { border-color: var(--brand-400); }

.ci-group-list { display: flex; flex-direction: column; gap: 12px; }
.ci-group-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fafafa; }
.ci-group-header { font-weight: 600; font-size: 14px; color: var(--brand-600); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ci-group-members { display: flex; flex-wrap: wrap; gap: 6px; }
.ci-group-member { padding: 4px 14px; border-radius: 14px; background: white; border: 1px solid var(--brand-200); font-size: 13px; color: var(--text-primary); }

/* ============ 6. 随机排序 ============ */
.ci-order-area { display: flex; gap: 10px; margin-bottom: 16px; }
.ci-order-area input { flex: 1; padding: 10px 14px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px; outline: none; }
.ci-order-area input:focus { border-color: var(--brand-400); }

.ci-order-list { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; }
.ci-order-item { padding: 10px 16px; border-radius: 10px; background: linear-gradient(135deg, var(--brand-50), white); font-size: 15px; color: var(--text-primary); border: 1px solid var(--brand-200); display: flex; align-items: center; gap: 10px; }
.ci-order-index { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-500); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* ============ 7. 音浪小球 ============ */
.vb-layout { display: flex; gap: 20px; }

/* 左侧：麦克风检测面板 — 参考 CDN 设计 */
.vb-monitor { flex: 1; border-radius: 20px; border: 1px solid #efe2cc; background: linear-gradient(180deg, #fdf8ef, #f8f0e4); padding: 16px; display: flex; flex-direction: column; }
.vb-monitor.vb-ok { border-color: #b8dfc0; background: linear-gradient(180deg, #f4fbf5, #edf8ef); }
.vb-monitor-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 8px; }
.vb-monitor-title { font-size: 15px; font-weight: 800; color: #7d3a19; margin: 0; }
.vb-ok .vb-monitor-title { color: #2e6b35; }
.vb-monitor-desc { font-size: 12px; color: #a07a4f; margin: 2px 0 0; }
.vb-ok .vb-monitor-desc { color: #6b9b72; }

.vb-status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid #efdcc3; background: #fff9f0; color: #a07a4f; white-space: nowrap; }
.vb-status-badge.vb-status-ok { border-color: #86c78a; background: #eef9ef; color: #3d8b45; }
.vb-status-badge.vb-status-checking { border-color: #d3893f; background: #fff3e0; color: #c4681a; }
.vb-status-badge.vb-status-error { border-color: #f5b8b4; background: #fef2f1; color: #c9463a; }
.vb-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #b98f68; display: inline-block; }
.vb-ok .vb-status-dot { background: #4caf50; }
.vb-status-ok .vb-status-dot { background: #4caf50; }
.vb-status-ok .vb-status-dot { box-shadow: 0 0 0 2px rgba(76,175,80,0.3); }
.vb-status-checking .vb-status-dot { background: #d3893f; animation: vb-pulse-dot 1s ease-in-out infinite; }
.vb-status-error .vb-status-dot { background: #c9463a; }

/* 垂直分贝计（手机形） */
.vb-db-meter-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 0; }
.vb-db-meter { width: 52px; height: clamp(160px, 30vmin, 220px); border-radius: 36px; background: #f2e6d7; padding: 4px; box-shadow: inset 0 2px 5px rgba(145,107,63,0.15); position: relative; }
.vb-meter-fill { position: absolute; left: 4px; right: 4px; bottom: 4px; border-radius: 32px; background: linear-gradient(180deg, #ffd2a2, #ff8b30, #ff6a00); transition: height 0.15s; }
.vb-db-value { margin-top: 12px; font-size: 28px; font-weight: 800; color: #ff6a00; line-height: 1; }
.vb-ok .vb-db-value { color: #ff6a00; }

.vb-monitor-footer { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vb-monitor-footer label { font-size: 12px; font-weight: 700; color: #7a4c2d; white-space: nowrap; }
.vb-device-select { flex: 1; padding: 8px 10px; border: 1px solid #efdcc3; border-radius: 12px; background: #fffaf1; font-size: 12px; font-weight: 600; color: #7d3a19; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23b98f68' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 28px; }
.vb-ok .vb-device-select { border-color: #c8e6cb; background-color: rgba(255,255,255,0.8); color: #2e6b35; }

.vb-check-mic-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; padding: 10px; border: none; border-radius: 12px; background: linear-gradient(90deg, #ff7a1a, #ff6a00); color: #FFFFFF; font-size: 13px; font-weight: 800; cursor: pointer; transition: all 0.15s; }
.vb-check-mic-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.vb-check-mic-btn:disabled { opacity: 0.5; cursor: wait; }
.vb-check-mic-btn.vb-ok-btn { background: linear-gradient(90deg, #4caf50, #3d8b45); }
.vb-check-mic-btn svg { flex-shrink: 0; }

/* 右侧：设置面板 */
.vb-settings { flex: 1; }
.vb-settings h4 { font-size: 16px; font-weight: 600; color: #1f2937; margin-bottom: 16px; }
.vb-setting-row { margin-bottom: 14px; }
.vb-setting-row label { display: block; font-size: 13px; font-weight: 500; color: #6b7280; margin-bottom: 6px; }
.vb-number-control { display: flex; align-items: center; gap: 8px; }
.vb-number-control button { width: 32px; height: 32px; border: 1px solid #d1d5db; background: white; border-radius: 8px; cursor: pointer; font-size: 16px; font-weight: 600; color: #6b7280; transition: all 0.15s; }
.vb-number-control button:hover { background: #f3f4f6; }
.vb-number-control input { flex: 1; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; font-weight: 600; text-align: center; color: #1f2937; }
.vb-setting-row textarea { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; resize: none; font-family: inherit; }
.vb-slider-wrap { display: flex; align-items: center; gap: 12px; }
.vb-setting-row input[type="range"] { flex: 1; height: 6px; background: #e5e7eb; border-radius: 3px; -webkit-appearance: none; }
.vb-setting-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; background: var(--brand-500); border-radius: 50%; cursor: pointer; }
.vb-setting-row input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; background: var(--brand-500); border-radius: 50%; cursor: pointer; border: none; }
.vb-slider-wrap span { font-size: 16px; font-weight: 700; color: var(--brand-600); min-width: 40px; text-align: right; }
.vb-hint { font-size: 12px; color: #9ca3af; margin-top: 6px; }
.vb-hint span { color: var(--brand-600); font-weight: 600; }

.vb-challenge-header { display: flex; justify-content: space-around; margin-bottom: 20px; }
.vb-challenge-info { text-align: center; }
.vb-challenge-info span:first-child { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.vb-challenge-value { font-size: 18px; font-weight: 700; color: #1f2937; }
.vb-decibel-current { color: var(--brand-600); }
.vb-challenge-progress { margin-bottom: 20px; }
.vb-progress-bar { height: 12px; background: #f3f4f6; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.vb-progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); border-radius: 6px; transition: width 0.5s; }
.vb-progress-text { font-size: 13px; color: #6b7280; text-align: center; }
.vb-progress-text span { color: var(--brand-600); font-weight: 600; }

.vb-balls-area { height: 220px; background: #020c55; background-image: linear-gradient(180deg, #020c55, #001133); border-radius: 16px; position: relative; overflow: hidden; }
.vb-ball { position: absolute; border-radius: 50%; transition: all 0.15s; }
.vb-ball-inner { width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 10px 30px 5px rgba(150,200,255,0.5); background-image: radial-gradient(circle farthest-corner at 50% 60%, rgba(100,150,255,0.1) 0%, rgba(100,150,255,0.2) 40%, rgba(100,150,255,0.3) 55%); }

@keyframes vb-pulse-dot { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

.vb-lottery { width: 480px; }
.vb-lottery-wheel { width: 280px; height: 280px; margin: 0 auto; position: relative; }
.vb-lottery-wheel svg { width: 100%; height: 100%; border-radius: 50%; }
.vb-lottery-result { text-align: center; margin-top: 16px; font-size: 24px; font-weight: 700; color: var(--brand-600); }

/* 😴 静音小球 — 宠物区 */
.qb-pet-area { height: 220px; background: linear-gradient(180deg, #f0f0e8, #e8e4d8, #e8e0d0); border-radius: 16px; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qb-pet { font-size: 80px; line-height: 1; transition: all 0.3s; user-select: none; animation: qb-sleep 2.5s ease-in-out infinite; }
.qb-pet.qb-awake { animation: qb-wake 0.5s ease; }
.qb-pet.qb-angry { animation: qb-shake 0.4s ease 3; font-size: 80px; }
.qb-pet-status { font-size: 14px; color: #6b7280; margin-top: 12px; font-weight: 500; }
.qb-pet-status.qb-warn { color: #ea580c; font-weight: 700; }
.qb-pet-status.qb-fail { color: #ef4444; font-weight: 800; }

@keyframes qb-sleep { 0%,100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.04) translateY(-4px); } }
@keyframes qb-wake { 0% { transform: scale(1); } 30% { transform: scale(1.2); } 60% { transform: scale(0.9); } 100% { transform: scale(1); } }
@keyframes qb-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }

/* 静音小球结果页 */
.qb-result-content { text-align: center; padding: 30px 20px; }
.qb-result-content .qb-result-icon { font-size: 72px; margin-bottom: 16px; }
.qb-result-content .qb-result-msg { font-size: 20px; font-weight: 700; color: #1f2937; margin-bottom: 8px; }
.qb-result-content .qb-result-sub { font-size: 14px; color: #6b7280; }

/* ============ 8/9. 隔空手势 ============ */
.ci-gesture-area { position: relative; width: 100%; height: 280px; background: linear-gradient(180deg, #f0f9ff, #e0f2fe); border-radius: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ci-gesture-area canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.ci-gesture-hint { font-size: 48px; opacity: 0.3; }
.ci-gesture-result { font-size: 36px; font-weight: 700; color: var(--brand-700); animation: ci-pop 0.4s ease; z-index: 1; }

/* ============ 10. 时钟生成器 ============ */
.ci-clock-wrap { text-align: center; padding: 10px 0; }
.ci-clock-canvas { border-radius: 50%; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.ci-clock-digital { font-size: 28px; font-weight: 700; color: var(--text-primary); margin-top: 12px; font-variant-numeric: tabular-nums; letter-spacing: 2px; }

/* ============ 11. 秒表计时器 ============ */
.ci-sw-display { text-align: center; padding: 20px 0; }
.ci-sw-time { font-size: 64px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: 2px; line-height: 1; }
.ci-sw-ms { font-size: 40px; color: var(--brand-500); }
.ci-sw-controls { display: flex; justify-content: center; gap: 12px; }
.ci-sw-laps { margin-top: 16px; max-height: 200px; overflow-y: auto; }
.ci-sw-lap { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ci-sw-lap:nth-child(odd) { background: var(--bg-subtle); border-radius: 6px; }

/* ============ 12. 教室分贝管家 ============ */
.ci-db-wrap { text-align: center; padding: 10px 0; }
.ci-db-status { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.ci-db-row { display: flex; align-items: center; gap: 16px; margin: 16px 0; }
.ci-db-bar-wrap { flex: 1; height: 24px; background: #E5E7EB; border-radius: 12px; overflow: hidden; }
.ci-db-bar { height: 100%; border-radius: 12px; transition: width 0.1s ease; background: linear-gradient(90deg, #22C55E, #EAB308, #EF4444); }
.ci-db-value { font-size: 24px; font-weight: 700; color: var(--text-primary); min-width: 70px; text-align: right; }
.ci-db-level { font-size: 16px; font-weight: 600; color: var(--text-secondary); padding: 8px 0; }
.ci-db-history { margin-top: 12px; max-height: 140px; overflow-y: auto; border-top: 1px solid var(--border); padding-top: 8px; }
.ci-db-history-item { display: flex; justify-content: space-between; padding: 4px 8px; font-size: 12px; color: var(--text-secondary); }

/* ============ 13. 正话反做 ============ */
.ci-rs-wrap { text-align: center; padding: 20px 0; }
.ci-rs-command { font-size: 28px; font-weight: 700; color: var(--text-primary); min-height: 80px; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ci-rs-action { font-size: 18px; color: var(--brand-600); margin: 8px 0; font-weight: 500; }
.ci-rs-empty { font-size: 16px; color: var(--text-secondary); padding: 24px 0; }

/* ============ 14. 趣味对对碰 ============ */
.ci-wm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 340px; margin: 0 auto; }
.ci-wm-card { height: 76px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; transition: all 0.3s; background: linear-gradient(135deg, var(--brand-400), var(--brand-600)); color: #FFFFFF; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.ci-wm-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.ci-wm-card.flipped { background: white; border: 2px solid var(--brand-300); color: var(--text-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.ci-wm-card.matched { background: linear-gradient(135deg, #D6F3EA, #A7F3D0); border: 2px solid var(--brand-400); color: var(--brand-700); cursor: default; box-shadow: none; }
.ci-wm-status { text-align: center; font-size: 14px; color: var(--text-secondary); margin-top: 12px; }

/* ============ 15. 抽奖扭蛋机 ============ */
.ci-gacha-wrap { text-align: center; padding: 20px 0; }
.ci-gacha-machine { width: 180px; height: 240px; margin: 0 auto 20px; position: relative; display: flex; align-items: center; justify-content: center; }
.ci-gacha-body { width: 140px; height: 200px; background: linear-gradient(180deg, #FEF3C7, #FDE68A); border-radius: 20px 20px 16px 16px; border: 3px solid #F59E0B; display: flex; align-items: center; justify-content: center; position: relative; }
.ci-gacha-top { position: absolute; top: -20px; width: 80px; height: 30px; background: linear-gradient(135deg, #F59E0B, #D97706); border-radius: 10px 10px 0 0; }
.ci-gacha-ball { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #111827; font-weight: 700; transition: all 0.3s; }
.ci-gacha-ball.spinning { animation: gacha-shake 0.15s infinite; }
@keyframes gacha-shake { 0%,100% { transform: translate(0,0) rotate(0); } 25% { transform: translate(-5px,-3px) rotate(-8deg); } 75% { transform: translate(5px,3px) rotate(8deg); } }
.ci-gacha-result { font-size: 22px; font-weight: 700; color: var(--brand-700); margin-top: 8px; animation: ci-pop 0.3s ease; }
.ci-gacha-history { margin-top: 12px; max-height: 180px; overflow-y: auto; border-top: 1px solid var(--border); padding-top: 8px; }
.ci-gacha-history-item { display: flex; justify-content: space-between; padding: 4px 8px; font-size: 12px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }

/* ============ 16. 词语赛跑 ============ */
.ci-wr-wrap { text-align: center; }
.ci-wr-progress { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.ci-wr-scrambled { font-size: 32px; font-weight: 700; color: var(--brand-700); letter-spacing: 10px; text-align: center; margin: 16px 0; padding: 16px; background: var(--brand-50); border-radius: 12px; }
.ci-wr-input { width: 220px; padding: 12px 16px; border: 2px solid var(--border); border-radius: 10px; font-size: 18px; text-align: center; outline: none; transition: border-color 0.2s; }
.ci-wr-input:focus { border-color: var(--brand-400); }
.ci-wr-result { font-size: 18px; font-weight: 600; margin: 12px 0; min-height: 30px; }
.ci-wr-correct { color: #059669; }
.ci-wr-wrong { color: #DC2626; }

/* ============ 17. 计算大PK ============ */
.ci-mp-wrap { text-align: center; }
.ci-mp-score { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.ci-mp-question { font-size: 36px; font-weight: 700; color: var(--text-primary); padding: 20px 0; }
.ci-mp-input { width: 140px; padding: 12px 16px; border: 2px solid var(--border); border-radius: 10px; font-size: 24px; text-align: center; outline: none; transition: border-color 0.2s; }
.ci-mp-input:focus { border-color: var(--brand-400); }
.ci-mp-result { font-size: 28px; margin: 12px 0; min-height: 40px; }
.ci-mp-stats { display: flex; justify-content: center; gap: 32px; margin-top: 16px; }
.ci-mp-stat { text-align: center; }
.ci-mp-stat-val { font-size: 24px; font-weight: 700; }
.ci-mp-stat-lbl { font-size: 12px; color: var(--text-secondary); }
.ci-mp-correct { color: #059669; }
.ci-mp-wrong { color: #DC2626; }

/* ============ 18. 趣味拼图 ============ */
.ci-pz-wrap { text-align: center; }
.ci-pz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 230px; margin: 0 auto; }
.ci-pz-tile { height: 74px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; cursor: pointer; background: linear-gradient(135deg, var(--brand-400), var(--brand-600)); color: #FFFFFF; transition: all 0.2s; box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.ci-pz-tile:hover { transform: scale(1.05); }
.ci-pz-tile.empty { background: transparent; cursor: default; box-shadow: none; }
.ci-pz-status { text-align: center; font-size: 14px; color: var(--text-secondary); margin-top: 12px; }

/* ============ 19. 课文挖空练习 ============ */
.ci-fb-wrap { text-align: center; }
.ci-fb-progress { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.ci-fb-content { font-size: 20px; line-height: 2.2; text-align: center; margin-bottom: 12px; color: var(--text-primary); }
.ci-fb-gap { display: inline-block; width: 90px; border-bottom: 3px solid var(--brand-400); margin: 0 4px; text-align: center; color: var(--brand-600); font-weight: 600; cursor: pointer; }
.ci-fb-gap.filled { background: var(--brand-50); border-radius: 4px; }
.ci-fb-hint { font-size: 13px; color: var(--text-secondary); margin: 8px 0; }
.ci-fb-input { width: 140px; padding: 12px 16px; border: 2px solid var(--border); border-radius: 10px; font-size: 20px; text-align: center; outline: none; transition: border-color 0.2s; }
.ci-fb-input:focus { border-color: var(--brand-400); }
.ci-fb-result { font-size: 18px; font-weight: 600; margin: 12px 0; min-height: 30px; }
.ci-fb-correct { color: #059669; }
.ci-fb-wrong { color: #DC2626; }

/* ============ 课程表弹窗（已迁至 homeroom-tools.css） ============ */

/* 响应式 */
@media (max-width: 600px) {
    .ci-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .ci-card { height: 56px; padding: 0 8px; }
    .ci-card-icon { width: 36px; height: 36px; font-size: 18px; }
    .ci-panel-box { width: 95vw; }
    .ci-timer-time { font-size: 48px; }
    .ci-sw-time { font-size: 40px; }
    .ci-wm-grid { grid-template-columns: repeat(3, 1fr); }
    .ci-pz-grid { width: 200px; }
    .ci-pz-tile { height: 64px; font-size: 18px; }
    .ci-mp-question { font-size: 28px; }
}
