/* ==================== CSS VARIABLES & RESET ==================== */
:root {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d27;
  --bg-tertiary: #242836;
  --bg-hover: #2a2e3d;
  --bg-card: #1e2230;
  --border: #2d3348;
  --border-light: #383d52;
  --text-primary: #e8eaed;
  --text-secondary: #9aa0b4;
  --text-tertiary: #6b7280;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-dim: rgba(99, 102, 241, 0.15);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --yellow: #f59e0b;
  --yellow-dim: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.15);
  --blue: #3b82f6;
  --blue-dim: rgba(59, 130, 246, 0.15);
  --orange: #f97316;
  --sidebar-width: 240px;
  --header-height: 56px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --transition: 0.2s ease;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

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

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ==================== SCREENS ==================== */
.screen { display: none; height: 100vh; width: 100vw; }
.screen.active { display: flex; }

/* ==================== AUTH ==================== */
.auth-container {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-primary);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,0.15), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(139,92,246,0.08), transparent);
}

.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.8;
}
.auth-footer a { color: var(--text-tertiary); }
.auth-footer a:hover { color: var(--text-secondary); }

.auth-card {
  width: 400px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}

.auth-header { text-align: center; margin-bottom: 32px; }
.auth-header h1 { font-size: 24px; font-weight: 700; margin: 12px 0 4px; }
.auth-header p { color: var(--text-secondary); font-size: 14px; }

.logo-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  color: white;
}

.auth-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: var(--bg-tertiary); border-radius: var(--radius); padding: 4px; }
.auth-tab {
  flex: 1; padding: 8px; border: none; background: transparent;
  color: var(--text-secondary); cursor: pointer; border-radius: 6px;
  font-size: 14px; font-weight: 500; transition: var(--transition);
}
.auth-tab.active { background: var(--accent); color: white; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 10px 14px; background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-size: 14px; outline: none;
  transition: var(--transition); font-family: var(--font-sans);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-error { color: var(--red); font-size: 13px; margin-top: 12px; text-align: center; min-height: 20px; }
.form-success { color: var(--green); font-size: 13px; margin-top: 12px; text-align: center; padding: 10px; background: rgba(16,185,129,0.1); border-radius: 8px; line-height: 1.6; }

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: var(--transition); font-family: var(--font-sans);
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-light); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon {
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 6px; border-radius: 6px; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.btn-icon svg { width: 18px; height: 18px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ==================== BADGE ==================== */
.badge {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border-radius: 12px; font-size: 12px; font-weight: 500;
  background: var(--bg-tertiary); color: var(--text-secondary);
}
.badge-green { background: var(--green-dim); color: var(--green); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-red { background: var(--red-dim); color: var(--red); }
.badge-blue { background: var(--blue-dim); color: var(--blue); }
.badge-accent { background: var(--accent-dim); color: var(--accent-hover); }

/* ==================== SIDEBAR ==================== */
#sidebar {
  width: var(--sidebar-width); height: 100vh;
  background: var(--bg-secondary); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; flex-shrink: 0;
}

.sidebar-header {
  padding: 16px 20px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border); height: var(--header-height);
}

.logo-small {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white; padding: 4px 8px; border-radius: 6px;
}

.sidebar-header span { font-weight: 600; font-size: 15px; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  cursor: pointer; transition: var(--transition); margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--accent-dim); color: var(--accent-hover); }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; color: white; flex-shrink: 0;
}
.user-meta { min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.user-points { font-size: 11px; color: var(--text-tertiary); }

/* ==================== MAIN CONTENT ==================== */
#main-content {
  flex: 1; height: 100vh; overflow-y: auto;
  padding: 32px 40px;
}

.page-header { margin-bottom: 28px; }
.page-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-header p { color: var(--text-secondary); font-size: 14px; }

/* ==================== DASHBOARD ==================== */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
}
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

