/* ============ 基础变量 ============ */
:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-soft: #dbeafe;
  --star-gold: #f59e0b;
  --star-gold-soft: #fef3c7;
  --warm-orange: #fb923c;
  --success: #10b981;
  --success-soft: #d1fae5;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f1f5f9;
  --bg-soft: #f8fafc;
  --card: #ffffff;
  --text: #1f2937;
  --text-soft: #6b7280;
  --text-light: #64748b;
  --border: #e5e7eb;
  --shadow: 0 6px 18px rgba(30,58,138,0.07);
  --shadow-hover: 0 12px 30px rgba(30,58,138,0.13);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  /* z-index 层级规范：组件内堆叠用 2~50，全局浮层用以下变量 */
  --z-header: 10;
  --z-modal: 9000;
  --z-toast: 9999;
}

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

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: inherit; }
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }

/* ============ 登录页 ============ */
.page { display: none; }
.page.active { display: block; }

.login-page {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #3b82f6 100%);
  display: none; align-items: center; justify-content: center;
  overflow: hidden;
}
.login-page.active { display: flex; }
.login-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(1px 1px at 60% 70%, white, transparent),
    radial-gradient(1.5px 1.5px at 80% 20%, white, transparent),
    radial-gradient(1px 1px at 40% 80%, white, transparent),
    radial-gradient(2px 2px at 90% 60%, #fef3c7, transparent),
    radial-gradient(1px 1px at 15% 60%, white, transparent),
    radial-gradient(1.5px 1.5px at 70% 45%, #fef3c7, transparent);
  background-size: 100% 100%;
  opacity: 0.7;
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.4; } to { opacity: 0.9; } }

.login-card {
  position: relative; z-index: 2;
  background: rgba(255,255,255,0.97);
  border-radius: 16px;
  padding: 40px 50px;
  width: 720px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 30px; }
.logo-star {
  display: inline-block;
  font-size: 36px;
  color: var(--star-gold);
  text-shadow: 0 0 12px rgba(245,158,11,0.4);
  margin-bottom: 8px;
}
.login-logo h1 {
  font-size: 26px; color: var(--primary);
  letter-spacing: 2px; margin-bottom: 6px;
}
.slogan { color: var(--text-soft); font-size: 14px; letter-spacing: 1px; }

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.role-grid .role-card:nth-child(4) { grid-column: 1 / 2; }
.role-grid .role-card:nth-child(5) { grid-column: 3 / 4; }

.role-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.role-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(59,130,246,0.2);
}
.role-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef6ff, #fff7df);
  color: #1f2937;
  font-size: 30px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.role-name { font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.role-desc { color: var(--text-soft); font-size: 12px; }
.login-footer { text-align: center; color: var(--text-light); font-size: 12px; }
.login-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 14px;
  color: var(--text-soft);
  font-size: 12px;
}
.mobile-demo-btn,
.device-toggle {
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.18);
}
.mobile-demo-btn:hover,
.device-toggle:hover {
  filter: brightness(1.05);
}

/* ============ 主应用布局 ============ */
.main-app { display: none; height: 100vh; flex-direction: column; }
.main-app.active { display: flex; }

.app-header {
  height: 60px;
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 100%);
  color: white;
  display: flex; align-items: center;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: var(--z-header);
}
.header-left { display: flex; align-items: center; gap: 24px; flex: 1; }
.header-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.header-logo .logo-star { font-size: 22px; color: var(--star-gold); margin: 0; }
.breadcrumb { color: rgba(255,255,255,0.85); font-size: 14px; }
.header-center { flex: 0; }
.role-switcher {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 4px;
}
.role-switcher button {
  color: rgba(255,255,255,0.85);
  padding: 6px 16px;
  border-radius: 16px;
  font-size: 13px;
  transition: all 0.2s;
}
.role-switcher button.active {
  background: white;
  color: var(--primary);
  font-weight: 600;
}
.role-switcher button:not(.active):hover { background: rgba(255,255,255,0.1); }

.header-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.device-toggle {
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: none;
  padding: 6px 12px;
}
.notify-icon {
  position: relative; cursor: pointer; font-size: 12px;
  background: rgba(255,255,255,0.12);
  padding: 6px 10px;
  border-radius: 14px;
}
.notify-icon .badge {
  position: absolute; top: -6px; right: -8px;
  background: var(--star-gold);
  color: white; font-size: 10px;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--star-gold);
  color: white; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.user-meta { font-size: 12px; line-height: 1.3; }
.user-name { font-weight: 600; }
.user-role { opacity: 0.85; font-size: 11px; }

.app-body { flex: 1; display: flex; overflow: hidden; }
.mobile-role-bar,
.mobile-bottom-nav {
  display: none;
}

body.mobile-demo {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 12%, rgba(245,158,11,0.18), transparent 22%),
    linear-gradient(135deg, #0f172a, #1e3a8a 48%, #eef4fb 48%, #eef4fb);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
body.mobile-demo .main-app.active {
  position: relative;
  width: min(430px, calc(100vw - 24px));
  height: min(900px, calc(100vh - 48px));
  max-height: 900px;
  border-radius: 30px;
  overflow: hidden;
  border: 10px solid #111827;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  background: #eef4fb;
}
body.mobile-demo .main-app.active::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 92px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: #111827;
  z-index: 50;
}
body.mobile-demo .app-header {
  height: 56px;
  min-height: 56px;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 8px 12px;
  position: sticky;
  top: 0;
}
body.mobile-demo .header-left,
body.mobile-demo .header-right {
  flex: 1;
}
body.mobile-demo .breadcrumb,
body.mobile-demo .notify-icon,
body.mobile-demo .header-center,
body.mobile-demo .device-toggle {
  display: none;
}
body.mobile-demo .header-logo span:last-child {
  font-size: 15px;
}
body.mobile-demo .user-avatar {
  width: 30px;
  height: 30px;
}
body.mobile-demo .user-meta {
  display: none;
}
body.mobile-demo .mobile-role-bar {
  display: block;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  position: sticky;
  top: 56px;
  z-index: 9;
}
body.mobile-demo .mobile-role-scroll {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
body.mobile-demo .mobile-role-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 6px 4px;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text-soft);
  border: 1px solid var(--border);
}
body.mobile-demo .mobile-role-chip span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e0ecff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
body.mobile-demo .mobile-role-chip b {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
body.mobile-demo .mobile-role-chip.active {
  border-color: var(--primary-light);
  background: linear-gradient(135deg, #eff6ff, #fff7ed);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}
body.mobile-demo .app-body {
  display: block;
  overflow: auto;
}
body.mobile-demo .sidebar {
  display: none;
}
body.mobile-demo .content {
  padding: 16px;
  padding-bottom: 88px;
  overflow: visible;
}
body.mobile-demo .mobile-bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  padding: 8px;
  background: rgba(255,255,255,0.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(10px);
}
body.mobile-demo .mobile-bottom-nav button {
  position: relative;
  display: flex;
  min-height: 48px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 8px;
  color: var(--text-soft);
}
body.mobile-demo .mobile-bottom-nav button span {
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}
body.mobile-demo .mobile-bottom-nav button b {
  font-size: 11px;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.mobile-demo .mobile-bottom-nav button.active {
  background: var(--primary-soft);
  color: var(--primary);
}
body.mobile-demo .mobile-bottom-nav button em {
  position: absolute;
  top: 3px;
  right: 16px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--star-gold);
  color: white;
  font-size: 10px;
  font-style: normal;
  line-height: 16px;
}
body.mobile-demo .grid-2,
body.mobile-demo .grid-2-1,
body.mobile-demo .grid-1-2,
body.mobile-demo .audit-layout,
body.mobile-demo .reward-grid,
body.mobile-demo .coupon-admin-grid,
body.mobile-demo .coupon-list {
  grid-template-columns: 1fr;
}
/* 移动端指标卡：紧凑双列小卡片，避免一行一个数值占位 */
body.mobile-demo .metric-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
body.mobile-demo .metric-card { padding: 14px 12px; }
body.mobile-demo .metric-card::before {
  width: 44px; height: 44px;
  transform: translate(16px, -16px);
}
body.mobile-demo .metric-label { font-size: 11px; margin-bottom: 4px; }
body.mobile-demo .metric-value { font-size: 22px; }
body.mobile-demo .metric-extra { font-size: 11px; margin-top: 4px; }
body.mobile-demo .form-row-flex,
body.mobile-demo .student-summary,
body.mobile-demo .audit-actions {
  flex-direction: column;
  align-items: stretch;
}
/* 移动端演示：弹窗以底部抽屉形式贴合手机框 */
body.mobile-demo .modal-mask {
  align-items: flex-end;
  padding: 24px;
}
body.mobile-demo .modal-box {
  width: min(410px, calc(100vw - 48px));
  max-width: 410px;
  max-height: 72vh;
  border-radius: 22px;
  padding: 20px;
}
body.mobile-demo .modal-mask.active .modal-box { animation: sheetUp .26s ease; }
body.mobile-demo .modal-footer .btn { flex: 1; }
body.mobile-demo .scan-row {
  flex: auto !important;
}
body.mobile-demo .summary-numbers,
body.mobile-demo .profile-stats {
  width: 100%;
  grid-template-columns: repeat(3, 1fr);
}
body.mobile-demo .profile-stats {
  display: grid;
  gap: 10px;
}
body.mobile-demo .page-header {
  display: block;
  margin-bottom: 14px;
}
body.mobile-demo .page-header .btn {
  margin-top: 10px;
}
body.mobile-demo .page-title {
  font-size: 20px;
}
body.mobile-demo .profile-hero {
  padding: 18px;
  gap: 14px;
  flex-wrap: wrap;
}
body.mobile-demo .profile-avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 26px;
}
body.mobile-demo .profile-info h2 {
  font-size: 20px;
}
body.mobile-demo .profile-stat .num {
  font-size: 22px;
}
body.mobile-demo .chart-box {
  height: 230px;
}
body.mobile-demo .mobile-card-table thead {
  display: none;
}
body.mobile-demo .mobile-card-table,
body.mobile-demo .mobile-card-table tbody,
body.mobile-demo .mobile-card-table tr,
body.mobile-demo .mobile-card-table td {
  display: block;
  width: 100%;
}
body.mobile-demo .mobile-card-table tr {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--bg-soft);
}
body.mobile-demo .mobile-card-table td {
  border-bottom: 0;
  padding: 3px 0;
}

/* ============ 侧边栏 ============ */
.sidebar {
  width: 220px;
  background: white;
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-group { margin-bottom: 16px; }
.sidebar-title {
  padding: 8px 24px;
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 1px;
}
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.menu-item:hover { background: var(--bg-soft); }
.menu-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}
.menu-item .menu-icon { font-size: 16px; width: 18px; text-align: center; }
.menu-item .menu-badge {
  margin-left: auto;
  background: var(--star-gold);
  color: white; font-size: 10px;
  padding: 1px 6px; border-radius: 8px;
}

/* ============ 主内容 ============ */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}
.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px;
}
.page-title { font-size: 22px; color: var(--primary); font-weight: 600; }
.page-subtitle { color: var(--text-soft); font-size: 13px; margin-top: 4px; }

