/* ============================================================
   PHP 面试通 — 全局样式 v2.0
   设计理念: 现代化、层次分明、微交互丰富
   ============================================================ */

/* ===== 设计令牌 ===== */
:root {
  /* 品牌色 */
  --php-purple: #777BB4;
  --php-dark: #4F5B93;
  --php-deep: #3B4474;
  --php-light: #a78bfa;
  --php-glow: rgba(119, 123, 180, 0.15);

  /* 背景 */
  --bg-primary: #f5f6fb;
  --bg-secondary: #eef0f8;
  --bg-card: #ffffff;
  --bg-hover: #f8f9ff;

  /* 文字 */
  --text-primary: #1e2138;
  --text-secondary: #5c6280;
  --text-tertiary: #9398ad;
  --text-on-primary: #ffffff;

  /* 边框 */
  --border: #e3e6f0;
  --border-light: #eef0f8;
  --border-strong: #d1d5e8;

  /* 语义色 */
  --success: #16c784;
  --success-bg: #e6f9f1;
  --success-border: #b8edd3;
  --warning: #f5a623;
  --warning-bg: #fef5e7;
  --warning-border: #fce4b3;
  --danger: #f6465d;
  --danger-bg: #fdeef0;
  --danger-border: #f9cdd3;
  --info: #3b82f6;
  --info-bg: #ebf3fe;

  /* 阴影 — 多层次 */
  --shadow-xs: 0 1px 2px rgba(30, 33, 56, 0.04);
  --shadow-sm: 0 2px 8px rgba(30, 33, 56, 0.06), 0 1px 2px rgba(30, 33, 56, 0.04);
  --shadow-md: 0 6px 20px rgba(30, 33, 56, 0.08), 0 2px 6px rgba(30, 33, 56, 0.04);
  --shadow-lg: 0 12px 40px rgba(30, 33, 56, 0.12), 0 4px 12px rgba(30, 33, 56, 0.06);
  --shadow-xl: 0 24px 64px rgba(30, 33, 56, 0.16), 0 8px 24px rgba(30, 33, 56, 0.08);
  --shadow-glow: 0 0 0 4px var(--php-glow);

  /* 圆角 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* 过渡 */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* 渐变 */
  --gradient-brand: linear-gradient(135deg, #4F5B93 0%, #777BB4 50%, #a78bfa 100%);
  --gradient-brand-soft: linear-gradient(135deg, rgba(79,91,147,0.06), rgba(167,139,250,0.06));
  --gradient-hero: linear-gradient(135deg, #2d3561 0%, #4F5B93 35%, #777BB4 70%, #a78bfa 100%);
  --gradient-card-hover: linear-gradient(135deg, rgba(119,123,180,0.03), rgba(167,139,250,0.03));

  /* 字体 */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'Courier New', monospace;

  /* 代码块内联背景 */
  --code-inline-bg: #f1f5f9;
  --code-inline-color: #4F5B93;
  --chat-user-bubble: #e8eaf6;
}

/* ===== 暗黑模式 ===== */
[data-theme="dark"] {
  --php-purple: #9ba0d4;
  --php-dark: #6b7ac4;
  --php-deep: #4a5490;
  --php-light: #b8a4ff;
  --php-glow: rgba(155, 160, 212, 0.12);

  --bg-primary: #0f1117;
  --bg-secondary: #1a1d28;
  --bg-card: #161821;
  --bg-hover: #1e2130;

  --text-primary: #e2e4f0;
  --text-secondary: #9499b8;
  --text-tertiary: #6b7088;
  --text-on-primary: #ffffff;

  --border: #2a2d3a;
  --border-light: #222530;
  --border-strong: #363948;

  --success: #2dd4a7;
  --success-bg: rgba(45, 212, 167, 0.1);
  --success-border: rgba(45, 212, 167, 0.25);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.1);
  --warning-border: rgba(251, 191, 36, 0.25);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.1);
  --danger-border: rgba(248, 113, 113, 0.25);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.1);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 0 4px var(--php-glow);

  --gradient-brand: linear-gradient(135deg, #4a5490 0%, #6b7ac4 50%, #b8a4ff 100%);
  --gradient-brand-soft: linear-gradient(135deg, rgba(107,122,196,0.08), rgba(184,164,255,0.08));
  --gradient-hero: linear-gradient(135deg, #1a1d28 0%, #2a2d50 35%, #4a5490 70%, #6b7ac4 100%);
  --gradient-card-hover: linear-gradient(135deg, rgba(155,160,212,0.04), rgba(184,164,255,0.04));

  --code-inline-bg: #2a2d3a;
  --code-inline-color: #b8a4ff;
  --chat-user-bubble: #2a2d48;
}

/* ===== 重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  font-size: 15px;
  letter-spacing: -0.01em;
}

/* ===== 工具类 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.ml-2 { margin-left: 8px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.w-full { width: 100%; }
.relative { position: relative; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 收藏按钮 ===== */
.bookmark-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); transition: all var(--transition);
  flex-shrink: 0;
}
.bookmark-btn:hover { color: var(--warning); background: var(--warning-bg); }
.bookmark-btn.active { color: var(--warning); }

