/* ==================== 全局样式 ==================== */
:root {
  --primary: #1565c0;
  --primary-dark: #0d47a1;
  --primary-light: #e3f2fd;
  --success: #2e7d32;
  --success-light: #e8f5e9;
  --warning: #e65100;
  --warning-light: #fff3e0;
  --danger: #c62828;
  --danger-light: #ffebee;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --wind-blue: #1565c0;
  --wind-teal: #00838f;
  /* CEEC 品牌色 */
  --ceec-blue: #005bac;
  --ceec-red: #e60012;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

/* ==================== 首页 Logo Hero ==================== */
.logo-hero {
  padding: 12px 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(243,248,255,0.85) 100%);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,91,172,0.10), 0 1px 4px rgba(0,0,0,0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* 官方中国能建Logo - 首页 */
.logo-ceec-official {
  width: 400px;
  max-width: 92vw;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  filter: drop-shadow(0 6px 26px rgba(0,91,172,0.18));
}
@media (max-width: 400px) {
  .logo-ceec-official { width: 300px; }
}

/* APP下载卡片 */
.app-download-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #d6e8f7 !important;
  box-shadow: 0 2px 24px rgba(0,91,172,0.08);
}
.qr-wrapper {
  display: inline-block;
  padding: 12px;
  background: #fff;
  border-radius: 16px;
  border: 2px dashed #b8d4f0;
}
.app-download-tip {
  font-size: 11px;
  color: var(--primary);
  background: #eef6ff;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}

/* 吸顶操作栏：将提交等按钮固定在页面上部，避免被底部菜单栏遮挡 */
.exam-action-bar {
  position: sticky;
  top: 56px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #eef6ff 0%, #e3f2fd 100%);
  border: 1px solid #cfe4fb;
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0,91,172,0.10);
}
.exam-action-bar .exam-progress-text {
  font-size: 13px;
  color: var(--ceec-blue);
  font-weight: 600;
}
.exam-action-bar #submit-btn {
  margin-top: 0;
  flex-shrink: 0;
  padding: 10px 22px;
  font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ==================== 通用组件 ==================== */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  /* 预留底部固定任务栏高度 + 刘海/安全区，避免长页面内容被遮挡、任务栏后不出现网页内容 */
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
  transition: box-shadow 0.2s, transform 0.15s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  min-height: 44px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}

.btn:active::after { background: rgba(255,255,255,0.15); }

