/* ====================================================================
   Java面试宝典刷题工具 - 现代化高端深色科技感主题样式系统
   ==================================================================== */

:root {
  --bg-main: #0B0F19;
  --bg-sidebar: #0F172A;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.85);
  --bg-input: #1E293B;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(99, 102, 241, 0.4);

  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  --accent-cyan: #06B6D4;
  --accent-green: #10B981;
  --accent-yellow: #F59E0B;
  --accent-red: #EF4444;

  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, Monaco, monospace;

  --sidebar-width: 260px;
  --topbar-height: 70px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 0 20px var(--primary-glow);
}

.brand-text h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.badge-tech {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-block;
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.25), rgba(99, 102, 241, 0.05));
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: #334155;
  color: #cbd5e1;
}

.nav-badge.hot {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-yellow);
}

.nav-badge.danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

.nav-badge.star {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

.sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.9);
}

.user-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}

.user-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: #1e293b;
}

.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: var(--accent-green);
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.btn-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  height: var(--topbar-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-box {
  position: relative;
  width: 480px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-dim);
  font-size: 0.95rem;
}

.search-box input {
  width: 100%;
  height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 0 40px 0 44px;
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.25s ease;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.api-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.api-status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4338CA);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

/* Tab Views */
.tab-view {
  display: none;
  padding: 28px 32px;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Level 1: 大区分区 Track Tabs Bar */
.track-tabs-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.track-tab-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8rpx;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.track-tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: rgba(99, 102, 241, 0.4);
}

.track-tab-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.track-tab-badge {
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  opacity: 0.9;
}

/* Level 2: 细分类型 Sub-category Chips Bar (联动展开) */
.category-chips-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
  scrollbar-width: thin;
}

.sub-chips-bar {
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed rgba(99, 102, 241, 0.25);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 20px;
  animation: fadeIn 0.25s ease-out;
}

.chip, .sub-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover, .sub-chip:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.4);
}

.chip.active, .sub-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.sub-chip-count {
  font-size: 0.72rem;
  opacity: 0.8;
}

/* Filter Bar */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.filter-group select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.85rem;
}

.filter-stats {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.highlight-count {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 1rem;
}

/* Question Grid */
.question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

/* Question Card */
.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.question-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.25s;
}

.question-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

.question-card:hover::before {
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.category-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 3px 10px;
  border-radius: 12px;
}

.difficulty-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.diff-1 { color: #34D399; background: rgba(52, 211, 153, 0.12); }
.diff-2 { color: #FBBF24; background: rgba(251, 191, 36, 0.12); }
.diff-3 { color: #F87171; background: rgba(248, 113, 113, 0.12); }

.card-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.45;
}

.card-keypoints-snippet {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.6);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.frequency-stars {
  color: #FBBF24;
}

.company-badges {
  display: flex;
  gap: 4px;
}

.company-badge {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: #cbd5e1;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 900px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-question-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.4;
}

.modal-meta-row {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Key Points Callout */
.key-points-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.kp-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #818CF8;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kp-content {
  font-size: 0.88rem;
  color: #E2E8F0;
  line-height: 1.7;
  white-space: pre-line;
}

/* Answer Markdown Box */
.answer-section {
  background: #1F2937;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
}

.section-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-green);
  text-transform: uppercase;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.05em;
}

.markdown-body {
  font-size: 0.92rem;
  color: #D1D5DB;
  line-height: 1.7;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: #fff;
  margin: 16px 0 8px;
}

.markdown-body p {
  margin-bottom: 12px;
}

.markdown-body code {
  font-family: var(--font-mono);
  background: #374151;
  padding: 2px 6px;
  border-radius: 4px;
  color: #F472B6;
  font-size: 0.85em;
}

.markdown-body pre {
  background: #0F172A;
  padding: 14px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 14px 0;
}

.markdown-body pre code {
  background: transparent;
  color: #A5B4FC;
  padding: 0;
}

