
img[src*="https://qiniu.liulaoshicoding.cn"],
[style*="https://qiniu.liulaoshicoding.cn"] {
  }
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  background: var(--bg-card);
}
.modal-tab {
  height: 44px;
  line-height: 44px;
  padding: 0 20px;
  border: none;
  background: none;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  font-weight: 400;
}
.modal-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.modal-tab:hover {
  color: var(--primary);
}

.paper-questions-panel .panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.paper-questions-panel .total-score {
  font-size: 0.875rem;
  margin-left: auto;
}
.q-empty {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --bg: #f5f3ff;
  --bg-card: #ffffff;
  --text: #1e1b4b;
  --text-secondary: #6b6588;
  --text-muted: #a19bb8;
  --border: #e2ddf0;
  --border-light: #f0edf8;
  --primary: #7c3aed;
  --primary-hover: #a78bfa;
  --primary-active: #6d28d9;
  --primary-light: #ede9fe;
  --primary-border: #c4b5fd;
  --success: #52c41a;
  --success-light: #f6ffed;
  --warning: #faad14;
  --warning-light: #fffbe6;
  --danger: #ff4d4f;
  --danger-light: #fff2f0;
  --info: #3b82f6;
  --header-bg: linear-gradient(135deg, #5b21b6 0%, #7c3aed 40%, #a78bfa 100%);
  --header-text: #ffffff;
  --header-height: 48px;
  --sidebar-bg: #ffffff;
  --sidebar-text: #262626;
  --sidebar-text-secondary: #8c8c8c;
  --sidebar-hover: #f5f5f5;
  --sidebar-active-bg: #ede9fe;
  --sidebar-active-text: #7c3aed;
  --sidebar-active-border: #7c3aed;
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.14);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;
  --table-header-bg: #f8f6fc;
  --table-row-alt-bg: #faf9fd;
  --card-bg: #ffffff;
  --bg-secondary: #f0edf8;
  --hp-bg: #f5f3ff;
  --hp-card: #ffffff;
  --hp-text: #262626;
  --hp-text2: #595959;
  --hp-text3: #8c8c8c;
  --hp-text4: #b0b0b0;
  --hp-border: #e8e8e8;
  --hp-footer-bg: #1e1b4b;
  --hp-footer-text: #a19bb8;
  color: var(--text);
  background: var(--bg);
}

/* ===== GLOBAL ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.8); }
  50% { transform: scale(1.04); }
  70% { transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ENHANCED CARDS ===== */
.card, .panel {
  animation: fadeInUp 0.4s ease both;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s cubic-bezier(0.4,0,0.2,1);
}
.card:hover, .panel:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card:nth-child(1), .panel:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2), .panel:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3), .panel:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4), .panel:nth-child(4) { animation-delay: 0.2s; }

/* ===== BUTTON POLISH ===== */
.primary-button, .q-btn-primary {
  position: relative; overflow: hidden;
}
.primary-button::after, .q-btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.25s ease;
}
.primary-button:hover::after, .q-btn-primary:hover::after { opacity: 1; }
.primary-button:active, .q-btn-primary:active { transform: scale(0.96) !important; }

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--bg-secondary) 50%, var(--border-light) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-card { height: 120px; border-radius: var(--radius-lg); }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }

/* ===== TABLE POLISH ===== */
.data-table tbody tr, .q-table tbody tr {
  transition: background 0.2s ease, transform 0.15s ease;
}
.data-table tbody tr:hover, .q-table tbody tr:hover {
  background: var(--primary-light) !important;
  transform: translateX(2px);
}

/* ===== SIDEBAR POLISH ===== */
.sidebar nav a {
  border-radius: var(--radius); margin: 1px 4px;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}
.sidebar nav a:hover { transform: translateX(2px); }
.sidebar .brand .brand-mark { border-radius: var(--radius); }

/* ===== MODAL POLISH ===== */
.modal-card { animation: scaleIn 0.3s cubic-bezier(0.4,0,0.2,1); }
.modal-backdrop { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; overflow-y: auto; }

/* ===== DASHBOARD STAT CARDS ===== */
.dash-stat-card {
  border-radius: var(--radius-lg);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s ease;
}
.dash-stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* ===== SPINNER ===== */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; color: var(--text-muted); text-align: center;
}
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { margin: 0 0 8px; color: var(--text-secondary); font-weight: 600; }
.empty-state p { margin: 0; font-size: 0.875rem; }

/* ===== BADGE POLISH ===== */
.badge, .tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 500;
  transition: transform 0.15s ease;
}
.badge:hover, .tag:hover { transform: scale(1.05); }

/* ===== PAGE TRANSITIONS ===== */
.content > * { animation: fadeInUp 0.35s ease both; }



/* ============ THEME: starry (default dark) ============ */
html[data-hp-theme="starry"] {
  --bg: #0a0e1a;
  --bg-card: #121828;
  --bg-secondary: #0f1525;
  --text: #e0e4f0;
  --text-secondary: #8899b8;
  --text-muted: #556688;
  --border: #1e2a44;
  --border-light: #162038;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-active: #4f46e5;
  --primary-light: #1e1b4b;
  --primary-border: #3730a3;
  --success: #22c55e;
  --success-light: #052e16;
  --warning: #f59e0b;
  --warning-light: #422006;
  --danger: #ef4444;
  --danger-light: #450a0a;
  --info: #3b82f6;
  --header-bg: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
  --header-text: #e0e4f0;
  --header-height: 48px;
  --sidebar-bg: #0f1525;
  --sidebar-text: #c8d0e0;
  --sidebar-text-secondary: #5a6880;
  --sidebar-hover: #1a2240;
  --sidebar-active-bg: rgba(99,102,241,0.12);
  --sidebar-active-text: #818cf8;
  --sidebar-active-border: #6366f1;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-xl: 0 8px 24px rgba(0,0,0,0.6);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s ease;
  --table-header-bg: #1a2240;
  --table-row-alt-bg: #131a30;
  --card-bg: #121828;
  --hp-bg: #0a0e1a;
  --hp-card: #121828;
  --hp-text: #e0e4f0;
  --hp-text2: #8899b8;
  --hp-text3: #556688;
  --hp-text4: #3a4a68;
  --hp-border: #1e2a44;
  --hp-footer-bg: #060a14;
  --text-primary: #e0e4f0;
    --hp-nav-bg: rgba(10,14,26,0.85);
  --hp-nav-bg-scr: rgba(10,14,26,0.97);
  --hp-gradient: linear-gradient(135deg,#6366f1,#8b5cf6);
  --hp-input-bg: #121828;
  --hp-border2: #1e2a44;
--hp-footer-text: #556688;
}

html[data-hp-theme="tech"] {
  --bg: #0f172a;
  --bg-card: #1a2332;
  --text: #c8d0dc;
  --text-secondary: #98a4b8;
  --text-muted: #68748c;
  --border: #2a3650;
  --border-light: #1e2a40;
  --primary: #38bdf8;
  --primary-hover: #7dd3fc;
  --primary-active: #0284c7;
  --primary-light: #0c4a6e;
  --primary-border: #0c4a6e;
  --success: #22c55e;
  --danger: #ef4444;
  --header-bg: linear-gradient(135deg, #0a0e1a, #111827 50%, #1e293b);
  --header-text: #d1d5db;
  --sidebar-bg: #111827;
  --sidebar-text: #c8d0dc;
  --sidebar-text-secondary: #5a6880;
  --sidebar-hover: #1e293b;
  --sidebar-active-bg: rgba(56, 189, 248, 0.12);
  --sidebar-active-text: #38bdf8;
  --sidebar-active-border: #38bdf8;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-xl: 0 8px 24px rgba(0,0,0,0.6);
  --table-header-bg: #1e2a40;
  --text-primary: #c8d0dc;
  --table-row-alt-bg: #131d30;
  --hp-bg: #0a0e1a;
  --hp-card: #1a2332;
  --hp-text: #c8d0dc;
  --hp-text2: #98a4b8;
  --hp-text3: #68748c;
  --hp-text4: #4a5870;
  --hp-border: #2a3650;
  --hp-footer-bg: #060a14;
    --hp-nav-bg: rgba(10,14,26,0.85);
  --hp-nav-bg-scr: rgba(10,14,26,0.97);
  --hp-gradient: linear-gradient(135deg,#38bdf8,#6366f1);
  --hp-input-bg: #1a2332;
  --hp-border2: #2a3650;
--hp-footer-text: #68748c;
}

html[data-hp-theme="fresh"] {
  --bg: #f0faf0;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #6b6588;
  --text-muted: #a19bb8;
  --border: #e2ddf0;
  --border-light: #f0edf8;
  --primary: #00b96b;
  --primary-hover: #13c27c;
  --primary-active: #009a59;
  --primary-light: #edfff5;
  --primary-border: #a8f0cc;
  --header-bg: linear-gradient(135deg, #00b96b, #13c27c 50%, #00d986);
  --sidebar-active-bg: #edfff5;
  --sidebar-active-text: #00b96b;
  --sidebar-active-border: #00b96b;
  --sidebar-bg: #ffffff;
  --sidebar-text: #1a1a1a;
  --sidebar-text-secondary: #6b6588;
  --sidebar-hover: #edfff5;
  --header-text: #ffffff;
  --table-header-bg: #edfff5;
  --table-row-alt-bg: #f8fdf8;
  --shadow: 0 2px 8px rgba(0,150,100,0.06);
  --shadow-lg: 0 4px 16px rgba(0,150,100,0.08);
  --text-primary: #1a1a1a;
  --shadow-xl: 0 8px 24px rgba(0,150,100,0.12);
  --hp-bg: #f5faf5;
  --hp-card: #ffffff;
  --hp-text: #1a2e1a;
  --hp-text2: #4a7a4a;
  --hp-text3: #7aaa7a;
  --hp-text4: #aaccaa;
  --hp-border: #d4eed4;
  --hp-footer-bg: #1a2e1a;
    --hp-nav-bg: rgba(255,255,255,0.85);
  --hp-nav-bg-scr: rgba(255,255,255,0.97);
  --hp-gradient: linear-gradient(135deg,#00b96b,#13c27c);
  --hp-input-bg: #fff;
  --hp-border2: #d4eed4;
--hp-footer-text: #7aaa7a;
}
html[data-hp-theme="warm"] {
  --bg: #fef7f0;
  --bg-card: #ffffff;
  --text: #1e1b4b;
  --text-secondary: #404040;
  --text-muted: #707070;
  --border: #e2ddf0;
  --border-light: #f0edf8;
  --primary: #fa8c16;
  --primary-hover: #ffa940;
  --primary-active: #d46b08;
  --primary-light: #fff7e6;
  --primary-border: #ffd591;
  --header-bg: linear-gradient(135deg, #fa8c16, #ffa940 50%, #ffbb66);
  --sidebar-active-bg: #fff7e6;
  --sidebar-active-text: #fa8c16;
  --sidebar-active-border: #fa8c16;
  --sidebar-bg: #ffffff;
  --sidebar-text: #1e1b4b;
  --sidebar-text-secondary: #404040;
  --sidebar-hover: #fff7e6;
  --header-text: #ffffff;
  --table-header-bg: #fff7e6;
  --table-row-alt-bg: #fffcf8;
  --shadow: 0 2px 8px rgba(250,140,22,0.06);
  --shadow-lg: 0 4px 16px rgba(250,140,22,0.08);
  --text-primary: #1e1b4b;
  --shadow-xl: 0 8px 24px rgba(250,140,22,0.12);
  --hp-bg: #fef9f2;
  --hp-card: #ffffff;
  --hp-text: #3d1f00;
  --hp-text2: #7a4a20;
  --hp-text3: #b87840;
  --hp-text4: #d4a870;
  --hp-border: #f0d4b8;
  --hp-footer-bg: #3d1f00;
    --hp-nav-bg: rgba(255,255,255,0.85);
  --hp-nav-bg-scr: rgba(255,255,255,0.97);
  --hp-gradient: linear-gradient(135deg,#fa8c16,#ffa940);
  --hp-input-bg: #fff;
  --hp-border2: #f0d4b8;
--hp-footer-text: #b87840;
}html[data-hp-theme="sakura"] {
  --bg: #fef0f5;
  --bg-card: #ffffff;
  --bg-secondary: #fff5f8;
  --text: #2d1a24;
  --text-secondary: #6b3d4d;
  --text-muted: #9a6b7d;
  --border: #e8c8d4;
  --border-light: #f5e0e8;
  --primary: #eb2f96;
  --primary-hover: #f06faf;
  --primary-active: #c41d7f;
  --primary-light: #fff0f8;
  --primary-border: #ffadd5;
  --success: #52c41a;
  --success-light: #f6ffed;
  --warning: #faad14;
  --warning-light: #fffbe6;
  --danger: #ff4d4f;
  --danger-light: #fff2f0;
  --header-bg: linear-gradient(135deg, #eb2f96 0%, #c41d7f 50%, #9b1b5a 100%);
  --header-text: #ffffff;
  --sidebar-bg: #ffffff;
  --sidebar-text: #2d1a24;
  --sidebar-text-secondary: #9a6b7d;
  --sidebar-hover: #fff0f8;
  --sidebar-active-bg: #fff0f8;
  --sidebar-active-text: #eb2f96;
  --sidebar-active-border: #eb2f96;
  --shadow: 0 2px 8px rgba(235, 47, 150, 0.06);
  --shadow-lg: 0 4px 16px rgba(235, 47, 150, 0.08);
  --shadow-xl: 0 8px 24px rgba(235, 47, 150, 0.12);
  --table-header-bg: #fff0f8;
  --table-row-alt-bg: #fef5f9;
  --card-bg: #ffffff;
  --hp-bg: #fef0f5;
  --hp-card: #ffffff;
  --hp-text: #2d1a24;
  --hp-text2: #6b3d4d;
  --hp-text3: #9a6b7d;
  --hp-text4: #b88294;
  --hp-border: #e8c8d4;
  --hp-footer-bg: #2d1a24;
  --text-primary: #2d1a24;
    --hp-nav-bg: rgba(255,255,255,0.85);
  --hp-nav-bg-scr: rgba(255,255,255,0.97);
  --hp-gradient: linear-gradient(135deg,#eb2f96,#c41d7f);
  --hp-input-bg: #fff;
  --hp-border2: #e8c8d4;
--hp-footer-text: #d4a0b8;
}

html[data-hp-theme="deepblue"] {
  --bg: #e8edf5;
  --bg-card: #ffffff;
  --bg-secondary: #f0f4fa;
  --text: #1a2440;
  --text-secondary: #3d5080;
  --text-muted: #6b7ca8;
  --border: #c8d4e8;
  --border-light: #e4eaf5;
  --primary: #1a3a8a;
  --primary-hover: #2a4aaa;
  --primary-active: #0e2a6a;
  --primary-light: #e8ecf8;
  --primary-border: #aab5d8;
  --success: #52c41a;
  --success-light: #f6ffed;
  --warning: #faad14;
  --warning-light: #fffbe6;
  --danger: #ff4d4f;
  --danger-light: #fff2f0;
  --header-bg: linear-gradient(135deg, #0d1f4a 0%, #1a3a8a 50%, #2a5aaa 100%);
  --header-text: #e0e8f8;
  --sidebar-bg: #ffffff;
  --sidebar-text: #1a2440;
  --sidebar-text-secondary: #6b7ca8;
  --sidebar-hover: #e8ecf8;
  --sidebar-active-bg: #e8ecf8;
  --sidebar-active-text: #1a3a8a;
  --sidebar-active-border: #1a3a8a;
  --shadow: 0 2px 8px rgba(26, 58, 138, 0.06);
  --shadow-lg: 0 4px 16px rgba(26, 58, 138, 0.08);
  --shadow-xl: 0 8px 24px rgba(26, 58, 138, 0.12);
  --table-header-bg: #eef2fa;
  --table-row-alt-bg: #f5f7fc;
  --card-bg: #ffffff;
  --hp-bg: #e8edf5;
  --hp-card: #ffffff;
  --hp-text: #1a2440;
  --hp-text2: #3d5080;
  --hp-text3: #6b7ca8;
  --hp-text4: #94a4c8;
  --hp-border: #c8d4e8;
  --hp-footer-bg: #0d1f4a;
  --text-primary: #1a2440;
    --hp-nav-bg: rgba(255,255,255,0.85);
  --hp-nav-bg-scr: rgba(255,255,255,0.97);
  --hp-gradient: linear-gradient(135deg,#1a3a8a,#2a5aaa);
  --hp-input-bg: #fff;
  --hp-border2: #c8d4e8;
--hp-footer-text: #94a4c8;
}
html[data-hp-theme="playful"] {
  --bg: #fef9ff;
  --bg-card: #ffffff;
  --bg-secondary: #fdf2ff;
  --text: #2d1b3d;
  --text-secondary: #6b4d7a;
  --text-muted: #a080b8;
  --border: #e8d4f8;
  --border-light: #f5e8fc;
  --primary: #9333ea;
  --primary-hover: #a855f7;
  --primary-active: #7e22ce;
  --primary-light: #f3e8ff;
  --primary-border: #d8b4fe;
  --success: #22c55e;
  --success-light: #f0fdf4;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #3b82f6;
  --header-bg: linear-gradient(135deg, #7e22ce 0%, #a855f7 30%, #c084fc 70%, #e9d5ff 100%);
  --header-text: #ffffff;
  --header-height: 52px;
  --sidebar-bg: #ffffff;
  --sidebar-text: #2d1b3d;
  --sidebar-text-secondary: #a080b8;
  --sidebar-hover: #f3e8ff;
  --sidebar-active-bg: #f3e8ff;
  --sidebar-active-text: #9333ea;
  --sidebar-active-border: #9333ea;
  --shadow: 0 4px 20px rgba(147,51,234,0.08);
  --shadow-lg: 0 8px 32px rgba(147,51,234,0.12);
  --shadow-xl: 0 16px 48px rgba(147,51,234,0.16);
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.4s cubic-bezier(0.4,0,0.2,1);
  --table-header-bg: #faf5ff;
  --table-row-alt-bg: #fdfaff;
  --card-bg: #ffffff;
  --hp-bg: #fef9ff;
  --hp-card: #ffffff;
  --hp-text: #2d1b3d;
  --hp-text2: #6b4d7a;
  --hp-text3: #a080b8;
  --hp-text4: #c8b8d8;
  --hp-border: #e8d4f8;
  --hp-footer-bg: #2d1b3d;
  --hp-footer-text: #c8b8d8;
  --text-primary: #2d1b3d;
}


*, *::before, *::after { box-sizing: border-box; }

.nav-item { font-weight: 400;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 4px; color: var(--sidebar-text); font-size: 0.875rem;
  text-decoration: none; transition: all 0.15s ease; position: relative; white-space: nowrap;
}
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-active-text); }
.nav-item.active {
  background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--sidebar-active-border);
}
.nav-item span { flex: 1; }
html { font-size: 0.875rem; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: inherit; letter-spacing: 0.01em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeSpeed; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
table { border-collapse: collapse; width: 100%; }
code { font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace; font-size: 0.9em; }
::selection { background: var(--primary-light); color: var(--primary); }

.app-shell { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden; z-index: 10;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px; padding: 16px 18px;
  border-bottom: 1px solid var(--border-light); flex-shrink: 0; min-height: 56px;
}
.sidebar .brand .brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 8px; background: var(--primary); color: #fff; flex-shrink: 0;
}
.sidebar .brand strong { font-size: 1rem; color: var(--text); }
.sidebar .brand span { font-size: 0.688rem; color: var(--text-muted); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; flex: 1; }
.sidebar nav a { font-weight: 400;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 4px; color: var(--sidebar-text); font-size: 0.875rem;
  transition: all 0.15s ease; position: relative; white-space: nowrap; text-decoration: none;
}
.sidebar nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-active-text); }
.sidebar nav a.active {
  background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600;
}
.sidebar nav a.active::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--sidebar-active-border);
}
.sidebar nav a span { flex: 1; }
.sidebar-close { display: none; }
.sidebar-backdrop { display: none; }

.header {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 0 20px;
  background: var(--header-bg); color: var(--header-text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 20;
}
.header-left { display: flex; align-items: center; gap: 12px; }
@media (min-width: 768px) {
.header-left .sidebar-toggle {
  display: none; background: none; border: none; color: var(--header-text);
  cursor: pointer; padding: 6px; border-radius: 4px;
}
}
.header-left .sidebar-toggle:hover { background: rgba(255,255,255,0.15); }
.header-left h1 { margin: 0; font-size: 0.938rem; font-weight: 600; opacity: 0.9; }
.header-right { display: flex; align-items: center; gap: 8px; }
.header-btn {
  background: none; border: none; color: var(--header-text) !important; cursor: pointer;
  padding: 6px 10px; border-radius: 4px; font-size: 0.8125rem;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.header-btn:hover { background: rgba(255,255,255,0.15); }
.header-btn .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.25); display: grid; place-items: center; font-size: 0.8125rem; font-weight: 600;
}

main { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.content { flex: 1; padding: 20px; max-width: 100%; overflow-x: hidden; }

.panel { background: var(--bg-card); border-radius: 8px; box-shadow: var(--shadow); padding: 20px 24px; }
.panel + .panel { margin-top: 16px; }

.login-page {
  display: grid; place-items: center; min-height: 100vh;
  background: linear-gradient(135deg, #141e30, #243b55 50%, #2d4a6a);
  position: relative; overflow: hidden;
}
.login-card {
  width: min(420px, 92vw); padding: 44px 36px 38px; border-radius: 12px;
  background: var(--bg-card); box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative; z-index: 1;
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
  display: inline-grid; place-items: center; width: 64px; height: 64px;
  border-radius: 16px; background: var(--primary); color: #fff; margin-bottom: 14px;
}
.login-header h1 { margin: 0; font-size: 1.5rem; color: var(--text); }
.login-header p { margin: 6px 0 0; color: var(--text-muted); font-size: 0.875rem; }
.login-field {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
  margin-bottom: 18px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card);
}
.login-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
.login-field svg { color: var(--text-muted); flex-shrink: 0; }
.login-field input { flex: 1; border: none; outline: none; font-size: 0.875rem; color: var(--text); background: transparent; height: 100%; }
.login-field input::placeholder { color: var(--text-muted); }
.login-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 46px; border: 0; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease; margin-top: 8px;
}
.login-btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,0.4); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.login-error { display: flex; align-items: center; gap: 7px; padding: 10px 12px; margin-bottom: 16px; border: 1px solid #fbc5c5; border-radius: 4px; background: var(--danger-light); color: var(--danger); font-size: 0.8125rem; }
.login-switch { text-align: center; margin-top: 20px; font-size: 0.8125rem; color: var(--text-muted); }
.login-switch button { font-size: 0.8125rem; color: var(--primary); margin-left: 4px; cursor: pointer; border: 0; background: none; padding: 0; }
.login-switch button:hover { text-decoration: underline; }
.login-code-btn {
  height: 36px; padding: 0 10px; border: 1px solid var(--primary); border-radius: 4px;
  background: #fff; color: var(--primary); font-size: 0.75rem; cursor: pointer;
  white-space: nowrap; flex-shrink: 0; transition: all 0.2s;
}
.login-code-btn:hover:not(:disabled) { background: var(--primary); color: #fff; }
.login-code-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 16px; border: 0; border-radius: 4px;
  background: var(--primary); color: #fff; font-size: 0.8125rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.primary-button:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(124,58,237,0.35); }
.primary-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.text-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-card); color: var(--text-secondary); font-size: 0.8125rem;
  cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.text-button:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.text-button.subtle { border: none; background: transparent; color: var(--text-secondary); padding: 0 8px; min-height: 32px; }
.text-button.subtle:hover { color: var(--primary); background: var(--sidebar-hover); }
.icon-button-sm { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.15s ease; }
.icon-button-sm:hover { background: var(--sidebar-hover); color: var(--text); }
.text-link { background: none; border: 0; color: var(--primary); text-decoration: underline; font-size: 0.8125rem; cursor: pointer; padding: 0; transition: all 0.15s ease; }
.text-link:hover { color: var(--primary-hover); }

.q-filter-bar { background: var(--bg-card); border-radius: 8px; box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 16px; }
.q-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.q-filter-select, .q-filter-input { color: var(--text); background: var(--bg-card);
  height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px;
  outline: 0; font-size: 0.8125rem; background: var(--bg-card); color: var(--text); transition: all 0.2s ease;
}
.q-filter-select { cursor: pointer; min-width: 120px; }
.q-filter-select:focus, .q-filter-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,0.1); }
.q-filter-input::placeholder { color: var(--text-muted); }

.q-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.q-toolbar .dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 4px; min-width: 160px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px;
  box-shadow: var(--shadow-lg); z-index: 100; overflow: hidden;
}
.q-toolbar .dropdown-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 14px;
  border: 0; background: none; font-size: 0.8125rem; color: var(--text);
  cursor: pointer; transition: all 0.15s ease; text-align: left;
}
.q-toolbar .dropdown-menu button:hover { background: var(--sidebar-hover); color: var(--primary); }

.q-selected-bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; margin-bottom: 16px; border: 1px solid var(--primary-border); border-radius: 4px; background: var(--primary-light); font-size: 0.8125rem; color: var(--primary); }