.section-title {
  font-size: 16px; font-weight: 600; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

.activity-week {
  display: flex; gap: 8px; margin-bottom: 28px;
}
.activity-day {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; text-align: center;
}
.activity-day .day-name { font-size: 11px; color: var(--text-tertiary); margin-bottom: 4px; }
.activity-day .day-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-tertiary); margin: 8px auto;
}
.activity-day .day-dot.active { background: var(--green); box-shadow: 0 0 8px rgba(34,197,94,0.4); }
.activity-day .day-count { font-size: 11px; color: var(--text-secondary); }

/* ==================== COURSE CARDS ==================== */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }

.course-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  cursor: pointer; transition: var(--transition);
}
.course-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.course-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.course-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.5; }

.progress-bar { height: 6px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.progress-bar .progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #8b5cf6); transition: width 0.5s ease; }
.progress-label { font-size: 12px; color: var(--text-secondary); display: flex; justify-content: space-between; }

/* ==================== KP LIST ==================== */
.kp-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

.kp-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  cursor: pointer; transition: var(--transition);
}
.kp-item:hover { border-color: var(--accent); background: var(--bg-hover); }

.kp-number {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
  background: var(--bg-tertiary); color: var(--text-secondary);
}
.kp-number.completed { background: var(--green-dim); color: var(--green); }
.kp-number.in-progress { background: var(--accent-dim); color: var(--accent-hover); }

.kp-info { flex: 1; min-width: 0; }
.kp-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.kp-info p { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.kp-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.kp-mastery { font-size: 12px; color: var(--text-tertiary); }

.difficulty-dots { display: flex; gap: 3px; }
.difficulty-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg-tertiary);
}
.difficulty-dots span.filled { background: var(--yellow); }

/* ==================== LESSON LAYOUT ==================== */
.lesson-layout { width: 100%; height: 100%; display: flex; flex-direction: column; }

.lesson-header {
  height: var(--header-height); padding: 0 20px;
  display: flex; align-items: center; gap: 16px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.lesson-title { flex: 1; font-size: 15px; font-weight: 600; }

.lesson-body { flex: 1; display: flex; overflow: hidden; }

/* Chat Panel */
.chat-panel {
  width: 45%; display: flex; flex-direction: column;
  border-right: 1px solid var(--border); background: var(--bg-primary);
}

.chat-messages { flex: 1; overflow-y: auto; padding: 20px; }

.chat-msg {
  margin-bottom: 16px; display: flex; gap: 10px;
  animation: fadeIn 0.3s ease;
}

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

.chat-msg.user { flex-direction: row-reverse; }
.chat-msg .msg-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0; font-weight: 600;
}
.chat-msg.assistant .msg-avatar { background: linear-gradient(135deg, var(--accent), #8b5cf6); color: white; }
.chat-msg.user .msg-avatar { background: var(--bg-tertiary); color: var(--text-secondary); }

.chat-msg .msg-bubble {
  max-width: 80%; padding: 12px 16px;
  border-radius: 12px; font-size: 14px; line-height: 1.7;
}
.chat-msg.assistant .msg-bubble { background: var(--bg-secondary); border: 1px solid var(--border); }
.chat-msg.user .msg-bubble { background: var(--accent); color: white; }

.msg-bubble pre {
  background: var(--bg-primary) !important; border-radius: var(--radius);
  padding: 12px 16px; margin: 8px 0; overflow-x: auto;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.5;
}
.msg-bubble code { font-family: var(--font-mono); font-size: 13px; }
.msg-bubble p { margin-bottom: 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol { padding-left: 20px; margin: 8px 0; }
.msg-bubble li { margin-bottom: 4px; }
.msg-bubble strong { color: var(--accent-hover); }

.chat-input-area {
  padding: 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--bg-secondary);
}

#chat-input {
  flex: 1; resize: none; background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; color: var(--text-primary); font-size: 14px;
  font-family: var(--font-sans); outline: none;
  max-height: 120px;
}
#chat-input:focus { border-color: var(--accent); }

/* Code Panel */
.code-panel {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg-primary); position: relative;
}