.btn-primary { background: linear-gradient(135deg, var(--primary), #1976d2); color: #fff; box-shadow: 0 2px 8px rgba(21,101,192,0.3); }
.btn-primary:hover { background: linear-gradient(135deg, #1976d2, var(--primary)); box-shadow: 0 4px 14px rgba(21,101,192,0.35); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(21,101,192,0.3); }

.btn-success { background: linear-gradient(135deg, var(--success), #43a047); color: #fff; box-shadow: 0 2px 8px rgba(46,125,50,0.25); }
.btn-success:hover { box-shadow: 0 4px 14px rgba(46,125,50,0.35); transform: translateY(-1px); }

.btn-danger { background: linear-gradient(135deg, var(--danger), #d32f2f); color: #fff; box-shadow: 0 2px 8px rgba(198,40,40,0.25); }
.btn-danger:hover { box-shadow: 0 4px 14px rgba(198,40,40,0.35); }

.btn-outline { background: #fff; border: 2px solid var(--border); color: var(--text); box-shadow: none; }
.btn-outline:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; min-height: 32px; }
.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

input, select, textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}

input::placeholder, textarea::placeholder { color: #9aa0a6; }

input[type="checkbox"], input[type="radio"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--text); }

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

/* ==================== 顶部导航 ==================== */
.app-header {
  background: linear-gradient(135deg, #0d47a1 0%, #006064 50%, #004d40 100%);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(13,71,161,0.25);
}

.app-header h1 { font-size: 17px; font-weight: 600; letter-spacing: 0.5px; }
.app-header .back-btn { color: rgba(255,255,255,0.9); font-size: 24px; cursor: pointer; padding: 0 4px; }

/* ==================== 底部导航 ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  display: flex;
  border-top: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 4px 5px;
  color: #9aa0a6;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  text-decoration: none;
  position: relative;
}

.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: -1px; left: 20%; right: 20%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--wind-teal));
  border-radius: 0 0 3px 3px;
}
.bottom-nav-item .icon { font-size: 22px; margin-bottom: 2px; transition: transform 0.2s; }
.bottom-nav-item.active .icon { transform: scale(1.1); }
.bottom-nav-item .label { font-size: 11px; font-weight: 500; }

/* ==================== 标签和徽章 ==================== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--primary-light); color: var(--primary); }
.badge-blue { background: #e3f0ff; color: #1a73e8; }
.badge-gray { background: #f1f3f4; color: var(--text-secondary); }

/* ==================== 进度条 ==================== */
.progress-bar {
  width: 100%;
  height: 10px;
  background: #e8eaed;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #42a5f5);
  border-radius: 5px;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }

/* ==================== 空状态 ==================== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* ==================== 弹窗 ==================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal h3 { margin-bottom: 12px; }

/* ==================== Toast 提示 ==================== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 2000;
  animation: fadeIn 0.3s, fadeOut 0.3s 2.7s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* ==================== 响应式 ==================== */
@media (min-width: 768px) {
  .container { max-width: 600px; }
}

/* ==================== 管理后台专用 ==================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 240px;
  background: linear-gradient(180deg, #0d1b2a 0%, #1b263b 50%, #0d1b2a 100%);
  color: #e0e1dd;
  padding: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 200;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.admin-sidebar .logo {
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.sidebar-logo-chip {
  display: block;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}
.sidebar-logo-img {
  width: 150px;
  max-width: 100%;
  height: auto;
  display: inline-block;
}
.sidebar-brand {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}
.sidebar-user {
  padding: 8px 14px 10px;
  border-bottom: 1px solid #334155;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.sidebar-logout {
  flex-shrink: 0;
  border-top: 1px solid #334155;
}

/* 移动端抽屉遮罩 */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 250;
}

.admin-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  font-size: 13px;
  flex-shrink: 0;
}

.admin-sidebar .nav-item:hover { background: rgba(255,255,255,0.06); color: #e0e1dd; padding-left: 22px; }
.admin-sidebar .nav-item.active { background: linear-gradient(90deg, rgba(21,101,192,0.3), transparent); color: #fff; border-left: 3px solid var(--primary); }
.admin-sidebar .nav-item .icon { font-size: 16px; }

.admin-main {
  flex: 1;
  margin-left: 240px;
  padding: 24px;
  background: var(--bg);
}

.admin-topbar {
  background: #fff;
  padding: 14px 24px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
}

.admin-topbar h2 { font-size: 18px; font-weight: 700; color: var(--text); }

/* 数据卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-card .stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-card .stat-info { flex: 1; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; color: var(--text); }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* 表格 */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.data-table th {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  padding: 13px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 11px;
}

.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f0f1f3;
  font-size: 14px;
  color: var(--text);
}

.data-table tbody tr { transition: background 0.15s; }
.data-table tr:hover { background: #f8f9fc; }
.data-table tr:last-child td { border-bottom: none; }
.data-table thead tr:first-child th:first-child { border-radius: var(--radius) 0 0 0; }
.data-table thead tr:first-child th:last-child { border-radius: 0 var(--radius) 0 0; }

/* 操作按钮组 */
.action-group { display: flex; gap: 6px; }

/* 搜索框 */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-bar input, .search-bar select {
  width: auto;
  min-width: 180px;
}

/* ==================== 级别筛选 Chips（视频管理） ==================== */
.level-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.level-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
  justify-content: center;
}

.level-chip:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.level-chip.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), #1976d2);
  box-shadow: 0 2px 8px rgba(21,101,192,0.3);
}

.level-chip-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.level-chip.active .level-chip-name {
  color: #fff;
}

.level-chip-hours {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.2;
}

.level-chip.active .level-chip-hours {
  color: rgba(255,255,255,0.85);
}

/* 移动端管理界面 */
@media (max-width: 768px) {
  /* 侧边栏改为「常驻折叠栏」：默认只显示图标窄栏，右滑/点汉堡展开完整菜单 */
  .admin-sidebar {
    width: 56px;                 /* 折叠态：仅图标窄栏，常驻可见 */
    transform: none;
    transition: width 0.25s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,0.18);
    z-index: 260;
    overflow-x: hidden;
  }
  /* 展开态：显示完整内容，宽度不超过屏幕横向三分之一 */
  body.sidebar-open .admin-sidebar {
    width: min(230px, 33vw);
    box-shadow: 4px 0 24px rgba(0,0,0,0.28);
  }

  /* 折叠态：隐藏文字/品牌/用户信息，仅留居中图标 */
  .admin-sidebar .logo { padding: 12px 6px 10px; }
  .sidebar-logo-chip { padding: 5px 4px; }
  .sidebar-logo-img { width: 100%; }
  .sidebar-brand,
  .sidebar-user,
  .admin-sidebar .nav-item .text { display: none; }
  .admin-sidebar .nav-item {
    justify-content: center;
    padding: 14px 0;
    gap: 0;
  }
  .admin-sidebar .nav-item:hover { padding-left: 0; }

  /* 展开态：恢复文字与用户信息 */
  body.sidebar-open .admin-sidebar .logo { padding: 14px 12px; }
  body.sidebar-open .sidebar-logo-chip { padding: 8px 10px; }
  body.sidebar-open .sidebar-brand { display: block; font-size: 12px; }
  body.sidebar-open .sidebar-user { display: flex; padding: 10px 14px; }
  body.sidebar-open .admin-sidebar .nav-item {
    justify-content: flex-start;
    padding: 12px 14px;
    gap: 10px;
  }
  body.sidebar-open .admin-sidebar .nav-item .text {
    display: inline;
    font-size: 13px;
    line-height: 1.25;
    white-space: normal;        /* 窄栏内长标题自动换行，不被截断 */
    word-break: break-all;
  }

  /* 主内容区始终给折叠栏留出宽度；展开时菜单以浮层覆盖，内容不跳动 */
  .admin-main { margin-left: 56px; padding: 14px; }
  .admin-topbar { padding: 12px 14px; }

  /* 展开时右侧内容遮罩（不盖住菜单），点击收起 */
  .sidebar-backdrop { left: min(230px, 33vw); }
  body.sidebar-open .sidebar-backdrop { display: block; }

  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 10px; }
}

/* ==================== 考试页面 ==================== */
.exam-question {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.exam-question .q-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.5;
}

.exam-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.exam-option:hover { border-color: var(--primary); background: var(--primary-light); }
.exam-option.selected { border-color: var(--primary); background: var(--primary-light); }
.exam-option.correct { border-color: var(--success); background: #e6f4ea; }
.exam-option.wrong { border-color: var(--danger); background: #fce8e6; }

.exam-option .option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.exam-option.selected .option-letter { background: var(--primary); color: #fff; }
.exam-option.correct .option-letter { background: var(--success); color: #fff; }
.exam-option.wrong .option-letter { background: var(--danger); color: #fff; }

/* ==================== 证书样式 ==================== */
.certificate-container {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.certificate-container::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(26,115,232,0.03) 0%, transparent 70%);
}

/* ==================== 证书样式（简约正式版） ==================== */

.cert-card {
  max-width: 600px;
  margin: 0 auto 24px;
  background: #fff;
  border: 1px solid #c8d6e5;
  position: relative;
}

/* 证书外边框装饰 */
.cert-card::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 2px solid #1a237e;
  pointer-events: none;
}

/* 标题区 */
.cert-header {
  text-align: center;
  padding: 36px 24px 20px;
  border-bottom: 1px solid #e0e0e0;
}

.cert-header-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a237e;
  letter-spacing: 6px;
}

.cert-header-subtitle {
  font-size: 13px;
  color: #666;
  margin-top: 8px;
  letter-spacing: 2px;
}

/* 正文区 */
.cert-body {
  padding: 32px 40px 24px;
}

.cert-body-content {
  text-align: center;
}

/* 信息表格 */
.cert-info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto;
  max-width: 440px;
}

.cert-info-table td {
  padding: 8px 12px;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}

.cert-info-table .label {
  color: #888;
  width: 100px;
  text-align: right;
  font-size: 13px;
}

.cert-info-table .value {
  color: #1a237e;
  font-weight: 600;
  text-align: left;
}

/* 成绩表格 */
.cert-score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px auto;
  max-width: 440px;
  font-size: 13px;
}

.cert-score-table th {
  background: #f5f5f5;
  color: #555;
  font-weight: 600;
  padding: 10px 8px;
  border: 1px solid #ddd;
  text-align: center;
}

.cert-score-table td {
  padding: 10px 8px;
  border: 1px solid #ddd;
  text-align: center;
  color: #333;
}

.cert-score-table .score-num {
  font-size: 16px;
  font-weight: 700;
  color: #1a237e;
}

/* 底部区 */
.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 20px 40px 28px;
}

/* 证书操作按钮：吸底悬浮于底部菜单栏之上，始终可点击，不被遮挡 */
.cert-actions-sticky {
  position: sticky;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 90;
  display: flex;
  gap: 8px;
  padding: 10px 24px;
  margin-top: 10px;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 14px rgba(0,0,0,0.06);
}

.cert-meta {
  font-size: 12px;
  color: #666;
  line-height: 2;
}

.cert-meta .cert-no {
  font-weight: 600;
  color: #333;
}

/* 印章（公章样式，SVG 渲染） */
.cert-seal {
  width: 112px;
  height: 112px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cert-seal-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* 证书证明语（成绩上方） */
.cert-statement {
  font-size: 14px;
  color: #333;
  line-height: 1.8;
  text-align: center;
  margin: 16px auto 4px;
  max-width: 440px;
  font-weight: 500;
}

/* 证书二维码 */
.cert-qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.cert-qr {
  width: 90px;
  height: 90px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  display: block;
}

.cert-qr-text {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.cert-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: 48px;
  font-weight: 900;
  color: rgba(200, 40, 40, 0.08);
  pointer-events: none;
  z-index: 5;
}
  background: #f5f5f5;
  border: 2px dashed #bdbdbd;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 32px;
  color: #bdbdbd;
}

/* 过期/撤销水印 */
.cert-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%) rotate(-25deg);
  font-size: 56px;
  font-weight: 900;
  color: rgba(234,67,53,0.12);
  border: 6px solid rgba(234,67,53,0.12);
  padding: 12px 32px;
  border-radius: 12px;
  pointer-events: none;
  z-index: 2;
}