.markdown-body ul, .markdown-body ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  border-radius: 8px;
  overflow: hidden;
}

.markdown-body th, .markdown-body td {
  border: 1px solid #374151;
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.markdown-body th {
  background: #1e1b4b;
  color: #c7d2fe;
  font-weight: 700;
}

.markdown-body tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px auto;
  display: block;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* Practice Action Box */
.practice-action-box {
  background: #1E293B;
  border-radius: var(--radius-md);
  padding: 18px;
  border: 1px solid var(--border-color);
}

.action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.action-header h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mastery-radios {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-muted);
}

.radio-label input:checked + span, .radio-label:has(input:checked) {
  color: var(--primary);
  font-weight: 600;
}

.practice-action-box textarea {
  width: 100%;
  height: 80px;
  background: #0F172A;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  outline: none;
}

.practice-action-box textarea:focus {
  border-color: var(--primary);
}

.action-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.left-btns {
  display: flex;
  gap: 10px;
}

.btn-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-action.active {
  color: #FBBF24;
  border-color: #FBBF24;
}

.btn-action.danger:hover {
  color: #EF4444;
  border-color: #EF4444;
}

/* Auth Dialog */
.auth-dialog {
  width: 400px;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 600;
}

.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-row input, .form-row select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.88rem;
  outline: none;
}

.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 10px;
}

.auth-tip {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 14px;
}

/* Mock Exam */
.mock-container {
  max-width: 800px;
  margin: 0 auto;
}

.mock-setup-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}

.mock-icon-header {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 16px;
}

.mock-setup-card h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.mock-setup-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 30px;
  line-height: 1.6;
}

.mock-form {
  max-width: 420px;
  margin: 0 auto;
  text-align: left;
}

.btn-large {
  width: 100%;
  padding: 12px;
  justify-content: center;
  font-size: 1rem;
  margin-top: 20px;
}

.mock-paper-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
}

.paper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.paper-timer {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-yellow);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mock-question-item {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
}

.mock-q-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.mock-answer-box {
  margin-top: 12px;
}

.paper-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  margin-top: 20px;
}

.self-score-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}

.self-score-wrap input {
  width: 70px;
  padding: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 6px;
  text-align: center;
}