.code-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: var(--bg-secondary);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}

.code-tabs { display: flex; gap: 4px; }
.code-tab {
  padding: 6px 12px; background: transparent; border: none;
  color: var(--text-secondary); font-size: 13px; cursor: pointer;
  border-radius: 6px; transition: var(--transition); font-family: var(--font-sans);
}
.code-tab:hover { background: var(--bg-tertiary); }
.code-tab.active { background: var(--accent-dim); color: var(--accent-hover); }

.code-actions { display: flex; gap: 8px; }

.code-tab-content { display: none; flex: 1; overflow: hidden; }
.code-tab-content.active { display: flex; flex-direction: column; }

/* CodeMirror 编辑器样式 */
#code-editor-wrapper { flex: 1; overflow: hidden; }
#code-editor-wrapper .CodeMirror {
  height: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
}
#code-editor-wrapper .CodeMirror-gutters {
  border-right: 1px solid var(--border);
}
#code-editor-wrapper .CodeMirror-linenumber {
  padding: 0 8px 0 4px;
  min-width: 32px;
  color: #6272a4;
}

.task-info {
  padding: 24px; overflow-y: auto; flex: 1;
  font-size: 14px; line-height: 1.7;
}
.task-info h3 { font-size: 16px; margin-bottom: 12px; }
.task-info .task-desc { color: var(--text-secondary); margin-bottom: 16px; }
.task-info .task-md p { margin-bottom: 10px; }
.task-info .task-md ul, .task-info .task-md ol { margin-bottom: 10px; padding-left: 24px; }
.task-info .task-md li { margin-bottom: 4px; }
.task-info .task-md h1, .task-info .task-md h2, .task-info .task-md h3, .task-info .task-md h4 { color: var(--text-primary); margin: 14px 0 8px; }
.task-info .task-md h1 { font-size: 18px; } .task-info .task-md h2 { font-size: 16px; } .task-info .task-md h3 { font-size: 15px; } .task-info .task-md h4 { font-size: 14px; }
.task-info .task-md code { font-family: var(--font-mono); font-size: 13px; background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; color: var(--accent-hover); }
.task-info .task-md pre { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; overflow-x: auto; }
.task-info .task-md pre code { background: none; padding: 0; color: var(--text-primary); }
.task-info .task-md blockquote { border-left: 3px solid var(--accent); padding: 8px 14px; margin: 10px 0; color: var(--text-secondary); background: var(--accent-dim); border-radius: 0 var(--radius) var(--radius) 0; }
.task-info .task-md table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.task-info .task-md th, .task-info .task-md td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; font-size: 13px; }
.task-info .task-md th { background: var(--bg-tertiary); font-weight: 600; }
.task-info .task-md strong { color: var(--text-primary); }
.task-info .task-md hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* General task-md styles (for exams and other places outside .task-info) */
.task-md p { margin-bottom: 10px; }
.task-md p:last-child { margin-bottom: 0; }
.task-md ul, .task-md ol { margin-bottom: 10px; padding-left: 24px; }
.task-md li { margin-bottom: 4px; }
.task-md h1, .task-md h2, .task-md h3, .task-md h4 { color: var(--text-primary); margin: 14px 0 8px; }
.task-md h1 { font-size: 18px; } .task-md h2 { font-size: 16px; } .task-md h3 { font-size: 15px; } .task-md h4 { font-size: 14px; }
.task-md code { font-family: var(--font-mono); font-size: 13px; background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; color: var(--accent-hover); }
.task-md pre { background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; overflow-x: auto; }
.task-md pre code { background: none; padding: 0; color: var(--text-primary); }
.task-md blockquote { border-left: 3px solid var(--accent); padding: 8px 14px; margin: 10px 0; color: var(--text-secondary); background: var(--accent-dim); border-radius: 0 var(--radius) var(--radius) 0; }
.task-md table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.task-md th, .task-md td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; font-size: 13px; }
.task-md th { background: var(--bg-tertiary); font-weight: 600; }
.task-md strong { color: var(--text-primary); }
.task-md hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* Exam CodeMirror editors */
.exam-cm-wrapper { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.exam-cm-wrapper .CodeMirror { height: 250px; font-size: 13px; }

.task-info .task-meta { display: flex; gap: 12px; margin-bottom: 16px; }

.submission-history { padding: 20px; overflow-y: auto; flex: 1; }

.submission-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  margin-bottom: 8px;
}
.submission-item .sub-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.submission-item .sub-score { font-weight: 600; }
.submission-item .sub-time { font-size: 12px; color: var(--text-tertiary); }
.submission-item .sub-feedback { font-size: 13px; color: var(--text-secondary); margin-top: 8px; line-height: 1.6; }