/* 通用卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.card-header-right { display: flex; align-items: center; gap: 10px; }
.card-title { font-size: 16px; font-weight: 600; color: var(--text); }
.card-title small { color: var(--text-soft); font-weight: normal; font-size: 12px; margin-left: 8px; }

/* 指标卡片 */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.metric-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.metric-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  background: var(--primary-soft);
  border-radius: 50%;
  transform: translate(20px, -20px);
}
.metric-card.gold::before { background: var(--star-gold-soft); }
.metric-card.green::before { background: var(--success-soft); }
.metric-card.purple::before { background: #ede9fe; }

.metric-label { color: var(--text-soft); font-size: 12px; margin-bottom: 8px; }
.metric-value {
  font-size: 28px; font-weight: 600; color: var(--primary);
  line-height: 1.2;
}
.metric-card.gold .metric-value { color: var(--star-gold); }
.metric-card.green .metric-value { color: var(--success); }
.metric-card.purple .metric-value { color: #7c3aed; }

.metric-extra { color: var(--text-soft); font-size: 12px; margin-top: 6px; }
.metric-extra .up { color: var(--success); }
.metric-extra .down { color: var(--danger); }

/* 网格布局 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }

/* 按钮 */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s;
}
.btn:hover { background: var(--primary-light); }
.btn.btn-gold { background: var(--star-gold); }
.btn.btn-gold:hover { background: #d97706; }
.btn.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn.btn-outline:hover { background: var(--primary-soft); }
.btn.btn-success { background: var(--success); }
.btn.btn-success:hover { background: #059669; }
.btn.btn-danger { background: var(--danger); }
.btn.btn-ghost {
  background: var(--bg-soft);
  color: var(--text);
}
.btn.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn.full-width, .full-width { width: 100%; justify-content: center; }
.btn:disabled, .btn.btn-ghost { opacity: 0.65; cursor: not-allowed; }

/* 表单 */
.form-row { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: white;
  font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.form-hint.warn { color: var(--warning); }

.form-row-flex { display: flex; gap: 12px; }
.form-row-flex .form-row { flex: 1; margin-bottom: 0; }
.scan-row { flex: 0 0 110px !important; }
.compact-select { max-width: 210px; }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th, .data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.data-table th {
  background: var(--bg-soft);
  color: var(--text-soft);
  font-weight: 500;
}
.data-table tr:hover td { background: var(--bg-soft); }

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}
.tag.tag-success { background: var(--success-soft); color: var(--success); }
.tag.tag-warning { background: var(--star-gold-soft); color: #b45309; }
.tag.tag-danger { background: #fee2e2; color: var(--danger); }
.tag.tag-default { background: #f3f4f6; color: var(--text-soft); }
.tag.tag-gold { background: var(--star-gold-soft); color: var(--star-gold); }

/* Tabs */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tabs .tab {
  padding: 8px 16px;
  border-bottom: 2px solid transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.tabs .tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.tabs .tab:hover:not(.active) { color: var(--text); }
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--bg-soft);
  font-size: 11px;
  color: var(--text-soft);
}

/* 成长时间轴 */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--star-gold), var(--primary-light), transparent);
}
.timeline-item {
  position: relative;
  padding-bottom: 16px;
}
.timeline-item::before {
  content: '✦';
  position: absolute;
  left: -20px; top: 2px;
  color: var(--star-gold);
  font-size: 14px;
  background: var(--bg);
  width: 14px; text-align: center;
}
.timeline-meta { color: var(--text-soft); font-size: 12px; margin-bottom: 4px; }
.timeline-title { font-weight: 500; margin-bottom: 4px; }
.timeline-body { color: var(--text-soft); font-size: 13px; }
.timeline-tags { margin-top: 4px; }

/* 德育券卡片 */
.coupon-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.coupon-card {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-radius: var(--radius-sm);
  padding: 16px;
  position: relative;
  border: 1px dashed #d97706;
  text-align: center;
}
.coupon-card.small {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: var(--primary-light);
}
.coupon-card-title { font-size: 16px; font-weight: 600; color: #b45309; margin-bottom: 4px; }
.coupon-card.small .coupon-card-title { color: var(--primary); }
.coupon-card-desc { font-size: 11px; color: var(--text-soft); margin-bottom: 6px; }
.coupon-card-count {
  display: inline-block;
  background: rgba(255,255,255,0.7);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  color: #92400e;
}

/* 待办列表 */
.todo-list { list-style: none; }
.todo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.todo-item:last-child { border-bottom: none; }
.todo-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--star-gold);
  flex-shrink: 0;
}
.todo-text { flex: 1; font-size: 13px; }
.todo-time { color: var(--text-soft); font-size: 12px; }

/* 学生卡片 */
.student-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.student-card:hover { background: var(--primary-soft); }
.student-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary-light);
  color: white; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.student-avatar.big {
  width: 56px;
  height: 56px;
  font-size: 22px;
}
.student-info { flex: 1; }
.student-name { font-weight: 500; }
.student-meta { font-size: 11px; color: var(--text-soft); }
.student-points {
  font-size: 18px;
  color: var(--star-gold);
  font-weight: 600;
}

/* 关键词云 */
.word-cloud {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  padding: 20px;
}
.word-cloud span {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
}
.word-cloud span.lg { font-size: 20px; font-weight: 600; background: var(--star-gold-soft); color: #b45309; }
.word-cloud span.md { font-size: 16px; background: #e0e7ff; color: #4f46e5; }
.word-cloud span.sm { font-size: 12px; opacity: 0.7; }

/* 学生画像顶部卡片 */
.profile-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 60%, #f59e0b 100%);
  border-radius: var(--radius);
  padding: 24px;
  color: white;
  display: flex; align-items: center; gap: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: '✦';
  position: absolute; right: 20px; top: 20px;
  font-size: 80px;
  opacity: 0.2;
}
.profile-hero::after {
  content: '✦';
  position: absolute; right: 100px; bottom: 10px;
  font-size: 40px;
  opacity: 0.15;
}
.profile-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: white;
  color: var(--primary);
  font-size: 32px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.profile-info h2 { font-size: 22px; margin-bottom: 6px; }
.profile-info .title { background: rgba(255,255,255,0.2); padding: 2px 10px; border-radius: 10px; font-size: 12px; display: inline-block; margin-right: 6px; }
.profile-stats { display: flex; gap: 32px; margin-left: auto; z-index: 2; }
.profile-stat { text-align: center; }
.profile-stat .num { font-size: 28px; font-weight: 600; }
.profile-stat .lab { font-size: 12px; opacity: 0.9; }

/* 奖励卡片 */
.reward-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.reward-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  transition: all 0.2s;
}
.reward-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.reward-icon {
  width: 60px; height: 60px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--star-gold-soft);
  color: var(--star-gold);
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
}
.reward-name { font-weight: 600; margin-bottom: 4px; }
.reward-type { font-size: 11px; color: var(--text-soft); margin-bottom: 12px; }
.reward-cost {
  font-size: 18px; color: var(--star-gold); font-weight: 600;
  margin-bottom: 12px;
}

/* Toast */
#toast-container {
  position: fixed; top: 80px; right: 20px;
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: white;
  border-left: 4px solid var(--success);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  min-width: 240px;
  animation: slideIn 0.3s ease-out;
}
.toast.warn { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--primary-light); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast .icon { font-size: 18px; }

