:root {
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-secondary: #909399;
  --border: #e9ecf0;
  --header-bg: linear-gradient(135deg, var(--primary-dark), var(--primary));
  --sidebar-bg: linear-gradient(180deg, var(--primary-dark), var(--primary));
  --primary: #2a5298;
  --primary-dark: #1e3c72;
  --menu-text: #d0d8e8;
  --menu-active: #ffffff;
}

body.dark {
  --bg: #1a1a2e;
  --card-bg: #16213e;
  --text: #e0e0e0;
  --text-secondary: #a0a0b0;
  --border: #2a2a4a;
  --header-bg: #0f3460;
  --sidebar-bg: #0f3460;
  --menu-text: #c0c8d8;
}

body, html {
  margin: 0; padding: 0;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* 加载遮罩 */
#loading-screen {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255,255,255,0.95);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
}
#loading-screen .el-icon-loading {
  font-size: 48px;
  color: var(--primary);
}
body.dark #loading-screen {
  background: rgba(26,26,46,0.95);
}

/* 水印层 */
.watermark {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9998;
  pointer-events: none;
  background-size: 400px 280px !important; /* 原来是 300px 200px，现在变大，水印更稀疏 */
}

/* 登录页 */
.login-container {
  display: flex; justify-content: center; align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 20px;
}
.login-card {
  width: 420px; max-width: 100%;
  border-radius: 16px; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
}
.login-title { text-align: center; margin-bottom: 30px; font-size: 26px; font-weight: 600; color: var(--primary-dark); }

/* 顶部栏 */
.app-header {
  height: 56px; background: var(--header-bg);
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.header-left { display: flex; align-items: center; }
.header-brand { font-size: 18px; font-weight: 600; }
.menu-btn { color: #fff !important; font-size: 24px; padding: 8px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 14px; white-space: nowrap; }
.theme-btn { color: #fff !important; font-size: 22px; padding: 8px; }
.el-dropdown-link { color: #fff; cursor: pointer; }

/* 侧边栏（电脑端） */
.sidebar {
  background: var(--sidebar-bg) !important;
  box-shadow: 2px 0 12px rgba(0,0,0,0.1);
  display: flex; flex-direction: column;
}
.el-menu { background: transparent !important; border-right: none !important; }
.el-menu-item {
  color: var(--menu-text) !important;
  transition: all 0.3s;
  height: 48px; line-height: 48px;
}
.el-menu-item:hover { background: rgba(255,255,255,0.15) !important; color: #fff !important; }
.el-menu-item.is-active { background: rgba(255,255,255,0.25) !important; color: #fff !important; }

/* 移动端抽屉菜单（强制背景） */
.el-drawer {
  background-color: var(--sidebar-bg) !important;
}
/* 确保抽屉头部不透明 */
.el-drawer .el-drawer__header {
  background: var(--sidebar-bg) !important;
  margin-bottom: 0; /* 如果有底部线条保留 */
}
.el-drawer .el-drawer__body {
  background: var(--sidebar-bg) !important;
}
.el-drawer .el-menu {
  background: transparent !important;
}
.el-drawer .el-menu-item {
  color: var(--menu-text) !important;
  height: 48px; line-height: 48px;
}
.el-drawer .el-menu-item:hover,
.el-drawer .el-menu-item.is-active {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
}

/* 主内容 */
.el-main { background: var(--bg); padding: 20px; }

/* 卡片 */
.el-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  transition: all 0.3s;
  margin-bottom: 16px;
}
.el-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.el-card__header { font-weight: 600; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.el-card__body { padding: 18px; }

/* 数据概览 */
.core-card-inner { display: flex; align-items: center; gap: 10px; }
.core-icon {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
}
.core-text { flex: 1; min-width: 0; }
.core-desc { font-size: 12px; color: var(--text-secondary); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stat-card {
  border-top: 3px solid var(--primary);
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-bg) 80%) !important;
}
.stat-label { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }
.stat-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }

/* 题目卡片 */
.question-card { border-left: 5px solid var(--primary); }
.q-number {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; border-radius: 50%;
  width: 28px; height: 28px; font-size: 14px; margin-right: 10px; flex-shrink: 0;
}

/* 按钮 */
.el-button--primary { background: var(--primary) !important; border-color: var(--primary) !important; }
.el-button--success { background: #67C23A !important; border-color: #67C23A !important; }
.el-button--warning { background: #E6A23C !important; border-color: #E6A23C !important; }

/* 计时器 */
.exam-timer {
  font-size: 20px; font-weight: 700; color: #e6a23c;
  background: #fef0d8; padding: 8px 16px; border-radius: 8px; display: inline-block;
  margin-bottom: 16px;
}

.ring-container { display: flex; justify-content: center; padding: 10px 0; }
.table-container { width: 100%; overflow-x: auto; }

/* 版权栏 */
.footer-bar {
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 13px;
  color: #909399;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 10px;
}

/* 暗色模式 */
body.dark .el-card,
body.dark .el-table,
body.dark .el-drawer,
body.dark .el-menu { background-color: var(--card-bg) !important; color: var(--text) !important; }
body.dark .el-table th.el-table__cell { background-color: #1a1a2e !important; }
body.dark .el-menu-item { color: var(--menu-text) !important; }
body.dark .el-menu-item:hover,
body.dark .el-menu-item.is-active { background-color: rgba(255,255,255,0.1) !important; }

/* 响应式 */
@media (max-width: 768px) {
  .login-card { width: 90%; margin: 0 auto; }
  .login-title { font-size: 22px; }
  .app-header { padding: 0 10px; }
  .header-brand { display: none; }
  .user-name { font-size: 13px; }
  .el-main { padding: 12px; }

  .core-stats .el-col { margin-bottom: 12px; }
  .core-icon { width: 40px; height: 40px; border-radius: 10px; }
  .core-icon i { font-size: 20px !important; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 13px; }
  .core-desc { font-size: 11px; }

  .ring-container .el-progress--circle { width: 120px !important; height: 120px !important; }
  .ring-container .el-progress__text { font-size: 18px !important; }

  .el-table { overflow-x: auto; display: block; width: 100%; }
  .el-table__header-wrapper, .el-table__body-wrapper { min-width: 400px; }

  .el-radio-group .el-radio { display: block; margin-bottom: 8px; margin-right: 0; }

  .el-drawer { width: 80% !important; }
  .el-drawer .el-menu-item { height: 44px; line-height: 44px; font-size: 15px; }

  .exam-timer { font-size: 18px; padding: 6px 12px; }

  .footer-bar { font-size: 11px; }
}

/* 答题卡小方格 */
.question-nav {
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nav-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: all 0.2s;
}
.nav-dot.answered {
  background: #67C23A;
  color: #fff;
  border-color: #67C23A;
}
.nav-dot.current {
  box-shadow: 0 0 0 2px var(--primary);
}

/* 水印层透明度和背景大小已在 app.js 中设置，此处覆盖备用 */
.watermark {
  background-size: 500px 300px !important;
}

/* 确保抽屉头部背景不透明 */
.el-drawer .el-drawer__header {
  background: var(--sidebar-bg) !important;
  margin-bottom: 0;
}