.feedback-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  max-height: 50%; background: var(--bg-secondary);
  border-top: 2px solid var(--accent);
  display: flex; flex-direction: column;
  animation: slideUp 0.3s ease;
  z-index: 10;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.feedback-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.feedback-title { font-weight: 600; font-size: 14px; }
.feedback-body { padding: 20px; overflow-y: auto; flex: 1; font-size: 14px; line-height: 1.7; }

/* ==================== LEADERBOARD ==================== */
.leaderboard-table {
  width: 100%; border-collapse: separate; border-spacing: 0 6px;
}
.leaderboard-table th {
  text-align: left; padding: 10px 16px; font-size: 12px;
  color: var(--text-tertiary); font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.leaderboard-table td {
  padding: 14px 16px; background: var(--bg-card);
  font-size: 14px;
}
.leaderboard-table tr td:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.leaderboard-table tr td:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

.rank-badge {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #000; }
.rank-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #000; }
.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: white; }

/* ==================== ACHIEVEMENTS ==================== */
.achievement-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.achievement-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; align-items: center; gap: 14px;
  transition: var(--transition);
}
.achievement-card.earned { border-color: var(--yellow); background: rgba(245, 158, 11, 0.05); }
.achievement-card.locked { opacity: 0.5; }
.achievement-card .ach-icon { font-size: 32px; flex-shrink: 0; }
.achievement-card.locked .ach-icon { filter: grayscale(1); }
.achievement-card .ach-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.achievement-card .ach-info p { font-size: 12px; color: var(--text-secondary); }
.achievement-card .ach-date { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

/* ==================== LEARNING PATH ==================== */
.path-summary {
  display: flex; gap: 16px; margin-bottom: 24px;
}
.path-stat {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
}
.path-stat .ps-num { font-size: 28px; font-weight: 700; }
.path-stat .ps-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.recommend-list { display: flex; flex-direction: column; gap: 8px; }
.recommend-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  cursor: pointer; transition: var(--transition);
}
.recommend-item:hover { border-color: var(--accent); }
.recommend-item .rec-reason {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  background: var(--accent-dim); color: var(--accent-hover);
}

/* ==================== TOAST ==================== */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: var(--radius); font-size: 14px;
  color: white; animation: fadeIn 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--blue); }

/* ==================== LOADING ==================== */
.loading-dots { display: inline-flex; gap: 4px; align-items: center; }
.loading-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-secondary); animation: blink 1.4s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .chat-panel { width: 40%; }
}

@media (max-width: 768px) {
  #sidebar { width: 60px; }
  .sidebar-header span, .nav-item span, .user-meta { display: none; }
  .sidebar-header { justify-content: center; }
  .nav-item { justify-content: center; padding: 10px; }
  #main-content { padding: 20px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .lesson-body { flex-direction: column; }
  .chat-panel { width: 100%; height: 50%; border-right: none; border-bottom: 1px solid var(--border); }
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-secondary);
}
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 16px; margin-bottom: 8px; color: var(--text-primary); }
.empty-state p { font-size: 14px; }

