/**
 * 龙湖掌班 · 手机端公共样式（商业级设计系统 v2）
 * 设计语言：主色浅蓝 #4A9EFF / 深蓝 #2B7DE9 / 渐变 135deg / 圆角卡片 / 柔和投影
 * 兼容红线：不用栅格布局 / 宽高比属性 / 毛玻璃滤镜，动画只用 transform+opacity
 */
:root {
  --c-primary: #4A9EFF;
  --c-primary-deep: #2B7DE9;
  --c-grad: linear-gradient(135deg, #5EA8FF, #3D8BFF);
  --c-orange: #FF9F43;
  --c-green: #2ECC71;
  --c-red: #FF5B5B;
  --c-bg: #F5F8FC;
  --c-text: #1F3350;
  --c-text2: #7A8BA6;
  --c-card: #FFFFFF;
  --c-line: #EDF2F9;
  --shadow-card: 0 2px 12px rgba(46, 108, 222, 0.08);
  --shadow-primary: 0 4px 14px rgba(61, 139, 255, 0.32);
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
input, textarea, select, button { font-family: inherit; font-size: inherit; }

.app-wrap { max-width: 640px; margin: 0 auto; min-height: 100%; position: relative; }
.page { padding: 16px 14px 110px; }
.page::after { content: ''; display: block; }

/* SVG 图标基类 */
.ic { width: 24px; height: 24px; display: inline-block; vertical-align: -0.15em; }

/* ---------- 顶部标题栏（渐变 + 白字 + 圆角底部） ---------- */
.page-head {
  display: flex; align-items: center;
  margin: -16px -14px 16px; padding: 14px 14px;
  background: var(--c-grad);
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 14px rgba(61, 139, 255, 0.25);
}
.back-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  color: #fff; margin-right: 4px; cursor: pointer; border-radius: 50%;
}
.back-btn:active { background: rgba(255, 255, 255, 0.18); }
.back-btn .ic { width: 22px; height: 22px; }
.page-title { font-size: 18px; font-weight: 700; color: #fff; flex: 1; letter-spacing: 1px; }

/* ---------- 底部 Tab 导航栏 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 640px; margin: 0 auto;
  background: #fff; display: flex;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(46, 108, 222, 0.10);
  border-top: 1px solid var(--c-line); z-index: 30;
}
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 5px 0 2px; color: #9AA9BF; font-size: 11px; cursor: pointer;
}
.tabbar-item .ic { width: 25px; height: 25px; margin-bottom: 3px; }
.tabbar-item.on { color: var(--c-primary-deep); font-weight: 600; }
.tabbar-item:active .ic { transform: scale(0.88); }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--c-card); border-radius: 14px; padding: 16px;
  box-shadow: var(--shadow-card); margin-bottom: 12px;
}
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--c-text); }
.label { font-size: 13px; color: var(--c-text2); margin-bottom: 8px; }
.hint { font-size: 12px; color: var(--c-text2); line-height: 1.8; margin-top: 8px; }

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 14px; }
.input, .textarea, .select {
  width: 100%; border: 1.5px solid transparent; border-radius: 12px;
  padding: 12px 14px; font-size: 16px; background: #F2F6FB;
  color: var(--c-text); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.16);
  background: #fff;
}
.input::-webkit-input-placeholder, .textarea::-webkit-input-placeholder { color: #A6B4C9; }
.textarea { min-height: 96px; resize: none; line-height: 1.6; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; border: none; border-radius: 12px; cursor: pointer;
  padding: 11px 18px; font-size: 16px; background: #EEF3FA; color: var(--c-text);
  transition: transform 0.12s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--c-grad); color: #fff; font-weight: 600;
  box-shadow: var(--shadow-primary);
}
.btn-primary:active { box-shadow: 0 2px 6px rgba(61, 139, 255, 0.3); }
.btn-danger {
  background: linear-gradient(135deg, #FF7B7B, #FF5B5B); color: #fff;
  box-shadow: 0 4px 12px rgba(255, 91, 91, 0.28);
}
.btn-ghost { background: #fff; border: 1.5px solid #B9D4FF; color: var(--c-primary-deep); }
.btn-big { width: 100%; padding: 14px; font-size: 17px; font-weight: 700; border-radius: 13px; }
.btn-mini { padding: 6px 13px; font-size: 13px; border-radius: 9px; }
.btn[disabled] { background: #C9D6EA; color: #fff; box-shadow: none; transform: none; }

/* ---------- Toast（顶部滑入） ---------- */
.toast {
  position: fixed; top: 0; left: 50%; transform: translate(-50%, 0);
  margin-top: calc(16px + env(safe-area-inset-top));
  background: rgba(31, 51, 80, 0.92); color: #fff;
  padding: 10px 22px; border-radius: 999px; font-size: 14px;
  z-index: 999; max-width: 80%; box-shadow: 0 6px 20px rgba(23, 36, 58, 0.3);
  animation: toastIn 0.28s cubic-bezier(0.2, 1.2, 0.4, 1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -24px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 弹窗（居中模态：遮罩 + 白卡圆角） ---------- */
.mask {
  position: fixed; left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(23, 36, 58, 0.5); z-index: 500;
  display: flex; align-items: center; justify-content: center;
}
.dialog {
  background: #fff; border-radius: 16px; padding: 26px 20px 18px;
  width: 82%; max-width: 340px;
  box-shadow: 0 12px 40px rgba(23, 36, 58, 0.25);
  animation: dialogIn 0.25s cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes dialogIn { from { opacity: 0; transform: scale(0.86) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.dialog-title { font-size: 16px; font-weight: 700; color: var(--c-text); margin-bottom: 18px; text-align: center; line-height: 1.6; }
.dialog-actions { display: flex; }
.dialog-actions .btn { flex: 1; }
.dialog-actions .btn + .btn { margin-left: 10px; }

/* ---------- 登录页 ---------- */
.login-page { padding-top: 7vh; }
.login-head { text-align: center; margin-bottom: 28px; }
.login-logo { font-size: 34px; font-weight: 800; color: var(--c-primary-deep); letter-spacing: 3px; }
.login-slogan { font-size: 13px; color: var(--c-text2); margin-top: 8px; letter-spacing: 1px; }

.tab-bar { display: flex; margin-bottom: 20px; background: #EEF3FA; border-radius: 12px; padding: 4px; }
.tab-item {
  flex: 1; text-align: center; padding: 9px 0; color: var(--c-text2);
  font-size: 15px; border-radius: 9px; cursor: pointer; transition: all 0.2s;
}
.tab-item.active { background: #fff; color: var(--c-primary-deep); font-weight: 700; box-shadow: 0 2px 8px rgba(46, 108, 222, 0.12); }

/* ---------- 科目多选 / 科目色映射 ---------- */
.subject-tags { display: flex; flex-wrap: wrap; }
.subject-tag {
  padding: 8px 16px; margin: 0 10px 10px 0; background: #F2F6FB;
  border-radius: 999px; font-size: 14px; color: var(--c-text2);
  border: 1.5px solid transparent; cursor: pointer; transition: all 0.15s;
}
.subject-tag.on {
  background: var(--c-grad); color: #fff; font-weight: 700;
  box-shadow: 0 3px 10px rgba(61, 139, 255, 0.3); border-color: transparent;
}
/* 科目徽章（胶囊）：数学蓝 / 语文橙 / 英语绿 / 科学紫 / 道法青 / 体育红 / 美术粉 / 音乐金 / 其他灰 */
.subj-math    { background: #EAF3FF; color: #2B7DE9; }
.subj-chinese { background: #FFF3E6; color: #E8862B; }
.subj-english { background: #E9F9F0; color: #1EA55B; }
.subj-science { background: #F1EAFE; color: #7C46E0; }
.subj-moral   { background: #E4F6FA; color: #1291AE; }
.subj-pe      { background: #FFEFEF; color: #E14D4D; }
.subj-art     { background: #FDEFF8; color: #D6489B; }
.subj-music   { background: #FFF8E1; color: #C08A00; }
.subj-other   { background: #EFF3F8; color: #7A8BA6; }

/* ---------- 首页：渐变 Hero ---------- */
.home-hero {
  margin: -16px -14px 16px; padding: 26px 18px 18px;
  background: var(--c-grad);
  border-radius: 0 0 26px 26px; color: #fff;
  box-shadow: 0 6px 20px rgba(61, 139, 255, 0.28);
}
.hero-row { display: flex; justify-content: space-between; align-items: flex-start; }
.hello { font-size: 22px; font-weight: 800; }
.sub { font-size: 13px; color: rgba(255, 255, 255, 0.85); margin-top: 6px; }
.hero-select {
  background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 13px;
  max-width: 150px; outline: none;
}
.hero-select option { color: var(--c-text); }
.hero-status {
  margin-top: 18px; display: flex; align-items: center;
  font-size: 13px; color: rgba(255, 255, 255, 0.95);
}
.hero-cam {
  margin-left: auto; background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 999px;
  padding: 5px 13px; display: flex; align-items: center; cursor: pointer;
}
.hero-cam:active { transform: scale(0.95); }
.hero-cam .ic { width: 15px; height: 15px; margin-right: 5px; }

/* ---------- 首页：功能入口 ---------- */
.home-tiles { display: flex; flex-wrap: wrap; justify-content: space-between; }
.home-btn {
  width: 48.5%; background: #fff; border-radius: 16px; padding: 24px 12px 20px;
  text-align: center; margin-bottom: 12px; box-shadow: var(--shadow-card);
  cursor: pointer; transition: transform 0.15s;
}
.home-btn:active { transform: scale(0.96); }
.home-btn .ic { width: 34px; height: 34px; margin-bottom: 9px; }
.home-btn .home-name { font-size: 16px; font-weight: 700; color: var(--c-text); }
.home-btn.c-blue .ic { color: var(--c-primary-deep); }
.home-btn.c-orange .ic { color: var(--c-orange); }
.home-btn.c-green .ic { color: var(--c-green); }
.home-btn.c-purple .ic { color: #9B59F5; }
.home-btn.c-cyan .ic { color: #17A2B8; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #C0C8D2; margin-right: 6px; }
.dot.on { background: #4DE08A; box-shadow: 0 0 6px rgba(77, 224, 138, 0.9); }

/* ---------- 空状态（SVG 插画式图标 + 提示文字） ---------- */
.empty-box { text-align: center; padding: 38px 16px; }
.empty-ic, .empty-box .ic { width: 56px; height: 56px; color: #C7D6EC; margin-bottom: 14px; }
.empty-text { color: var(--c-text2); font-size: 14px; margin-bottom: 18px; line-height: 1.7; }
.empty-box .btn { margin: 0 auto; }

/* ---------- 点名页 ---------- */
.mode-row { display: flex; margin: 0 -4px 14px; }
.mode-card {
  flex: 1; background: #fff; border-radius: 16px; padding: 20px 8px 16px;
  text-align: center; border: 2px solid transparent; box-shadow: var(--shadow-card);
  margin: 0 4px; cursor: pointer; transition: border-color 0.2s, transform 0.15s;
}
.mode-card:active { transform: scale(0.97); }
.mode-card.on { border-color: var(--c-primary); background: #F5FAFF; }
.mode-card .ic { width: 38px; height: 38px; color: #A9B9D2; margin-bottom: 8px; }
.mode-card.on .ic { color: var(--c-primary-deep); }
.mode-name { font-size: 16px; font-weight: 700; margin-top: 2px; }
.mode-desc { font-size: 12px; color: var(--c-text2); margin-top: 4px; }

.count-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 14px; padding: 14px 16px;
  margin-bottom: 12px; box-shadow: var(--shadow-card);
  font-size: 15px;
}
.count-val { font-size: 26px; font-weight: 800; color: var(--c-primary-deep); min-width: 44px; text-align: center; }
.step-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: #EEF3FA; font-size: 20px; color: var(--c-primary-deep);
  cursor: pointer; transition: transform 0.12s;
}
.step-btn:active { transform: scale(0.9); background: #DDE9FB; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 14px; padding: 14px 16px;
  margin-bottom: 12px; box-shadow: var(--shadow-card); font-size: 15px;
}
.switch {
  width: 52px; height: 30px; border-radius: 15px; background: #D5DCE8;
  position: relative; transition: background 0.2s; cursor: pointer; flex-shrink: 0;
}
.switch::after {
  content: ''; position: absolute; left: 2px; top: 2px; width: 26px; height: 26px;
  border-radius: 50%; background: #fff; transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(23, 36, 58, 0.25);
}
.switch.on { background: var(--c-primary); }
.switch.on::after { transform: translateX(22px); }

.roll-result {
  background: var(--c-grad); border-radius: 16px; padding: 24px 16px;
  text-align: center; margin-bottom: 14px;
  box-shadow: var(--shadow-primary); position: relative; overflow: hidden;
}
.roll-result::before, .roll-result::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.14);
}
.roll-result::before { width: 90px; height: 90px; right: -30px; top: -30px; }
.roll-result::after { width: 60px; height: 60px; left: -20px; bottom: -20px; }
.roll-result .names { font-size: 30px; font-weight: 800; color: #fff; line-height: 1.5; word-break: break-all; }
.roll-result .tip { font-size: 13px; color: rgba(255, 255, 255, 0.85); margin-top: 8px; }

/* ---------- 作业页 ---------- */
.hw-subject-row { display: flex; flex-wrap: wrap; margin: 0 -5px 12px; }
.hw-subject-row .subject-tag { margin: 0 5px 8px; }
.hw-item {
  background: #fff; border-radius: 14px; padding: 14px 15px; margin-bottom: 10px;
  box-shadow: var(--shadow-card); border-left: 4px solid #E4EBF5;
}
.hw-item.pin { border-left-color: #F5B84D; }
.hw-item.revoked { opacity: 0.5; }
.hw-line { display: flex; align-items: center; }
.hw-subject { font-size: 13px; font-weight: 700; border-radius: 999px; padding: 3px 11px; }
.pin-flag {
  display: inline-block; font-size: 12px; font-weight: 700; color: #B07A00;
  background: linear-gradient(135deg, #FFE3A6, #FFD066); border-radius: 999px;
  padding: 3px 10px; margin-left: 8px;
}
.hw-content { font-size: 15px; margin: 8px 0; word-break: break-all; line-height: 1.65; color: var(--c-text); }
.hw-meta { font-size: 12px; color: #A6B4C9; display: flex; justify-content: space-between; }
.hw-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- 喊话页 ---------- */
.tpl-row { display: flex; flex-wrap: wrap; margin: 0 -4px 12px; }
.tpl-tag {
  background: #EAF3FF; color: #2B7DE9; border-radius: 999px;
  padding: 7px 14px; font-size: 13px; margin: 0 4px 8px; cursor: pointer;
  border: 1px solid #D6E8FF; transition: transform 0.12s;
}
.tpl-tag:active { transform: scale(0.95); }
.style-row { display: flex; background: #EEF3FA; border-radius: 12px; padding: 4px; }
.style-btn {
  flex: 1; padding: 10px; border-radius: 9px; border: none;
  background: transparent; font-size: 14px; color: var(--c-text2); cursor: pointer;
  transition: all 0.2s;
}
.style-btn.on {
  background: #fff; color: var(--c-primary-deep); font-weight: 700;
  box-shadow: 0 2px 8px rgba(46, 108, 222, 0.12);
}

/* 按住说话：大圆钮 + 呼吸动画 */
.speak-wrap { text-align: center; padding: 10px 0 4px; }
.speak-btn {
  width: 136px; height: 136px; border-radius: 50%; border: none;
  background: var(--c-grad); color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; box-shadow: 0 8px 26px rgba(61, 139, 255, 0.42);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none; transition: transform 0.15s;
}
.speak-btn .ic { width: 36px; height: 36px; margin-bottom: 9px; }
.speak-btn.speaking {
  background: linear-gradient(135deg, #FF7B7B, #FF5B5B);
  box-shadow: 0 8px 26px rgba(255, 91, 91, 0.42);
  animation: speakPulse 1.1s ease-in-out infinite;
}
@keyframes speakPulse { 0% { transform: scale(1); } 50% { transform: scale(1.07); } 100% { transform: scale(1); } }
.speak-btn[disabled] { background: #C9D6EA; box-shadow: none; }
.voice-tip { font-size: 12px; color: var(--c-text2); text-align: center; margin-top: 14px; line-height: 1.8; }
.dismiss-btn { margin-top: 12px; }

/* ---------- 历史页 ---------- */
.his-tabs { display: flex; background: #EEF3FA; border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.his-tab {
  flex: 1; text-align: center; padding: 9px 0; font-size: 14px;
  color: var(--c-text2); border-radius: 9px; cursor: pointer; transition: all 0.2s;
}
.his-tab.on { background: #fff; color: var(--c-primary-deep); font-weight: 700; box-shadow: 0 2px 8px rgba(46, 108, 222, 0.12); }
.his-item {
  background: #fff; border-radius: 14px; padding: 13px 15px; margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}
.his-item .h-top {
  display: flex; justify-content: space-between; font-size: 12px;
  color: #A6B4C9; margin-bottom: 8px;
}
.his-item .h-content { font-size: 15px; word-break: break-all; line-height: 1.65; }
.his-item .h-tag {
  display: inline-block; font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 2px 9px; margin-right: 6px;
  background: #EAF3FF; color: #2B7DE9;
}
.h-tag.warn { background: #FFEFEF; color: #E14D4D; }
.status-card .s-row {
  display: flex; justify-content: space-between; padding: 10px 0;
  font-size: 15px; border-bottom: 1px solid var(--c-line);
}
.status-card .s-row:last-child { border-bottom: none; }
.load-more {
  text-align: center; color: var(--c-primary-deep); font-size: 14px;
  padding: 12px 0; cursor: pointer;
}

/* ---------- 看教室页 ---------- */
.camera-page { padding: 16px 14px 40px; }
.camera-video-wrap {
  background: #10151D; border-radius: 16px; overflow: hidden; position: relative;
  min-height: 300px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
}
.camera-video-wrap video { width: 100%; display: block; }
.camera-tip { color: var(--c-text2); text-align: center; padding: 60px 20px; font-size: 15px; line-height: 2; }
.camera-notice {
  font-size: 12px; color: #A6B4C9; text-align: center; margin-top: 12px;
  background: #EEF3FA; border-radius: 10px; padding: 9px 12px;
}

/* ---------- 班级管理页 ---------- */
.mgr-section {
  background: #fff; border-radius: 14px; padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow-card);
}
.code-show {
  font-size: 32px; font-weight: 800; letter-spacing: 7px;
  color: var(--c-primary-deep); padding: 8px 0 14px;
}
.member-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--c-line);
}
.member-item:last-child { border-bottom: none; }
.member-name { font-size: 15px; font-weight: 600; }
.member-sub { font-size: 12px; color: #A6B4C9; margin-top: 3px; }
.role-tag { font-size: 12px; border-radius: 999px; padding: 2px 9px; background: #EAF3FF; color: #2B7DE9; font-weight: 600; }
.role-tag.owner { background: #FFF3E6; color: #E8862B; }
.student-item {
  display: flex; align-items: center; padding: 9px 0;
  border-bottom: 1px solid var(--c-line); font-size: 15px;
}
.student-item:last-child { border-bottom: none; }
.student-no { color: #A6B4C9; width: 36px; font-size: 13px; }
.student-name { flex: 1; }
.screen-bind-row { display: flex; }
.screen-bind-row .input { flex: 1; }
.screen-bind-row .btn { margin-left: 10px; }

/* ---------- 我的页 ---------- */
.me-head { text-align: center; padding: 28px 0 20px; }
.me-avatar {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--c-grad); color: #fff; font-size: 30px;
  line-height: 76px; margin: 0 auto 14px;
  box-shadow: 0 8px 22px rgba(61, 139, 255, 0.35);
}
.me-name { font-size: 20px; font-weight: 800; }
.me-sub { font-size: 13px; color: var(--c-text2); margin-top: 5px; }