/* Dashboard Metrics */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.c-blue { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.c-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.c-purple { background: rgba(168, 85, 247, 0.15); color: #C084FC; }
.c-red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-data .value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
}

.metric-data .label {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.mt-4 {
  margin-top: 24px;
}

.box-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-progress-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cat-progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cat-prog-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.cat-prog-bar-bg {
  height: 8px;
  background: #1E293B;
  border-radius: 4px;
  overflow: hidden;
}

.cat-prog-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1E293B;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.25s ease;
}

.toast.success { border-left-color: var(--accent-green); }
.toast.danger { border-left-color: var(--accent-red); }

@keyframes slideIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ====================================================================
   全网题库实时同步与 AI 抓取中心样式
   ==================================================================== */
.btn-gradient {
  background: linear-gradient(135deg, #EC4899, #8B5CF6, #3B82F6);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.35);
}

.btn-gradient:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.sync-dialog {
  max-width: 720px;
  width: 95%;
  background: #0F172A;
  border: 1px solid rgba(139, 92, 246, 0.3);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 30px rgba(139, 92, 246, 0.15);
}

.sync-status-banner {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.sync-stat-item {
  display: flex;
  flex-direction: column;
}

.sync-stat-item .stat-label {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.sync-stat-item .stat-val {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 1.05rem;
}

.sync-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.sync-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-tab-btn.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px var(--primary-glow);
}

.sync-pane {
  display: none;
}

.sync-pane.active {
  display: block;
}

.sync-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.sync-form-grid.full {
  grid-template-columns: 1fr;
}

.sync-terminal {
  background: #020617;
  border: 1px solid #1E293B;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38BDF8;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.sync-terminal .log-success {
  color: #4ADE80;
}

.sync-terminal .log-warn {
  color: #FBBF24;
}

.sync-terminal .log-info {
  color: #94A3B8;
}

/* ====================================================================
   移动端与响应式样式系统 (Mobile & Tablet Responsiveness)
   ==================================================================== */

/* Desktop defaults: mobile-only elements hidden */
.mobile-toggle-btn,
.mobile-sidebar-close,
.sidebar-overlay,
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 992px) {
  .search-box {
    width: 320px;
  }
}

@media (max-width: 768px) {
  /* 1. App Layout on Mobile */
  .app-container {
    flex-direction: column;
  }

  /* 2. Slide-out Mobile Drawer Sidebar */
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    width: 290px;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-sidebar-close {
    display: flex;
    margin-left: auto;
    font-size: 1.1rem;
    color: var(--text-muted);
  }

  /* 3. Main Content & Topbar */
  .main-content {
    margin-left: 0 !important;
    width: 100%;
    padding-bottom: 75px; /* Leave space for bottom nav */
  }

  .topbar {
    height: 60px;
    padding: 0 12px;
    gap: 8px;
  }

  .mobile-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
  }

  .mobile-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
  }

  .search-box {
    width: 100%;
    flex: 1;
  }

  .search-box input {
    font-size: 0.82rem;
    padding: 7px 10px 7px 32px;
    height: 36px;
  }

  .search-icon {
    left: 10px;
    font-size: 0.85rem;
  }

  .topbar-actions {
    gap: 6px;
  }

  .api-status-pill {
    display: none; /* Hide on mobile to preserve screen width */
  }

  .btn-gradient {
    padding: 7px 11px;
    font-size: 0.78rem;
    gap: 4px;
    border-radius: 16px;
  }

  .btn-primary#btn-quick-checkin {
    padding: 7px 11px;
    font-size: 0.78rem;
    gap: 4px;
    border-radius: 16px;
  }

  /* 4. Tab Views & Chips */
  .tab-view {
    padding: 14px 12px;
  }

  .category-chips-bar {
    padding: 8px 12px;
    margin: 0 -12px 12px -12px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    display: flex;
    gap: 6px;
    scrollbar-width: none;
  }

  .category-chips-bar::-webkit-scrollbar {
    display: none;
  }

  .chip {
    flex-shrink: 0;
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: 16px;
  }

  /* 5. Filter Bar */
  .filter-bar {
    padding: 10px 12px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .filter-group label {
    font-size: 0.75rem;
  }

  .filter-group select {
    width: 100%;
    height: 34px;
    font-size: 0.8rem;
    padding: 0 8px;
  }

  /* 6. Questions Grid */
  .questions-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .question-card {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .question-title {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .question-card-footer {
    padding-top: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 7. Mobile App Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 6px 12px;
    position: relative;
    transition: all 0.2s;
  }

  .mobile-nav-item i {
    font-size: 1.15rem;
    transition: transform 0.2s;
  }

  .mobile-nav-item.active {
    color: #818CF8;
  }

  .mobile-nav-item.active i {
    transform: scale(1.15);
    color: #818CF8;
    filter: drop-shadow(0 0 8px var(--primary-glow));
  }

  .mobile-nav-item .m-badge {
    position: absolute;
    top: 2px;
    right: 6px;
    font-size: 0.65rem;
    background: var(--primary);
    color: #fff;
    padding: 1px 5px;
    border-radius: 10px;
    font-weight: 700;
  }

  .mobile-nav-item .m-badge.red {
    background: var(--accent-red);
  }

  /* 8. Bottom Sheet Modals on Mobile */
  .modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 92vh !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-bottom: none !important;
    animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  @keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .modal-body {
    padding: 16px 14px 24px 14px !important;
    max-height: calc(92vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-question-title {
    font-size: 1.1rem;
    line-height: 1.45;
  }

  .modal-meta-row {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
  }

  .key-points-box {
    padding: 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
  }

  .kp-title {
    font-size: 0.88rem;
  }

  .markdown-body {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .markdown-body pre {
    border-radius: 8px;
    padding: 10px;
  }

  .markdown-body pre code {
    font-size: 0.78rem;
  }

  .action-footer {
    flex-direction: column !important;
    gap: 10px !important;
    position: sticky;
    bottom: -16px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(16px);
    padding: 12px 14px;
    margin: 16px -14px -24px -14px;
    border-top: 1px solid var(--border-color);
    z-index: 10;
  }

  .left-btns {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 6px;
  }

  .left-btns .btn-action {
    flex: 1;
    justify-content: center;
    padding: 8px 4px;
    font-size: 0.75rem;
  }

  #btn-modal-save-practice {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }

  .mastery-radios {
    flex-wrap: wrap;
    gap: 8px;
  }

  .radio-label {
    font-size: 0.8rem;
  }

  /* 9. Dashboard Stats Grid on Mobile */
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric-card {
    padding: 12px;
  }

  .metric-data .value {
    font-size: 1.4rem;
  }

  .metric-data .label {
    font-size: 0.75rem;
  }

  /* 10. Sync Modal on Mobile */
  .sync-form-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .sync-status-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .sync-tabs {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .sync-btn-label,
  .checkin-btn-label {
    display: none; /* Icon-only buttons on very narrow screens */
  }

  .topbar {
    padding: 0 8px;
  }

  .btn-gradient,
  .btn-primary#btn-quick-checkin {
    padding: 7px 10px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* ====================================================================
   个人能力测评与定制题库样式系统 (Personal Assessment & Tailored Stream)
   ==================================================================== */
.assessment-container {
  max-width: 1000px;
  margin: 0 auto;
}

.assessment-hero {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.assessment-hero h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 10px 0 8px 0;
  background: linear-gradient(135deg, #fff, #CBD5E1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.assessment-hero p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 680px;
  margin: 0 auto;
}

.quick-preset-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.skill-sliders-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.slider-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all 0.2s;
}

.slider-row:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.slider-score-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
}

.slider-score-badge.high { background: rgba(16, 185, 129, 0.2); color: #34D399; }
.slider-score-badge.mid { background: rgba(245, 158, 11, 0.2); color: #FBBF24; }
.slider-score-badge.low { background: rgba(239, 68, 68, 0.2); color: #F87171; }

.skill-range-input {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  height: 6px;
}

/* Diagnostic Quiz Cards */
.diagnostic-quiz-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quiz-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.quiz-question {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #F1F5F9;
}

.quiz-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quiz-opt-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.quiz-opt-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  color: #fff;
}

.quiz-opt-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* Assessment Header & Score Dial */
.assessment-header-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-card);
}

.assessment-header-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 8px 0;
  color: #fff;
}

.score-dial {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid var(--accent-cyan);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.35);
  background: rgba(11, 15, 25, 0.8);
  flex-shrink: 0;
}

.score-dial .dial-num {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  line-height: 1;
}

.score-dial .dial-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.evaluation-text {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #E2E8F0;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary);
}

.diagnosis-highlight-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.weakness-callout {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 14px;
}

.strength-callout {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 14px;
}

.callout-title {
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.weakness-callout .callout-title { color: #F87171; }
.strength-callout .callout-title { color: #34D399; }

.weak-tags-wrap, .strength-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.weak-pill {
  background: rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.strong-pill {
  background: rgba(16, 185, 129, 0.2);
  color: #6EE7B7;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.skill-bars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.skill-bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

.skill-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 768px) {
  .skill-sliders-grid,
  .diagnosis-highlight-row,
  .skill-bars-grid {
    grid-template-columns: 1fr !important;
  }

  .assessment-header-card {
    flex-direction: column !important;
    text-align: center !important;
    gap: 16px !important;
  }
}