/* ==================== PET SYSTEM ==================== */
.pet-page { display: flex; gap: 24px; flex-wrap: wrap; }
.pet-display-area { flex: 0 0 320px; display: flex; flex-direction: column; gap: 16px; }
.pet-right-panel { flex: 1; min-width: 300px; display: flex; flex-direction: column; gap: 20px; }

.pet-stage {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; text-align: center; position: relative;
}
.pet-name-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; }
.pet-name-text { font-size: 18px; font-weight: 600; color: var(--text-primary); }
.pet-art {
  font-family: var(--font-mono); font-size: 16px; line-height: 1.4; color: var(--accent-hover);
  margin: 12px auto; display: inline-block; text-align: left;
  animation: petBob 2s ease-in-out infinite;
}
@keyframes petBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.pet-level-badge {
  display: inline-block; background: var(--accent-dim); color: var(--accent-hover);
  padding: 4px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-top: 8px;
}
.pet-speech {
  margin-top: 12px; font-size: 13px; color: var(--text-secondary);
  background: var(--bg-tertiary); padding: 8px 16px; border-radius: 16px;
  display: inline-block; position: relative;
}
.pet-speech::before {
  content: ''; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid var(--bg-tertiary);
}

.pet-stats {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px;
}
.pet-stat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.pet-stat-row:last-child { margin-bottom: 0; }
.pet-stat-row > span:first-child { width: 80px; flex-shrink: 0; }
.pet-stat-row > span:last-child { width: 60px; text-align: right; flex-shrink: 0; font-weight: 500; color: var(--text-secondary); }
.pet-bar { flex: 1; height: 10px; background: var(--bg-tertiary); border-radius: 5px; overflow: hidden; }
.pet-bar-fill { height: 100%; background: var(--green); border-radius: 5px; transition: width 0.5s ease; }
.pet-bar-fill.mood { background: var(--accent); }
.pet-bar-fill.exp { background: var(--yellow); }
.pet-bar-fill.danger { background: var(--red); }
.pet-bar-fill.warn { background: var(--orange); }

.pet-auto-feed {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}

.pet-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.pet-section h3 { font-size: 15px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
/* 宠物打卡左右布局 */
.pet-page-lr { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: stretch; }
@media (max-width: 900px) { .pet-page-lr { grid-template-columns: 1fr; } }
.pet-left-panel { display: flex; flex-direction: column; gap: 16px; }
.pet-right-panel { display: flex; flex-direction: column; gap: 16px; height: 100%; }
.pet-right-panel .pet-checkin-section { flex: 1; display: flex; flex-direction: column; }
.pet-right-panel .pet-checkin-section .pet-checkin-card { flex: 1; display: flex; flex-direction: column; }
.pet-right-panel .pet-checkin-section .pet-checkin-body { flex: 1; max-height: none; }

/* 励志语句 */
.pet-motivation-section { border-color: var(--accent); border-width: 1.5px; background: linear-gradient(135deg, var(--bg-card), rgba(99,102,241,0.05)); }
.pet-motivation-quote { display: flex; align-items: flex-start; gap: 14px; }
.pet-motivation-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.pet-motivation-content { font-size: 15px; line-height: 1.7; color: var(--text-primary); margin: 0 0 6px; font-style: italic; }
.pet-motivation-author { font-size: 13px; color: var(--text-tertiary); margin: 0; text-align: right; }

/* 打卡区域 */
.pet-checkin-section { border-color: var(--accent); border-width: 1.5px; }
.pet-checkin-card { }
.pet-checkin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.pet-checkin-header strong { font-size: 15px; }
.pet-checkin-body { font-size: 14px; line-height: 1.7; max-height: 400px; overflow-y: auto; margin-bottom: 16px; }
.pet-checkin-body pre { font-size: 13px; margin: 10px 0; }
.pet-checkin-body code { font-family: 'JetBrains Mono', monospace; }

.pet-inventory { display: flex; flex-direction: column; gap: 6px; }
.pet-inv-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--bg-tertiary); border-radius: var(--radius); cursor: pointer; transition: background var(--transition);
}
.pet-inv-item:hover { background: var(--bg-hover); }
.pet-inv-emoji { font-size: 20px; }
.pet-inv-name { flex: 1; font-size: 13px; font-weight: 500; }
.pet-inv-qty { font-size: 13px; color: var(--text-secondary); font-weight: 600; }