.q-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.q-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.q-table thead { background: var(--table-header-bg, #fafafa); }
.q-table th { padding: 12px 10px; font-weight: 700; color: var(--text-secondary); text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 0.8125rem; user-select: none; }
.q-table td { padding: 10px; border-bottom: 1px solid var(--border-light); color: var(--text); vertical-align: middle; font-weight: 400; }
.q-table tbody tr { transition: background 0.15s ease; }
.q-table tbody tr:nth-child(even) { background: var(--table-row-alt-bg, #fafafa); }
.q-table tbody tr:hover { background: var(--primary-light); }
.q-table tbody tr.selected { background: #f3f0ff; }
.q-table th input[type=checkbox], .q-table td input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.row-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.q-view-card .q-table tbody tr { display: inline-block; width: calc(33.33% - 16px); margin: 8px; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.q-view-stripped tbody tr:nth-child(even) { background: #f8f9fb; }
.q-view-bordered .q-table th, .q-view-bordered .q-table td { border: 1px solid var(--border); }
.q-view-style-select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.75rem; color: var(--text); background: var(--bg-card); outline: 0; cursor: pointer; }

.q-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 0 4px; font-size: 0.8125rem; color: var(--text-secondary); }
.q-page-controls { display: flex; align-items: center; gap: 4px; }
.q-page-info { display: flex; align-items: center; gap: 4px; padding: 0 8px; font-size: 0.8125rem; }
.q-page-input { width: 48px; height: 28px; text-align: center; border: 1px solid var(--border); border-radius: 4px; font-size: 0.8125rem; outline: 0; background: var(--bg-card); color: var(--text); }
.q-page-input:focus { border-color: var(--primary); }

.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 500; white-space: nowrap; line-height: 22px; }
.badge-green { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.badge-gray { background: #f5f5f5; color: #8c8c8c; border: 1px solid #d9d9d9; }
.badge-blue { background: #f3f0ff; color: #7c3aed; border: 1px solid #c4b5fd; }
.badge-orange { background: #fff7e6; color: #d46b08; border: 1px solid #ffd591; }
.badge-red { background: #fff2f0; color: #cf1322; border: 1px solid #ffa39e; }
.badge-purple { background: #f9f0ff; color: #722ed1; border: 1px solid #d3adf7; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.stat-card { background: var(--bg-card); border-radius: 8px; box-shadow: var(--shadow); padding: 20px; transition: all 0.3s ease; position: relative; overflow: hidden; }
.stat-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--card-accent, var(--primary)); opacity: 0.8; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; margin-bottom: 14px; background: var(--card-icon-bg, var(--primary-light)); color: var(--card-accent, var(--primary)); }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text); line-height: 1.2; margin-bottom: 4px; }
.stat-label { font-size: 0.8125rem; color: var(--text-muted); }

.question-page { display: flex; flex-direction: column; }
.q-stem-cell { display: flex; align-items: center; gap: 6px; position: relative; min-width: 0; }
.q-stem-cell span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; color: var(--text); line-height: 1.6; cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: all 0.15s ease; }
.q-stem-cell span:hover { background: var(--sidebar-hover); }
.q-stem-hover-box { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 340px; max-width: 520px; max-height: 320px; overflow-y: auto; padding: 16px 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-xl); }
.q-stem-hover-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); color: var(--text); }
.q-stem-hover-body { font-size: 0.8125rem; line-height: 1.6; color: var(--text-secondary); }
.q-type-tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary-border); white-space: nowrap; }

.q-form-modal { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; background: rgba(0,0,0,0.45); animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.q-form-modal .q-form-card { width: min(820px, 96vw); max-height: 90vh; background: var(--bg-card); border-radius: 12px; box-shadow: var(--shadow-xl); display: flex; flex-direction: column; animation: scaleIn 0.2s ease; }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.q-form-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.q-form-header h2 { margin: 0; font-size: 1rem; color: var(--text); font-weight: 600; }
.q-form-header .close-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.15s ease; }
.q-form-header .close-btn:hover { background: var(--sidebar-hover); color: var(--text); }
.q-form-body { flex: 1; overflow-y: auto; padding: 24px; }
.q-form { display: flex; flex-direction: column; gap: 20px; }
.q-form-section { display: flex; flex-direction: column; gap: 6px; }
.q-form-label { font-size: 0.8125rem; font-weight: 600; color: var(--text); min-width: 90px; }
.q-form-label .required { color: var(--danger); margin-left: 2px; }
.q-form-input, .q-form-select, .q-form-textarea { padding: 8px 11px; border: 1px solid var(--border); border-radius: 4px; outline: 0; font-size: 0.8125rem; background: var(--bg-card); color: var(--text); transition: all 0.2s ease; width: 100%; box-sizing: border-box; }
.q-form-input:focus, .q-form-select:focus, .q-form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,0.1); }
.q-form-number { max-width: 120px; }
.q-form-select { cursor: pointer; }
.q-form-textarea { resize: vertical; min-height: 60px; font-family: inherit; line-height: 1.55; }
.q-form-radios { display: flex; flex-wrap: wrap; gap: 6px; }
.q-form-radio-group { display: flex; flex-wrap: wrap; gap: 6px; }
.q-form-radio-group label { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.8125rem; cursor: pointer; transition: all 0.15s ease; color: var(--text-secondary); background: var(--bg-card); }
.q-form-radio-group label:hover { border-color: var(--primary); color: var(--primary); }
.q-form-radio-group label.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 500; box-shadow: 0 0 0 1px var(--primary); }
.q-form-radio-group input[type=radio], .q-form-radio-group input[type=checkbox] { display: none; }
.q-form-type-group { display: flex; flex-wrap: wrap; gap: 6px; }
.q-form-type-group { display: flex; flex-wrap: wrap; gap: 8px; }
.q-form-type-group label { padding: 6px 16px; border: 1px solid var(--border); border-radius: 20px; font-size: 0.75rem; cursor: pointer; transition: all 0.2s ease; color: var(--text-secondary); background: var(--bg-card); font-weight: 500; }
.q-form-type-group label:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.q-form-type-group label.active { border-color: var(--primary); background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(124,58,237,0.3); }
.q-form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.q-form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg-card); border-radius: 0 0 12px 12px; flex-shrink: 0; }