/* ===== 课程学习 ===== */
.course-list { display: flex; flex-direction: column; gap: 12px; }
.course-section {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.course-section.current { border-color: var(--php-purple); }
.course-section.completed { opacity: 0.85; }
.course-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  transition: background var(--transition);
}
.course-section-header:hover { background: var(--bg-hover); }
.course-section-left { display: flex; align-items: center; gap: 14px; flex: 1; }
.course-section-num {
  width: 32px; height: 32px; border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
  background: var(--bg-secondary); color: var(--text-secondary);
  transition: all var(--transition);
}
.course-section-num.done { background: var(--success); color: #fff; }
.course-section-num.active { background: var(--php-dark); color: #fff; }
.course-section-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.course-section-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.course-section-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.course-section-toggle { display: flex; transition: transform var(--transition); color: var(--text-tertiary); }
.course-section-body {
  padding: 0 20px 20px 66px;
  border-top: 1px solid var(--border-light);
  animation: fadeIn 0.2s ease;
}
.course-section-content {
  font-size: 14px; line-height: 1.8; color: var(--text-primary);
  padding: 16px 0;
}

/* ===== 每日一题卡片 ===== */
.daily-question-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand-soft);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.daily-question-card:hover {
  border-color: var(--php-purple);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.daily-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.daily-question-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.5;
}
.daily-question-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.daily-question-right {
  color: var(--php-dark);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ===== 搜索栏 ===== */
.practice-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.practice-search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary);
  display: flex;
  pointer-events: none;
}
.practice-search-input {
  padding-left: 42px !important;
  flex: 1;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  padding: 24px;
  transition: box-shadow var(--transition);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-ui);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--php-dark);
  color: #fff;
}
.btn-primary:hover {
  background: var(--php-purple);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  border: 1.5px solid var(--border-strong);
  color: var(--php-dark);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--php-purple);
  background: var(--php-glow);
}