.pet-shop-grid { display: flex; flex-direction: column; gap: 8px; }
.pet-shop-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--bg-tertiary); border-radius: var(--radius); transition: background var(--transition);
}
.pet-shop-item:hover { background: var(--bg-hover); }
.pet-shop-emoji { font-size: 24px; }
.pet-shop-info { flex: 1; }
.pet-shop-name { font-size: 13px; font-weight: 600; }
.pet-shop-effect { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.pet-shop-buy { display: flex; align-items: center; gap: 6px; }
.pet-shop-cost { font-size: 12px; color: var(--accent-hover); font-weight: 600; white-space: nowrap; }

@media (max-width: 768px) {
  .pet-page { flex-direction: column; }
  .pet-display-area { flex: none; width: 100%; }
}

/* Pet Selection Screen */
.pet-select-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; padding: 20px 0; max-width: 800px;
}
.pet-select-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 24px 16px; background: var(--bg-secondary); border: 2px solid var(--border);
  border-radius: var(--radius-lg); cursor: pointer; transition: all 0.2s;
}
.pet-select-card:hover {
  border-color: var(--accent); background: var(--bg-tertiary); transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.15);
}
.pet-select-card.selected {
  border-color: var(--accent); background: rgba(99,102,241,0.08);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.pet-select-emoji { font-size: 36px; }
.pet-select-art {
  font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.3;
  white-space: pre; color: var(--text-primary); margin: 4px 0;
}
.pet-select-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.pet-select-confirm {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 20px 0; animation: fadeIn 0.3s;
}
.pet-select-input-row {
  display: flex; align-items: center; gap: 12px; font-size: 14px;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== DAILY CHECK-IN ==================== */
.checkin-container { max-width: 720px; margin: 0 auto; }
.checkin-stats {
  display: flex; gap: 16px; margin-bottom: 24px;
}
.checkin-stat-item {
  flex: 1; background: var(--bg-secondary); border-radius: 12px;
  padding: 16px; text-align: center; border: 1px solid var(--border-color);
}
.checkin-stat-val {
  font-size: 28px; font-weight: 700; color: var(--accent-primary);
}
.checkin-stat-label {
  font-size: 12px; color: var(--text-muted); margin-top: 4px;
}
.checkin-card {
  background: var(--bg-secondary); border-radius: 16px;
  border: 1px solid var(--border-color); overflow: hidden;
}
.checkin-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}
.checkin-card-title {
  font-size: 18px; font-weight: 700; color: var(--text-primary);
}
.checkin-card-date {
  font-size: 13px; color: var(--text-muted);
  background: var(--bg-primary); padding: 4px 12px; border-radius: 20px;
}
.checkin-card-body { padding: 24px; }
.checkin-content {
  color: var(--text-secondary); line-height: 1.8; font-size: 14px;
}
.checkin-content h1, .checkin-content h2, .checkin-content h3 {
  color: var(--text-primary); margin: 16px 0 8px;
}
.checkin-content strong { color: var(--accent-primary); }
.checkin-content code {
  background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
}
.checkin-content pre {
  background: var(--bg-primary); border-radius: 8px;
  padding: 16px; margin: 12px 0; overflow-x: auto;
}
.checkin-content pre code {
  background: none; padding: 0; font-size: 13px;
}
.checkin-content ul, .checkin-content ol {
  padding-left: 20px; margin: 8px 0;
}
.checkin-quiz {
  padding: 20px 24px; border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}
.checkin-quiz-label {
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px;
}
.checkin-quiz-options { display: flex; gap: 10px; flex-wrap: wrap; }
.quiz-option-btn {
  min-width: 56px; padding: 10px 20px; border-radius: 8px;
  border: 2px solid var(--border-color); background: var(--bg-secondary);
  color: var(--text-primary); font-size: 16px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--accent-primary); background: rgba(99, 102, 241, 0.1);
}
.quiz-option-btn.selected {
  border-color: var(--accent-primary); background: rgba(99, 102, 241, 0.15);
}
.quiz-option-btn.correct {
  border-color: var(--success); background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}