.option-row { background: var(--bg); display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--border-light); border-radius: 4px; background: #fafbfc; transition: all 0.15s ease; }
.option-row:hover { border-color: var(--border); background: var(--bg-card); }
.option-row .option-marker { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 0.8125rem; font-weight: 600; flex-shrink: 0; background: var(--primary-light); color: var(--primary); }
.option-row .option-content { flex: 1; min-width: 0; }
.option-row .option-actions { display: flex; gap: 4px; flex-shrink: 0; }

.rich-editor { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; transition: all 0.2s ease; }
.rich-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,0.1); }
.rich-editor-toolbar { background: var(--border-light); display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--border-light); background: #fafafa; flex-wrap: wrap; }
.rich-editor-toolbar button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); cursor: pointer; transition: all 0.15s ease; }
.rich-editor-toolbar button:hover { background: var(--sidebar-hover); color: var(--text); }
.rich-editor-toolbar button.active { background: var(--primary-light); color: var(--primary); }
.rich-editor-toolbar .separator { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.rich-editor-content { min-height: 120px; padding: 12px; outline: 0; font-size: 0.8125rem; line-height: 1.7; color: var(--text); background: var(--bg-card); border-radius: 0 0 4px 4px; }
.rich-editor-content:empty::before { content: attr(data-placeholder); color: var(--text-muted); pointer-events: none; }
.rich-editor-content img { max-width: 100%; border-radius: 4px; }

.tree-select { position: relative; width: 100%; }
.tree-select-wrap { position: relative; width: 100%; }

.tree-select-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--text);
  transition: background 0.12s ease;
}
.tree-select-option:hover { background: var(--bg2); }
.tree-select-option.selected { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.tree-select-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
}
.tree-select-toggle:hover { background: var(--bg2); }
.tree-select-label { flex: 1; }
.tree-select-parent { font-weight: 500; }
.tree-select-child { padding-left: 32px; }
.tree-select-placeholder { color: var(--text-muted); }

.tree-select-trigger { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.8125rem; background: var(--bg-card); color: var(--text); cursor: pointer; transition: all 0.15s ease; }
.tree-select-trigger:hover { border-color: var(--primary); }
.tree-select-trigger.open { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,0.1); }
.tree-select-trigger .placeholder { color: var(--text-muted); }
.tree-select-dropdown { position: absolute; top: calc(100% + 4px); left: 0; min-width: 100%; width: auto; max-height: 260px; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow-lg); z-index: 220; white-space: nowrap; }
.tree-node { display: flex; align-items: center; gap: 4px; padding: 8px 10px; cursor: pointer; transition: all 0.1s ease; font-size: 0.8125rem; color: var(--text); }
.tree-node:hover { background: var(--sidebar-hover); }
.tree-node.selected { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.tree-node .toggle-btn { display: grid; place-items: center; width: 20px; height: 20px; border: 0; background: none; color: var(--text-muted); cursor: pointer; transition: all 0.15s ease; flex-shrink: 0; padding: 0; }
.tree-node .toggle-btn:hover { color: var(--text); }
.tree-node .node-label { flex: 1; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 180; background: rgba(0,0,0,0.3); animation: fadeIn 0.2s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 96vw); z-index: 190; background: var(--bg-card); box-shadow: var(--shadow-xl); display: flex; flex-direction: column; animation: slideInRight 0.25s ease; }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer-header h2 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text); }
.drawer-header .close-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.15s ease; }
.drawer-header .close-btn:hover { background: var(--sidebar-hover); color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); flex-shrink: 0; }

.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: var(--text-muted); font-size: 0.875rem; }
.state.error { color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: 16px; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

:focus-visible {
  outline: 2px solid var(--primary, #667eea);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px; left: 0;
  background: var(--primary, #667eea);
  color: #fff;
  padding: 8px 16px;
  z-index: 10000;
  border-radius: 0 0 6px 0;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

@media (max-width: 767px) {
  button, .q-btn, [role="button"], .clickable {
    min-height: 44px;
    min-width: 44px;
  }
  input, select, textarea {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
@media (max-width: 767px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-shell > .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; z-index: 100; transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: var(--shadow-xl); }
  .sidebar.open { transform: translateX(0); pointer-events: auto; z-index: 101; }
  .sidebar .sidebar-close { display: inline-flex; position: absolute; top: 12px; right: 12px; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 99; background: rgba(0,0,0,0.3); }
  .topbar .sidebar-toggle { display: inline-flex !important; }
  .header { padding: 0 12px; }
  .header-left h1 { font-size: 0.875rem; }
  .content { padding: 16px; max-width: 100vw; overflow-x: hidden; }
  .stats-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 1.5rem; }
  .q-filter-bar { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .q-filter-select, .q-filter-input { color: var(--text); background: var(--bg-card); font-size: 0.75rem; height: 32px; }
  .q-table { font-size: 0.75rem; }
  .q-table th, .q-table td { padding: 8px 6px; }
  .q-table-wrap, .q-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .q-pagination { padding: 10px 0; font-size: 0.75rem; flex-wrap: wrap; }
  img, video, canvas, svg { max-width: 100%; height: auto; }
  .row-actions { white-space: nowrap; gap: 4px; }
  .app-shell .modal-card, .app-shell .modal { max-width: 92vw; }
}
@media (max-width: 768px) {
  .header { padding: 0 10px; height: 44px; }
  .header-btn { font-size: 0.75rem; padding: 4px 8px; }
  .header-btn span.header-text-label { display: none; }
  .content { padding: 12px; overflow-x: hidden; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 1.375rem; }
  .stat-icon { width: 40px; height: 40px; }
  .panel { padding: 14px 16px; }
  .q-filter-bar { padding: 10px 12px; margin-bottom: 12px; flex-wrap: wrap; gap: 6px; }
  .q-filter-select, .q-filter-input { color: var(--text); background: var(--bg-card); font-size: 0.75rem; height: 30px; min-width: 100px; }
  .q-toolbar .primary-button, .q-toolbar .text-button { font-size: 0.75rem; padding: 0 10px; min-height: 30px; }
  .q-table { font-size: 0.688rem; }
  .q-table th, .q-table td { padding: 6px 4px; }
  .q-pagination { flex-direction: column; align-items: center; gap: 8px; font-size: 0.75rem; padding: 8px 0; }
  .app-shell .drawer { width: 100vw; }
  .login-card { padding: 30px 20px 28px; }
  .login-header h1 { font-size: 1.25rem; }
  .option-row { background: var(--bg); flex-direction: column; gap: 8px; }
  .option-row .option-actions { align-self: flex-end; }
  .q-table-wrap, .q-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100vw; }
  .q-table { min-width: 600px; }
  .modal-card, .modal, .q-form-modal { max-width: 100vw !important; width: 95vw !important; margin: 10px; border-radius: 8px; }
  .modal-backdrop, .sys-backdrop { padding: 10px; }
  .modal-head, .modal-foot { padding: 10px 14px; }
  .modal-body { padding: 12px 14px; }
  .q-form-modal form, .modal form { display: flex; flex-direction: column; gap: 10px; }
  .q-form-modal input, .q-form-modal select, .q-form-modal textarea,
  .modal input, .modal select, .modal textarea { width: 100%; box-sizing: border-box; min-height: 36px; font-size: 0.875rem; }
  .q-stem-cell { flex-wrap: wrap; }
  @media (max-width: 767px) { .create-layout { flex-direction: column; } }
  .create-sidebar { width: 100%; max-height: 40vh; overflow-y: auto; }
  .create-main { width: 100%; }
  .create-editor-toolbar { flex-wrap: wrap; gap: 4px; }
  @media (max-width: 767px) { .lc-layout { flex-direction: column; } }
  .lc-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .row-actions .text-button.subtle { min-height: 28px; padding: 4px 6px; font-size: 0.688rem; }
  .row-actions { gap: 2px; white-space: nowrap; }
  button, .nav-item, select, input[type="checkbox"], input[type="radio"] { min-height: 36px; }
}
@media (max-width: 480px) {
  .header { height: 40px; }
  .content { padding: 6px; max-width: 100vw; overflow-x: hidden; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-card { padding: 10px; }
  .stat-value { font-size: 1rem; }
  .stat-icon { width: 28px; height: 28px; border-radius: 6px; margin-bottom: 6px; }
  .stat-label { font-size: 0.625rem; }
  .panel { padding: 8px 10px; border-radius: 6px; }
  .q-filter-bar { padding: 6px 8px; margin-bottom: 8px; flex-wrap: wrap; gap: 4px; }
  .q-filter-select, .q-filter-input { color: var(--text); background: var(--bg-card); font-size: 0.688rem; height: 28px; min-width: 70px; max-width: 100%; }
  .q-toolbar { flex-wrap: wrap; gap: 4px; padding: 6px 8px; }
  .q-table { font-size: 9px; min-width: 500px; }
  .q-table th, .q-table td { padding: 3px 2px; white-space: nowrap; }
  .q-table-wrap, .q-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -6px; padding: 0 6px; }
  .q-pagination { font-size: 0.625rem; gap: 4px; }
  .q-page-input { width: 30px; height: 22px; font-size: 0.625rem; }
  .row-actions .text-button.subtle { min-height: 24px; padding: 2px 4px; font-size: 0.625rem; }
  .badge { font-size: 0.625rem; min-height: 18px; padding: 0 4px; }
  .login-card { padding: 20px 12px 18px; max-width: 100%; }
  .login-header h1 { font-size: 1rem; }
  .login-field { height: 36px; }
  .login-btn { height: 38px; font-size: 0.8125rem; }
  .app-shell .modal-card, .app-shell .modal { max-width: 98vw; width: 96vw; border-radius: 6px; }
  .modal-head h2, .modal-head h3 { font-size: 0.875rem; }
  .modal-body { padding: 8px 10px; }
  img, video, canvas { max-width: 100%; height: auto; }
  button, select, input[type="text"], input[type="number"], input[type="email"], input[type="password"], textarea { font-size: 0.875rem !important; }
  .q-stem-cell { flex-wrap: wrap; gap: 4px; }
  .option-row { padding: 6px 8px; }
}
@media print {
  .sidebar, .sidebar-backdrop, .header, .q-filter-bar, .q-toolbar, .q-selected-bar, .q-pagination, .q-form-modal, .drawer, .drawer-backdrop { display: none !important; }
  .app-shell { grid-template-columns: 1fr; }
  .content { padding: 0; }
  .panel { box-shadow: none; border: 1px solid #ddd; border-radius: 0; }
  .q-table th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 48px; padding: 0 20px;
  background: var(--header-bg); color: var(--header-text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin: 0; font-size: 0.938rem; font-weight: 600; color: var(--header-text); }
.topbar p { margin: 0; font-size: 0.688rem; opacity: 0.7; color: var(--header-text); display: none; }
@media (min-width: 768px) {
.topbar .sidebar-toggle {
  display: none; background: none; border: none; color: var(--header-text);
  cursor: pointer; padding: 6px; border-radius: 4px;
}
}
.topbar .sidebar-toggle:hover { background: rgba(255,255,255,0.15); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions .theme-select {
  height: 30px; padding: 0 8px; border: 1px solid rgba(255,255,255,0.3); border-radius: 4px;
  background: rgba(255,255,255,0.12); color: var(--header-text); font-size: 0.75rem; cursor: pointer; outline: 0;
}
.topbar-actions .theme-select option { color: #262626; background: #fff; }
.topbar-actions .icon-button {
  background: none; border: none; color: var(--header-text); cursor: pointer;
  padding: 6px; border-radius: 4px; display: grid; place-items: center;
}
.topbar-actions .icon-button:hover { background: rgba(255,255,255,0.15); }
.user-menu { display: flex; align-items: center; gap: 6px; color: var(--header-text); font-size: 0.8125rem; }
.user-menu .user-name { opacity: 0.9; }

@media (max-width: 767px) {
  .topbar .sidebar-toggle { display: inline-flex !important; }
}
@media (max-width: 768px) {
  .topbar { padding: 0 10px; height: 44px; }
  .user-menu .user-name { display: none; }
}

.modal-backdrop { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; overflow-y: auto; }
.modal { z-index: 210; max-width: 680px; width: 100%; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg-card); border-radius: 12px 12px 0 0;
}
.modal-head h2 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text); }
.modal-head .icon-button {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); cursor: pointer;
}
.modal-head .icon-button:hover { background: var(--sidebar-hover); color: var(--text); }
.modal-body { background: var(--bg-card); padding: 24px; overflow-y: auto;
  max-height: 80vh;
  border-radius: 0 0 12px 12px; box-shadow: var(--shadow-xl);
}
.modal .modal-head + .modal-body { background: var(--bg-card); border-radius: 0 0 12px 12px; }

.question-form { display: grid; gap: 18px; }
.form-row { display: flex; gap: 20px; flex-wrap: wrap; }
.q-form-hint { font-size: 0.75rem; color: var(--text-muted); margin: 4px 0; }

.q-option-list { display: flex; flex-direction: column; gap: 8px; }
.q-option-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card);
  transition: all 0.2s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.q-option-row:hover { border-color: var(--primary-border); box-shadow: 0 1px 6px rgba(0,0,0,0.08); }
.q-option-row .rich-editor { flex: 1; min-width: 0; }
.q-option-row .rich-editor-content { min-height: 60px; font-size: 0.8125rem; }
.q-option-row input[type=radio], .q-option-row input[type=checkbox] {
  margin-top: 6px; width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); flex-shrink: 0;
}
.q-option-row:hover { border-color: var(--border); }
.option-label {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font-weight: 600; font-size: 0.8125rem; color: #fff; background: var(--primary);
  flex-shrink: 0; margin-top: 2px;
}
.q-option-move { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; margin-right: 2px; }
.q-judge-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg-card); cursor: pointer; font-size: 0.875rem; color: var(--text);
}

.drawer.drawer-right {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 96vw);
  z-index: 190; background: var(--bg-card); box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.drawer-head h2 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--text); }
.drawer-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 14px 24px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.drawer-section {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, 90vw);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  z-index: 99999;
  max-height: 80vh;
  overflow-y: auto;
}

.q-action-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.q-action-left { display: flex; align-items: center; gap: 8px; }