.btn-sm { padding: 7px 16px; font-size: 12px; }
.btn-lg { padding: 14px 36px; font-size: 16px; border-radius: var(--radius); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 2px 8px rgba(246,70,93,0.25); }
.btn-danger:hover { background: #e03450; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(246,70,93,0.3); }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 2px 8px rgba(22,199,132,0.25); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}
.form-input {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-ui);
  color: var(--text-primary);
  background: var(--bg-card);
  transition: all var(--transition);
  outline: none;
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-input:hover { border-color: var(--border-strong); }
.form-input:focus {
  border-color: var(--php-purple);
  box-shadow: var(--shadow-glow);
}
.form-select {
  appearance: none;
  background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%235c6280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E") no-repeat right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* ===== 自定义下拉组件 ===== */
.cs {
  position: relative;
  display: inline-block;
  width: 100%;
}
.cs-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 14px;
  font-family: var(--font-ui);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  outline: none;
  text-align: left;
}
.cs-trigger:hover { border-color: var(--border-strong); }
.cs.open .cs-trigger {
  border-color: var(--php-purple);
  box-shadow: var(--shadow-glow);
}
.cs-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-text:empty::before {
  content: attr(data-placeholder);
  color: var(--text-tertiary);
}
.cs-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  color: var(--text-tertiary);
  transition: transform var(--transition);
}
.cs.open .cs-arrow { transform: rotate(180deg); color: var(--php-purple); }
.cs-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 260px;
  overflow-y: auto;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  padding: 4px;
}
.cs.open .cs-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.cs-option {
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cs-option:hover { background: var(--bg-hover); }
.cs-option.active {
  background: var(--php-glow);
  color: var(--php-dark);
  font-weight: 600;
}
.cs-option.active::after {
  content: '';
  margin-left: auto;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%234F5B93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/contain no-repeat;
}
/* Smaller variant for filter bars */
.cs-sm .cs-trigger { padding: 9px 14px; font-size: 13px; min-width: 130px; }
/* dark scrollbar for dropdown */
.cs-menu::-webkit-scrollbar { width: 6px; }
.cs-menu::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ===== 导航栏 ===== */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-brand { display: flex; align-items: center; gap: 10px; cursor: pointer; text-decoration: none; }
.nav-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--php-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
}
.nav-brand:hover .nav-brand-icon { background: var(--php-purple); }
.nav-brand-text {
  font-weight: 800;
  font-size: 18px;
  color: var(--php-dark);
  letter-spacing: -0.02em;
}
.nav-links { display: flex; gap: 2px; }
.nav-link {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--transition);
  font-family: var(--font-ui);
}
.nav-link:hover { color: var(--php-dark); background: var(--php-glow); }
.nav-link.active {
  color: var(--php-dark);
  background: var(--php-glow);
  font-weight: 600;
}
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--php-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/* ===== 页面切换 ===== */
.page { display: none; animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.page.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 网格 ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ===== 技能卡片 ===== */
.skill-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.skill-card:hover {
  border-color: var(--php-purple);
  box-shadow: var(--shadow-sm);
}
.skill-card-icon { font-size: 30px; margin-bottom: 12px; }
.skill-card-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; letter-spacing: -0.01em; }
.skill-card-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.6; }
.skill-card-meta { display: flex; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.skill-card-meta span { padding: 3px 10px; border-radius: var(--radius-full); background: var(--bg-secondary); font-weight: 500; }

/* ===== 进度条 ===== */
.progress-bar { height: 7px; background: var(--bg-secondary); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--php-purple);
}

/* ===== 徽章 ===== */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
}
.badge-l1 { background: var(--success-bg); color: #0a7c4e; border: 1px solid var(--success-border); }
.badge-l2 { background: var(--warning-bg); color: #8a5300; border: 1px solid var(--warning-border); }
.badge-l3 { background: var(--danger-bg); color: #b91c3a; border: 1px solid var(--danger-border); }
.badge-purple { background: #f0ebff; color: var(--php-dark); border: 1px solid #d9ccff; }

/* ===== 标签页 ===== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border-light); margin-bottom: 24px; }
.tab {
  padding: 11px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-ui);
}
.tab:hover { color: var(--php-dark); }
.tab.active {
  color: var(--php-dark);
  border-bottom-color: var(--php-purple);
  font-weight: 600;
}

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 33, 56, 0.4);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 18px; letter-spacing: -0.01em; }

/* ===== Toast ===== */
.toast-container { position: fixed; top: 80px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  padding: 13px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  animation: toastIn 0.3s ease;
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--php-dark); }
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== 统计卡片 ===== */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  text-align: center;
  transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-sm); }
.stat-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--php-dark);
  letter-spacing: -0.02em;
}
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 6px; font-weight: 500; }

/* ===== 标题 ===== */
.section-title { font-size: 22px; font-weight: 800; margin-bottom: 20px; letter-spacing: -0.02em; }
.section-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; margin-top: -14px; }