/* Modal */
.modal-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: var(--z-modal);
  align-items: center; justify-content: center;
}
.modal-mask.active { display: flex; }
.modal-box {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-title {
  font-size: 18px; font-weight: 600; color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* 审核确认弹窗：头部 / 摘要 */
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
}
.modal-head-success .modal-head-icon { color: var(--success); background: var(--success-soft); }
.modal-head-danger .modal-head-icon { color: var(--danger); background: #fee2e2; }
.modal-head-detail { align-items: center; }
.modal-head-main { flex: 1; min-width: 0; }
.audit-modal-footer { justify-content: flex-end; }
.modal-title-plain {
  margin: 2px 0 0;
  padding: 0;
  border: none;
}
.modal-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft);
  font-weight: normal;
}
.audit-confirm-summary {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.acs-row {
  display: flex;
  gap: 12px;
  font-size: 13px;
  line-height: 1.7;
}
.acs-row + .acs-row { margin-top: 4px; }
.acs-label { flex: 0 0 64px; color: var(--text-soft); }
.acs-value { flex: 1; color: var(--text); font-weight: 500; }
.form-optional { color: var(--text-light); font-weight: normal; font-size: 12px; }

/* 大券合成动画 */
.combine-modal { text-align: center; padding: 30px; }
.combine-modal .combine-icon {
  font-size: 60px; color: var(--star-gold);
  animation: bounce 0.8s ease-out infinite alternate;
}
@keyframes bounce { from { transform: scale(1); } to { transform: scale(1.15); } }
.combine-title { font-size: 20px; margin: 12px 0; color: var(--primary); }
.combine-desc { color: var(--text-soft); margin-bottom: 20px; }

/* 报告卡片 */
.report-card {
  background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
  border: 1px dashed #d97706;
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
  color: #78350f;
  font-size: 14px;
}

/* 雷达图 / 折线图容器 */
.chart-box { width: 100%; height: 280px; }
.chart-box.lg { height: 320px; }
.chart-box.sm { height: 200px; }

/* ============ Demo 增强组件 ============ */
.demo-step {
  margin: 4px 16px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.demo-step:hover,
.demo-step.active {
  background: var(--star-gold-soft);
  color: #92400e;
  font-weight: 600;
}

.inline-title {
  margin: 18px 0 10px;
}

.student-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff, #f8fbff);
}
.student-summary-info {
  min-width: 130px;
}
.student-summary-info h3 {
  color: var(--primary);
  font-size: 18px;
}
.student-summary-info p {
  color: var(--text-soft);
  font-size: 12px;
}
.summary-numbers {
  margin-left: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 10px;
}
.summary-numbers div {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  text-align: center;
}
.summary-numbers b {
  display: block;
  font-size: 20px;
  color: var(--star-gold);
}
.summary-numbers span {
  display: block;
  color: var(--text-soft);
  font-size: 11px;
}

.audit-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: start;
}
.audit-list,
.audit-history {
  min-height: 520px;
}
.card-hint {
  font-size: 12px;
  color: var(--text-soft);
}
.audit-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  background: white;
  cursor: pointer;
  transition: all 0.15s;
}
.audit-item:hover,
.audit-item.active {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  background: #f8fbff;
}
.audit-item:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}
.audit-item.is-pending {
  border-left: 3px solid var(--star-gold);
}
.audit-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.audit-meta {
  color: var(--text-soft);
  font-size: 12px;
  margin-bottom: 6px;
}
.audit-content {
  color: var(--text-soft);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.audit-item-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
}
.audit-foot-time { color: var(--text-light); }
.audit-foot-cta { color: var(--primary-light); font-weight: 600; }
.audit-item.is-pending .audit-foot-cta { color: var(--star-gold); }
.audit-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.detail-block {
  margin-bottom: 16px;
}
.detail-label {
  color: var(--text-soft);
  font-size: 12px;
  margin-bottom: 6px;
}
.attachment-placeholder {
  border: 1px dashed #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.camera-capture {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed #93c5fd;
  background: linear-gradient(135deg, #eff6ff 0%, #fff7ed 100%);
  color: #1d4ed8;
  border-radius: var(--radius);
  padding: 32px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  margin-bottom: 10px;
}
.camera-capture:hover {
  border-color: #2563eb;
  background: #dbeafe;
  transform: translateY(-1px);
}
.camera-capture-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .3);
}

.dial-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0 4px;
}
.dial-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dial-name {
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.dial-sub {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 400;
}
.dial-number {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text);
  min-height: 34px;
}
.dial-pad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  gap: 10px;
  margin: 6px 0 10px;
}
.dial-key {
  width: 64px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
}
.dial-key:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.dial-actions {
  display: flex;
  gap: 10px;
}

.insight-box {
  background: linear-gradient(135deg, #eff6ff 0%, #fff7ed 100%);
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--star-gold);
  border-radius: var(--radius);
  padding: 14px;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.7;
  margin-top: 12px;
}
.soft-copy {
  color: var(--text-soft);
  font-size: 12px;
  margin-top: 12px;
}
.progress-line {
  margin-bottom: 14px;
}
.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.progress-head b {
  color: var(--primary);
}

.coupon-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.rule-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  padding: 14px;
}
.rule-card-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.small-coupon-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.small-coupon-wrap span {
  background: white;
  border: 1px solid var(--border);
  color: var(--text-soft);
  border-radius: 14px;
  padding: 3px 8px;
  font-size: 12px;
}

.reward-desc {
  min-height: 42px;
  color: var(--text-soft);
  font-size: 12px;
  margin-bottom: 12px;
}
.mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.mini-row:last-child { border-bottom: 0; }

.bar-fallback,
.radar-fallback {
  padding: 16px 4px;
}
.bar-row,
.radar-axis {
  display: grid;
  grid-template-columns: 86px 1fr 42px;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--text-soft);
  font-size: 12px;
}
.bar-track {
  height: 12px;
  border-radius: 6px;
  background: #e5e7eb;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary-light), var(--star-gold));
}
.bar-row b,
.radar-axis b {
  color: var(--primary);
}

/* 同行锦囊卡片 */
.tip-list { display: flex; flex-direction: column; }
.tip-card {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid #7c3aed;
}
.tip-card .tip-title { font-weight: 600; color: #5b21b6; margin-bottom: 6px; }
.tip-card .tip-body { color: #4c1d95; font-size: 13px; line-height: 1.6; }

/* 进度条 */
.progress {
  height: 8px;
  background: var(--bg-soft);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--star-gold));
  border-radius: 4px;
}

/* 状态点 */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 4px;
}
.status-dot.warn { background: var(--warning); }
.status-dot.danger { background: var(--danger); }

/* 空状态 */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--text-soft);
}
.empty-state .icon { font-size: 48px; opacity: 0.4; margin-bottom: 8px; }
.empty-state .msg { font-size: 14px; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 1120px) {
  .role-grid,
  .metric-grid,
  .reward-grid,
  .coupon-list {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2,
  .grid-2-1,
  .grid-1-2,
  .audit-layout {
    grid-template-columns: 1fr;
  }
  .profile-stats {
    margin-left: 0;
  }
  .profile-hero {
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  body {
    background: #eef4fb;
  }
  .app-header {
    height: 56px;
    min-height: 56px;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 12px;
    position: sticky;
    top: 0;
  }
  .header-left,
  .header-right {
    flex: 1;
  }
  .breadcrumb { display: none; }
  .header-logo span:last-child { font-size: 15px; }
  .notify-icon { display: none; }
  .user-avatar {
    width: 30px;
    height: 30px;
  }
  .user-meta {
    display: none;
  }
  .header-center {
    display: none;
  }
  .mobile-role-bar {
    display: block;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 8px 10px;
    position: sticky;
    top: 56px;
    z-index: 9;
  }
  .mobile-role-scroll {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .mobile-role-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 38px;
    padding: 6px 4px;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text-soft);
    border: 1px solid var(--border);
  }
  .mobile-role-chip span {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e0ecff;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
  }
  .mobile-role-chip b {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
  }
  .mobile-role-chip.active {
    border-color: var(--primary-light);
    background: linear-gradient(135deg, #eff6ff, #fff7ed);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
  }
  .app-body {
    display: block;
    overflow: auto;
  }
  .sidebar {
    display: none;
  }
  .content {
    padding: 16px;
    padding-bottom: 88px;
    overflow: visible;
  }
  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,0.96);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(10px);
  }
  .mobile-bottom-nav button {
    position: relative;
    display: flex;
    min-height: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 8px;
    color: var(--text-soft);
  }
  .mobile-bottom-nav button span {
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
  }
  .mobile-bottom-nav button b {
    font-size: 11px;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-bottom-nav button.active {
    background: var(--primary-soft);
    color: var(--primary);
  }
  .mobile-bottom-nav button em {
    position: absolute;
    top: 3px;
    right: 16px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--star-gold);
    color: white;
    font-size: 10px;
    font-style: normal;
    line-height: 16px;
  }
  .login-card {
    width: calc(100vw - 28px);
    padding: 28px 20px;
  }
  .role-card[data-role="admin"] {
    display: none;
  }
  .role-grid,
  .reward-grid,
  .coupon-admin-grid,
  .coupon-list {
    grid-template-columns: 1fr;
  }
  .role-grid .role-card:nth-child(4),
  .role-grid .role-card:nth-child(5) {
    grid-column: auto;
  }
  .form-row-flex,
  .student-summary,
  .audit-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .modal-mask {
    align-items: flex-end;
  }
  .modal-box {
    width: 100%;
    max-width: 100%;
    max-height: 86vh;
    border-radius: 22px 22px 0 0;
    padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  }
  .modal-mask.active .modal-box { animation: sheetUp .26s ease; }
  .modal-footer .btn { flex: 1; }
  .scan-row {
    flex: auto !important;
  }
  .summary-numbers,
  .profile-stats {
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }
  .profile-stats {
    display: grid;
    gap: 10px;
  }
  .bar-row,
  .radar-axis {
    grid-template-columns: 70px 1fr 34px;
  }
  .page-header {
    display: block;
    margin-bottom: 14px;
  }
  .page-header .btn {
    margin-top: 10px;
  }
  .page-title {
    font-size: 20px;
  }
  .card,
  .metric-card,
  .reward-card {
    box-shadow: 0 2px 10px rgba(30,58,138,0.07);
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  .metric-card {
    padding: 14px 12px;
  }
  .metric-card::before {
    width: 44px; height: 44px;
    transform: translate(16px, -16px);
  }
  .metric-label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .metric-value {
    font-size: 22px;
  }
  .metric-extra {
    font-size: 11px;
    margin-top: 4px;
  }
  .audit-list,
  .audit-history {
    min-height: auto;
  }
  .profile-hero {
    padding: 18px;
    gap: 14px;
  }
  .profile-avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 26px;
  }
  .profile-info h2 {
    font-size: 20px;
  }
  .profile-stat .num {
    font-size: 22px;
  }
  .chart-box {
    height: 230px;
  }
  .mobile-card-table thead {
    display: none;
  }
  .mobile-card-table,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td {
    display: block;
    width: 100%;
  }
  .mobile-card-table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--bg-soft);
  }
  .mobile-card-table td {
    border-bottom: 0;
    padding: 3px 0;
  }
}

/* ===== 新增二级页面样式（德育券 / 挑战 / 互评 / 方案 / 系统） ===== */
.bullet-list { list-style: none; padding: 0; margin: 4px 0 0; }
.bullet-list li {
  position: relative; padding: 7px 0 7px 18px; font-size: 13px; color: var(--text-soft);
  border-bottom: 1px dashed var(--border);
}
.bullet-list li:last-child { border-bottom: 0; }
.bullet-list li::before {
  content: ""; position: absolute; left: 2px; top: 14px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--primary-light);
}