/* 人脸识别弹窗样式 */
.face-guide-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 180px;
  height: 220px;
  border: 3px solid rgba(255,255,255,0.7);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.3);
}

/* ==================== 加载动画 ==================== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

/* ==================== 工具类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }

/* 专项培训：批量筛选 chip */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  user-select: none;
  transition: all .15s;
}
.filter-chip:hover { border-color: var(--primary); }
.filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 证书二维码设置区域 */
.qr-settings-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}
.qr-settings-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
  border-bottom: 1px solid #e2e8f0;
  user-select: none;
}
.qr-settings-header strong { font-size: 14px; color: #1a237e; }
.qr-settings-sub { font-size: 12px; color: #888; }
.qr-toggle-icon { margin-left: auto; color: #aaa; font-size: 12px; }
.qr-settings-body-visible { display: block; }
#qr-options-body {
  padding: 14px 16px 12px;
}
#qr-options-body[style*="display: none"] { display: none !important; }
.qr-section { margin-bottom: 10px; }
.qr-section:last-of-type { margin-bottom: 0; }
.qr-section-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.qr-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px 10px;
}
.qr-grid-sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.qr-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.qr-chip:hover { background: #eff6ff; border-color: #bfdbfe; }
.qr-chip input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; }
.qr-chip span { color: #334155; line-height: 1.3; }
.qr-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}
.qr-msg { font-size: 13px; color: #2e7d32; font-weight: 500; }

/* 人员附件多文件上传 */
.attach-type-group { margin-bottom: 8px; }
.attach-pdf-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: #e3f2fd; color: #1565c0;
  border-radius: 6px; font-size: 12px; text-decoration: none;
  transition: background 0.2s;
}
.attach-pdf-link:hover { background: #bbdefb; }
.attach-preview-grid { min-height: 30px; }