/* ===== 加载 ===== */
.loading { text-align: center; padding: 48px; color: var(--text-secondary); }
.spinner {
  display: inline-block;
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--php-purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 空状态 ===== */
.empty { text-align: center; padding: 56px 24px; color: var(--text-secondary); }
.empty-icon { font-size: 52px; margin-bottom: 16px; opacity: 0.8; }
.empty h3, .empty h2 { color: var(--text-primary); margin-bottom: 8px; }

/* ===== 筛选栏 ===== */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-bar .form-select, .filter-bar .form-input { padding: 9px 14px; font-size: 13px; width: auto; min-width: 130px; }

/* ===== 题目卡片 ===== */
.question-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border-light);
  margin-bottom: 14px;
  transition: box-shadow var(--transition);
}
.question-card:hover { box-shadow: var(--shadow-sm); }
.question-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}
.question-number.correct-answer { background: var(--success); color: #fff; }
.question-number.wrong-answer { background: var(--danger); color: #fff; }

/* ===== 选项 ===== */
.option-item {
  display: block;
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition);
  text-align: left;
  background: var(--bg-card);
  font-family: var(--font-ui);
  color: var(--text-primary);
}
.option-item:hover { border-color: var(--php-purple); background: var(--bg-hover); }
.option-item.selected { border-color: var(--php-purple); background: #f0ebff; font-weight: 600; }
.option-item.correct { border-color: var(--success); background: var(--success-bg); color: #0a7c4e; font-weight: 600; }
.option-item.wrong { border-color: var(--danger); background: var(--danger-bg); color: #b91c3a; font-weight: 600; }
.option-item:disabled { cursor: default; }

/* ===== 代码块 ===== */
.code-block {
  background: #1a1b2e;
  color: #cdd6f4;
  padding: 18px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 12px 0;
  line-height: 1.7;
  border: 1px solid #2d2e4a;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}
.code-block code { background: none; padding: 0; color: inherit; }

/* 代码编辑器 */
.code-editor {
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
  background: #1a1b2e !important;
  color: #cdd6f4 !important;
  border: 1px solid #2d2e4a !important;
  border-radius: var(--radius) !important;
  padding: 14px !important;
  resize: vertical;
}
.code-editor:focus {
  border-color: var(--php-purple) !important;
  box-shadow: 0 0 0 3px var(--php-glow) !important;
}

/* ===== 解析框 ===== */
.explanation-box {
  background: var(--info-bg);
  border: 1px solid #b8d4fe;
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 18px;
  border-left: 4px solid var(--info);
}
.explanation-box.correct-explanation { background: var(--success-bg); border-color: var(--success-border); border-left-color: var(--success); }
.explanation-box.wrong-explanation { background: var(--danger-bg); border-color: var(--danger-border); border-left-color: var(--danger); }

/* ===== 雷达图 ===== */
.radar-container { max-width: 500px; margin: 0 auto; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .container { padding: 0 16px; }
  .filter-bar { flex-direction: column; }
  .tabs { overflow-x: auto; }
  .modal { padding: 24px; border-radius: var(--radius-lg); }
  .section-title { font-size: 19px; }
}

/* ===== 管理后台 ===== */
.admin-sidebar { width: 220px; min-height: calc(100vh - 64px); background: var(--bg-card); border-right: 1px solid var(--border-light); padding: 20px; }
.admin-content { flex: 1; padding: 28px; }
.admin-link { display: block; padding: 11px 16px; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 14px; cursor: pointer; margin-bottom: 4px; transition: all var(--transition); font-weight: 500; }
.admin-link:hover, .admin-link.active { background: var(--php-glow); color: var(--php-dark); }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border-light); font-size: 13px; }
th { background: var(--bg-secondary); font-weight: 600; color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: var(--bg-hover); }

/* ===== 定价卡片 ===== */
.pricing-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  text-align: center;
  transition: all var(--transition);
  position: relative;
}
.pricing-card.featured {
  border-color: var(--php-purple);
  box-shadow: var(--shadow-md);
}
.pricing-card:hover { box-shadow: var(--shadow-md); }
.pricing-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--php-dark);
  color: #fff;
  padding: 5px 18px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.pricing-name { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.pricing-price { font-size: 40px; font-weight: 800; color: var(--php-dark); margin-bottom: 18px; letter-spacing: -0.02em; }
.pricing-price small { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.pricing-features { list-style: none; margin: 18px 0; text-align: left; }
.pricing-features li { padding: 7px 0; font-size: 13px; color: var(--text-secondary); display: flex; align-items: flex-start; gap: 8px; }
.pricing-features li::before { content: '\2713'; color: var(--success); font-weight: 700; flex-shrink: 0; }

/* ===== 移动端导航 ===== */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2.5px; background: var(--text-primary); border-radius: 2px; transition: all var(--transition); }
.nav-toggle span+span { margin-top: 5px; }
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-card);
  z-index: 49;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.mobile-menu.show { display: flex; }
.mobile-menu .nav-link { padding: 15px 18px; font-size: 16px; border-radius: var(--radius); margin-bottom: 4px; text-align: left; width: 100%; font-weight: 500; }
.mobile-menu .nav-link.active { background: var(--php-glow); }
.mobile-menu .nav-user { padding: 16px; border-top: 1px solid var(--border-light); margin-top: auto; }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; }
  .navbar-inner .nav-user { display: none; }
}