.kp-tree-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: 0;
  background: var(--sidebar-hover); color: var(--text-muted);
  cursor: pointer; font-size: 0.625rem; border-radius: 4px;
  transition: all 0.15s ease; flex-shrink: 0;
}
.kp-tree-toggle:hover { background: var(--primary-light); color: var(--primary); }
.kp-tree-toggle-empty { cursor: default; background: transparent; }
.kp-tree-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-light); transition: background 0.15s; }
.kp-tree-row:hover { background: var(--bg-secondary); }
.kp-tree-name { font-weight: 600; font-size: 0.875rem; color: var(--text); min-width: 120px; }
.kp-tree-badges { display: flex; gap: 6px; flex-shrink: 0; }
.kp-badge { padding: 2px 10px; border-radius: 12px; font-size: 0.688rem; font-weight: 500; }
.kp-badge-type { background: var(--primary-light); color: var(--primary); }
.kp-badge-subject { background: #f0f5ff; color: #597ef7; }
.kp-tree-desc { flex: 1; font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-tree-actions { display: flex; gap: 4px; flex-shrink: 0; }
.kp-tree-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 2px solid var(--border-light); font-weight: 600; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.kp-tree-header span:nth-child(1) { min-width: 120px; }
.kp-tree-header span:nth-child(2) { min-width: 100px; }
.kp-tree-body { min-height: 100px; }
.kp-tree-empty { padding: 40px; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

.btn-label { font-size: 0.75rem; white-space: nowrap; }
.icon-button {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); cursor: pointer;
}
.icon-button:hover { background: var(--sidebar-hover); color: var(--primary); }

.q-form-input.q-form-number { max-width: 120px; }
.q-form-input.q-form-textarea { min-height: 60px; resize: vertical; }
.text-button.subtle { border: none; background: transparent; color: var(--text-secondary); padding: 0 8px; min-height: 32px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.text-button.subtle:hover { color: var(--primary); background: var(--sidebar-hover); }
.icon-button-sm.q-option-del-btn { color: var(--danger); }

.exam-taking-layout {
  position: fixed; inset: 0; z-index: 250;
  display: flex; flex-direction: column;
  background: var(--bg-body);
}

.et-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 52px; flex-shrink: 0;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.et-topbar-left { display: flex; align-items: center; gap: 12px; }
.et-topbar-center { font-size: 0.875rem; color: var(--text-muted); }
.et-topbar-right { display: flex; align-items: center; gap: 8px; }
.et-title { font-weight: 600; font-size: 0.938rem; color: var(--text); }
.et-progress { font-size: 0.8125rem; }

.et-body { flex: 1; display: flex; overflow: hidden; }

.et-sidebar {
  width: 200px; flex-shrink: 0; overflow-y: auto;
  background: var(--bg-card); border-right: 1px solid var(--border);
  padding: 16px 12px;
}
.et-card { margin-bottom: 12px; }
.et-card-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.875rem; color: var(--text); margin-bottom: 10px; }
.et-qgroup { margin-bottom: 10px; }
.et-qgroup-title { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; display: flex; align-items: center; gap: 4px; }
.et-qgroup-count { font-weight: 400; color: var(--text-muted); }
.et-qgroup-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.et-qbtn {
  width: 32px; height: 32px; border: 2px solid transparent; border-radius: 4px;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  display: grid; place-items: center; transition: all 0.15s;
}
.et-qbtn:hover { transform: scale(1.1); }
.et-qbtn-answered { background: #52c41a; color: #fff; }
.et-qbtn-unanswered { background: #f0f0f0; color: #999; }
.et-qbtn-active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,0.2); }

.et-legend { display: flex; gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-light); }
.et-legend-item { display: flex; align-items: center; gap: 4px; font-size: 0.688rem; color: var(--text-muted); }
.et-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.et-dot-green { background: #52c41a; }
.et-dot-red { background: #ff4d4f; }
.et-qbtn-correct { background: #52c41a; color: #fff; }
.et-qbtn-wrong { background: #ff4d4f; color: #fff; }
.et-result-area { margin-top: 16px; padding: 12px; background: #fafafa; border-radius: 8px; border: 1px solid #f0f0f0; }
.et-result-badge { font-size: 0.875rem; font-weight: 600; margin-bottom: 8px; }
.et-result-correct { color: #52c41a; }
.et-result-wrong { color: #ff4d4f; }
.et-answer-compare { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.et-answer-row { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; }
.et-answer-label { color: #666; font-weight: 500; min-width: 70px; }
.et-answer-value { font-weight: 600; padding: 2px 8px; border-radius: 3px; }
.et-answer-wrong { color: #ff4d4f; background: #fff2f0; }
.et-answer-right { color: #52c41a; background: #f6ffed; }
.et-analysis { margin-top: 8px; padding: 8px 12px; background: #f3f0ff; border-radius: 6px; font-size: 0.8125rem; color: #333; line-height: 1.6; }

.et-dot-gray { background: #d9d9d9; }
.et-dot-blue { background: var(--primary); }

.et-content {
  flex: 1; overflow-y: auto; padding: 24px 32px;
  background: var(--bg-body);
}

.et-question-area { max-width: 800px; margin: 0 auto; }
.et-q-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.et-q-header-left { display: flex; align-items: center; gap: 8px; }
.et-q-type-tag {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border-radius: 4px; font-size: 0.75rem; font-weight: 600;
  background: #f3f0ff; color: #7c3aed;
}
.et-q-num { font-size: 0.875rem; color: var(--text); font-weight: 500; }
.et-q-score { font-size: 0.75rem; color: var(--text-muted); }

.et-q-stem {
  font-size: 0.938rem; line-height: 1.9; margin-bottom: 20px;
  padding: 16px; background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 8px;
}

.et-q-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.et-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; transition: all 0.15s;
  background: var(--bg-card); font-size: 0.875rem;
}
.et-option:hover { border-color: var(--primary); background: #f0f8ff; }
.et-option-selected { border-color: var(--primary); background: #f3f0ff; color: var(--primary); font-weight: 500; }
.et-option input[type="radio"] { display: none; }
.et-option-label { font-weight: 700; color: var(--text); width: 20px; }
.et-option-text { color: var(--text); }

.et-textarea {
  width: 100%; padding: 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.875rem; resize: vertical;
  background: var(--bg-card); color: var(--text);
}

.et-nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 24px; padding: 16px 0; border-top: 1px solid var(--border-light);
}
.et-nav-info { font-size: 0.8125rem; color: var(--text-muted); }
.et-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); font-size: 0.875rem; }
.exam-review-layout {
  position: fixed; inset: 0; z-index: 250;
  display: flex; flex-direction: column;
  background: var(--bg-body);
}

.er-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 52px; flex-shrink: 0;
  background: var(--bg-card); border-bottom: 1px solid var(--border);
}
.er-topbar-left { display: flex; align-items: center; gap: 12px; }
.er-topbar-right { display: flex; align-items: center; gap: 8px; }
.er-title { font-weight: 600; font-size: 0.938rem; color: var(--text); }

.er-body {
  flex: 1; display: flex; overflow: hidden;
}

.er-sidebar {
  width: 260px; flex-shrink: 0; overflow-y: auto;
  background: #fff; border-right: 1px solid #f0f0f0;
  padding: 16px 12px; display: flex; flex-direction: column; gap: 12px;
}

.er-content {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  background: #fff;
}

.er-side-card {
  background: #fff; border: 1px solid #f0f0f0;
  border-radius: 8px; padding: 16px;
}
.er-side-card-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.8125rem; color: #333;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}
.er-side-card-title svg { color: var(--primary); }

.er-side-score-main {
  display: flex; align-items: baseline; gap: 4px;
  padding: 10px 0 14px; border-bottom: 1px solid #f5f5f5;
}
.er-side-score-num {
  font-size: 2.25rem; font-weight: 700; color: var(--primary);
  line-height: 1;
}
.er-side-score-unit {
  font-size: 0.875rem; color: #999;
}
.er-side-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px; padding-top: 12px;
}
.er-side-stat {
  text-align: center;
}
.er-side-stat-val {
  font-size: 1.125rem; font-weight: 700; color: #333;
}
.er-side-stat-lbl {
  font-size: 0.688rem; color: #999; margin-top: 2px;
}

.er-nav-tabs {
  display: flex; gap: 0; margin-bottom: 12px;
  background: #f5f5f5; border-radius: 6px; padding: 3px;
}
.er-nav-tab {
  flex: 1; border: 0; background: transparent;
  padding: 6px 8px; border-radius: 4px; font-size: 0.8125rem; color: #666;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px;
  transition: all 0.2s;
}
.er-nav-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.er-nav-count { font-size: 0.688rem; color: #999; }
.er-nav-tab.active .er-nav-count { color: var(--primary); }

.er-q-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.er-q-dot {
  width: 28px; height: 28px; border: 0; border-radius: 4px;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; background: #e8e8e8; color: #666;
}
.er-q-dot:hover { transform: scale(1.12); }
.er-q-dot.correct { background: #52c41a; color: #fff; }
.er-q-dot.wrong { background: #ff4d4f; color: #fff; }

.er-score-summary { display: flex; flex-direction: column; gap: 8px; }
.er-score-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.8125rem; }
.er-score-row strong { font-size: 0.875rem; }
.er-score-main { background: var(--primary-light); margin: 0 -6px; padding: 6px 8px; border-radius: 6px; }
.er-score-highlight { font-size: 1.25rem; color: var(--primary); }

.er-answer-card { display: flex; flex-direction: column; gap: 10px; }
.er-qgroup-title { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.er-qgroup-btns { display: flex; flex-wrap: wrap; gap: 4px; }
.er-qbtn {
  width: 30px; height: 30px; border: 0; border-radius: 4px;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  display: grid; place-items: center; transition: all 0.15s;
}
.er-qbtn:hover { transform: scale(1.1); }
.er-qbtn-correct { background: #52c41a; color: #fff; }
.er-qbtn-wrong { background: #ff4d4f; color: #fff; }
.er-qbtn-unanswered { background: #d9d9d9; color: #666; }

.er-legend { display: flex; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-light); }
.er-legend-item { display: flex; align-items: center; gap: 4px; font-size: 0.688rem; color: var(--text-muted); }
.er-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.er-dot-green { background: #52c41a; }
.er-dot-red { background: #ff4d4f; }
.er-dot-gray { background: #d9d9d9; }

.er-ov-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.er-ov-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 16px; text-align: center;
}
.er-ov-num { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.er-ov-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

.er-toggle-bar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.er-toggle-label { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--text-secondary); cursor: pointer; }

.er-q-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 16px 20px; margin-bottom: 12px;
}
.er-q-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.er-q-header-left { display: flex; align-items: center; gap: 8px; }
.er-q-header-right { display: flex; align-items: center; }
.er-q-type-tag {
  display: inline-flex; align-items: center; padding: 2px 10px;
  border-radius: 4px; font-size: 0.75rem; font-weight: 600;
  background: #f3f0ff; color: #7c3aed;
}
.er-q-num { font-size: 0.8125rem; color: var(--text); font-weight: 500; }
.er-q-score { font-size: 0.75rem; color: var(--text-muted); }
.er-q-status { font-size: 0.75rem; font-weight: 600; padding: 2px 10px; border-radius: 4px; }
.er-q-status-correct { background: #f6ffed; color: #52c41a; }
.er-q-status-wrong { background: #fff2f0; color: #ff4d4f; }
.er-q-status-unanswered { background: #f5f5f5; color: #999; }

.er-q-stem { font-size: 0.875rem; line-height: 1.8; margin-bottom: 12px; padding: 12px; background: var(--bg); border-radius: 6px; }
.er-q-options { margin-bottom: 12px; }

.er-q-answer-compare {
  background: var(--bg); border-radius: 6px; padding: 12px;
  margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px;
}
.er-compare-row { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; }
.er-compare-label { color: var(--text-muted); flex-shrink: 0; }
.er-answer-correct { color: #52c41a; font-weight: 600; }
.er-answer-wrong { color: #ff4d4f; font-weight: 600; text-decoration: line-through; }

.er-q-analysis-toggle {
  display: flex; align-items: center; gap: 4px;
  font-weight: 600; font-size: 0.8125rem; color: var(--text);
  cursor: pointer; padding: 8px 0; user-select: none;
}
.er-q-analysis-body { font-size: 0.8125rem; line-height: 1.7; color: var(--text-secondary); padding: 8px 0 4px; }

body.exam-mode { overflow: hidden; }

.et-timer {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.938rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--text); padding: 2px 10px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border-light);
}
.et-timer-warn { color: #ff4d4f; background: #fff2f0; border-color: #ffccc7; }

.et-user-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; color: var(--text-muted); background: var(--bg);
  padding: 2px 10px; border-radius: 12px; border: 1px solid var(--border-light);
}

.et-score {
  font-size: 0.875rem; color: var(--primary); font-weight: 600;
  padding: 2px 12px; border-radius: 6px;
  background: #f3f0ff; border: 1px solid #c4b5fd;
}

.et-submitted-badge {
  font-size: 0.8125rem; font-weight: 600; color: #52c41a;
  padding: 4px 14px; border-radius: 6px;
  background: #f6ffed; border: 1px solid #b7eb8f;
}

.et-result-area {
  margin-top: 16px; padding: 16px;
  background: var(--bg); border-radius: 8px;
  border: 1px solid var(--border-light);
}
.et-result-badge {
  font-size: 0.875rem; font-weight: 700; padding: 6px 16px;
  border-radius: 6px; display: inline-block; margin-bottom: 12px;
}
.et-result-correct { color: #52c41a; background: #f6ffed; border: 1px solid #b7eb8f; }
.et-result-wrong { color: #ff4d4f; background: #fff2f0; border: 1px solid #ffccc7; }
.et-answer-compare { display: flex; flex-direction: column; gap: 8px; }
.et-answer-row { display: flex; align-items: center; gap: 8px; font-size: 0.875rem; }
.et-answer-label { color: var(--text-muted); }
.et-answer-value { font-weight: 600; }
.et-answer-right { color: #52c41a; }
.et-answer-wrong { color: #ff4d4f; }
.et-analysis { margin-top: 12px; font-size: 0.8125rem; line-height: 1.7; color: var(--text-secondary); padding: 12px; background: #fffbe6; border-radius: 6px; border: 1px solid #ffe58f; }

.sys-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center;
}
.sys-dialog {
  width: 600px; background: #fff; border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.sys-dialog-header {
  height: 55px; padding: 0 24px;
  border-bottom: 1px solid #e8e8e8;
  display: flex; align-items: center; justify-content: space-between;
}
.sys-dialog-header h3 {
  font-size: 1rem; color: #333; font-weight: 700; margin: 0;
}
.sys-dialog-close {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer; border-radius: 4px;
  font-size: 1.125rem; color: #666; line-height: 1;
}
.sys-dialog-close:hover { background: #f5f5f5; }
.sys-dialog-body {
  padding: 24px; display: flex; flex-direction: column; gap: 24px;
}
.sys-dialog-footer {
  height: 55px; padding: 0 24px;
  border-top: 1px solid #e8e8e8;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.sys-field { display: flex; flex-direction: column; }
.sys-field-label {
  font-size: 0.875rem; color: #333; line-height: 22px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 4px;
}
.sys-field-required { color: #ff4d4f; }
.sys-field-help {
  font-size: 0.75rem; color: #999; margin-left: 2px; cursor: help;
  display: inline-flex; align-items: center;
}
.sys-input {
  height: 32px; width: 100%; border: 1px solid #d9d9d9; border-radius: 4px;
  padding: 0 11px; font-size: 0.875rem; color: #333; outline: none;
  box-sizing: border-box; transition: border-color 0.2s;
}
.sys-input:focus { border-color: #7c3aed; }
.sys-input::placeholder { color: #bfbfbf; }
.sys-input-number {
  height: 32px; width: 120px; border: 1px solid #d9d9d9; border-radius: 4px;
  padding: 0 11px; font-size: 0.875rem; color: #333; outline: none;
  box-sizing: border-box; transition: border-color 0.2s;
}
.sys-input-number:focus { border-color: #7c3aed; }
.sys-textarea {
  width: 100%; height: 150px; border: 1px solid #d9d9d9; border-radius: 4px;
  padding: 11px; font-size: 0.875rem; color: #333; outline: none;
  box-sizing: border-box; resize: vertical; transition: border-color 0.2s;
  font-family: inherit;
}
.sys-textarea:focus { border-color: #7c3aed; }
.sys-textarea::placeholder { color: #999; }
.sys-btn {
  height: 32px; padding: 0 15px; border-radius: 4px; font-size: 0.875rem;
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  transition: all 0.2s; outline: none;
}
.sys-btn-default {
  background: #fff; border: 1px solid #d9d9d9; color: #333;
}
.sys-btn-default:hover { border-color: #7c3aed; color: #7c3aed; }
.sys-btn-primary {
  background: #7c3aed; border: 1px solid #7c3aed; color: #fff;
}
.sys-btn-primary:hover { background: #7c3aed; border-color: #7c3aed; }

.sys-perm-tree {
  max-height: 400px; overflow-y: auto; padding: 4px 0;
}
.sys-perm-item {
  display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer;
}
.sys-perm-item label {
  display: flex; align-items: center; gap: 6px; cursor: pointer; margin: 0;
}
.sys-perm-item input[type=checkbox] { margin: 0; accent-color: #7c3aed; }
.sys-perm-label { font-size: 0.875rem; color: #333; }
.sys-perm-code { font-size: 0.75rem; color: #999; margin-left: 6px; }
.sys-perm-group { font-weight: 600; }
.sys-switch {
  position: relative; display: inline-block; width: 44px; height: 22px;
  cursor: pointer; vertical-align: middle;
}
.sys-switch input { opacity: 0; width: 0; height: 0; }
.sys-switch-slider {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc; border-radius: 11px; transition: 0.2s;
}
.sys-switch-slider::before {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
  transition: 0.2s;
}
.sys-switch input:checked + .sys-switch-slider { background: #7c3aed; }
.sys-switch input:checked + .sys-switch-slider::before { transform: translateX(22px); }

.user-menu {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  transition: background 0.2s; position: relative;
}
.user-menu:hover { background: var(--bg-hover); }
.user-arrow { color: var(--text-muted); transition: transform 0.2s; }
.user-dropdown-backdrop { position: fixed; inset: 0; z-index: 99; }
.user-dropdown {
  display: flex; flex-direction: column;
  position: absolute; top: 44px; right: 0; z-index: 100;
  background: #fff; border: 1px solid #e8e8e8; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1); min-width: 160px;
  padding: 4px; animation: dropIn 0.15s ease;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 6px; font-size: 0.875rem; color: #333;
  cursor: pointer; transition: background 0.15s;
}
.user-dropdown-item:hover { background: #f5f5f5; }
.user-dropdown-item svg { color: var(--text-muted); }
.user-dropdown-divider { height: 1px; background: #f0f0f0; margin: 4px 8px; }

.homepage { min-height: 100vh; background: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.hp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px; height: 64px; background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px); border-bottom: 1px solid #f0f0f0;
  position: sticky; top: 0; z-index: 10;
}
.hp-logo { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; font-weight: 700; color: #7c3aed; }
.hp-nav { display: flex; align-items: center; gap: 24px; }
.hp-nav-link { font-size: 0.875rem; color: #555; text-decoration: none; transition: color 0.2s; }
.hp-nav-link:hover { color: #7c3aed; }
.hp-login-btn {
  height: 34px; padding: 0 18px; border: 0; border-radius: 6px;
  background: #7c3aed; color: #fff; font-size: 0.875rem; cursor: pointer;
  transition: all 0.2s;
}
.hp-login-btn:hover { background: #7c3aed; }

.hp-hero { position: relative; height: 480px; overflow: hidden; }
.hp-carousel { width: 100%; height: 100%; position: relative; }
.hp-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease; }
.hp-slide.active { opacity: 1; }
.hp-slide-bg { position: absolute; inset: 0; background-size: cover; background-position: center; background-color: #1a1a2e; }
.hp-slide-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,0,0,0.5), rgba(0,0,0,0.2)); }
.hp-slide-content {
  position: absolute; left: 80px; top: 50%; transform: translateY(-50%); color: #fff; z-index: 2;
}
.hp-slide-content h2 { font-size: 40px; font-weight: 700; margin: 0 0 12px; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.hp-slide-content p { font-size: 1.125rem; margin: 0 0 28px; opacity: 0.9; }
.hp-cta-btn {
  height: 44px; padding: 0 32px; border: 0; border-radius: 8px;
  background: #7c3aed; color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s;
}
.hp-cta-btn:hover { background: #7c3aed; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(124,58,237,0.4); }
.hp-carousel-dots {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 3;
}
.hp-dot {
  width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%;
  background: transparent; cursor: pointer; transition: all 0.3s; padding: 0;
}
.hp-dot.active { background: #fff; transform: scale(1.3); }

.hp-features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  max-width: 1000px; margin: -40px auto 60px; padding: 0 24px; position: relative; z-index: 4;
}
.hp-feature-card {
  background: #fff; border-radius: 12px; padding: 28px 24px; text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06); transition: transform 0.2s;
}
.hp-feature-card:hover { transform: translateY(-4px); }
.hp-feature-icon { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 12px; background: #f0f5ff; color: #7c3aed; margin-bottom: 16px; }
.hp-feature-card h3 { font-size: 17px; color: #333; margin: 0 0 8px; }
.hp-feature-card p { font-size: 0.8125rem; color: #888; margin: 0; line-height: 1.6; }

.hp-footer { text-align: center; padding: 32px 0; border-top: 1px solid #f0f0f0; color: #999; font-size: 0.8125rem; }

.et-code-area { margin-bottom: 16px; }
.et-code-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.et-code-lang { font-size: 0.75rem; font-weight: 600; color: #7c3aed; background: #f0f5ff; padding: 2px 10px; border-radius: 4px; }
.et-code-actions { display: flex; gap: 8px; }
.et-code-editor {
  width: 100%; min-height: 260px; background: #1e1e1e; color: #d4d4d4;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace; font-size: 0.8125rem;
  padding: 12px; border: 0; border-radius: 8px; line-height: 1.6; resize: vertical; tab-size: 4;
  box-sizing: border-box;
}
.et-code-editor::placeholder { color: #666; }
.et-code-editor:focus { outline: 2px solid #7c3aed; }

.nav-group { }
.nav-item-parent { justify-content: flex-start; }
.nav-item-parent .nav-arrow { opacity: 0.5; font-size: 0.75rem; }
.nav-item-parent:hover .nav-arrow { opacity: 1; }
.nav-item-child { padding-left: 16px; }
.nav-item-child span { font-size: 0.8125rem; color: var(--sidebar-text-secondary); }
.nav-item-child.active span { color: var(--sidebar-active-text); font-weight: 600; }
.nav-item-child:hover span { color: var(--sidebar-active-text); }
.nav-group-active { color: var(--sidebar-active-text); }

.create-page { display: flex; height: calc(100vh - 116px); }
.create-works-panel { width: 250px; border-right: 1px solid var(--border); background: var(--bg2); display: flex; flex-direction: column; }
.create-works-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.create-works-list { flex: 1; overflow-y: auto; padding: 8px; }
.create-work-item { cursor: pointer; padding: 8px 12px; border-radius: 4px; font-size: 0.8125rem; display: flex; align-items: center; gap: 6px; }
.create-work-item:hover { background: var(--sidebar-hover); }
.create-work-item.active { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.create-work-item span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.create-editor-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.create-editor-header { padding: 8px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; background: var(--bg); }
.create-output-panel { width: 400px; border-left: 1px solid var(--border); background: var(--bg2); display: flex; flex-direction: column; }
.create-output-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.875rem; font-weight: 600; }
.create-output-body { flex: 1; margin: 0; padding: 16px; font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace; font-size: 0.8125rem; line-height: 1.6; white-space: pre-wrap; word-break: break-all; overflow: auto; color: var(--fg); }

.create-code-wrapper {
  flex: 1; display: flex; overflow: hidden; position: relative;
}
.create-line-numbers {
  width: 48px; background: #252526; color: #858585; text-align: right;
  padding: 16px 8px 16px 0; overflow: hidden; user-select: none;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace; font-size: 0.8125rem; line-height: 1.6;
  border-right: 1px solid #333;
}
.create-line-num { height: 20.8px; line-height: 1.6; }
.create-code-container {
  flex: 1; position: relative; overflow: hidden;
}
.create-code-textarea {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: none; resize: none; outline: none;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace; font-size: 0.8125rem;
  line-height: 1.6; padding: 16px; background: transparent; color: transparent;
  caret-color: #d4d4d4; tab-size: 4; z-index: 2;
  white-space: pre; overflow: auto;
}
.create-code-textarea::placeholder { color: #555; }
.create-code-highlight {
  position: absolute; inset: 0; padding: 16px;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace; font-size: 0.8125rem;
  line-height: 1.6; white-space: pre; overflow: auto; z-index: 1;
  pointer-events: none; background: #1e1e1e; color: #d4d4d4;
  margin: 0;
}
.create-code-line { height: 20.8px; line-height: 1.6; }
.hl-keyword { color: #569cd6; font-weight: 600; }
.hl-string { color: #ce9178; }
.hl-comment { color: #6a9955; font-style: italic; }
.hl-number { color: #b5cea8; }
.hl-normal { color: #d4d4d4; }

.student-page { padding: 0; }
.student-home { }
.sh-banner {
  background: linear-gradient(135deg, #7c3aed 0%, #69b1ff 100%);
  border-radius: 20px;
  padding: 48px 40px;
  color: #fff;
  margin-bottom: 32px;
}
.sh-banner h1 { font-size: 1.75rem; font-weight: 700; margin: 0 0 8px; }
.sh-banner h2 { font-size: 1.375rem; font-weight: 700; margin: 0 0 8px; }
.sh-banner p { font-size: 0.938rem; opacity: 0.9; margin: 0; }
.sh-actions { display: flex; gap: 12px; margin-top: 20px; }
.sh-section { margin-bottom: 32px; }
.sh-section h2 { font-size: 1.125rem; font-weight: 600; color: #333; margin: 0 0 16px; }
.sh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.sh-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.sh-card-clickable { cursor: pointer; }
.sh-card-clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.sh-card-img {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: #f0f5ff;
}
.sh-card-body { padding: 14px; }
.sh-card-title { font-size: 0.875rem; font-weight: 600; color: #333; margin-bottom: 4px; }
.sh-card-desc { font-size: 0.75rem; color: #999; line-height: 1.5; }
.sh-empty {
  background: #fff;
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  color: #999;
  font-size: 0.875rem;
  grid-column: 1 / -1;
}
.sh-unit {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.sh-unit-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sh-cert-box {
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

@media (max-width: 768px) {
  .sh-banner { padding: 28px 20px; }
  .sh-banner h1 { font-size: 1.375rem; }
  .sh-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .sh-actions { flex-direction: column; }
}

@media (max-width: 767px) {
  .question-page { padding: 12px; }
  .question-page h2 { font-size: 1rem; }
}
@media (max-width: 768px) {
  .question-page .q-form-row { flex-direction: column; gap: 8px; }
  .question-page .q-form-row > * { width: 100%; }
  .question-page .q-form-label { min-width: auto; margin-bottom: 2px; }
  .question-page > div[style*="grid"] { grid-template-columns: 1fr !important; gap: 10px !important; }
  .q-filter-bar { flex-direction: column; align-items: stretch; }
  .question-page .q-filter-bar > * { width: 100%; }
  .q-toolbar { flex-wrap: wrap; }
  .q-toolbar .primary-button { flex: 1; min-width: 0; justify-content: center; }
  .q-pagination { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .q-pagination select { font-size: 0.75rem; }
  .q-tabs, .tab-header { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  .sys-toast-container { left: 10px; right: 10px; bottom: 10px; }
}
@media (max-width: 480px) {
  .question-page { padding: 8px; }
  .question-page h2 { font-size: 0.938rem; margin-bottom: 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .nav-item { padding: 8px 10px; font-size: 0.8125rem; gap: 6px; }
  .header-actions { gap: 4px; }
}

@media (max-width: 768px) {
  .et-topbar {
    padding: 0 12px;
    height: 48px;
  }
  .et-topbar-left {
    gap: 8px;
  }
  .et-title {
    font-size: 0.8125rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .et-body {
    position: relative;
  }
  .et-sidebar {
    position: fixed;
    top: 48px;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
  }
  .et-sidebar.et-sidebar-open {
    transform: translateX(0);
  }
  .et-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: 48px;
    background: rgba(0,0,0,0.35);
    z-index: 299;
  }
  .et-sidebar-overlay.et-sidebar-open {
    display: block;
  }
  .et-content {
    padding: 16px 12px;
    width: 100%;
  }
  .et-question-area {
    max-width: 100%;
  }
  .et-q-stem {
    font-size: 0.875rem;
    padding: 12px;
    line-height: 1.7;
  }
  .et-option {
    padding: 14px 12px;
    font-size: 0.8125rem;
    gap: 8px;
    min-height: 44px;
  }
  .et-option-label {
    width: 18px;
    font-size: 0.8125rem;
  }
  .et-nav-bar {
    padding: 12px 0;
    margin-top: 16px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .et-nav-bar button {
    font-size: 0.8125rem;
    padding: 8px 14px;
    height: 38px;
  }
  .et-q-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 12px;
  }
  .et-q-header-left {
    gap: 6px;
  }
  .et-textarea {
    font-size: 0.875rem;
    padding: 10px;
  }
  .et-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    cursor: pointer;
    color: var(--text);
    font-size: 1.125rem;
  }
  .et-mobile-toggle:hover {
    background: var(--bg-hover);
  }
  .et-score {
    font-size: 0.75rem;
  }
  .et-user-tag {
    display: none;
  }
}

@media (min-width: 768px) {
  .et-mobile-toggle {
    display: none;
  }
  .et-sidebar-overlay {
    display: none;
  }
}

.q-filter-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.q-filter-toolbar .tree-select-wrap { width: 180px; }
.q-filter-toolbar .q-filter-select { width: 130px; }
.q-filter-toolbar .q-filter-input { width: 160px; }

.page h2 { font-size: 1.375rem; font-weight: 700; margin-bottom: 20px; color: var(--text); }

.form-panel { background: var(--card-bg); border: 1px solid var(--border-light); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.form-panel h3 { margin: 0 0 14px; font-size: 1rem; font-weight: 600; }
.form-grid { display: grid; gap: 12px; margin-bottom: 14px; }
.form-grid input, .form-grid select, .form-grid textarea { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-light); font-size: 0.8125rem; background: var(--bg); color: var(--text); outline: none; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(124,58,237,0.1); }
.form-actions { display: flex; gap: 8px; }

@media (min-width: 768px) and (max-width: 1024px) {
  .app-shell { grid-template-columns: 200px 1fr; }
  @media (min-width: 1024px) { .app-shell .sidebar { position: sticky; transform: none; width: 200px; } }
  @media (min-width: 1024px) { .sidebar-backdrop { display: none; } }
  .app-shell > .sidebar .sidebar-toggle { display: none; }
  .header .app-shell > .sidebar .sidebar-toggle { display: none; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .panel { padding: 16px; }
  .data-table { font-size: 0.8125rem; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .form-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .q-filter-bar { flex-wrap: wrap; gap: 8px; }
  .toolbar .q-filter-input { width: 160px; font-size: 0.8125rem; }
  .question-page h2 { font-size: 1.125rem; }
  .toolbar { flex-wrap: wrap; gap: 8px; flex-direction: row; align-items: center; }
  .toolbar .primary-button { width: auto; }
  .form-actions { flex-direction: row; }
  .form-actions button { width: auto; }
  .header { padding: 0 12px; }
  .header-btn { padding: 5px 10px; font-size: 0.75rem; }
}

@media (max-width: 767px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  
  .sidebar { 
    position: fixed !important; left: 0; top: 0; bottom: 0; 
    width: 260px; z-index: 99999; 
    transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); pointer-events: auto; z-index: 101; }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 199; }
  
  .header { height: 44px; padding: 0 8px; }
  .header-actions { gap: 4px; }
  .header-btn { padding: 4px 8px; font-size: 0.75rem; min-width: unset; }
  .header-btn span.header-text-label { display: none; }
  .topbar .sidebar-toggle { display: inline-flex !important; }
  
  .content { padding: 10px; max-width: 100vw; overflow-x: hidden; }
  
  .question-page h2, .page h2 { font-size: 1rem; margin-bottom: 10px; }
  
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 10px 12px; }
  .stat-value { font-size: 1.125rem; }
  .stat-icon { width: 32px; height: 32px; border-radius: 8px; }
  .stat-icon svg { width: 16px; height: 16px; }
  
  .panel { padding: 12px; border-radius: var(--radius-lg); }
  
  .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { font-size: 0.75rem; min-width: 600px; }
  .data-table th, .data-table td { padding: 6px 8px; white-space: nowrap; }
  
  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .form-panel { padding: 16px; }
  .form-panel h3 { font-size: 1rem; }
  .form-actions { flex-direction: column; gap: 8px; }
  .form-actions button { width: 100%; }
  
  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .toolbar input[type="text"],
  .toolbar input[type="search"] { width: 100%; }
  .toolbar .primary-button { width: 100%; text-align: center; justify-content: center; }
  
  .q-filter-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .q-filter-row { flex-direction: column; gap: 8px; }
  .question-page .q-filter-input { width: 100%; }
  .question-page .q-filter-select { width: 100%; }
  .q-filter-toolbar { flex-direction: column; }
  .question-page .tree-select-wrap { width: 100%; }
  
  button.primary-button, button.danger-button { width: 100%; justify-content: center; }
  
  .modal-backdrop > div,
  .q-form-modal > div,
  [style*="position: fixed"] > div[style*="background: var(--card-bg)"] {
    width: 95vw; max-width: 95vw; 
    padding: 20px; margin: 10px;
    border-radius: 16px;
  }
  
  .login-card { width: 92vw; padding: 24px 20px; }
  .login-header h1 { font-size: 1.25rem; }
  
  .q-pagination { flex-wrap: wrap; gap: 4px; font-size: 0.75rem; }
  .q-pagination button { padding: 4px 8px; min-width: 28px; }
  
  .sh-banner { padding: 24px 16px; text-align: center; }
  .sh-banner h1 { font-size: 1.25rem; }
  .sh-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .sh-actions { flex-direction: column; }
  
  .badge, .tag { font-size: 0.625rem; padding: 2px 6px; }
  
  .tree-node { padding: 6px 8px; font-size: 0.8125rem; }
  .tree-children { padding-left: 16px; }
  
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { white-space: nowrap; padding: 8px 14px; font-size: 0.8125rem; }
  
  .user-menu { gap: 4px; }
  .user-menu .user-name { display: none; }
  
  .kt-container { flex-direction: column; }
  .kt-sidebar { width: 100%; max-height: 200px; }
  
  .search-select-dropdown { max-width: 95vw; }
  
  .honor-grid { grid-template-columns: 1fr; gap: 10px; }
  
  img { max-width: 100%; height: auto; }
  
  button, .nav-item, .tree-node, select, input[type="checkbox"], 
  input[type="radio"], .clickable { min-height: 36px; }
  input, select, textarea { font-size: 1rem; }
}

@media (max-width: 480px) {
  .header { height: 40px; }
  .content { padding: 6px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .stat-card { padding: 8px 10px; }
  .stat-value { font-size: 1rem; }
  .question-page h2, .page h2 { font-size: 0.938rem; }
  .nav-item { padding: 8px 10px; font-size: 0.8125rem; gap: 6px; }
  .modal-backdrop > div,
  .q-form-modal > div { padding: 14px; }
  .login-card { padding: 20px 14px; }
  .login-header h1 { font-size: 1.125rem; }
}

@media (min-width: 1400px) {
  .app-shell { grid-template-columns: 260px 1fr; }
  .content { padding: 28px 40px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .panel { padding: 24px; }
  .data-table { font-size: 0.875rem; }
  .data-table th, .data-table td { padding: 12px 16px; }
}

@media print {
  .sidebar, .sidebar-backdrop, .header, .q-filter-bar, .q-toolbar,
  .q-selected-bar, .q-pagination, .q-form-modal, .drawer, .drawer-backdrop,
  button, .toolbar { display: none !important; }
  .app-shell { grid-template-columns: 1fr; }
  .content { padding: 0; }
  .panel { box-shadow: none; border: 1px solid #ddd; }
}

html { scroll-behavior: smooth; }
@media (hover: none) and (pointer: coarse) {
  * { -webkit-tap-highlight-color: transparent; }
  input, select, textarea, button { font-size: 1rem; }
}

   UI POLISH & INTERACTION ENHANCEMENTS

.panel, .stat-card, .nav-item, .data-table tr {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.panel:hover { box-shadow: var(--shadow-lg); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-card {
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  overflow: hidden;
  position: relative;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  opacity: 0.8;
}

.nav-item {
  border-radius: var(--radius-lg);
  margin: 2px 8px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left-color: var(--sidebar-active-border);
  font-weight: 600;
}

.sidebar {
  border-right: 1px solid var(--border-light);
  background: var(--sidebar-bg);
}

.header {
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border: none;
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 8px 20px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: inline-flex; align-items: center; gap: 6px;
}
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  filter: brightness(1.1);
}
.primary-button:active { transform: translateY(0); }

.danger-button {
  background: linear-gradient(135deg, var(--danger), #ff7875);
  border: none; color: #fff;
  border-radius: var(--radius-lg);
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.danger-button:hover { filter: brightness(1.1); transform: translateY(-1px); }

.text-button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.text-button:hover { background: var(--bg-secondary); border-color: var(--primary-border); color: var(--primary); }

.icon-button {
  width: 36px; height: 36px;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.icon-button:hover { background: var(--bg-secondary); color: var(--primary); border-color: var(--border); }

.data-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.data-table thead th {
  background: var(--table-header-bg);
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}
.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: var(--primary-light); }
.data-table tbody tr:nth-child(even) { background: var(--table-row-alt-bg); }

input[type="text"], input[type="search"], input[type="number"],
input[type="date"], input[type="email"], input[type="password"],
select, textarea {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.3px;
}

.login-card {
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.login-logo {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--header-bg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.75rem;
}
.login-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.18); filter: brightness(1.1); }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 16px;
}
.toolbar input[type="text"], .toolbar input[type="search"] {
  flex: 1; min-width: 160px;
}

.question-page, .page {
  animation: pageFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

::-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(--text-muted); }

[style*="position: fixed"] > div[style*="background: var(--card-bg)"] {
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.tree-node {
  border-radius: var(--radius);
  transition: all 0.15s ease;
  cursor: pointer;
}
.tree-node:hover { background: var(--sidebar-hover); }
.tree-node.selected { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.q-filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.q-pagination {
  display: flex; align-items: center; gap: 4px;
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.q-pagination button {
  min-width: 34px; height: 34px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.8125rem;
  transition: all 0.15s ease;
}
.q-pagination button:hover { border-color: var(--primary); color: var(--primary); }
.q-pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

   DEEP ELEMENT STYLING - catches all pages

.panel table {
  width: 100%; border-collapse: collapse;
  border-radius: var(--radius-lg); overflow: hidden;
}
.panel table th {
  background: var(--table-header-bg);
  font-weight: 600; font-size: 0.8125rem; color: var(--text-secondary);
  padding: 10px 14px; text-align: left;
  border-bottom: 2px solid var(--border);
}
.panel table td {
  padding: 10px 14px; font-size: 0.8125rem;
  border-bottom: 1px solid var(--border-light);
}
.panel table tbody tr:hover { background: var(--primary-light); }
.panel table tbody tr:nth-child(even) { background: var(--table-row-alt-bg); }

.panel button, .toolbar button, .page button {
  border-radius: var(--radius-lg);
  cursor: pointer; font-weight: 600;
  transition: all 0.2s ease;
}

.panel input[type="text"],
.panel input[type="search"],
.panel input[type="number"],
.panel input[type="date"],
.panel input[type="email"],
.panel input[type="password"],
.panel select,
.panel textarea {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  outline: none;
}
.panel input:focus, .panel select:focus, .panel textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.question-page, [class*="page"] {
  padding: 20px 24px;
  animation: pageFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 16px;
}
.toolbar input[type="text"], .toolbar input[type="search"] { flex: 1; min-width: 160px; }

.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; box-sizing: border-box;
}
.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.kp-tree-row {
  border-radius: var(--radius);
  transition: background 0.15s ease;
}
.kp-tree-row:hover { background: var(--sidebar-hover); }

.q-filter-select {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.8125rem;
  outline: none;
  cursor: pointer;
}

.q-filter-input {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.8125rem;
  outline: none;
  transition: all 0.2s ease;
}
.q-filter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.badge-green { background: var(--success-light); color: var(--success); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-orange { background: var(--warning-light); color: var(--warning); }
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-gray { background: var(--bg-secondary); color: var(--text-muted); }

[style*="position: fixed"][style*="rgba(0"] {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

[style*="background: var(--card-bg)"]:hover {
  box-shadow: var(--shadow-lg);
}

.tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border-light);
  margin-bottom: 16px; overflow-x: auto;
}
.tab {
  padding: 10px 20px; font-size: 0.875rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.2s ease; white-space: nowrap;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tree-node {
  padding: 8px 12px; border-radius: var(--radius);
  cursor: pointer; transition: all 0.15s ease;
  display: flex; align-items: center; gap: 8px;
}
.tree-node:hover { background: var(--sidebar-hover); }
.tree-node.selected { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); font-weight: 600; }
.tree-children { padding-left: 20px; }

.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 20px; margin-bottom: 16px;
  transition: all 0.2s ease;
}
.section-card:hover { box-shadow: var(--shadow-lg); }

.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted); font-size: 0.875rem;
}
.empty-state svg { margin-bottom: 12px; opacity: 0.3; }

.loading-spinner {
  display: flex; align-items: center; justify-content: center;
  padding: 48px; color: var(--text-muted);
}

.search-select-dropdown {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  max-height: 240px; overflow-y: auto; z-index: 999;
}

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--primary);
  width: 16px; height: 16px; cursor: pointer;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); text-decoration: underline; }

hr { border: none; border-top: 1px solid var(--border-light); margin: 16px 0; }

code, pre {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 2px 6px; font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-size: 0.8125rem;
}
pre { padding: 12px 16px; overflow-x: auto; }
pre code { padding: 0; background: none; }

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 99999;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 12px 20px;
  box-shadow: var(--shadow-xl); font-size: 0.875rem;
  animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel img, .page img { max-width: 100%; height: auto; border-radius: var(--radius); }

select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}

input[type="file"] { font-size: 0.875rem; }
input[type="file"]::file-selector-button {
  background: var(--primary); color: #fff; border: none;
  padding: 8px 16px; border-radius: var(--radius-lg);
  cursor: pointer; font-weight: 600; margin-right: 12px;
  transition: all 0.2s ease;
}
input[type="file"]::file-selector-button:hover {
  filter: brightness(1.1); transform: translateY(-1px);
}

.drag-handle { cursor: grab; color: var(--text-muted); }
.drag-handle:active { cursor: grabbing; }

.chip, .tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
  background: var(--primary-light); color: var(--primary);
  white-space: nowrap;
}

.score-value {
  font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-card {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-xl);
}

.modal-backdrop { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; overflow-y: auto; }
.modal-content {
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.dash-tech { position:relative; overflow:hidden; display:flex; flex-direction:column; gap:18px; padding:4px 0; }
.dash-particles { position:absolute; inset:0; pointer-events:none; z-index:0; }
.dash-particle { position:absolute; border-radius:50%; background:#667eea; animation:dashFloat linear infinite; }
@keyframes dashFloat { 0%,100% { transform:translateY(0) scale(1); opacity:.1; } 50% { transform:translateY(-30px) scale(1.5); opacity:.3; } }
.dash-timebar { position:relative; z-index:1; display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-radius:16px; background:linear-gradient(135deg, rgba(99,102,241,.08), rgba(6,182,212,.08)); border:1px solid rgba(99,102,241,.15); backdrop-filter:blur(10px); }
.dash-time-left { display:flex; align-items:center; gap:12px; }
.dash-time-icon { width:42px; height:42px; border-radius:12px; background:linear-gradient(135deg,#6366f1,#06b6d4); display:flex; align-items:center; justify-content:center; color:#fff; }
.dash-time-big { font-size:28px; font-weight:800; letter-spacing:2px; font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace; background:linear-gradient(135deg,#6366f1,#06b6d4); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.dash-time-sub { font-size:12px; color:var(--hp-text4); margin-top:2px; }
.dash-time-right { display:flex; align-items:center; gap:8px; font-size:13px; color:#10b981; font-weight:600; }
.dash-status-dot { width:8px; height:8px; border-radius:50%; background:#10b981; box-shadow:0 0 8px #10b981; animation:dashPulse 2s ease-in-out infinite; }
@keyframes dashPulse { 0%,100%{box-shadow:0 0 4px #10b981} 50%{box-shadow:0 0 16px #10b981,0 0 24px rgba(16,185,129,.3)} }
.dash-stats-grid-tech { position:relative; z-index:1; display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:14px; }
.dash-stat-tech { position:relative; padding:20px; border-radius:16px; background:var(--hp-card); border:1px solid var(--hp-border); overflow:hidden; transition:all .3s; cursor:default; }
.dash-stat-tech:hover { transform:translateY(-3px); border-color:var(--c); box-shadow:0 8px 30px var(--g); }
.dash-stat-glow { position:absolute; top:-20px; right:-20px; width:80px; height:80px; border-radius:50%; filter:blur(30px); opacity:.3; transition:opacity .3s; }
.dash-stat-tech:hover .dash-stat-glow { opacity:.6; }
.dash-stat-top-tech { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.dash-stat-icon-tech { width:40px; height:40px; border-radius:10px; display:flex; align-items:center; justify-content:center; color:var(--c); background:var(--c)18; }
.dash-stat-bar-wrap { flex:1; height:4px; border-radius:2px; background:var(--hp-bg); overflow:hidden; }
.dash-stat-bar { height:100%; border-radius:2px; transition:width 1.2s cubic-bezier(.34,1.56,.64,1); }
.dash-stat-value-tech { font-size:32px; font-weight:900; letter-spacing:-1px; font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace; position:relative; z-index:1; }
.dash-stat-label-tech { font-size:12px; color:var(--hp-text4); margin-top:4px; font-weight:500; text-transform:uppercase; letter-spacing:1px; position:relative; z-index:1; }
.dash-bottom-row { position:relative; z-index:1; display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.dash-panel-tech { background:var(--hp-card); border-radius:16px; border:1px solid var(--hp-border); padding:18px 20px; }
.dash-panel-head { display:flex; align-items:center; gap:8px; margin-bottom:14px; font-size:14px; font-weight:700; }
.dash-actions-tech { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.dash-action-tech { display:flex; flex-direction:column; align-items:center; gap:6px; padding:14px 8px; border-radius:12px; border:1px solid var(--hp-border); background:var(--hp-card); color:var(--hp-text); cursor:pointer; font-size:12px; font-weight:500; transition:all .25s; }
.dash-action-tech:hover { background:var(--ac)10; border-color:var(--ac)50; color:var(--ac); transform:translateY(-2px); box-shadow:0 4px 16px var(--ac)20; }
.dash-action-tech svg { transition:all .25s; }
.dash-action-tech:hover svg { transform:scale(1.15); }
.dash-sys-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.dash-sys-item { display:flex; flex-direction:column; gap:6px; }
.dash-sys-label { font-size:11px; color:var(--hp-text4); text-transform:uppercase; letter-spacing:.5px; }
.dash-sys-val { font-size:15px; font-weight:700; font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace; }
.dash-sys-bar-outer { height:6px; border-radius:3px; background:var(--hp-bg); overflow:hidden; }
.dash-sys-bar-inner { height:100%; border-radius:3px; transition:width 1s ease; position:relative; }

@media (max-width: 767px) {
  .dash-bottom-row { grid-template-columns:1fr; }
  .dash-stats-grid-tech { grid-template-columns:repeat(2,1fr); gap:8px; }
  .dash-stat-tech { padding:14px; }
  .dash-stat-value-tech { font-size:24px; }
  .dash-time-big { font-size:20px; }
  .dash-timebar { flex-direction:column; align-items:flex-start; gap:8px; padding:12px 14px; }
}

:root { --text-primary: #1a1a2e; }

@keyframes notifFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes notifSlideIn {
  from { opacity: 0; transform: translateY(-10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes notifPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.notif-panel::-webkit-scrollbar {
  width: 4px;
}
.notif-panel::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}
.notif-panel::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body label {
  letter-spacing: 0.3px;
}
.modal-body select:focus,
.modal-body input:focus,
.modal-body textarea:focus {
  border-color: var(--primary, #667eea);
  box-shadow: 0 0 0 3px rgba(102,126,234,.1);
}

.data-table tbody tr:hover {
  background: var(--bg-secondary, rgba(0,0,0,.015));
}

@media (max-width: 480px) {
  .notif-panel {
    width: calc(100vw - 20px);
    right: -10px;
  }
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.announce-marquee {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  padding: 10px 0;
  overflow: hidden;
  position: relative;
  z-index: 10;
}
.announce-marquee-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  animation: marquee 30s linear infinite;
}
.announce-marquee-inner:hover {
  animation-play-state: paused;
}
.announce-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 40px;
  flex-shrink: 0;
}

@keyframes dashFadeIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
.dash-stat-card::after{content:"";position:absolute;bottom:0;left:0;right:0;height:3px;background:linear-gradient(90deg,var(--primary),var(--primary-light));opacity:0;transition:opacity .3s}
.dash-stat-card:hover::after{opacity:1}

.q-btn{padding:8px 18px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:1px solid transparent;transition:all .2s;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-family:inherit;line-height:1.4}
.q-btn-primary{background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;border:none;box-shadow:0 2px 8px rgba(99,102,241,.25)}
.q-btn-primary:hover{transform:translateY(-1px);box-shadow:0 4px 16px rgba(99,102,241,.35)}
.q-btn-secondary{background:var(--bg-secondary);color:var(--text-primary);border:1px solid var(--border)}
.q-btn-secondary:hover{background:var(--bg-hover);border-color:var(--primary)}
.q-btn-ghost{background:transparent;color:var(--text-secondary);border:1px solid var(--border)}
.q-btn-ghost:hover{background:var(--bg-hover);color:var(--text-primary)}
.q-btn-danger{background:linear-gradient(135deg,#ef4444,#dc2626);color:#fff;border:none;box-shadow:0 2px 8px rgba(239,68,68,.25)}
.q-btn-danger:hover{transform:translateY(-1px);box-shadow:0 4px 16px rgba(239,68,68,.35)}
.q-btn-sm{padding:5px 12px;font-size:12px;border-radius:6px}
.q-btn-xs{padding:3px 8px;font-size:11px;border-radius:5px}
.q-btn:disabled{opacity:.5;cursor:not-allowed;transform:none}

.q-table{width:100%;border-collapse:collapse;font-size:13px}
.q-table thead{background:var(--bg-secondary)}
.q-table th{padding:12px 14px;text-align:left;font-weight:600;color:var(--text-secondary);font-size:12px;text-transform:uppercase;letter-spacing:.5px;border-bottom:2px solid var(--border);white-space:nowrap}
.q-table td{padding:12px 14px;border-bottom:1px solid var(--border-light);color:var(--text-primary)}
.q-table tbody tr{transition:background .15s}
.q-table tbody tr:hover{background:var(--bg-hover)}
.q-table-wrap{overflow-x:auto;border-radius:12px;border:1px solid var(--border-light)}


@media (max-width: 767px) {
  .app-shell { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 0.875rem; }
  .topbar p { display: none; }
  .content { padding: 12px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .data-table th, .data-table td { padding: 8px 10px; font-size: 0.75rem; }
  .modal-card { max-width: 100%; margin: 10px; border-radius: 12px; }
  .modal-body { padding: 16px; }
  .modal-foot { flex-direction: column; }
  .modal-foot .text-button, .modal-foot .primary-button { width: 100%; }
  .toolbar { flex-direction: column; gap: 8px; }
  .toolbar input { width: 100%; }
  .create-page { flex-direction: column; height: auto; }
  .create-works-panel { width: 100%; max-height: 200px; }
  .create-output-panel { width: 100%; }
  .hp-hero { padding: 40px 16px; }
  .hp-hero h1 { font-size: 1.5rem; }
  .hp-section { padding: 24px 12px; }
  .hp-work-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hide-mobile { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .app-shell { grid-template-columns: 180px 1fr; }
  .content { padding: 16px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .create-output-panel { width: 300px; }
  .hide-tablet { display: none !important; }
}
@media (min-width: 1024px) {
  .hide-desktop { display: none !important; }
}

.primary-button {
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(124,58,237,0.25);
}
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124,58,237,0.35);
}
.primary-button:active { transform: scale(0.97); }

.card, .panel {
  transition: all 0.25s ease;
}
.card:hover, .panel:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.modal-card {
  animation: modalIn 0.3s cubic-bezier(0.4,0,0.2,1);
}
.modal-backdrop { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; overflow-y: auto; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.data-table tbody tr { transition: background 0.15s ease; }
.data-table tbody tr:hover { background: #f5f3ff; }

.form-input:focus, .form-select:focus, .form-textarea:focus,
.sys-textarea:focus, .sys-input:focus {
  box-shadow: 0 0 0 3px var(--primary-light);
}

::-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(--text-muted); }

@media print {
  .topbar, .app-shell { display: block !important; }
  .content { margin: 0 !important; padding: 0 !important; }
}

@supports (padding-top: env(safe-area-inset-top)) {
  .topbar { padding-top: env(safe-area-inset-top); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }



/* ===== HOMEPAGE PLAYFUL ENHANCEMENTS ===== */
/* Hero section glass effect */
.hp-hero {
  position: relative;
  overflow: hidden;
}
.hp-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* Floating decoration dots */
.hp-hero::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  top: -100px; right: -100px;
  animation: float 6s ease-in-out infinite;
  pointer-events: none;
}

/* Playful card hover for works grid */
.hp-work-grid > * {
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), 
              box-shadow 0.3s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
}
.hp-work-grid > *:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

/* Section titles with gradient underline */
.hp-section h2 {
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}
.hp-section h2::after {
  content: '';
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 40px; height: 3px;
  border-radius: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}
.hp-section h2:hover::after {
  width: 80px;
}

/* Course card playful hover */
.hp-course-card {
  border-radius: var(--radius-lg);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative; overflow: hidden;
}
.hp-course-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary-light), transparent);
  opacity: 0; transition: opacity 0.3s ease;
}
.hp-course-card:hover::before { opacity: 1; }
.hp-course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Banner dot indicators */
.hp-banner-dots {
  display: flex; gap: 8px; justify-content: center; margin-top: 16px;
}
.hp-banner-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}
.hp-banner-dot.active {
  background: #fff;
  width: 28px; border-radius: 5px;
}

/* Footer enhancement */
.hp-footer {
  background: var(--hp-footer-bg);
  color: var(--hp-footer-text);
  padding: 48px 24px 24px;
  position: relative;
}
.hp-footer::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* Navbar glass effect on scroll */
.hp-nav.scrolled {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

/* Button pulse on CTA */
.hp-cta-btn {
  animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(124,58,237,0); }
}

/* Animated stat counters */
.hp-stat-number {
  display: inline-block;
  animation: bounceIn 0.6s cubic-bezier(0.4,0,0.2,1) both;
}

/* Work detail image zoom */
.hp-work-image {
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}
.hp-work-image:hover {
  transform: scale(1.05);
}

/* Responsive HP refinements */
@media (max-width: 767px) {
  .hp-hero { padding: 48px 16px; text-align: center; }
  .hp-hero h1 { font-size: 1.75rem; }
  .hp-work-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hp-section { padding: 32px 12px; }
}



/* ===== SCROLLBAR POLISH ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
  transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Dark scrollbar for tech theme */
html[data-hp-theme="tech"] ::-webkit-scrollbar-thumb {
  background: #2a3650;
}
html[data-hp-theme="tech"] ::-webkit-scrollbar-thumb:hover {
  background: #4a5878;
}

/* ===== FOCUS VISIBLE POLISH ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
}

/* ===== SELECTION COLOR ===== */
::selection {
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== PRINT STYLES ===== */
@media print {
  .sidebar, .header, .topbar { display: none !important; }
  .app-shell { display: block !important; }
  .content { margin: 0 !important; padding: 0 !important; }
  .card, .panel { box-shadow: none !important; border: 1px solid #ddd; break-inside: avoid; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== SAFE AREA (mobile notch) ===== */
@supports (padding-top: env(safe-area-inset-top)) {
  .header, .topbar { padding-top: env(safe-area-inset-top); }
}

/* ===== RESPONSIVE MICRO ===== */
@media (max-width: 480px) {
  .content { padding: 12px; }
  .panel { padding: 16px; border-radius: var(--radius); }
  .modal-card { margin: 8px; border-radius: var(--radius-lg); max-width: calc(100vw - 16px); }
  .data-table th, .data-table td { padding: 8px 10px; font-size: 0.75rem; }
  .login-card { padding: 32px 20px; }
}



/* ================================================================
   THREE-DEVICE RESPONSIVE SYSTEM
   Phone:  < 768px   | Tablet: 768-1023px | Desktop: 闂?1024px
   ================================================================ */

/* ---- PHONE (< 768px) ---- */
@media (max-width: 767px) {
  :root {
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 18px;
    --header-height: 44px;
  }

  /* Shell: no sidebar */
  .app-shell {
    grid-template-columns: 1fr;
  }

  /* Sidebar: off-canvas overlay */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
    width: 260px; transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 49;
    background: rgba(0,0,0,0.4); opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .sidebar-close {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 8px; right: 8px;
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--sidebar-hover); border: none; cursor: pointer;
    color: var(--sidebar-text);
  }

  /* Content */
  .content { padding: 12px; }
  .panel { padding: 16px; border-radius: var(--radius); }

  /* Header */
  .header { padding: 0 12px; }
  .header h1 { font-size: 0.875rem; }
  .header-btn { padding: 4px 8px; font-size: 0.75rem; }
  .header-left .sidebar-toggle { display: inline-flex; }

  /* Grids: single column */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Tables: scroll horizontally */
  .data-table-wrap, .q-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .data-table th, .data-table td,
  .q-table th, .q-table td {
    padding: 8px 10px; font-size: 0.75rem; white-space: nowrap;
  }

  /* Forms: full width */
  .form-grid { grid-template-columns: 1fr !important; }
  .form-grid input, .form-grid select, .form-grid textarea { width: 100%; }

  /* Modals: full screen */
  .modal-card {
    max-width: calc(100vw - 16px);
    margin: 8px; border-radius: var(--radius-lg);
    max-height: 90vh; overflow-y: auto;
  }
  .modal-body { padding: 16px; }
  .modal-foot { flex-direction: column; gap: 8px; }
  .modal-foot button { width: 100%; }

  /* Toolbar: stack */
  .toolbar { flex-direction: column; gap: 8px; }
  .toolbar input, .toolbar select { width: 100%; }

  /* Login */
  .login-card { width: calc(100vw - 32px); padding: 32px 20px; }

  /* Create page */
  .create-page { flex-direction: column; height: auto; }
  .create-works-panel { width: 100%; max-height: 200px; }
  .create-output-panel { width: 100%; }

  /* Stats grid: 2 columns */
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dash-stat-card { padding: 14px; }

  /* Touch-friendly sizing */
  button, .btn, [role="button"], .nav-item {
    min-height: 40px; min-width: 40px;
  }
  input, select, textarea {
    font-size: 16px !important; /* prevent iOS zoom */
  }

  /* Homepage */
  .hp-hero { padding: 40px 16px; text-align: center; }
  .hp-hero h1 { font-size: 1.5rem; }
  .hp-section { padding: 24px 12px; }
  .hp-work-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Hide desktop-only elements */
  .hide-mobile { display: none !important; }

  /* Paper/Exam */
  .paper-layout, .exam-layout { flex-direction: column; }
  .paper-sidebar, .exam-sidebar { width: 100%; max-height: 200px; }
  .q-table { min-width: 600px; }

  /* Charts: responsive */
  .chart-container { width: 100% !important; height: auto !important; }
}

/* ---- TABLET (768px - 1023px) ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --radius: 9px;
    --radius-lg: 14px;
    --header-height: 48px;
  }

  /* Shell: compact sidebar */
  .app-shell {
    grid-template-columns: 180px 1fr;
  }

  /* Sidebar: compact mode */
  .sidebar {
    position: sticky; top: 0; height: 100vh;
    width: 180px;
  }
  .sidebar nav a {
    padding: 8px 10px; font-size: 0.8125rem; gap: 8px;
  }
  .sidebar .brand {
    padding: 12px 14px; min-height: 48px;
  }
  .sidebar .brand strong { font-size: 0.875rem; }
  .sidebar .brand .brand-mark { width: 30px; height: 30px; font-size: 0.75rem; }

  /* Content */
  .content { padding: 16px; }
  .panel { padding: 18px 20px; }

  /* Grids: 2 columns */
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* Stats: 2 columns */
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* Modals */
  .modal-card { max-width: 640px; }

  /* Create page */
  .create-page { flex-direction: row; }
  .create-works-panel { width: 240px; }
  .create-output-panel { width: 300px; flex-shrink: 0; }

  /* Homepage */
  .hp-hero { padding: 64px 24px; }
  .hp-hero h1 { font-size: 2rem; }
  .hp-section { padding: 32px 20px; }
  .hp-work-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }

  /* Tables */
  .data-table th, .data-table td { padding: 10px 12px; font-size: 0.8125rem; }

  .hide-tablet { display: none !important; }
}

/* ---- DESKTOP (闂?1024px) ---- */
@media (min-width: 1024px) {
  :root {
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
  }

  .app-shell {
    grid-template-columns: 200px 1fr;
  }
  .app-shell .sidebar {
    position: sticky; transform: none; width: 200px;
  }
  .sidebar-backdrop { display: none; }
  .sidebar-close { display: none; }
  .header-left .sidebar-toggle { display: none; }

  .content { padding: 20px; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }

  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }

  .hp-hero { padding: 80px 48px; }
  .hp-hero h1 { font-size: 2.5rem; }
  .hp-work-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }

  .hide-desktop { display: none !important; }
}

/* ---- LARGE DESKTOP (闂?1400px) ---- */
@media (min-width: 1400px) {
  .app-shell { grid-template-columns: 220px 1fr!important; }
  .content { padding: 28px 40px; }
  .hp-section { max-width: 1200px; margin: 0 auto; }
  .hp-work-grid { grid-template-columns: repeat(4, 1fr); gap: 24px; }
}

/* ---- LANDSCAPE PHONE ---- */
@media (max-width: 767px) and (orientation: landscape) {
  .modal-card { max-height: 85vh; }
  .create-page { flex-direction: row; }
  .create-works-panel { width: 40%; }
  .create-output-panel { width: 60%; }
}

/* ---- SAFE AREA (notch phones) ---- */
@supports (padding-top: env(safe-area-inset-top)) {
  @media (max-width: 1023px) {
    .sidebar { padding-top: env(safe-area-inset-top); }
    .header { padding-top: env(safe-area-inset-top); }
  }
}



/* ================================================================
   DASHBOARD ENHANCEMENTS
   ================================================================ */

/* Stat card grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* Individual stat card */
.dash-stat-card {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px 24px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.3s cubic-bezier(0.4,0,0.2,1);
}
.dash-stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
.dash-stat-card:hover::before { transform: scaleX(1); }
.dash-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Stat icon container */
.dash-stat-card .stat-icon {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: var(--radius);
  font-size: 22px;
}

/* Stat value (number) */
.dash-stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--text);
}

/* Stat label */
.dash-stat-card .stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Stat trend indicator */
.stat-trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
}
.stat-trend.up { color: #16a34a; background: #f0fdf4; }
.stat-trend.down { color: #dc2626; background: #fef2f2; }

/* Quick action cards */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.quick-action-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}
.quick-action-card:hover {
  border-color: var(--primary-border);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.quick-action-card .qa-icon {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  flex-shrink: 0;
}
.quick-action-card .qa-text {
  display: flex; flex-direction: column; gap: 2px;
}
.quick-action-card .qa-title {
  font-size: 0.875rem; font-weight: 600; color: var(--text);
}
.quick-action-card .qa-desc {
  font-size: 0.75rem; color: var(--text-muted);
}

/* Dashboard section headers */
.dash-section {
  margin-bottom: 24px;
}
.dash-section-title {
  font-size: 1rem; font-weight: 700; color: var(--text);
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.dash-section-title::before {
  content: '';
  display: inline-block; width: 4px; height: 20px;
  border-radius: 2px;
  background: var(--primary);
}

/* Welcome banner */
.dash-welcome {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-radius: var(--radius-lg);
  color: #fff;
  position: relative; overflow: hidden;
}
.dash-welcome::after {
  content: '';
  position: absolute; right: -40px; top: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.dash-welcome h2 { margin: 0; font-size: 1.375rem; font-weight: 700; }
.dash-welcome p { margin: 4px 0 0; opacity: 0.85; font-size: 0.875rem; }

/* Chart containers */
.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.chart-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.chart-card-title {
  font-size: 0.9375rem; font-weight: 600; color: var(--text);
}
.chart-card-body {
  position: relative;
  min-height: 200px;
}

/* Analytics grid */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

/* KPI ring */
.kpi-ring {
  display: flex; align-items: center; gap: 24px;
  padding: 20px;
}
.kpi-ring-circle {
  position: relative;
  width: 80px; height: 80px;
}
.kpi-ring-value {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 1.25rem; font-weight: 800;
  color: var(--text);
}



/* ================================================================
   TABLE & TOOLBAR ENHANCEMENTS (濠电姷顣藉Σ鍛村磻閸℃ɑ娅犳俊銈呮噺閺咁亞绱?闂傚倷娴囧畷鍨叏閺夋嚚娲晝閳ь剛鍙呴梺鍝勮癁閸涱喗顔?闂傚倸鍊烽悞锕€顪冮崹顕呯劷闁秆勵殔缁€澶屸偓骞垮劚椤︻垶寮伴妷锔剧闁瑰鍋為惃鎴濃槈閹惧磭效闁哄被鍔岄埥澶娢熸笟顖欑棯闂備胶顭堥敃锕傚磻閻旂儤顫?
   ================================================================ */

/* Toolbar */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0; flex-wrap: wrap;
}
.toolbar .search-box {
  position: relative; flex: 1; min-width: 200px; max-width: 360px;
}
.toolbar .search-box svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.toolbar .search-box input {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); color: var(--text);
  font-size: 0.875rem; transition: all 0.2s ease;
}
.toolbar .search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}
.toolbar .search-box input::placeholder { color: var(--text-muted); }

/* Batch action bar */
.batch-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; margin-bottom: 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius);
  font-size: 0.8125rem; color: var(--primary);
  animation: slideDown 0.25s ease;
}
.batch-bar .batch-count {
  font-weight: 600; margin-right: auto;
}
.batch-bar button {
  padding: 4px 14px; border-radius: 6px; border: 1px solid var(--primary-border);
  background: var(--bg-card); color: var(--primary);
  font-size: 0.75rem; font-weight: 500; cursor: pointer;
  transition: all 0.15s ease;
}
.batch-bar button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.batch-bar button.danger { color: var(--danger); border-color: var(--danger); }
.batch-bar button.danger:hover { background: var(--danger); color: #fff; }

/* Table checkbox column */
.data-table .col-check, .q-table .col-check {
  width: 40px; text-align: center;
}
.data-table input[type="checkbox"], .q-table input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--primary);
  cursor: pointer;
}

/* Table row: selected state */
.data-table tbody tr.selected, .q-table tbody tr.selected {
  background: var(--primary-light) !important;
}

/* Table: sticky header */
.data-table thead, .q-table thead {
  position: sticky; top: 0; z-index: 2;
}
.q-table-wrap {
  max-height: 60vh; overflow-y: auto;
  border-radius: var(--radius); border: 1px solid var(--border-light);
}

/* Table: empty row placeholder */
.data-table .empty-row td, .q-table .empty-row td {
  padding: 48px 16px; text-align: center; color: var(--text-muted);
}

/* Table: inline actions */
.td-actions {
  display: flex; gap: 4px; justify-content: flex-end;
}
.td-actions button {
  padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-secondary);
  font-size: 0.75rem; cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.td-actions button:hover {
  background: var(--primary-light); color: var(--primary); border-color: var(--primary-border);
}
.td-actions button.danger:hover {
  background: var(--danger-light); color: var(--danger); border-color: var(--danger);
}

/* Table sort indicator */
.sort-header {
  cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 4px;
}
.sort-header:hover { color: var(--primary); }
.sort-header .sort-arrow { opacity: 0.3; font-size: 0.7rem; }
.sort-header.active .sort-arrow { opacity: 1; color: var(--primary); }

/* ================================================================
   SIDEBAR COLLAPSE MODE
   ================================================================ */
.sidebar.collapsed {
  width: 64px;
}
.sidebar.collapsed .brand strong,
.sidebar.collapsed .brand span,
.sidebar.collapsed nav a span,
.sidebar.collapsed nav a::before {
  display: none;
}
.sidebar.collapsed .brand {
  justify-content: center; padding: 14px 8px;
}
.sidebar.collapsed nav a {
  justify-content: center; padding: 12px 8px; margin: 1px 8px;
  border-radius: var(--radius);
}
.sidebar.collapsed nav a svg {
  width: 20px; height: 20px;
}
.sidebar.collapsed nav a:hover::after {
  content: attr(data-tooltip);
  position: absolute; left: 72px; top: 50%; transform: translateY(-50%);
  padding: 6px 12px; background: var(--text); color: var(--bg-card);
  border-radius: 6px; font-size: 0.75rem; white-space: nowrap;
  z-index: 100; pointer-events: none;
}
.sidebar-collapse-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin: 8px auto;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); color: var(--text-muted);
  cursor: pointer; transition: all 0.2s ease;
}
.sidebar-collapse-btn:hover {
  background: var(--primary-light); color: var(--primary);
  border-color: var(--primary-border);
}

/* ================================================================
   TOP NAVBAR ENHANCEMENTS
   ================================================================ */

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  padding: 0 0 16px;
  font-size: 0.8125rem; color: var(--text-muted);
}
.breadcrumb a {
  color: var(--text-muted); text-decoration: none;
  transition: color 0.15s ease;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .breadcrumb-current {
  color: var(--text); font-weight: 600;
}
.breadcrumb .breadcrumb-sep {
  color: var(--border); user-select: none;
}

/* Quick search (Cmd+K style) */
.quick-search {
  position: relative;
}
.quick-search-trigger {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); color: var(--text-muted);
  font-size: 0.8125rem; cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
}
.quick-search-trigger:hover {
  border-color: var(--primary-border);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.quick-search-trigger .shortcut {
  margin-left: auto; padding: 1px 6px;
  background: var(--bg-secondary); border-radius: 4px;
  font-size: 0.6875rem; font-weight: 600;
  color: var(--text-muted);
}
.quick-search-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 15vh;
  animation: fadeIn 0.15s ease;
}
.quick-search-panel {
  width: min(560px, 92vw);
  max-height: 400px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: scaleIn 0.2s cubic-bezier(0.4,0,0.2,1);
}
.quick-search-input {
  width: 100%; height: 52px; padding: 0 20px;
  border: none; border-bottom: 1px solid var(--border);
  font-size: 1rem; color: var(--text);
  background: transparent; outline: none;
}
.quick-search-results {
  max-height: 340px; overflow-y: auto; padding: 8px;
}
.quick-search-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius);
  cursor: pointer; transition: background 0.1s ease;
}
.quick-search-item:hover, .quick-search-item.active {
  background: var(--primary-light);
}
.quick-search-item .qs-icon {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-secondary); flex-shrink: 0;
}
.quick-search-item .qs-text { flex: 1; }
.quick-search-item .qs-title { font-size: 0.875rem; font-weight: 500; color: var(--text); }
.quick-search-item .qs-desc { font-size: 0.75rem; color: var(--text-muted); }

/* Notification bell */
.notif-bell {
  position: relative;
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; border: none;
  color: var(--header-text); cursor: pointer;
  transition: background 0.15s ease;
}
.notif-bell:hover { background: rgba(255,255,255,0.15); }
.notif-bell .notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--header-bg, transparent);
}

/* User dropdown */
.user-menu {
  position: relative;
}
.user-menu-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 999px;
  background: transparent; border: none;
  color: var(--header-text); cursor: pointer;
  transition: background 0.15s ease;
}
.user-menu-trigger:hover { background: rgba(255,255,255,0.15); }
.user-menu-trigger .avatar-sm {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.25);
  font-weight: 600; font-size: 0.8125rem;
}
.user-menu-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 200px; padding: 6px;
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  animation: scaleIn 0.15s ease;
  z-index: 30;
}
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px; border-radius: var(--radius);
  border: none; background: transparent;
  color: var(--text); font-size: 0.8125rem; cursor: pointer;
  transition: background 0.1s ease;
}
.user-menu-item:hover { background: var(--sidebar-hover); }
.user-menu-item.danger { color: var(--danger); }
.user-menu-item.danger:hover { background: var(--danger-light); }
.user-menu-divider {
  height: 1px; margin: 4px 8px;
  background: var(--border-light);
}

/* Header right section layout */
.header-right {
  display: flex; align-items: center; gap: 4px;
}

/* ================================================================
   FILTERS & TAGS
   ================================================================ */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-secondary);
  font-size: 0.75rem; cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--primary-border); color: var(--primary); }
.filter-chip.active {
  background: var(--primary-light); color: var(--primary);
  border-color: var(--primary-border); font-weight: 600;
}

/* Status tags */
.status-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 0.6875rem; font-weight: 600;
}
.status-tag.published { background: #f0fdf4; color: #16a34a; }
.status-tag.draft { background: #fffbeb; color: #d97706; }
.status-tag.archived { background: #f3f4f6; color: #6b7280; }
.status-tag.error { background: #fef2f2; color: #dc2626; }


@media (min-width: 1024px) {
  .app-shell { grid-template-columns: 200px 1fr !important; }
  .sidebar { display: flex !important; transform: none !important; }
}
@media (min-width: 1400px) {
  .app-shell { grid-template-columns: 220px 1fr !important; }
}

@media(min-width:1024px){
  .app-shell .content{max-width:none!important;width:auto!important}
  .app-shell [style*="minmax(180px"]{grid-template-columns:repeat(auto-fill,minmax(200px,1fr))!important}
}
@media(min-width:1400px){
  .app-shell [style*="minmax(180px"]{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))!important}
}
@media(min-width:1600px){
  .app-shell [style*="minmax(180px"]{grid-template-columns:repeat(auto-fill,minmax(240px,1fr))!important}
}

.modal-card {
  background: var(--bg-card, #fff);
  border-radius: var(--radius-lg, 12px);
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-width: 90vw;
  width: 100%;
  animation: modalIn 0.3s cubic-bezier(0.4,0,0.2,1);
}
.modal-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 20px 24px 16px;
  margin: 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.modal-card form {
  padding: 20px 24px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--border, #e5e7eb);
  background: var(--bg-page, #f9fafb);
  border-radius: 0 0 var(--radius-lg, 12px) var(--radius-lg, 12px);
}
