/* ============================================================
   新员工闯关学习系统 PRO - 样式表
   移动端优先 / 浅色主题 / 专业友好
   ============================================================ */

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

:root {
  --primary: #4263EB;
  --primary-light: #5C7CFA;
  --primary-dark: #364FC7;
  --primary-bg: #EDF2FF;
  --success: #2F9E44;
  --success-bg: #EBFBEE;
  --success-light: #69DB7C;
  --danger: #E03131;
  --danger-bg: #FFF5F5;
  --warning: #F08C00;
  --warning-bg: #FFF9DB;
  --locked: #ADB5BD;
  --locked-bg: #F1F3F5;
  --bg: #F8F9FA;
  --card-bg: #FFFFFF;
  --text: #212529;
  --text-secondary: #6C757D;
  --text-light: #868E96;
  --border: #E9ECEF;
  --border-strong: #DEE2E6;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-primary: 0 4px 16px rgba(66,99,235,0.25);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; outline: none; -webkit-tap-highlight-color: transparent; }

/* ---------- 主内容容器（居中，限制最大宽度） ---------- */
.app-main {
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- 屏幕切换 ---------- */
.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 加载页 ---------- */
.loading-content { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; gap: 16px; }
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 15px; color: var(--text-secondary); }

/* ---------- 部门选择页 ---------- */
.dept-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); }
.dept-card { background: var(--card-bg); border-radius: var(--radius-lg); padding: 40px 28px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); text-align: center; }
.dept-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; color: var(--primary); }
.dept-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.dept-user-info { margin-bottom: 20px; font-size: 14px; color: var(--text); }
.dept-form { text-align: left; }
.dept-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; margin-top: 16px; }
.dept-label:first-of-type { margin-top: 0; }
.dept-select { width: 100%; padding: 12px 14px; font-size: 15px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--card-bg); color: var(--text); outline: none; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23868e96'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; transition: var(--transition); }
.dept-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.dept-btn { width: 100%; margin-top: 24px; padding: 14px; font-size: 16px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); border-radius: var(--radius); box-shadow: var(--shadow-primary); transition: var(--transition); letter-spacing: 0.5px; }
.dept-btn:active { transform: scale(0.97); background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%); }
.dept-btn:disabled { background: var(--border-strong); color: var(--text-light); box-shadow: none; cursor: not-allowed; }
.dept-input { width: 100%; padding: 12px 14px; font-size: 15px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--card-bg); color: var(--text); outline: none; transition: var(--transition); box-sizing: border-box; }
.dept-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.dept-input::placeholder { color: var(--text-light); }
.wechat-btn { background: linear-gradient(135deg, #07c160 0%, #06ad56 100%); margin-top: 8px; }
.wechat-btn:active { background: linear-gradient(135deg, #06ad56 0%, #058a45 100%); }
.login-divider { display: flex; align-items: center; text-align: center; margin: 22px 0 4px; color: var(--text-light); font-size: 13px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-divider span { padding: 0 14px; }
.login-error { color: #e54d42; font-size: 13px; margin-top: 12px; min-height: 18px; text-align: center; }

/* ---------- 通用头部 ---------- */
header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.92); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 640px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 12px; }
.header-inner h1 { font-size: 16px; font-weight: 700; color: var(--text); }
.header-title { font-size: 17px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subtitle { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.back-btn { font-size: 13px; color: var(--text-light); cursor: pointer; padding: 6px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); transition: var(--transition); }
.back-btn:active { background: var(--border); }

/* 头部进度条 */
.header-progress { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.progress-text { font-size: 12px; font-weight: 600; color: var(--primary); }
.progress-bar-mini { width: 60px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill-mini { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: 3px; transition: width 0.5s ease; }

/* ---------- Hero / 欢迎横幅 ---------- */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 36px 24px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-banner::before { content: ''; position: absolute; top: -40%; right: -20%; width: 200px; height: 200px; background: rgba(255,255,255,0.08); border-radius: 50%; }
.hero-banner::after { content: ''; position: absolute; bottom: -30%; left: -10%; width: 150px; height: 150px; background: rgba(255,255,255,0.06); border-radius: 50%; }
.hero-icon { font-size: 48px; margin-bottom: 8px; position: relative; z-index: 1; }
.hero-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; position: relative; z-index: 1; letter-spacing: 1px; }
.hero-desc { font-size: 14px; opacity: 0.88; line-height: 1.7; position: relative; z-index: 1; }

/* Hero 统计区 */
.hero-stats { display: flex; align-items: center; justify-content: center; gap: 0; margin-top: 24px; position: relative; z-index: 1; }
.stat-item { display: flex; flex-direction: column; align-items: center; padding: 0 20px; }
.stat-num { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; opacity: 0.8; margin-top: 4px; }
.stat-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.25); }

/* ---------- 关卡地图 ---------- */
.map-stage { max-width: 640px; margin: 0 auto; padding: 20px 20px 12px; }

/* 关卡卡片（对齐版本A） */
.level-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
}

.level-card:not(.locked) {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.level-card:not(.locked):active {
  transform: scale(0.98);
}

.level-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.level-card.current {
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-primary);
}

.level-card.completed {
  border-left: 4px solid var(--success);
}

/* 连接线 */
.level-connector {
  width: 3px;
  height: 20px;
  margin-left: 36px;
  background: var(--border-strong);
  border-radius: 2px;
  transition: var(--transition);
}

.level-connector.active {
  background: var(--success);
}

/* 关卡图标 */
.level-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  position: relative;
}

.level-card.locked .level-icon {
  background: var(--locked-bg);
}

.level-card:not(.locked) .level-icon {
  background: var(--primary-bg);
}

.level-card.completed .level-icon {
  background: var(--success-bg);
}

/* 锁定标记 */
.level-lock {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: var(--card-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.level-card.locked .level-lock::before {
  content: '🔒';
}

.level-card.completed .level-lock::before {
  content: '✅';
}

.level-card.current .level-lock::before {
  content: '▶️';
}

.level-card:not(.locked):not(.completed):not(.current) .level-lock {
  display: none;
}

/* 关卡信息 */
.level-info {
  flex: 1;
  min-width: 0;
}

.level-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 2px;
}

.level-card.completed .level-day {
  color: var(--success);
}

.level-card.current .level-day {
  color: var(--primary);
}

.level-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.level-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 关卡状态标签 */
.level-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.level-status.completed {
  background: var(--success-bg);
  color: var(--success);
}

.level-status.current {
  background: var(--primary-bg);
  color: var(--primary);
}

.level-status.locked {
  background: var(--locked-bg);
  color: var(--locked);
}

/* ---------- 关卡地图底部 ---------- */
.map-footer { max-width: 640px; margin: 0 auto; padding: 20px; text-align: center; }
.footer-tip { font-size: 13px; color: var(--text-light); }
.footer-dept { font-size: 12px; color: var(--text-light); margin-top: 12px; }
.footer-logout { font-size: 12px; color: var(--text-light); margin-top: 6px; cursor: pointer; display: inline-block; }
.footer-logout:hover { color: var(--danger); }

/* ---------- 结业证书按钮 ---------- */
.cert-btn { display: block; width: 100%; margin-top: 16px; padding: 16px; font-size: 17px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(47,158,68,0.3); transition: var(--transition); letter-spacing: 1px; }
.cert-btn:active { transform: scale(0.97); }
.cert-btn.hidden { display: none; }

/* ---------- 关卡详情页 ---------- */
.level-header-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  text-align: center;
  padding: 32px 20px 28px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.level-icon-big { font-size: 52px; margin-bottom: 8px; }
.level-day-label { font-size: 13px; opacity: 0.85; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 4px; }
.level-title-big { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.level-subtitle-big { font-size: 14px; opacity: 0.8; line-height: 1.5; }
.materials-section { padding: 24px 20px 16px; }
.section-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.section-icon { font-size: 20px; }
.section-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }
/* 材料按钮区 */
.start-quiz-section { padding: 12px 20px 32px; text-align: center; }
.start-quiz-section .btn-primary.btn-large {
  width: 100%; padding: 16px; font-size: 16px; font-weight: 700;
  border-radius: var(--radius); box-shadow: var(--shadow-primary);
  transition: var(--transition); border: none; cursor: pointer;
}
.start-quiz-section .btn-primary.btn-large:disabled {
  background: var(--border-strong); color: var(--text-light);
  box-shadow: none; cursor: not-allowed;
}
.btn-hint { margin-top: 8px; font-size: 13px; color: var(--text-secondary); }
.material-arrow { color: var(--text-light); display: flex; align-items: center; }
.material-item-nolink { cursor: default; opacity: 0.6; }
.material-nolink-badge { font-size: 11px; color: var(--text-light); padding: 2px 8px; background: var(--locked-bg); border-radius: 4px; }

/* 学习材料 */
.materials-list { display: flex; flex-direction: column; gap: 12px; }
.material-item { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--card-bg); border-radius: var(--radius-sm); border: 1px solid var(--border); text-decoration: none; color: var(--text); transition: var(--transition); }
.material-item:active { transform: scale(0.98); border-color: var(--primary); }
.material-check { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; font-size: 18px; border-radius: 50%; }
.check-circle { display: block; width: 24px; height: 24px; border-radius: 50%; border: 2px dashed var(--border-strong); transition: var(--transition); }
.material-done { border-left: 3px solid var(--success); background: var(--success-bg); }
.material-done .material-title { color: var(--success); }
.material-type-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.material-type-icon.video { background: #FFF4E6; }
.material-type-icon.link { background: var(--primary-bg); }
.material-type-icon.audio { background: #E8F3FF; }
.material-info { flex: 1; min-width: 0; }
.material-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.material-desc { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 答题页 ---------- */
#screenQuiz { display: none; padding: 0 20px; }
#screenQuiz.active { display: block; }
.quiz-progress-bar { height: 4px; background: var(--border); border-radius: 2px; margin: 0 0 16px 0; overflow: hidden; }
.quiz-progress-fill { height: 100%; background: var(--success); border-radius: 2px; transition: width 0.4s ease; width: 0%; }
.quiz-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 14px; color: var(--text-secondary); }
.quiz-score { color: var(--success); font-weight: 600; }
.quiz-question-card { background: var(--card-bg); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); }
.quiz-question { font-size: 17px; font-weight: 700; margin-bottom: 20px; line-height: 1.6; }
.quiz-type-tag { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; padding: 2px 8px; border-radius: 4px; margin-left: 8px; vertical-align: middle; background: var(--primary); }
.quiz-type-tag-single { background: var(--primary); }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg); border: 2px solid transparent; border-radius: var(--radius-sm); transition: var(--transition); text-align: left; width: 100%; font-size: 15px; color: var(--text); cursor: pointer; }
.quiz-option:not(.disabled):active { transform: scale(0.98); }
.quiz-option.multi-selected { border-color: var(--primary); background: var(--primary-bg); }
.quiz-option.multi-selected .option-label { background: var(--primary); border-color: var(--primary); color: white; }
.quiz-option.correct { border-color: var(--success); background: var(--success-bg); }
.quiz-option.correct .option-label { background: var(--success); border-color: var(--success); color: white; }
.quiz-option.wrong { border-color: var(--danger); background: var(--danger-bg); }
.quiz-option.wrong .option-label { background: var(--danger); border-color: var(--danger); color: white; }
.quiz-option.disabled { cursor: default; }
.option-label { width: 28px; height: 28px; border-radius: 50%; background: var(--card-bg); border: 1.5px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; transition: var(--transition); }
.option-text { flex: 1; line-height: 1.5; }
.option-check, .option-result { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.option-result { color: var(--success); }
.quiz-option.wrong .option-result { color: var(--danger); }
.quiz-explain { margin-top: 16px; padding: 14px 16px; background: var(--warning-bg); border-radius: var(--radius-sm); border-left: 3px solid var(--warning); font-size: 13px; line-height: 1.7; display: none; animation: fadeIn 0.3s ease; }
.quiz-explain.show { display: block; }
.quiz-verdict { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.verdict-correct { color: var(--success); }
.verdict-wrong { color: var(--danger); }
.quiz-explain-label { font-weight: 700; color: var(--warning); }
/* 答题底部按钮区 */
.quiz-actions { padding: 20px 0 32px; display: flex; flex-direction: column; gap: 10px; }
.quiz-actions .btn-large { padding: 16px; font-size: 16px; font-weight: 700; border-radius: var(--radius); border: none; cursor: pointer; text-align: center; width: 100%; }
.quiz-actions .btn-large:disabled { cursor: not-allowed; }
.btn-confirm-answer { background: linear-gradient(135deg, var(--warning) 0%, #FD7E14 100%); color: white; box-shadow: 0 4px 16px rgba(240,140,0,0.25); }
.btn-confirm-answer:disabled { background: var(--border-strong); color: var(--text-light); box-shadow: none; }
/* 兼容旧 quiz-footer (不再使用，保留兜底) */
.quiz-footer { display: none; }
.quiz-content { display: none; }

/* ---------- 按钮 ---------- */
.btn { padding: 12px 24px; font-size: 15px; font-weight: 600; border-radius: var(--radius-sm); transition: var(--transition); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:active { background: var(--primary-dark); }
.btn-primary:disabled { background: var(--border-strong); color: var(--text-light); cursor: not-allowed; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); }
.btn-secondary:active { background: var(--border); }

/* ---------- 结果页 ---------- */
#screenResult { display: none; }
#screenResult.active { display: block; }
.result-card { background: var(--card-bg); border-radius: var(--radius-lg); padding: 40px 28px; text-align: center; box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; margin: 40px auto; }
.result-icon { font-size: 64px; margin-bottom: 16px; animation: bounceIn 0.6s ease; }
@keyframes bounceIn { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.result-title { font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.result-title.pass { color: var(--success); }
.result-title.fail { color: var(--danger); }
.result-score { font-size: 48px; font-weight: 900; margin: 16px 0; line-height: 1; }
.result-score.pass { color: var(--success); }
.result-score.fail { color: var(--danger); }
.result-score-unit { font-size: 24px; font-weight: 600; margin-left: 4px; }
.result-detail { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.result-message { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
.result-actions { display: flex; flex-direction: column; gap: 10px; }
.result-actions .btn-large,
.result-actions .btn-primary.btn-large,
.result-actions .btn-secondary.btn-large {
  width: 100%; padding: 14px; font-size: 16px; font-weight: 700;
  border-radius: var(--radius); border: none; cursor: pointer;
  transition: var(--transition); text-align: center;
}

/* ---------- 结业证书 ---------- */
#screenCertificate { display: none; }
#screenCertificate.active { display: block; }
.cert-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.cert-body { background: var(--card-bg); border-radius: var(--radius-lg); padding: 28px; text-align: center; box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; border: 3px solid var(--primary-bg); }
.cert-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; text-align: left; }
.cert-card-header-text h1 { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.cert-card-header-text .subtitle { font-size: 13px; color: var(--text-light); margin: 0; }
.cert-card-header .back-btn { flex-shrink: 0; margin-left: 12px; }
.cert-ribbon { font-size: 56px; margin-bottom: 12px; animation: bounceIn 0.8s ease; }
.cert-title { font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 14px; line-height: 1.4; }
.cert-score { font-size: 40px; font-weight: 900; color: var(--primary); margin-bottom: 16px; }
.cert-message { font-size: 14px; line-height: 1.8; color: var(--text); white-space: pre-line; text-align: center; background: var(--bg); padding: 20px; border-radius: var(--radius-sm); margin-bottom: 20px; }
.cert-signature { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.cert-actions { display: flex; gap: 10px; }
.cert-actions .btn { flex: 1; }

/* ---------- 分享弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.active { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(2px); }
.modal-card { position: relative; width: 100%; max-width: 380px; max-height: 90vh; background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); display: flex; flex-direction: column; align-items: center; overflow: hidden; z-index: 1; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.5); color: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center; z-index: 2; }
.share-loading { padding: 40px; color: var(--text-light); font-size: 14px; }
.share-image-wrap { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: #f1f3f5; display: flex; align-items: center; justify-content: center; flex-shrink: 1; max-height: calc(90vh - 160px); }
.share-image-wrap img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; object-fit: contain; }

/* 分数叠加层 */
.share-score-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; pointer-events: none; overflow: hidden; }
.share-sparkles { position: absolute; inset: 5%; pointer-events: none; }

.share-score-card {
  position: absolute;
  z-index: 3;
  left: var(--card-left, 10%);
  top: var(--card-top, 35%);
  width: var(--card-width, 80%);
  min-height: var(--card-min-height, 60px);
  background: linear-gradient(160deg, rgba(240,248,255,0.97) 0%, rgba(218,236,250,0.97) 100%);
  border: 1px solid rgba(26,95,180,0.12);
  border-radius: 20px;
  padding: 24px 16px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(26,95,180,0.08), 0 1px 4px rgba(26,95,180,0.04), inset 0 1px 0 rgba(255,255,255,0.6);
  backdrop-filter: blur(4px);
  animation: cardReveal 0.6s cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes cardReveal { from { opacity:0; transform:scale(0.92); } to { opacity:1; transform:scale(1); } }

.share-score-label { display: block; font-size: clamp(11px,2.2vw,15px); color: rgba(26,95,180,0.7); font-weight: 500; margin-bottom: 8px; }
.share-score-line { display: flex; align-items: baseline; justify-content: center; gap: 2px; }
.share-score-num { font-size: clamp(42px,10vw,72px); font-weight:800; color:#1a5fb4; line-height:1; min-width:1.2em; text-align:right; }
.share-score-unit { font-size: clamp(14px,3vw,22px); font-weight:600; color:#1a5fb4; }
.share-tip { margin: 12px 0 0; font-size: 13px; color: var(--text-secondary); text-align: center; }

/* ---------- 彩带 ---------- */
.confetti-container { position: fixed; top:0; left:0; width:100%; height:100%; pointer-events: none; z-index:200; overflow:hidden; }
.confetti { position: absolute; width:10px; height:10px; top:-20px; animation: confettiFall linear forwards; }
@keyframes confettiFall { 0%{ transform:translateY(-20px) rotate(0deg); opacity:1; } 100%{ transform:translateY(100vh) rotate(720deg); opacity:0.5; } }

/* ---------- 响应式 ---------- */
@media (min-width: 768px) {
  .hero-title { font-size: 28px; }
  .level-title { font-size: 17px; }
}

/* ---------- 工具类 ---------- */
.hidden { display: none !important; }