/* 我的德育券：收集进度 */
.coupon-collect-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px;
}
.collect-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.collect-card.done { border-color: var(--star-gold); background: linear-gradient(180deg, var(--star-gold-soft), #fff); }
.collect-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.collect-big { font-size: 17px; font-weight: 700; color: #b45309; }
.collect-big span { display: block; font-size: 11px; font-weight: 400; color: var(--text-soft); margin-top: 2px; }
.collect-status { font-size: 13px; font-weight: 600; color: var(--primary); }
.collect-card.done .collect-status { color: var(--star-gold); }
.collect-smalls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.collect-smalls span {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: #f3f4f6; color: var(--text-light); border: 1px solid var(--border);
}
.collect-smalls span.got { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-light); }

/* 挑战任务 */
.challenge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.challenge-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.challenge-top { display: flex; align-items: center; justify-content: space-between; }
.challenge-title { font-size: 16px; font-weight: 600; color: var(--text); }
.challenge-dim { font-size: 12px; color: var(--primary); font-weight: 600; }
.challenge-desc { font-size: 13px; color: var(--text-soft); line-height: 1.6; min-height: 40px; }
.challenge-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-light); }
.challenge-card .progress { margin: 2px 0; }

/* 学生互评 */
.peer-list { display: flex; flex-direction: column; gap: 10px; }
.peer-item { padding: 12px 14px; border-radius: var(--radius); background: var(--bg-soft); border: 1px solid var(--border); }
.peer-meta { font-size: 11px; color: var(--text-light); margin-bottom: 6px; }
.peer-msg { font-size: 13px; color: var(--text); line-height: 1.6; }
.peer-tags { display: flex; gap: 6px; margin-top: 8px; }

@media (max-width: 760px) {
  .coupon-collect-grid, .challenge-grid { grid-template-columns: 1fr; }
}