.quiz-option-btn.wrong {
  border-color: var(--danger); background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}
.quiz-option-btn:disabled { cursor: default; opacity: 0.8; }
.checkin-quiz-result {
  margin-top: 12px; padding: 12px 16px; border-radius: 8px;
  font-size: 14px; line-height: 1.6;
}
.checkin-quiz-result.correct {
  background: rgba(16, 185, 129, 0.1); color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.checkin-quiz-result.wrong {
  background: rgba(239, 68, 68, 0.1); color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.checkin-action {
  padding: 20px 24px; text-align: center;
  border-top: 1px solid var(--border-color);
}
.checkin-action .btn-lg {
  padding: 14px 40px; font-size: 16px; font-weight: 600;
  border-radius: 12px;
}
.checkin-done {
  font-size: 18px; font-weight: 600; color: var(--success);
  padding: 8px 0;
}
.loading-text {
  text-align: center; color: var(--text-muted); padding: 60px 0;
  font-size: 14px;
}

/* ==================== PRIVATE MESSAGES ==================== */
.msg-badge {
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px; margin-left: 4px; line-height: 1;
}
.approval-badge {
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px; margin-left: 4px; line-height: 1;
}
.msg-layout { display: flex; gap: 0; height: calc(100vh - 180px); min-height: 400px;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.msg-sidebar { width: 280px; border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.msg-sidebar-header { padding: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.msg-sidebar-header h3 { font-size: 15px; font-weight: 600; }
.msg-conv-list { flex: 1; overflow-y: auto; }
.msg-conv-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  cursor: pointer; transition: background var(--transition); border-bottom: 1px solid var(--border);
}
.msg-conv-item:hover { background: var(--bg-hover); }
.msg-conv-item.active { background: var(--accent-dim); }
.msg-conv-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; color: #fff;
}
.msg-conv-avatar.teacher { background: linear-gradient(135deg, #f59e0b, #d97706); }
.msg-conv-avatar.student { background: linear-gradient(135deg, var(--accent), #8b5cf6); }
.msg-conv-info { flex: 1; min-width: 0; }
.msg-conv-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.msg-conv-name .role-tag { font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 500; }
.msg-conv-name .role-tag.teacher { background: var(--yellow-dim); color: var(--yellow); }
.msg-conv-name .role-tag.student { background: var(--accent-dim); color: var(--accent-hover); }
.msg-conv-preview { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.msg-conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.msg-conv-time { font-size: 11px; color: var(--text-tertiary); }
.msg-conv-unread {
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.msg-main { flex: 1; display: flex; flex-direction: column; }
.msg-main-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.msg-main-header h3 { font-size: 15px; font-weight: 600; }
.msg-main-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); font-size: 14px; }
.msg-chat-area { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg-bubble-row { display: flex; gap: 8px; }
.msg-bubble-row.sent { flex-direction: row-reverse; }
.msg-bubble-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff;
}
.msg-bubble-avatar.teacher { background: linear-gradient(135deg, #f59e0b, #d97706); }
.msg-bubble-avatar.student { background: linear-gradient(135deg, var(--accent), #8b5cf6); }
.msg-bubble-content {
  max-width: 65%; padding: 10px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.6; word-break: break-word;
}
.msg-bubble-row.received .msg-bubble-content { background: var(--bg-tertiary); color: var(--text-primary); }
.msg-bubble-row.sent .msg-bubble-content { background: var(--accent); color: #fff; }
.msg-bubble-time { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
.msg-bubble-row.sent .msg-bubble-time { text-align: right; }
.msg-input-area {
  padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end; background: var(--bg-card);
}
.msg-input-area textarea {
  flex: 1; resize: none; background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; color: var(--text-primary); font-size: 14px;
  font-family: var(--font-sans); outline: none; max-height: 100px;
}
.msg-input-area textarea:focus { border-color: var(--accent); }

/* 学生选择弹窗 */
.msg-student-picker { position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 200; display: flex; align-items: center; justify-content: center; }
.msg-picker-card {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 480px; max-height: 70vh; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.msg-picker-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.msg-picker-header h3 { font-size: 15px; font-weight: 600; }
.msg-picker-search { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.msg-picker-search input {
  width: 100%; padding: 8px 12px; background: var(--bg-tertiary);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-size: 14px; outline: none;
}
.msg-picker-list { flex: 1; overflow-y: auto; padding: 8px; }
.msg-picker-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius); cursor: pointer; transition: background var(--transition);
}
.msg-picker-item:hover { background: var(--bg-hover); }
.msg-picker-item .picker-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.msg-picker-item .picker-info { flex: 1; }
.msg-picker-item .picker-name { font-size: 14px; font-weight: 500; }
.msg-picker-item .picker-class { font-size: 12px; color: var(--text-tertiary); }

@media (max-width: 768px) {
  .msg-layout { flex-direction: column; height: auto; }
  .msg-sidebar { width: 100%; max-height: 300px; border-right: none; border-bottom: 1px solid var(--border); }
}

/* ==================== GENERAL (名将之路) ==================== */
.general-page { display: grid; grid-template-columns: 340px 1fr; gap: 24px; }
@media (max-width: 900px) { .general-page { grid-template-columns: 1fr; } }
.general-left { display: flex; flex-direction: column; gap: 16px; }
.general-right { display: flex; flex-direction: column; gap: 16px; }

.general-art-box {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}
.general-art-pre {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.3;
  color: var(--accent-hover);
  white-space: pre;
  display: inline-block;
  text-align: left;
}
.general-rank-title {
  font-size: 22px;
  font-weight: 800;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.general-rank-subtitle { font-size: 13px; color: var(--text-tertiary); margin-top: 4px; }
.general-progress-bar { margin-top: 16px; }
.general-progress-bar .bar-bg { height: 10px; background: var(--bg-tertiary); border-radius: 99px; overflow: hidden; }
.general-progress-bar .bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #f59e0b); transition: width 0.5s; }
.general-progress-bar .bar-text { font-size: 12px; color: var(--text-secondary); margin-top: 6px; display: flex; justify-content: space-between; }

.general-info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.weapon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.weapon-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}
.weapon-card.unlocked { border-color: var(--accent); background: linear-gradient(135deg, var(--bg-card), rgba(99,102,241,0.08)); }
.weapon-card.unlocked:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(99,102,241,0.2); }
.weapon-card.locked { opacity: 0.4; filter: grayscale(0.8); }
.weapon-card .weapon-art {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-hover);
  margin-bottom: 8px;
}
.weapon-card.locked .weapon-art { color: var(--text-tertiary); }
.weapon-card .weapon-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.weapon-card .weapon-desc { font-size: 11px; color: var(--text-tertiary); }
.weapon-card .weapon-lock { position: absolute; top: 6px; right: 6px; font-size: 12px; }