/* ===== 计时器 ===== */
.question-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  transition: all var(--transition);
}
.question-timer.warning { color: var(--warning); background: var(--warning-bg); }
.question-timer.danger { color: var(--danger); background: var(--danger-bg); animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { opacity: 0.65; } }

/* ===== 用户下拉菜单 ===== */
.nav-user-wrapper { position: relative; display: flex; align-items: center; gap: 10px; }
.nav-theme-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--bg-card);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: all var(--transition); flex-shrink: 0;
}
.nav-theme-toggle:hover { border-color: var(--php-purple); color: var(--php-dark); background: var(--bg-hover); }
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 8px;
  z-index: 60;
  display: none;
  animation: dropdownIn 0.2s ease;
}
@keyframes dropdownIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.user-dropdown.show { display: block; }
.user-dropdown-header { padding: 14px; border-bottom: 1px solid var(--border-light); margin-bottom: 4px; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-ui);
}
.user-dropdown-item:hover { background: var(--php-glow); }

/* ===== 页脚 ===== */
.site-footer { background: #1a1b2e; color: #8890b0; padding: 48px 0 24px; margin-top: 72px; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 36px; }
.footer-brand { flex: 1; min-width: 220px; }
.footer-brand h3 { color: #fff; font-size: 19px; margin-bottom: 10px; letter-spacing: -0.01em; }
.footer-brand p { font-size: 13px; line-height: 1.8; }
.footer-links { display: flex; gap: 52px; }
.footer-col h4 { color: #d8dcea; font-size: 14px; margin-bottom: 14px; font-weight: 600; }
.footer-col a { display: block; font-size: 13px; color: #8890b0; text-decoration: none; padding: 5px 0; cursor: pointer; transition: color var(--transition); }
.footer-col a:hover { color: #fff; }
.footer-bottom { text-align: center; padding-top: 28px; margin-top: 28px; border-top: 1px solid #2a2b45; font-size: 12px; }
@media (max-width: 768px) { .footer-links { flex-direction: column; gap: 28px; } }

/* ===== 错题本 ===== */
.wrong-book-item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  border: 1px solid var(--border-light);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition);
}
.wrong-book-item:hover { border-color: var(--php-purple); box-shadow: var(--shadow-sm); }
.wrong-book-badge { font-size: 11px; padding: 3px 10px; border-radius: var(--radius-full); background: var(--danger-bg); color: #b91c3a; font-weight: 600; border: 1px solid var(--danger-border); }

/* ===== 能力诊断 ===== */
.diagnostic-progress { display: flex; gap: 5px; margin-bottom: 24px; }
.diagnostic-progress-step { flex: 1; height: 5px; border-radius: var(--radius-full); background: var(--border-light); transition: background 0.4s ease; }
.diagnostic-progress-step.done { background: var(--success); }
.diagnostic-progress-step.current { background: var(--php-purple); }
.diagnostic-result-card {
  background: var(--php-dark);
  border-radius: var(--radius-xl);
  padding: 36px;
  color: #fff;
  text-align: center;
  margin-bottom: 28px;
}
.diagnostic-result-score { font-size: 68px; font-weight: 800; margin: 8px 0; letter-spacing: -0.03em; }
.diagnostic-level-badge { display: inline-block; padding: 7px 22px; border-radius: var(--radius-full); background: rgba(255,255,255,0.2); font-size: 15px; font-weight: 600; margin-bottom: 18px; backdrop-filter: blur(8px); }

/* ===== 筛选标签 ===== */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filter-chip {
  padding: 7px 18px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-ui);
}
.filter-chip:hover { border-color: var(--php-purple); color: var(--php-dark); }
.filter-chip.active {
  border-color: var(--php-dark);
  background: var(--php-dark);
  color: #fff;
}

/* ===== 设置面板 ===== */
.settings-card { max-width: 520px; margin: 0 auto; }
.avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--php-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  margin: 0 auto 18px;
}

/* ===== 空状态按钮 ===== */
.empty-action { margin-top: 20px; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ===== 面试计时条 ===== */
.interview-timer-bar {
  position: sticky;
  top: 64px;
  z-index: 40;
  background: var(--php-dark);
  color: #fff;
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
}
.interview-timer-bar .timer-countdown { font-variant-numeric: tabular-nums; font-size: 17px; font-family: var(--font-mono); }
.interview-timer-bar .timer-countdown.warning { color: #fcd34d; }
.interview-timer-bar .timer-countdown.danger { color: #fca5a5; animation: pulse 1s ease infinite; }

/* ===== 英雄区 ===== */
.hero {
  background: linear-gradient(135deg, var(--php-deep), var(--php-dark));
  border-radius: var(--radius-xl);
  padding: 56px 36px;
  color: #fff;
  margin-bottom: 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero h1 { font-size: 34px; font-weight: 800; margin-bottom: 14px; letter-spacing: -0.02em; }
.hero p { font-size: 16px; opacity: 0.85; margin-bottom: 28px; max-width: 620px; margin-left: auto; margin-right: auto; line-height: 1.8; }
.hero-icon { margin-bottom: 16px; opacity: 0.9; }
.hero-btn-white { background: #fff; color: var(--php-dark); }
.hero-btn-white:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.hero-btn-outline { border: 2px solid rgba(255,255,255,0.4); color: #fff; background: rgba(255,255,255,0.05); }
.hero-btn-outline:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.6); }

.hero-sm { padding: 40px 28px; margin-bottom: 24px; }
.hero-sm h1 { font-size: 26px; margin-bottom: 8px; }
.hero-sm p { font-size: 14px; }

@media (max-width: 768px) {
  .hero { padding: 40px 20px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14px; }
}

/* ===== 快捷入口卡片 ===== */
.quick-card {
  text-align: center;
  padding: 28px 20px;
}
.quick-card .quick-icon { margin-bottom: 10px; display: flex; justify-content: center; color: var(--php-dark); }
.quick-card .quick-icon svg { width: 36px; height: 36px; }

/* ===== SVG 图标通用 ===== */
.icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; flex-shrink: 0; }
.icon svg { width: 100%; height: 100%; }
.filter-chip .icon, .btn .icon { margin-right: 2px; }
.empty-icon .icon svg { width: 48px; height: 48px; }

/* ===== 分类图标容器 ===== */
.cat-icon-wrap { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--bg-secondary); display: flex; align-items: center; justify-content: center; color: var(--php-dark); flex-shrink: 0; }
.cat-icon-wrap svg { width: 22px; height: 22px; }

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--php-deep), var(--php-dark));
}
.login-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 44px;
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-xl);
}

/* ===== 代码运行结果 ===== */
.code-result-pre {
  background: #1a1b2e;
  color: #cdd6f4;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  overflow-x: auto;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #2d2e4a;
}
.code-result-pre.error {
  background: #2a1518;
  color: #f38ba8;
  border-color: #4a2530;
}

/* ===== 链接 ===== */
a { color: var(--php-dark); text-decoration: none; }
a:hover { color: var(--php-purple); }

/* ===== 选区 ===== */
::selection { background: var(--php-glow); color: var(--php-dark); }