/* ===== 德育券管理增强（进步等级积分 / 关系区） ===== */
.rule-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rule-card-head .rule-card-title { margin-bottom: 0; }
.rule-dim-tag {
  font-size: 11px; padding: 2px 9px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.rule-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border);
}
.rule-level { font-size: 11px; color: var(--text-soft); }
.rule-level b { color: var(--star-gold); }
.rule-relation { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.rule-relation-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.rule-relation .mini-row b { color: var(--primary); }

/* ============ UI/UX 规范化（无障碍 / 触控 / 减弱动效 / 指针） ============ */

/* 1. 键盘焦点可见（无障碍 · CRITICAL） */
:focus-visible {
  outline: 3px solid var(--star-gold);
  outline-offset: 2px;
  border-radius: 6px;
}
/* 深色头部 / 侧栏内的焦点改用浅色描边，确保对比可见 */
.app-header :focus-visible,
.sidebar :focus-visible,
.role-switcher :focus-visible,
.mobile-role-bar :focus-visible,
.login-page :focus-visible {
  outline-color: #ffffff;
}
/* 表单控件聚焦补充柔光环（与原 border 高亮叠加，不冲突） */
.form-input:focus, .form-select:focus, .form-textarea:focus {
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* 2. 所有 JS 可点击元素统一手型，明确可交互性 */
[data-page], [data-go], [data-action], [data-audit-id],
[data-filter], [data-mobile-page], [data-mobile-role],
.menu-item, .demo-step, .role-card, .mobile-role-chip {
  cursor: pointer;
}

/* 3. 触控目标尺寸与移动端可读字号（HIGH） */
@media (max-width: 760px) {
  .form-input, .form-select, .form-textarea { font-size: 16px; }   /* 防止 iOS 聚焦自动缩放 */
  .btn { min-height: 44px; }
  .menu-item, .demo-step, .mobile-role-chip { min-height: 44px; }
  .mobile-bottom-nav button { min-height: 52px; }
}

/* 4. 尊重系统“减弱动效”偏好（无障碍 / 性能） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ K12 风格改版 + Lucide 图标系统 ============ */

/* 图标基础：尺寸由内联 width/height 决定，CSS 不覆盖尺寸 */
.lucide { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }

/* 侧边栏：圆角胶囊菜单 + 图标 */
.menu-item {
  margin: 2px 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border-left: 0;
  gap: 12px;
  transition: background .18s, color .18s;
}
.menu-item:hover { background: var(--bg-soft); }
.menu-item.active {
  background: linear-gradient(135deg, var(--primary-soft), #eaf2ff);
  color: var(--primary);
  border-left: 0;
  font-weight: 600;
}
.menu-item .menu-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; color: var(--text-light);
}
.menu-item.active .menu-icon { color: var(--primary); }

/* 移动端底部导航图标 */
.mobile-bottom-nav .menu-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
}

/* 按钮：胶囊形 + 渐变，更亲和 */
.btn {
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  padding: 9px 18px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.18);
}
.btn:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--primary-light), var(--primary)); }
.btn.btn-gold { background: linear-gradient(135deg, #fbbf24, var(--star-gold)); box-shadow: 0 4px 12px rgba(245,158,11,0.22); }
.btn.btn-gold:hover { filter: brightness(1.05); background: linear-gradient(135deg, #fbbf24, var(--star-gold)); }
.btn.btn-outline {
  background: #fff; color: var(--primary);
  border: 1.5px solid var(--primary-soft); box-shadow: none;
}
.btn.btn-outline:hover { background: var(--primary-soft); filter: none; }
.btn.btn-ghost { background: var(--bg-soft); color: var(--text); box-shadow: none; }
.btn.btn-ghost:hover { filter: none; background: #eef2f7; }
.btn.btn-success { background: linear-gradient(135deg, #34d399, var(--success)); }
.btn.btn-danger { background: linear-gradient(135deg, #f87171, var(--danger)); }
.btn.btn-sm { padding: 5px 12px; }

/* 卡片：更圆润 + 细描边，温暖通透 */
.card { border: 1px solid #eef1f6; }
.metric-card { border: 1px solid #eef1f6; }
.metric-card::before { width: 72px; height: 72px; opacity: 0.7; }

/* 登录角色卡图标 */
.role-icon { color: var(--primary); }
.role-icon svg { width: 30px; height: 30px; }
.role-card:hover .role-icon { color: var(--primary-light); }

/* 奖励 / 合成 / Toast / 通知 图标容器 */
.reward-icon svg { width: 28px; height: 28px; }
.combine-modal .combine-icon { animation: bounce 0.8s ease-out infinite alternate; }
.combine-modal .combine-icon svg { width: 60px; height: 60px; }
.toast .icon { display: inline-flex; align-items: center; }
.toast.success .icon { color: var(--success); }
.toast.warn .icon, .toast.error .icon { color: var(--warning); }
.toast.info .icon { color: var(--primary-light); }
.notify-icon { display: inline-flex; align-items: center; }
.notify-icon .notify-ico { display: inline-flex; }

/* 标题左侧星光强调点，强化 K12 识别 */
.page-title { position: relative; }

/* ============ 真实产品化：账号菜单 / 身份切换路径 ============ */
.role-switcher { display: none; }            /* 顶部角色按钮组改为头像账号菜单 */

.user-wrap { position: relative; }
.user-info {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; padding: 4px 8px; border-radius: 12px;
  transition: background .15s;
}
.user-info:hover { background: rgba(255,255,255,0.12); }
.user-caret { display: inline-flex; opacity: .85; }

.user-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 250px; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-hover); padding: 8px;
  z-index: var(--z-modal); animation: menuIn .16s ease;
}
.user-menu.hidden { display: none; }
.um-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.um-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--star-gold); color: #fff; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.um-name { font-weight: 600; font-size: 14px; }
.um-desc { font-size: 11px; color: var(--text-soft); margin-top: 2px; }
.um-section { font-size: 11px; color: var(--text-light); padding: 4px 10px 6px; }
.um-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); font-size: 13px; text-align: left; }
.um-item:hover { background: var(--bg-soft); }
.um-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.um-item .um-ico { display: inline-flex; color: var(--text-light); }
.um-item.active .um-ico { color: var(--primary); }
.um-item .um-check { margin-left: auto; color: var(--primary); display: inline-flex; }
.um-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.um-logout { color: var(--danger); }
.um-logout .um-ico { color: var(--danger); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ============ 移动端：iPhone 17 Pro + 微信小程序外壳 ============ */
.device-island, .mp-statusbar, .mp-navbar { display: none; }

body.mobile-demo .main-app.active {
  width: min(393px, calc(100vw - 24px));
  height: min(852px, calc(100vh - 36px));
  max-height: 852px;
  border-radius: 56px;
  border: 14px solid #3f3f46;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(155deg, #6b6b73, #2b2b30 38%, #45454d 68%, #18181b) border-box;
  box-shadow: 0 40px 90px rgba(0,0,0,0.45), inset 0 0 0 2px rgba(255,255,255,0.06);
  overflow: hidden;
}
body.mobile-demo .main-app.active::before { display: none; }   /* 移除旧听筒条 */

body.mobile-demo .device-island {
  display: block; position: absolute;
  top: 13px; left: 50%; transform: translateX(-50%);
  width: 116px; height: 33px; border-radius: 18px;
  background: #000; z-index: 60;
}
body.mobile-demo .device-island::after {
  content: ""; position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2563eb 0 32%, #0b1220 62%);
}

body.mobile-demo .app-header { display: none; }   /* 桌面顶栏 → 小程序导航 */

body.mobile-demo .mp-statusbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 54px; padding: 8px 28px 0; flex-shrink: 0;
  background: #fff; color: #111827; font-size: 14px; font-weight: 600;
}
.mp-status-icons { display: inline-flex; align-items: center; gap: 6px; }

body.mobile-demo .mp-navbar {
  display: flex; align-items: center; justify-content: center; position: relative;
  height: 44px; flex-shrink: 0; background: #fff;
  border-bottom: 1px solid var(--border);
}
.mp-nav-title { font-size: 16px; font-weight: 600; color: var(--text); max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-capsule {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: stretch; height: 32px;
  border: 1px solid rgba(0,0,0,0.14); border-radius: 999px;
  background: rgba(247,248,250,0.92); color: #3f3f46; cursor: pointer;
}
.mp-capsule .mp-dots, .mp-capsule .mp-ring { width: 40px; display: inline-flex; align-items: center; justify-content: center; }
.mp-capsule .mp-dots { border-right: 1px solid rgba(0,0,0,0.14); }
.mp-capsule svg { width: 18px; height: 18px; }

/* 移动端身份切换条：加说明，弱化为“演示工具” */
body.mobile-demo .mobile-role-bar { position: static; }
body.mobile-demo .mobile-role-bar::before {
  content: "切换演示身份"; display: block;
  font-size: 11px; color: var(--text-light); margin: 0 2px 6px;
}

/* ============ 真实产品化：页面切换与微交互 ============ */
.content.page-enter { animation: pageEnter .26s ease both; }
@keyframes pageEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.btn:active { transform: translateY(1px); }
.menu-item:active { transform: translateY(1px); }
.modal-mask.active .modal-box { animation: modalIn .2s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* ============ 新增：称号 / 表扬墙 / 消息面板 / 排行榜 / 习惯曲线 / 流水 ============ */
.tier-badge { background: linear-gradient(90deg, #fbbf24, #f59e0b); color: #fff !important; font-weight: 600; }
.star-badge { background: linear-gradient(90deg, #818cf8, #6366f1); color: #fff !important; font-weight: 600; }

.notify-wrap { position: relative; }
.notify-icon { position: relative; background: none; border: none; cursor: pointer; padding: 6px; }
.msg-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 320px; max-height: 420px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14); z-index: 60; padding: 8px;
}
.msg-panel.hidden { display: none; }
.msg-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 10px; border-bottom: 1px solid var(--border, #e5e7eb); }
.msg-readall { background: none; border: none; color: #2563eb; font-size: 12px; cursor: pointer; }
.msg-item { padding: 10px 8px; border-radius: 8px; cursor: pointer; }
.msg-item:hover { background: #f8fafc; }
.msg-item.unread { background: #eff6ff; }
.msg-item-head { display: flex; justify-content: space-between; margin-bottom: 2px; }
.msg-type { font-size: 11px; color: #2563eb; background: #dbeafe; border-radius: 999px; padding: 1px 8px; }
.msg-time { font-size: 11px; color: #94a3b8; }
.msg-title { font-size: 13px; font-weight: 600; color: #1e293b; }
.msg-content { font-size: 12px; color: #64748b; }

.praise-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.praise-card { background: linear-gradient(135deg, #fffbeb, #fff); border: 1px solid #fde68a; border-radius: 12px; padding: 14px; }
.praise-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.praise-head .tag { margin-left: auto; }
.praise-name { font-weight: 600; color: #1e293b; }
.praise-meta { font-size: 12px; color: #94a3b8; }
.praise-text { font-size: 13px; color: #57534e; line-height: 1.7; }
.praise-wall { border-color: #fde68a; }

.rank-top3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.rank-card { text-align: center; border-radius: 14px; padding: 18px 12px; background: #fff; border: 1px solid var(--border, #e5e7eb); }
.rank-card.rank-1 { background: linear-gradient(160deg, #fffbeb, #fff); border-color: #fbbf24; }
.rank-card.rank-2 { background: linear-gradient(160deg, #f8fafc, #fff); }
.rank-card.rank-3 { background: linear-gradient(160deg, #fff7ed, #fff); }
.rank-medal { font-size: 22px; }
.rank-name { font-weight: 600; margin-top: 8px; }
.rank-value { color: #f59e0b; font-weight: 700; }
.rank-card .student-avatar.big { margin: 8px auto 0; }
tr.rank-me td { background: #eff6ff; }

.ledger-filter { width: auto; min-width: 130px; }
.ledger-plus { color: #059669; font-weight: 600; }
.ledger-minus { color: #dc2626; font-weight: 600; }

.habit-list { display: flex; flex-direction: column; gap: 10px; }
.habit-item { display: flex; align-items: center; gap: 10px; }
.habit-name { width: 72px; font-size: 13px; color: #475569; flex-shrink: 0; }
.habit-bar-wrap { flex: 1; height: 10px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.habit-bar { height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); border-radius: 999px; transition: width .3s; }
.habit-days { font-size: 12px; color: #94a3b8; width: 42px; text-align: right; flex-shrink: 0; }

.activity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 16px; }
.activity-card { background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; padding: 16px; }
.activity-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.activity-title { font-weight: 600; color: #1e293b; }
.activity-meta { font-size: 12px; color: #94a3b8; margin-bottom: 10px; }
.activity-stats { display: flex; gap: 24px; margin-bottom: 10px; }
.activity-stats b { font-size: 20px; color: #2563eb; display: block; }
.activity-stats span { font-size: 12px; color: #94a3b8; }
.activity-rule { font-size: 12px; color: #64748b; line-height: 1.6; }

.semester-switch { display: flex; gap: 8px; margin-bottom: 14px; }
.semester-btn { border: 1px solid var(--border, #e5e7eb); background: #fff; border-radius: 999px; padding: 6px 16px; font-size: 13px; cursor: pointer; color: #64748b; }
.semester-btn.active { background: #2563eb; border-color: #2563eb; color: #fff; }

.timeline-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.timeline-filter .form-select { width: auto; min-width: 130px; }

.warning-item { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #92400e; background: #fffbeb; border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.warning-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; margin-top: 5px; flex-shrink: 0; }

.student-actions { display: flex; gap: 6px; }
.void-link { background: none; border: none; color: #dc2626; font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0; }

.report-section { margin-bottom: 14px; }
.report-section-title { font-weight: 600; color: #1e293b; margin-bottom: 6px; font-size: 14px; }
.report-story { font-size: 13px; color: #57534e; line-height: 1.7; }
.term-report { font-size: 14px; line-height: 2; color: #44403c; }
.term-report-sign { text-align: right; color: #94a3b8; }
.tip-actions { display: flex; gap: 8px; margin-top: 10px; }
.mini-sub { color: #94a3b8; font-size: 12px; }

/* ============ 方案/任务管理重构 ============ */
.task-ops { white-space: nowrap; }
.task-ops .btn { margin-right: 4px; }
.btn-danger-outline { background: none; border: 1px solid #fecaca; color: #dc2626; }
.btn-danger-outline:hover { background: #fef2f2; }
.dim-checks { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 4px 0; }
.dim-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #475569; cursor: pointer; }
.task-banner { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.task-chip-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(90deg, #eff6ff, #fff); border: 1px solid #bfdbfe;
  border-radius: 12px; padding: 12px 16px;
}
.task-chip-title { font-weight: 600; color: #1e40af; font-size: 14px; }
.task-chip-meta { font-size: 12px; color: #64748b; margin-top: 2px; }
.activity-link { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border, #e5e7eb); }

/* ============ 修改建议 13 项新增样式 ============ */
.attach-preview { max-width: 180px; max-height: 120px; border-radius: 10px; border: 1px solid var(--border, #e5e7eb); margin-top: 8px; display: block; }
.attach-preview.hidden { display: none; }
.timeline-attach { max-width: 160px; max-height: 100px; border-radius: 10px; border: 1px solid var(--border, #e5e7eb); margin-bottom: 8px; display: block; }
.hidden { display: none !important; }

.quick-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.quick-tab { flex: 1; padding: 9px 0; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; background: #f8fafc; font-size: 13px; color: #475569; cursor: pointer; }
.quick-tab.active { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; font-weight: 600; }
.qr-demo { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; }
.qr-svg { width: 132px; height: 132px; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; padding: 8px; background: #fff; }

.chat-box { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; margin-bottom: 10px; }
.chat-msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.65; }
.chat-msg.ai { align-self: flex-start; background: #eff6ff; color: #1e3a8a; border: 1px solid #dbeafe; border-top-left-radius: 4px; }
.chat-msg.user { align-self: flex-end; background: #1d4ed8; color: #fff; border-top-right-radius: 4px; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row .form-input { flex: 1; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }

.modal-box.modal-lg { max-width: 780px; width: 92vw; max-height: 86vh; overflow-y: auto; }
.report-story-card { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.report-story-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.report-story-body { font-size: 13px; color: #57534e; line-height: 1.65; }

.teacher-style-row { padding: 8px 0; border-bottom: 1px dashed var(--border, #e5e7eb); }
.teacher-style-row:last-of-type { border-bottom: none; }
.teacher-style-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; font-size: 13px; }
.teacher-style-note { font-size: 12px; color: #64748b; margin-top: 4px; }
.ts-head-left { display: flex; align-items: center; gap: 6px; }
.soft-text { font-size: 12px; color: var(--text-soft, #94a3b8); font-weight: 400; }

.record-voided { opacity: .6; }
.record-voided .timeline-title, .record-voided .timeline-body { text-decoration: line-through; text-decoration-color: #fca5a5; }
.void-reason { font-size: 12px; color: #b91c1c; background: #fef2f2; border: 1px dashed #fecaca; border-radius: 8px; padding: 6px 10px; margin-top: 6px; }

/* ============ 月度班报美化 ============ */
.modal-box.modal-lg { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.modal-box.modal-lg .report-shell { overflow-y: auto; padding: 0 0 4px; }
.modal-box.modal-lg .modal-footer { padding: 12px 22px; border-top: 1px solid var(--border, #e5e7eb); margin: 0; }

.report-cover {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #f59e0b 130%);
  color: #fff; padding: 26px 26px 22px; position: relative; overflow: hidden;
}
.report-cover::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,.18) 0%, transparent 70%); border-radius: 50%;
}
.report-cover-tag {
  display: inline-block; font-size: 12px; letter-spacing: 1px; padding: 4px 12px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; margin-bottom: 12px;
}
.report-cover-title { font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.report-cover-sub { font-size: 12.5px; opacity: .82; margin-top: 6px; }
.report-cover-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.rcs-item {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px; padding: 10px 6px; text-align: center; backdrop-filter: blur(2px);
}
.rcs-item b { display: block; font-size: 20px; line-height: 1.2; }
.rcs-item span { font-size: 11.5px; opacity: .85; }

.report-block { padding: 18px 26px 6px; }
.report-block + .report-block { border-top: 8px solid #f1f5f9; }
.report-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.report-block-icon {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.report-block-icon-gold { background: #fef3c7; color: #b45309; }
.report-block-icon-blue { background: #dbeafe; color: #1d4ed8; }
.report-block-icon-purple { background: #ede9fe; color: #6d28d9; }
.report-block-icon-green { background: #d1fae5; color: #047857; }
.report-block-title { font-size: 15px; font-weight: 700; color: #0f172a; }
.report-block-sub { font-size: 12px; color: #94a3b8; margin-top: 1px; }

.term-letter {
  background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
  border: 1px solid #fde8c8; border-radius: 12px;
  padding: 16px 18px; font-size: 14px; line-height: 2; color: #44403c;
}
.term-letter p { margin: 0 0 8px; }
.term-letter p:last-child { margin-bottom: 0; }
.term-letter b { color: #b45309; }

.report-charts-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.report-chart-cell {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px;
}
.report-chart-label { font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.report-chart-sm { height: 210px; }
.report-chart-note { font-size: 12px; color: #94a3b8; line-height: 1.6; margin-top: 4px; }

.level-dist-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.level-dist-cell {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
  padding: 14px 10px; text-align: center;
}
.level-dist-num { font-size: 24px; font-weight: 700; color: #0f172a; }
.level-dist-name { font-size: 12.5px; color: #475569; margin-top: 2px; }
.level-dist-pct { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.source-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.source-cell {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1px solid #dbeafe; border-radius: 12px; padding: 14px 10px; text-align: center;
}
.source-num { font-size: 22px; font-weight: 700; color: #1d4ed8; }
.source-name { font-size: 12.5px; color: #475569; margin-top: 2px; }

.report-story-foot { font-size: 11.5px; color: #b45309; opacity: .75; margin-top: 6px; }
.term-tips { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.report-rank-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px dashed #f1f5f9;
  font-size: 13.5px; color: #334155;
}
.report-rank-row:last-child { border-bottom: none; }
.report-rank-no {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  background: #eff6ff; color: #1d4ed8;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.report-rank-name { font-weight: 600; flex: 1; }
.term-tiers {
  margin-top: 10px; font-size: 12.5px; color: #64748b;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 9px 12px;
}
.soft-copy-inline { font-size: 12px; color: #94a3b8; }

.report-story-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid #fde8c8; border-left: 4px solid #f59e0b;
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.report-story-rank {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.rank-bg-1 { background: linear-gradient(135deg, #f59e0b, #f97316); }
.rank-bg-2 { background: linear-gradient(135deg, #94a3b8, #64748b); }
.rank-bg-3 { background: linear-gradient(135deg, #d97706, #b45309); }
.rank-bg-4, .rank-bg-5 { background: linear-gradient(135deg, #93c5fd, #60a5fa); }
.report-story-main { flex: 1; min-width: 0; }

.report-radar-wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; align-items: center; }
.report-radar { height: 250px; }
.report-radar-note {
  background: #eff6ff; border: 1px solid #dbeafe; border-radius: 12px; padding: 14px 16px;
  font-size: 13px; color: #1e3a8a; line-height: 1.8;
}
.report-radar-note p { margin: 0 0 6px; }
.report-radar-note p:last-child { margin-bottom: 0; }

.report-block .chat-box { background: #f8f5ff; border: 1px solid #ede9fe; border-radius: 12px; padding: 12px; }

@media (max-width: 760px) {
  .report-cover-stats { grid-template-columns: repeat(2, 1fr); }
  .report-radar-wrap { grid-template-columns: 1fr; }
  .report-block { padding: 16px 16px 6px; }
  .report-charts-2col { grid-template-columns: 1fr; }
  .level-dist-grid { grid-template-columns: repeat(2, 1fr); }
  .source-grid { grid-template-columns: repeat(2, 1fr); }
  .term-tips { grid-template-columns: 1fr; }
}

/* ===== 移动端专属入口（PC 端隐藏学生 / 家长角色） ===== */
.role-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}
body:not(.mobile-demo) .role-switcher .mobile-only { display: none; }
body:not(.mobile-demo) .role-grid .role-card.mobile-only { opacity: 0.55; }

/* ===== 适用范围层级多选（旧树形，保留兼容） ===== */
.scope-tree { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; max-height: 240px; overflow: auto; }
.scope-grade { padding-left: 14px; }
.scope-classes { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 4px 0 4px 22px; }
.form-hint-inline { color: #94a3b8; font-size: 12px; margin-left: 6px; }

/* ===== 适用范围选择器（模式切换 + 搜索） ===== */
.scope-picker { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.scope-mode-row { display: flex; gap: 18px; flex-wrap: wrap; }
.scope-mode { font-weight: 500; }
.scope-panel { padding: 2px 0; }
.scope-panel-tip { color: #94a3b8; font-size: 12px; }
.scope-grade-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 4px 0; }
.scope-class-groups { max-height: 190px; overflow: auto; border: 1px dashed #e2e8f0; border-radius: 8px; padding: 8px 10px; margin: 6px 0 2px; }
.scope-group + .scope-group { border-top: 1px solid #eef2f7; margin-top: 6px; padding-top: 6px; }
.scope-group-title { font-size: 12px; font-weight: 600; color: #64748b; margin: 0 0 4px; }
.scope-class-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.scope-ops { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.scope-op-sep { color: #cbd5e1; }
.scope-op-link { border: 0; background: none; padding: 0; font-size: 12px; color: #2563eb; cursor: pointer; }
.scope-op-link:hover { text-decoration: underline; }
.scope-summary { display: flex; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid #eef2f7; font-size: 12px; color: #475569; }
.scope-summary .sp-count { color: #2563eb; font-weight: 700; }
.scope-summary .sp-count-note { color: #94a3b8; flex: 1; }
.scope-search { margin-bottom: 2px; }
.scope-teacher-fixed { padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; font-size: 13px; color: #475569; }
.scope-teacher-fixed b { color: #2563eb; }

/* ===== 诊断室筛选与报告区 ===== */
.diag-filter-card { padding: 12px 16px; }
.diag-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.diag-filter-row .form-label { margin: 0; white-space: nowrap; }
.diag-filter-row .form-select { width: auto; min-width: 140px; }
.diag-report-summary { display: flex; gap: 18px; flex-wrap: wrap; padding: 6px 0 14px; }
.form-label-sm { font-size: 12px; color: #64748b; }

/* ===== 德育券卡片翻面（大券可翻面查看合成来源） ===== */
.coupon-flip { perspective: 800px; cursor: pointer; }
.coupon-flip-inner { position: relative; transform-style: preserve-3d; transition: transform .5s ease; }
.coupon-flip.flipped .coupon-flip-inner { transform: rotateY(180deg); }
.coupon-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.coupon-back { position: absolute; inset: 0; transform: rotateY(180deg); display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.coupon-kind-tag {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  padding: 0 6px; border-radius: 6px; font-size: 10px; font-weight: 700; line-height: 18px;
  color: #fff; background: linear-gradient(135deg, #f59e0b, #f97316);
}
.coupon-kind-tag.small-kind { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.coupon-flip-hint { font-size: 10px; color: #b45309; text-align: right; }

/* ===== 合成规则抽屉 ===== */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 70; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.drawer-mask.active { opacity: 1; pointer-events: auto; }
.drawer-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 88vw); z-index: 71;
  background: #fff; box-shadow: -8px 0 30px rgba(15,23,42,.18);
  transform: translateX(100%); transition: transform .28s ease;
  display: flex; flex-direction: column;
}
.drawer-panel.active { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid #eef2f7; }
.drawer-title { font-size: 16px; font-weight: 700; }
.drawer-close { border: none; background: #f1f5f9; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 14px; color: #64748b; }
.drawer-body { padding: 16px 18px; overflow: auto; font-size: 13px; line-height: 1.9; color: #334155; }
.drawer-body .mini-row { margin-bottom: 6px; }

/* ===== 券核销面板 ===== */
.writeoff-coupon-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.writeoff-coupon-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.writeoff-kind-row { display: flex; gap: 10px; }
.writeoff-kind { flex: 1; border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px; cursor: pointer; text-align: center; font-size: 13px; background: #fff; }
.writeoff-kind.active { border-color: #f59e0b; background: #fffbeb; color: #b45309; font-weight: 600; }

/* ===== 券卡片补充 ===== */
.coupon-card { position: relative; }
.coupon-x { font-size: 11px; color: #b45309; font-weight: 700; }
.coupon-card.small .coupon-x { color: #1d4ed8; }
.coupon-front { display: flex; flex-direction: column; gap: 2px; }
.coupon-back { background: #fff7ed; border-radius: inherit; padding: 4px; }
.coupon-back .coupon-card-title { font-size: 13px; }
.coupon-back .coupon-card-desc { font-size: 11px; line-height: 1.6; }

/* ===== 时间轴发券信息 ===== */
.timeline-coupon { margin-top: 6px; font-size: 11px; color: #92400e; background: #fffbeb; border: 1px dashed #fde68a; border-radius: 8px; padding: 4px 8px; display: inline-block; }

/* ===== 翻面卡片尺寸修正 ===== */
.coupon-card.coupon-flip { padding: 0; overflow: hidden; }
.coupon-card.coupon-flip .coupon-flip-inner { padding: 16px; min-height: 108px; }
.coupon-card.coupon-flip .coupon-back {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  padding: 16px; text-align: center; align-items: center;
  border-radius: var(--radius-sm);
}

/* ================= 小程序端视觉优化（20260806） ================= */
/* 外框背景：更柔和的夜色，突出手机壳 */
body.mobile-demo {
  background:
    radial-gradient(circle at 18% 10%, rgba(245,158,11,0.22), transparent 26%),
    radial-gradient(circle at 82% 88%, rgba(59,130,246,0.20), transparent 30%),
    linear-gradient(135deg, #0b1226, #14285c 52%, #1e3a8a 52.2%, #eef4fb 52.2%, #eef4fb);
}
/* 手机内屏背景：淡星光渐变，替代纯灰 */
body.mobile-demo .main-app.active {
  background: linear-gradient(180deg, #eaf1fb 0%, #f5f8fd 34%, #f8fafc 100%);
}
/* 小程序导航栏：白色半透明 + 底部发丝线 */
body.mobile-demo .mp-navbar {
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.86) !important;
  box-shadow: 0 1px 0 rgba(15,23,42,0.05);
}
body.mobile-demo .mp-nav-title { font-weight: 700; letter-spacing: 0.5px; }
/* 页面标题区在移动端更紧凑 */
body.mobile-demo .page-header { padding: 2px 2px 10px; }
body.mobile-demo .page-title { font-size: 19px; }
body.mobile-demo .page-subtitle { font-size: 12px; line-height: 1.5; }
/* 卡片：更大圆角 + 更轻盈的阴影 */
body.mobile-demo .card {
  border-radius: 16px;
  border: 1px solid rgba(226,232,240,0.85);
  box-shadow: 0 4px 14px rgba(30,58,138,0.06);
}
body.mobile-demo .card + .card { margin-top: 12px; }
/* 指标卡：2 列、紧凑、左侧彩条标识 */
body.mobile-demo .metric-card {
  border-radius: 14px;
  border: 1px solid rgba(226,232,240,0.85);
  position: relative;
  overflow: hidden;
}
body.mobile-demo .metric-card::after {
  content: "";
  position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 3px; background: var(--primary-light);
}
body.mobile-demo .metric-card.gold::after { background: var(--star-gold); }
body.mobile-demo .metric-card.green::after { background: var(--success); }
body.mobile-demo .metric-card.purple::after { background: #7c3aed; }
/* 主按钮更圆润 */
body.mobile-demo .btn { border-radius: 10px; }
body.mobile-demo .btn-gold { box-shadow: 0 4px 10px rgba(245,158,11,0.25); }
/* 时间轴卡片化 */
body.mobile-demo .timeline-item {
  border-radius: 12px;
  border: 1px solid #eef2f7;
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(15,23,42,0.04);
}
/* 数据表在移动端转为上下堆叠卡片样式 */
body.mobile-demo .data-table { display: block; overflow-x: auto; }
/* 标签页可横向滑动 */
body.mobile-demo .tabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
body.mobile-demo .tabs::-webkit-scrollbar { display: none; }
body.mobile-demo .tab { white-space: nowrap; }
/* 大标题英雄区（学生/家长端顶部） */
body.mobile-demo .profile-hero {
  border-radius: 18px;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 55%, #60a5fa 100%);
  color: #fff;
  padding: 18px 16px;
  box-shadow: 0 10px 24px rgba(30,58,138,0.28);
}
body.mobile-demo .profile-hero p { opacity: 0.85; }
body.mobile-demo .profile-stat { background: rgba(255,255,255,0.14); border-radius: 12px; }
/* 底部导航：图标上移、文字更小 */
body.mobile-demo .mobile-bottom-nav {
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
}
/* 挑战任务卡片 */
body.mobile-demo .challenge-card { border-radius: 14px; }
/* 学生摘要卡（积分/能量） */
body.mobile-demo .student-summary {
  border-radius: 14px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px dashed #fcd34d;
}
/* 核销/申报列表项更分明 */
body.mobile-demo .audit-item { border-radius: 12px; }
/* 抽屉在移动端全宽 */
body.mobile-demo .drawer-panel { width: min(430px, 100vw); }
/* 小屏隐藏 PC 端演示闭环节省空间 */
body.mobile-demo .sidebar { display: none; }

/* ===== 小程序端视觉修正（第二轮） ===== */
body.mobile-demo .app-header { display: none !important; }
body.mobile-demo .main-app.active {
  background: linear-gradient(180deg, #eaf1fb 0%, #f5f8fd 34%, #f8fafc 100%);
  border: 12px solid #17171c;
  box-shadow: 0 30px 70px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.05);
}
body.mobile-demo .mp-statusbar,
body.mobile-demo .mp-navbar { background: transparent; }
body.mobile-demo .mp-navbar { border-bottom: 1px solid rgba(226,232,240,0.7); backdrop-filter: blur(12px); }
body.mobile-demo .mobile-role-bar { background: transparent; border-bottom: 1px solid rgba(226,232,240,0.7); }

/* ================= 小程序端视觉优化（第三轮 · 整体打磨） ================= */
/* 1. 外壳：状态栏更紧凑、导航胶囊更精致 */
body.mobile-demo .mp-statusbar {
  height: 48px;
  padding: 10px 26px 0;
  background: transparent;
  font-weight: 700;
}
body.mobile-demo .mp-navbar {
  height: 42px;
  background: rgba(255,255,255,0.78);
}
body.mobile-demo .mp-capsule {
  height: 28px;
  border-color: rgba(0,0,0,0.10);
  background: rgba(247,248,250,0.82);
}
body.mobile-demo .mp-capsule .mp-dots,
body.mobile-demo .mp-capsule .mp-ring { width: 34px; }
body.mobile-demo .mp-capsule svg { width: 16px; height: 16px; }

/* 2. 演示身份切换条：做成更精致的分段控件 */
body.mobile-demo .mobile-role-bar {
  padding: 6px 12px 8px;
  background: rgba(255,255,255,0.62);
  backdrop-filter: blur(8px);
}
body.mobile-demo .mobile-role-bar::before {
  content: "切换演示身份";
  display: block;
  font-size: 10px;
  color: var(--text-light);
  margin-bottom: 5px;
  text-align: center;
  letter-spacing: 0.5px;
}
body.mobile-demo .mobile-role-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
body.mobile-demo .mobile-role-scroll::-webkit-scrollbar { display: none; }
body.mobile-demo .mobile-role-chip {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
body.mobile-demo .mobile-role-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 3px 10px rgba(30,58,138,0.18);
}
body.mobile-demo .mobile-role-chip.active span {
  background: rgba(255,255,255,0.22);
  color: #fff;
}
body.mobile-demo .mobile-role-chip span {
  width: 20px;
  height: 20px;
  font-size: 11px;
}
body.mobile-demo .mobile-role-chip b {
  font-size: 11px;
  font-weight: 500;
}

/* 3. 底部导航：active 用顶部圆点/颜色，减少实心背景 */
body.mobile-demo .mobile-bottom-nav {
  padding: 6px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,0.94);
  border-top: 1px solid rgba(226,232,240,0.85);
  box-shadow: 0 -6px 18px rgba(15,23,42,0.06);
}
body.mobile-demo .mobile-bottom-nav button {
  min-height: 50px;
  gap: 3px;
  border-radius: 12px;
  position: relative;
}
body.mobile-demo .mobile-bottom-nav button::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary-light);
  transition: transform .2s ease;
}
body.mobile-demo .mobile-bottom-nav button.active::before {
  transform: translateX(-50%) scale(1);
}
body.mobile-demo .mobile-bottom-nav button.active {
  background: transparent;
  color: var(--primary);
}
body.mobile-demo .mobile-bottom-nav button .menu-icon {
  width: 24px;
  height: 24px;
}
body.mobile-demo .mobile-bottom-nav button b {
  font-size: 10px;
  font-weight: 500;
}
body.mobile-demo .mobile-bottom-nav button em {
  top: 4px;
  right: 12px;
  min-width: 14px;
  height: 14px;
  font-size: 9px;
  line-height: 14px;
  padding: 0 3px;
}

/* 4. 内容区边距 */
body.mobile-demo .content {
  padding: 14px 14px 92px;
}

/* 5. 页面标题区：垂直排布、操作按钮组 */
body.mobile-demo .page-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 2px 12px;
}
body.mobile-demo .page-header > div:first-child { width: 100%; }
body.mobile-demo .page-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
body.mobile-demo .page-subtitle {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
  line-height: 1.5;
}
body.mobile-demo .page-header > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body.mobile-demo .page-header .btn,
body.mobile-demo .page-header .btn-outline {
  align-self: flex-start;
  min-height: 38px;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 10px;
}

/* 6. 卡片：更大圆角、更柔和阴影、统一内边距 */
body.mobile-demo .card {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(226,232,240,0.9);
  box-shadow: 0 3px 12px rgba(30,58,138,0.05);
}
body.mobile-demo .card + .card { margin-top: 12px; }
body.mobile-demo .card-header { margin-bottom: 12px; }
body.mobile-demo .card-title {
  font-size: 15px;
  font-weight: 700;
}
body.mobile-demo .card-hint {
  font-size: 11px;
  color: var(--text-light);
}

/* 7. 表单：更大触控区域、更聚焦的激活态 */
body.mobile-demo .form-row { margin-bottom: 14px; }
body.mobile-demo .form-label {
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 500;
}
body.mobile-demo .form-input,
body.mobile-demo .form-select,
body.mobile-demo .form-textarea {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}
body.mobile-demo .form-textarea { min-height: 96px; }
body.mobile-demo .form-input:focus,
body.mobile-demo .form-select:focus,
body.mobile-demo .form-textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
body.mobile-demo .form-hint { font-size: 11px; margin-top: 4px; }
body.mobile-demo .form-row-flex {
  flex-direction: column;
  gap: 0;
}
body.mobile-demo .btn {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 12px;
}
body.mobile-demo .btn.full-width { width: 100%; }
body.mobile-demo .btn-sm {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12px;
}

/* 8. 表格卡片化：隐藏表头，每行一张卡片 */
body.mobile-demo .mobile-card-table,
body.mobile-demo .mobile-card-table tbody,
body.mobile-demo .mobile-card-table tr,
body.mobile-demo .mobile-card-table td {
  display: block;
  width: 100%;
}
body.mobile-demo .mobile-card-table thead { display: none; }
body.mobile-demo .mobile-card-table tr {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
}
body.mobile-demo .mobile-card-table td {
  border: none;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text-soft);
}
body.mobile-demo .mobile-card-table td:first-child {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}
body.mobile-demo .mobile-card-table .btn-sm { margin-top: 4px; }

/* 9. 英雄区/摘要区微调 */
body.mobile-demo .profile-hero {
  border-radius: 20px;
  padding: 20px 16px;
}
body.mobile-demo .profile-avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 28px;
}
body.mobile-demo .profile-info h2 { font-size: 20px; }
body.mobile-demo .profile-stats { gap: 8px; }
body.mobile-demo .profile-stat {
  flex: 1;
  padding: 8px 6px;
  min-width: 0;
}
body.mobile-demo .profile-stat .num { font-size: 22px; }
body.mobile-demo .profile-stat .lab { font-size: 11px; }
body.mobile-demo .student-summary {
  border-radius: 16px;
  padding: 14px;
}
body.mobile-demo .summary-numbers { gap: 8px; }

/* 10. 标签与状态 */
body.mobile-demo .tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}
body.mobile-demo .soft-copy {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 10px;
  line-height: 1.5;
}

/* 德育处学生成长档案 · 班级树导航 */
.archive-tree {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.archive-grade {
  font-weight: 600;
  font-size: 13px;
  color: #334155;
  margin: 0 0 4px;
}
.archive-class-link {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  text-decoration: none;
}
.archive-class-link:hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.archive-class-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* 校级驾驶舱 · 内联月度/学期报告 */
.report-inline {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 16px;
}
.report-inline .report-block:last-child { padding-bottom: 18px; }

/* ===== 券面占位图（无实图时用券类色块 + 券名占位） ===== */
.coupon-face-img {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: inset 0 -8px 14px rgba(0,0,0,0.12), 0 2px 6px rgba(15,23,42,0.18);
  text-align: center;
  line-height: 1;
}
.coupon-face-img i {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  opacity: 0.92;
}
.coupon-face-img b {
  font-weight: 800;
  letter-spacing: 1px;
}
.coupon-face-img.big {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  gap: 5px;
}
.coupon-face-img.big b { font-size: 12px; }
.coupon-face-img.small {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  gap: 3px;
}
.coupon-face-img.small b { font-size: 9px; }

/* ===== 大券 / 小券数量下钻明细（需求2） ===== */
.coupon-drill-block {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  margin-top: 12px;
}
.coupon-drill-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.coupon-drill-title { font-size: 13px; font-weight: 700; color: var(--text); }
.coupon-drill-hint { font-size: 11px; color: var(--text-light); }
.coupon-drill-grid { display: flex; flex-direction: column; gap: 8px; }
.coupon-drill-item {
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #f8fafc;
  overflow: hidden;
}
.coupon-drill-item[open] .drill-caret { transform: rotate(180deg); }
.coupon-drill-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
  flex-wrap: wrap;
}
.coupon-drill-summary::-webkit-details-marker { display: none; }
.coupon-drill-summary .coupon-face-img.big { width: 42px; height: 42px; }
.drill-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.drill-info b { font-size: 13px; color: var(--text); }
.drill-info em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-light);
}
.drill-total {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 9px;
  border-radius: 999px;
}
.drill-caret { font-size: 12px; color: var(--text-light); transition: transform .2s ease; }
.drill-small-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px 10px;
  padding: 6px 10px 10px;
  border-top: 1px dashed #e2e8f0;
  background: #fff;
}
.drill-small-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drill-small-row .coupon-face-img.small { width: 30px; height: 30px; border-radius: 8px; }
.drill-small-row b {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drill-small-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  flex-shrink: 0;
}
.drill-small-count.on { color: var(--primary); }

/* ===== 德育券配置区 · 大券正反闪卡（需求4） ===== */
.coupon-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.rule-card.coupon-flip { overflow: hidden; }
.admin-flip .coupon-flip-inner { min-height: 128px; }
.admin-flip .coupon-front { gap: 6px; }
.admin-back {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
  padding: 12px;
  text-align: center;
  justify-content: flex-start;
  gap: 8px;
}
.admin-back-title { font-size: 12px; font-weight: 700; color: var(--primary); }
.admin-back-smalls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.admin-back-small {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.admin-back-small span { font-size: 10px; color: var(--text-soft); }
.admin-back-small .coupon-face-img.small { width: 32px; height: 32px; }

/* ===== 德育券配置区 · 小券正反闪卡（需求4） ===== */
.small-admin-grid { display: flex; flex-direction: column; gap: 14px; }
.small-admin-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  padding: 10px 12px;
}
.small-admin-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}
.small-admin-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}
.small-flip .coupon-flip-inner { min-height: 84px; }
.small-flip .coupon-front {
  height: 100%;
  align-items: center;
  justify-content: center;
}
.small-back {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  padding: 8px;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}
.small-back b { font-size: 11px; color: #1d4ed8; }
.small-back span { font-size: 10px; color: #334155; }

/* ===== 德育券配置区 · 平铺卡片 + 图片上传 / 查看（需求3） ===== */
.coupon-admin-card { cursor: pointer; transition: box-shadow .2s ease, border-color .2s ease; }
.coupon-admin-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(37, 99, 235, .10); }
.coupon-admin-preview {
  width: 52px; height: 52px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--border); flex: none;
}
.rule-card-head .coupon-admin-preview { margin-right: 4px; }
.rule-card-actions { display: flex; align-items: center; gap: 6px; }
.coupon-small-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.coupon-small-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: white; border: 1px solid var(--border);
  color: var(--text-soft); border-radius: 999px;
  padding: 2px 8px; font-size: 11px; cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.coupon-small-tag:hover { border-color: var(--primary); color: var(--primary); }
.coupon-small-tag-img {
  width: 18px; height: 18px; border-radius: 5px; object-fit: cover; flex: none;
}
.small-coupon-card {
  background: white; border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 6px 6px; display: flex; flex-direction: column; align-items: center;
  gap: 4px; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease;
}
.small-coupon-card:hover { border-color: var(--primary); box-shadow: 0 3px 10px rgba(37, 99, 235, .12); }
.small-coupon-card .coupon-face-img.small { width: 44px; height: 44px; }
.small-coupon-img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; border: 1px solid var(--border); }
.small-coupon-card b { font-size: 11px; color: var(--text); }
.small-coupon-card span { font-size: 10px; color: var(--text-soft); }

/* 查看券正反两面图片 */
.coupon-view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 4px; }
.coupon-view-cell { display: flex; flex-direction: column; gap: 6px; }
.coupon-view-label { font-size: 11px; color: var(--text-soft); font-weight: 600; }
.coupon-view-img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-soft);
}
.coupon-view-placeholder {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 12px;
  border: 1px dashed var(--border); background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft); font-size: 12px;
}

/* 上传券正反两面图片 */
.coupon-upload-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 4px; }
.coupon-upload-cell { display: flex; flex-direction: column; gap: 6px; }
.coupon-upload-cell .form-label { margin-bottom: 0; }
.coupon-file { font-size: 12px; padding: 6px; }
.coupon-upload-preview {
  min-height: 72px; border: 1px dashed var(--border); border-radius: 10px;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center;
  color: var(--text-soft); font-size: 12px; overflow: hidden;
}
.coupon-upload-preview img { width: 100%; max-height: 120px; object-fit: cover; border-radius: 8px; }

/* ===== 券卡片正面券面图布局（需求4：其余展示处只显示正面） ===== */
.coupon-card.coupon-flip .coupon-front-img {
  align-items: center;
  gap: 6px;
}
.coupon-front-text { display: flex; flex-direction: column; gap: 2px; }
.coupon-front-text .coupon-card-title { margin-bottom: 0; }
.coupon-small-img {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.coupon-small-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.coupon-small-text .coupon-card-title { margin-bottom: 0; font-size: 14px; }
.coupon-small-text .coupon-card-desc { margin-bottom: 0; }

/* 收集进度：已拥有小券以券面图呈现，去掉胶囊背景 */
.collect-smalls span.got {
  background: transparent;
  border-color: transparent;
  padding: 0;
  color: inherit;
}
.collect-smalls span.got .coupon-face-img.small { width: 32px; height: 32px; }
.collect-small-empty {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: #f3f4f6; color: var(--text-light); border: 1px solid var(--border);
}

/* 时间轴发券信息：券面图 + 文字并排 */
.timeline-coupon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  color: #92400e;
  background: #fffbeb;
  border: 1px dashed #fde68a;
  border-radius: 8px;
  padding: 4px 8px;
}
.timeline-coupon .coupon-face-img.small { width: 26px; height: 26px; border-radius: 7px; }
.timeline-coupon-text { line-height: 1.5; }

/* 云图切换器：大券·小券数量 */
.cloud-mode-select { width: auto; }

/* ===== 学生端小程序 · 「更多」入口（需求1） ===== */
.mobile-more-btn b { color: #64748b; }
body.mobile-demo .mobile-bottom-nav button.mobile-more-btn:active { background: #f1f5f9; }
.more-entry-grid { display: flex; flex-direction: column; gap: 10px; }
.more-entry-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.more-entry-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
}
.more-entry-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.more-entry-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.more-entry-info b { font-size: 14px; color: var(--text); }
.more-entry-info span { font-size: 11px; color: var(--text-light); }
.more-entry-arrow { font-size: 18px; color: #cbd5e1; flex-shrink: 0; }

/* 移动端 / 窄屏适配 */
@media (max-width: 760px) {
  .coupon-admin-grid { grid-template-columns: 1fr; }
  .drill-small-list { grid-template-columns: 1fr 1fr; }
  .coupon-drill-summary { gap: 8px; }
  .coupon-view-grid,
  .coupon-upload-row { grid-template-columns: 1fr; }
}
body.mobile-demo .coupon-drill-block { margin-top: 8px; }
body.mobile-demo .coupon-admin-grid { grid-template-columns: 1fr; }
body.mobile-demo .small-admin-items { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
body.mobile-demo .coupon-view-grid,
body.mobile-demo .coupon-upload-row { grid-template-columns: 1fr; }
