
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: flex-start; justify-content: center; overflow-y: auto; padding: 40px 20px; }

/* ===== 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; }

/* ===== ADMIN SURFACE POLISH ===== */
.app-shell .content {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,255,255,0)),
    var(--bg);
}
.app-shell .page {
  width: 100%;
  box-sizing: border-box;
}
.app-shell .page > h2,
.admin-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.25;
}
.app-shell .panel,
.app-shell .card,
.q-filter-bar,
.q-table-wrapper,
.q-table-wrap,
.modal-card,
.drawer {
  border: 1px solid var(--border-light);
  box-shadow: 0 8px 28px rgba(30,27,75,0.06);
}
.app-shell .panel:hover {
  transform: none;
  box-shadow: 0 8px 28px rgba(30,27,75,0.08);
}
.app-shell .toolbar,
.app-shell .q-toolbar,
.app-shell .q-filter-row {
  align-items: center;
  gap: 10px;
}
.app-shell input[type="text"],
.app-shell input[type="search"],
.app-shell input[type="number"],
.app-shell input[type="email"],
.app-shell input[type="password"],
.app-shell input:not([type]),
.app-shell select,
.app-shell textarea {
  box-sizing: border-box;
  border-color: var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.app-shell input:focus,
.app-shell select:focus,
.app-shell textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
  outline: none;
}
.app-shell textarea {
  line-height: 1.6;
}
.data-table,
.q-table {
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
}
.data-table th,
.q-table th {
  background: var(--table-header-bg);
  color: var(--text-secondary);
}
.data-table td,
.q-table td {
  vertical-align: middle;
}
.text-button.danger {
  color: var(--danger);
  border-color: rgba(255,77,79,0.28);
  background: var(--danger-light);
}
.text-button.danger:hover {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}
.primary-button,
.text-button {
  border-radius: 6px;
}
.modal-backdrop,
.sys-backdrop {
  backdrop-filter: blur(4px);
}



/* ============ 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);
  min-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; }
.code-editor,
.create-code-textarea,
.et-code-editor {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  resize: vertical;
  padding: 10px 12px;
}
.code-editor:focus,
.create-code-textarea:focus,
.et-code-editor:focus {
  outline: 2px solid rgba(124,58,237,0.18);
  border-color: var(--primary);
}
.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 > * { flex: 0 0 auto; }
.topbar-actions .user-menu { flex: 0 0 auto; min-width: 24px; }
.topbar-actions .user-menu > img,
.topbar-actions .user-menu > span:not(.user-name) {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  flex: 0 0 24px !important;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}
.topbar-actions .user-menu > img { display: block; object-fit: cover; }
.topbar-actions .account-profile-btn > img,
.topbar-actions .account-profile-btn > span:not(.header-text-label) {
  flex: 0 0 22px !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
}
.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: flex-start; justify-content: center; overflow-y: auto; padding: 40px 20px; }
.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 { width: min(100%, 1080px); 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; color: var(--text);
  padding: 16px; background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 8px;
}
.et-q-stem pre,
.exam-image-zoom pre,
.er-q-stem pre,
.create-question-body pre {
  margin: 12px 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid #263244;
  border-radius: 6px;
  background: #0b1020;
  color: #e2e8f0;
  font: 0.8125rem/1.7 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', monospace;
  white-space: pre;
  tab-size: 4;
}
.et-q-stem pre code,
.exam-image-zoom pre code,
.er-q-stem pre code,
.create-question-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}
.et-q-stem img,
.et-option-text img,
.et-analysis img,
.er-q-stem img,
.er-q-options img,
.er-q-analysis-body img,
.exam-image-zoom img {
  display: block;
  max-width: min(100%, 720px);
  height: auto;
  margin: 12px auto;
  border-radius: 8px;
  object-fit: contain;
  cursor: zoom-in;
  transition: box-shadow .16s ease, transform .16s ease;
}

.et-q-stem img:hover,
.et-option-text img:hover,
.et-analysis img:hover,
.er-q-stem img:hover,
.er-q-options img:hover,
.er-q-analysis-body img:hover,
.exam-image-zoom img:hover {
  transform: scale(1.01);
  box-shadow: 0 10px 30px rgba(15,23,42,.22);
}

.question-image-preview {
  position: fixed;
  inset: 0;
  z-index: 1000005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 8, 20, .84);
  backdrop-filter: blur(8px);
  animation: questionImagePreviewIn .16s ease-out;
}

.question-image-preview-viewport {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px;
  touch-action: none;
  user-select: none;
}

.question-image-preview-viewport.is-draggable { cursor: grab; }
.question-image-preview-viewport.is-dragging { cursor: grabbing; }

.question-image-preview-viewport img {
  display: block;
  width: auto;
  max-width: min(92vw, 1600px);
  height: auto;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0,0,0,.48);
  transform-origin: center;
  will-change: transform;
  -webkit-user-drag: none;
}

.question-image-preview-toolbar {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 42px 72px 42px 42px;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 8px;
  background: rgba(15,23,42,.78);
  box-shadow: 0 12px 32px rgba(0,0,0,.34);
  backdrop-filter: blur(10px);
}

.question-image-preview-tool {
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: #fff;
  background: transparent;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, opacity .16s ease;
}

.question-image-preview-tool.zoom-reset { font-size: 13px; font-weight: 700; }
.question-image-preview-tool.pan-reset { font-size: 21px; }
.question-image-preview-tool:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.question-image-preview-tool:disabled { opacity: .32; cursor: default; }
.question-image-preview-tool:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }

.question-image-preview-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 50%;
  color: #fff;
  background: rgba(15,23,42,.5);
  font-size: 29px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0 0 3px;
  transition: background .16s ease, transform .16s ease;
}

.question-image-preview-close:hover { background: rgba(255,255,255,.18); }
.question-image-preview-close:active { transform: scale(.94); }
.question-image-preview-close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.question-image-preview-error {
  display: none;
  color: #fff;
  font-size: 14px;
}

.question-image-preview.is-error .question-image-preview-viewport,
.question-image-preview.is-error .question-image-preview-toolbar { display: none; }
.question-image-preview.is-error .question-image-preview-error { display: block; }

@keyframes questionImagePreviewIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 640px) {
  .question-image-preview { padding: 12px; }
  .question-image-preview-viewport { padding: 12px; }
  .question-image-preview-viewport img { max-width: 96vw; max-height: 78vh; border-radius: 5px; }
  .question-image-preview-close { top: 12px; right: 12px; }
  .question-image-preview-toolbar { bottom: max(12px, env(safe-area-inset-bottom)); }
}

.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: color-mix(in srgb, var(--primary) 9%, var(--bg-card)); }
.et-option-selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 16%, var(--bg-card));
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--primary);
  font-weight: 600;
}
.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-option-selected .et-option-label { color: var(--primary-hover); }
.et-option-selected .et-option-text { color: var(--text); }

html[data-hp-theme="starry"] .exam-taking-layout,
html[data-hp-theme="tech"] .exam-taking-layout {
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border: #334155;
  --border-light: #263449;
  --bg-card: #111827;
  --bg-body: #080f1e;
}

html[data-hp-theme="starry"] .et-qbtn-unanswered,
html[data-hp-theme="tech"] .et-qbtn-unanswered {
  background: #e2e8f0;
  color: #334155;
}

.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-q-dot.pending { background: #faad14; 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-yellow { background: #faad14; }
.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-pending { background: #fff7e6; color: #d48806; }
.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-answer-pending { color: #d48806; font-weight: 600; }

.er-review-pill {
  display: inline-flex; align-items: center; height: 28px;
  padding: 0 10px; border-radius: 999px;
  background: #fff7e6; color: #d48806;
  border: 1px solid #ffe7ba; font-size: 0.75rem; font-weight: 700;
}

.er-review-box {
  margin: 0 0 12px; padding: 12px;
  border: 1px solid #ffe7ba; border-radius: 8px;
  background: linear-gradient(180deg, #fffaf0, #fff);
}
.er-review-box-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px; font-size: 0.8125rem; font-weight: 700; color: #8c5a00;
}

.er-mastery {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-secondary);
}

.er-mastery-head,
.er-mastery-summary,
.er-mastery-group,
.er-mastery-toggle {
  display: flex;
  align-items: center;
}

.er-mastery-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.er-mastery-title {
  margin-right: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.er-mastery-head strong {
  color: var(--primary);
  font-size: 20px;
}

.er-mastery-summary {
  gap: 12px;
  font-size: 12px;
}

.er-mastery-summary span,
.er-mastery-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.er-mastery .is-correct { color: var(--success); }
.er-mastery .is-wrong { color: var(--danger); }

.er-mastery-groups {
  display: grid;
  gap: 8px;
}

.er-mastery-group {
  align-items: flex-start;
  gap: 10px;
}

.er-mastery-label {
  width: 48px;
  flex: 0 0 48px;
  padding-top: 3px;
  font-size: 12px;
  font-weight: 700;
}

.er-mastery-names {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.er-mastery-name {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  font-size: 12px;
}

.er-mastery-empty {
  color: var(--text-muted);
  font-size: 12px;
  padding-top: 3px;
}

.er-mastery-toggle {
  gap: 4px;
  margin: 10px 0 0 58px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
}

@media (max-width: 640px) {
  .er-mastery-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .er-mastery-summary {
    flex-wrap: wrap;
  }
}
.er-review-max { color: var(--text-muted); font-weight: 500; }
.er-review-controls {
  display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; align-items: center;
}
.er-review-score-label {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary); font-size: 0.8125rem; font-weight: 600;
}
.er-review-score-label input {
  width: 72px; height: 34px; border: 1px solid var(--border);
  border-radius: 6px; padding: 0 8px; background: var(--bg-card);
  color: var(--text); font-weight: 700;
}
.er-review-comment {
  width: 100%; height: 34px; border: 1px solid var(--border);
  border-radius: 6px; padding: 0 10px; background: var(--bg-card);
  color: var(--text); box-sizing: border-box;
}

.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;
  overflow: hidden;
  border: 1px solid #263244;
  border-radius: 8px;
  background: #0b1020;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}
.et-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 11px 14px;
  border-bottom: 1px solid #263244;
  background: #111827;
}
.et-code-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.et-code-lang {
  flex: none;
  padding: 4px 9px;
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 4px;
  background: rgba(8, 145, 178, 0.16);
  color: #a5f3fc;
  font-size: 0.75rem;
  font-weight: 700;
}
.et-code-limit { color: #94a3b8; font-size: 0.75rem; white-space: nowrap; }
.et-code-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.et-code-actions .text-button {
  min-height: 32px;
  border: 1px solid #3b4a60;
  border-radius: 5px;
  background: #182235;
  color: #dbeafe;
}
.et-code-actions .text-button:hover { border-color: #22d3ee; background: #1d2d43; color: #ecfeff; }
.et-code-actions .et-run-tests { min-height: 32px; border-radius: 5px; }
.et-code-actions button:disabled { cursor: wait; opacity: 0.62; }
.et-code-editor {
  display: block;
  width: 100%;
  min-height: 340px;
  padding: 20px;
  border: 0;
  border-radius: 0;
  background: #0b1020;
  color: #e2e8f0;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  resize: vertical;
  tab-size: 2;
  caret-color: #67e8f9;
  box-sizing: border-box;
}
.et-code-editor::placeholder { color: #526175; }
.et-code-editor:focus { outline: 0; box-shadow: inset 3px 0 #22d3ee; }
.et-code-console { display: grid; grid-template-columns: minmax(220px, 0.85fr) minmax(300px, 1.35fr); border-top: 1px solid #263244; }
.et-console-panel { min-width: 0; padding: 14px; background: #101827; }
.et-stdin-panel { border-right: 1px solid #263244; }
.et-console-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; margin-bottom: 9px; color: #e2e8f0; font-size: 0.8125rem; font-weight: 700; }
.et-console-title small { color: #64748b; font-size: 0.6875rem; font-weight: 500; }
.et-console-input {
  display: block;
  width: 100%;
  min-height: 144px;
  padding: 10px 12px;
  border: 1px solid #2b3a50;
  border-radius: 5px;
  outline: 0;
  resize: vertical;
  box-sizing: border-box;
  background: #080d18;
  color: #dbeafe;
  font: 0.8125rem/1.6 'Cascadia Code', 'Consolas', monospace;
}
.et-console-input:focus { border-color: #22d3ee; box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.12); }
.et-console-input::placeholder { color: #526175; }
.et-output-panel { min-height: 190px; }
.et-console-empty { padding: 32px 12px; color: #64748b; font-size: 0.8125rem; text-align: center; }
.et-console-output,
.et-console-error,
.et-test-case pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.8125rem/1.6 'Cascadia Code', 'Consolas', monospace;
}
.et-console-output { min-height: 64px; padding: 11px 12px; border: 1px solid #263244; border-radius: 5px; background: #080d18; color: #d1fae5; }
.et-console-error { margin-top: 8px; padding: 10px 12px; border: 1px solid rgba(248, 113, 113, 0.28); border-radius: 5px; background: rgba(127, 29, 29, 0.18); color: #fecaca; }
.et-exit-code { margin-top: 8px; color: #64748b; font: 0.6875rem/1.4 'Cascadia Code', 'Consolas', monospace; }
.et-run-state { display: inline-flex; align-items: center; gap: 5px; color: #94a3b8; font-size: 0.6875rem; font-weight: 700; }
.et-run-state::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ''; }
.et-run-state.is-success { color: #34d399; }
.et-run-state.is-error { color: #fb7185; }
.et-run-state.is-running { color: #22d3ee; }
.et-console-loading { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 120px; color: #94a3b8; font-size: 0.8125rem; }
.et-console-loading span { width: 14px; height: 14px; border: 2px solid #334155; border-top-color: #22d3ee; border-radius: 50%; animation: et-code-spin 0.8s linear infinite; }
.et-test-results { display: grid; gap: 8px; }
.et-test-case { overflow: hidden; border: 1px solid #2b3a50; border-radius: 5px; background: #0b1220; }
.et-test-case.is-passed { border-color: rgba(52, 211, 153, 0.32); }
.et-test-case.is-failed { border-color: rgba(251, 113, 133, 0.34); }
.et-test-case-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; color: #dbeafe; font-size: 0.75rem; }
.et-test-case-head span { color: #94a3b8; font-size: 0.6875rem; }
.et-test-case.is-passed .et-test-case-head span { color: #34d399; }
.et-test-case.is-failed .et-test-case-head span { color: #fb7185; }
.et-test-case-data { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #263244; }
.et-test-case-data > div { min-width: 0; padding: 9px; border-right: 1px solid #263244; }
.et-test-case-data > div:last-child { border-right: 0; }
.et-test-case-data label { display: block; margin-bottom: 4px; color: #64748b; font-size: 0.625rem; font-weight: 700; }
.et-test-case-data pre { max-height: 120px; overflow: auto; color: #cbd5e1; font-size: 0.6875rem; }
@keyframes et-code-spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .et-code-header { align-items: flex-start; flex-direction: column; }
  .et-code-actions { width: 100%; justify-content: flex-start; }
  .et-code-editor { min-height: 280px; padding: 15px; font-size: 0.8125rem; }
  .et-code-console { grid-template-columns: 1fr; }
  .et-stdin-panel { border-right: 0; border-bottom: 1px solid #263244; }
  .et-test-case-data { grid-template-columns: 1fr; }
  .et-test-case-data > div { border-right: 0; border-bottom: 1px solid #263244; }
  .et-test-case-data > div:last-child { border-bottom: 0; }
}

.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-question-panel {
  max-height: 28vh;
  overflow: auto;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.create-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 700;
}
.create-question-head small { color: var(--text-muted); font-weight: 600; }
.create-question-panel h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-primary);
}
.create-question-body { font-size: 0.875rem; line-height: 1.75; color: var(--text); }
.create-question-loading { font-size: 0.8125rem; color: var(--text-muted); }

.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; }

.create-page {
  min-height: calc(100vh - 116px);
  background: linear-gradient(180deg, rgba(248,250,252,0.92), rgba(241,245,249,0.88));
}

.create-editor-panel {
  background: #0f172a;
  border-left: 1px solid rgba(148,163,184,0.16);
  border-right: 1px solid rgba(148,163,184,0.16);
}

.create-editor-header {
  min-height: 54px;
  padding: 10px 14px;
  background: #111827;
  border-bottom: 1px solid rgba(148,163,184,0.18);
  color: #e5e7eb;
}

.create-editor-header input {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(148,163,184,0.32) !important;
  color: #f8fafc !important;
  border-radius: 7px !important;
}

.create-editor-header input::placeholder { color: rgba(226,232,240,0.58); }
.create-editor-header .primary-button { border-radius: 7px; box-shadow: none; }

.create-question-panel {
  max-height: 30vh;
  padding: 16px 18px;
  background: #f8fafc;
  border-bottom: 1px solid rgba(148,163,184,0.28);
}

.create-question-head {
  color: #2563eb;
}

.create-question-panel h3 {
  font-size: 0.95rem;
}

.create-code-wrapper {
  min-height: 420px;
  background: #1e1e1e;
}

.create-line-numbers {
  width: 52px;
  padding-top: 18px;
  background: #171717;
  color: #7d8590;
  border-right: 1px solid #2f343d;
}

.create-code-textarea,
.create-code-highlight {
  padding: 18px 18px 18px 16px;
  font-size: 0.875rem;
  line-height: 1.65;
}

.create-code-highlight {
  background: #1f2428;
  color: #d6deeb;
}

.create-code-textarea {
  caret-color: #f8fafc;
}

.create-code-textarea::selection { background: rgba(96,165,250,0.34); }
.create-code-line,
.create-line-num { height: 23.1px; line-height: 1.65; }

.create-output-panel {
  width: min(420px, 34vw);
  background: #f8fafc;
  border-left: 1px solid rgba(148,163,184,0.32);
}

.create-output-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: #ffffff;
  border-bottom: 1px solid rgba(148,163,184,0.24);
  color: #0f172a;
}

.create-output-panel canvas {
  width: calc(100% - 24px) !important;
  height: auto;
  margin: 12px !important;
  border-radius: 8px !important;
  border-color: rgba(148,163,184,0.4) !important;
}

.create-output-body {
  margin: 0 12px 12px !important;
  min-height: 220px !important;
  border-radius: 8px !important;
  border-color: rgba(148,163,184,0.28) !important;
  background: #0f172a !important;
  color: #dbeafe !important;
  font-size: 0.8125rem;
}

@media (max-width: 960px) {
  .create-page { flex-direction: column; height: auto; min-height: calc(100vh - 96px); }
  .create-works-panel { width: 100%; max-height: 180px; border-right: 0; border-bottom: 1px solid var(--border); }
  .create-output-panel { width: 100%; min-height: 260px; border-left: 0; border-top: 1px solid rgba(148,163,184,0.32); }
  .create-code-wrapper { min-height: 380px; }
  .create-editor-header { flex-wrap: wrap; gap: 8px; }
  .create-editor-header input { width: 100% !important; }
}

.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: flex-start; justify-content: center; overflow-y: auto; padding: 40px 20px; }
.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: flex-start; justify-content: center; overflow-y: auto; padding: 40px 20px; }
@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);
}

.lls-editor-modal {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 96px);
  overflow: hidden;
}
.lls-editor-modal > h3,
.lls-editor-modal > div:first-child {
  flex-shrink: 0;
}
.lls-editor-modal > div:first-child h3 {
  padding: 0;
  border: 0;
}
.lls-editor-modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
form.lls-editor-modal-body {
  padding: 20px 24px;
}
div.lls-editor-modal-body {
  padding: 20px 24px;
}
.lls-editor-modal > .modal-foot,
.lls-editor-modal .modal-foot {
  flex-shrink: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(8px);
  overflow: auto;
  box-sizing: border-box;
}

.lls-feedback-toast-container {
  position: fixed;
  right: 24px;
  top: 72px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.lls-feedback-toast {
  min-width: 220px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
  font-size: 13px;
  line-height: 1.55;
  animation: llsToastIn 0.18s ease-out;
}

.lls-feedback-toast-success { background: rgba(22, 163, 74, 0.96); }
.lls-feedback-toast-error { background: rgba(220, 38, 38, 0.96); }
.lls-feedback-toast-warning { background: rgba(217, 119, 6, 0.96); }
.lls-feedback-toast-info { background: rgba(37, 99, 235, 0.96); }
.lls-feedback-toast.is-leaving { opacity: 0; transform: translateY(-6px); transition: opacity 0.18s ease, transform 0.18s ease; }

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

.lls-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147482999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(6px);
  animation: llsConfirmFade 0.16s ease-out;
}

.lls-confirm-backdrop.is-leaving { opacity: 0; transition: opacity 0.16s ease; }

.lls-confirm-card {
  width: min(420px, 100%);
  display: flex;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: var(--bg-card, #fff);
  color: var(--text, #111827);
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.28);
}

.lls-confirm-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary, #7c3aed);
  font-weight: 800;
}

.lls-confirm-main { flex: 1; min-width: 0; }
.lls-confirm-main h3 { margin: 0 0 6px; padding: 0; border: 0; font-size: 16px; font-weight: 700; color: var(--text, #111827); }
.lls-confirm-main p { margin: 0; color: var(--text-secondary, #4b5563); font-size: 13px; line-height: 1.65; }
.lls-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.lls-confirm-actions button {
  min-width: 72px;
  height: 34px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--bg-card, #fff);
  color: var(--text, #111827);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.lls-confirm-actions .lls-confirm-ok {
  border-color: transparent;
  background: var(--primary, #7c3aed);
  color: #fff;
}

@keyframes llsConfirmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 640px) {
  .lls-feedback-toast-container {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 16px;
  }
  .lls-feedback-toast {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .lls-confirm-backdrop { padding: 14px; }
  .lls-confirm-card {
    gap: 10px;
    padding: 16px;
  }
}
.lls-modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.lls-modal-head h3 {
  padding: 0;
  border: 0;
  font-size: 18px;
  line-height: 1.3;
}
.lls-modal-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted, #64748b);
  font-size: 12px;
  line-height: 1.5;
}
.lls-editor-modal {
  max-height: calc(100vh - 48px);
  border-radius: 12px;
}
.lls-editor-modal-body {
  padding: 18px 22px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  margin-bottom: 14px;
}
.form-group label {
  color: var(--text-secondary, #475569);
  font-size: 13px;
  font-weight: 650;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 8px;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #0f172a);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.form-input,
.form-select {
  min-height: 40px;
  padding: 9px 11px;
}
.form-textarea {
  padding: 10px 11px;
  resize: vertical;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.lls-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 0;
}
.lls-form-grid .is-full {
  grid-column: 1 / -1;
}
.lls-note-modal .lls-editor-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}
.lls-note-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  padding: 28px 24px !important;
  background: rgba(15, 23, 42, 0.58) !important;
  backdrop-filter: blur(8px);
}
.lls-note-backdrop .lls-note-modal {
  width: min(1180px, calc(100vw - 48px)) !important;
  max-height: calc(100vh - 56px) !important;
  margin: 0 auto !important;
  overflow: hidden !important;
}
.lls-note-modal .lls-editor-modal-body {
  min-height: 0;
}
.lls-note-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 14px;
  flex-shrink: 0;
}
.lls-note-meta .form-group {
  margin-bottom: 0;
}
.lls-note-title-input {
  font-size: 16px;
  font-weight: 700;
}
.lls-note-modebar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.lls-note-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--border-light, #eef2f7);
  border-radius: 8px;
  background: var(--bg-secondary, #f8fafc);
  flex-shrink: 0;
}
.lls-note-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 7px;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #0f172a);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.lls-note-tool:hover {
  border-color: var(--primary, #6366f1);
  color: var(--primary, #6366f1);
}
.lls-note-upload {
  margin: 0;
}
.lls-note-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.lls-note-workspace.is-write,
.lls-note-workspace.is-preview {
  grid-template-columns: minmax(0, 1fr);
}
.lls-note-textarea,
.lls-note-preview {
  height: 100%;
  min-height: 420px;
  overflow: auto;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 10px;
  background: var(--bg-card, #fff);
}
.lls-note-textarea {
  resize: none;
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.75;
}
.lls-note-preview {
  padding: 18px 20px;
  box-sizing: border-box;
}
.lls-note-modal .modal-foot {
  position: sticky;
  bottom: 0;
  z-index: 3;
}
.lls-note-modal .lls-editor-modal-body {
  max-height: none;
}
.lls-note-workspace {
  min-height: clamp(360px, 52vh, 620px);
}
.lls-note-preview h1,
.kb-content h1 {
  font-size: 1.85em;
  line-height: 1.35;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light, #e5e7eb);
}
.lls-note-preview img,
.kb-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.kb-content {
  word-break: break-word;
}
.kb-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.65;
}
.kb-content code {
  font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
}
.kb-content :not(pre) > code,
.kb-inline-code {
  background: rgba(15, 23, 42, .07);
  padding: 2px 5px;
  border-radius: 5px;
}
.kb-content img {
  display: block;
  max-width: 100%;
  border-radius: 8px;
  margin: 12px 0;
}
.kb-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  overflow: hidden;
}
.kb-content th,
.kb-content td {
  border: 1px solid var(--border, #e5e7eb);
  padding: 8px 10px;
  text-align: left;
}
.kb-content th {
  background: var(--bg-secondary, #f8fafc);
}
.kb-content blockquote {
  margin: 14px 0;
  padding: 8px 14px;
  border-left: 4px solid var(--primary, #6366f1);
  background: rgba(99, 102, 241, .08);
  color: var(--text-secondary, #475569);
}
.kb-content .mermaid {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--border-light, #eef2f7);
  border-radius: 10px;
  background: #fff;
  overflow: auto;
}
.lls-knowledge-shell {
  display: flex;
  height: calc(100vh - 96px);
  min-height: 620px;
  background: linear-gradient(180deg, var(--bg-secondary, #f8fafc), var(--bg, #f3f6fb));
  border-top: 1px solid var(--border-light, #e5e7eb);
}
.lls-knowledge-sidebar {
  width: 282px;
  min-width: 282px;
  border-right: 1px solid var(--border-light, #e5e7eb);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .2s ease, min-width .2s ease, opacity .2s ease;
}
.lls-knowledge-sidebar.is-hidden {
  width: 0;
  min-width: 0;
  opacity: 0;
  border-right: 0;
}
.lls-knowledge-sidebar-head {
  padding: 18px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lls-knowledge-sidebar-head strong {
  display: block;
  font-size: 16px;
  color: var(--text, #172033);
}
.lls-knowledge-sidebar-head span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}
.lls-knowledge-search {
  margin: 0 14px 12px;
  position: relative;
}
.lls-knowledge-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #64748b);
}
.lls-knowledge-search input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 8px;
  background: var(--bg-card, #fff);
  padding: 0 12px 0 34px;
  outline: none;
  color: var(--text, #172033);
}
.lls-knowledge-search input:focus {
  border-color: var(--primary, #3157c9);
  box-shadow: 0 0 0 3px rgba(49,87,201,.1);
}
.lls-knowledge-tree {
  flex: 1;
  overflow: auto;
  padding: 2px 10px 18px;
}
.lls-kb-tree-item {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #475569);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.25;
  margin-bottom: 3px;
  padding: 8px 10px;
  text-align: left;
  box-sizing: border-box;
}
.lls-kb-tree-item:hover {
  background: rgba(49,87,201,.07);
  color: var(--primary, #3157c9);
}
.lls-kb-tree-item.is-active {
  background: rgba(49,87,201,.12);
  color: var(--primary, #3157c9);
  font-weight: 700;
}
.lls-kb-cat-icon {
  width: 18px;
  text-align: center;
}
.lls-knowledge-main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  position: relative;
  padding: 26px 30px 42px;
}
.lls-knowledge-main.is-reading {
  padding-top: 0;
}
.lls-reader-progress {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 3px;
  background: transparent;
}
.lls-reader-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #3157c9, #18a999);
  transition: width .12s linear;
}
.lls-reader-layout {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 820px) 220px;
  gap: 36px;
  align-items: start;
}
.lls-reader-column {
  min-width: 0;
}
.lls-reader-topbar {
  position: sticky;
  top: 3px;
  z-index: 12;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(248,250,252,.96), rgba(248,250,252,.82));
  backdrop-filter: blur(10px);
}
.lls-reader-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border, #d8dee8);
  border-radius: 8px;
  background: var(--bg-card, #fff);
  color: var(--text-secondary, #475569);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
}
.lls-reader-progress-text {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}
.lls-reader-article {
  padding: 20px 0 80px;
}
.lls-reader-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary, #3157c9);
  background: rgba(49,87,201,.08);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}
.lls-reader-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.22;
  color: var(--text, #172033);
  letter-spacing: 0;
}
.lls-reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 14px 0 28px;
  color: var(--text-muted, #64748b);
  font-size: 13px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light, #e5e7eb);
}
.lls-reader-content {
  font-size: 17px;
  line-height: 2.05;
  color: var(--text, #172033);
}
.lls-reader-content p {
  margin: 0 0 1.05em;
}
.lls-reader-content h1,
.lls-reader-content h2,
.lls-reader-content h3 {
  scroll-margin-top: 72px;
}
.lls-reader-content h2 {
  margin-top: 2em;
  font-size: 1.45em;
}
.lls-reader-content h3 {
  margin-top: 1.6em;
  font-size: 1.18em;
}
.lls-reader-toc {
  position: sticky;
  top: 24px;
}
.lls-reader-toc-card {
  border-left: 1px solid var(--border-light, #e5e7eb);
  padding: 10px 0 10px 16px;
  max-height: calc(100vh - 140px);
  overflow: auto;
}
.lls-reader-toc-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--text, #172033);
  font-size: 13px;
}
.lls-reader-toc-card button {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-muted, #64748b);
  text-align: left;
  padding: 6px 0;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.35;
}
.lls-reader-toc-card button:hover {
  color: var(--primary, #3157c9);
}
.lls-reader-toc-card .level-3 {
  padding-left: 12px;
}
.lls-reader-toc-card p {
  margin: 0;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}
.lls-knowledge-list {
  max-width: 960px;
  margin: 0 auto;
}
.lls-knowledge-list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 20px;
}
.lls-knowledge-list-head h2 {
  margin: 10px 0 4px;
  font-size: 24px;
}
.lls-knowledge-list-head p {
  margin: 0;
  color: var(--text-muted, #64748b);
  font-size: 13px;
}
.lls-knowledge-note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.lls-knowledge-note-card {
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-card, #fff);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  color: var(--text, #172033);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.lls-knowledge-note-card:hover {
  border-color: rgba(49,87,201,.35);
  box-shadow: 0 8px 22px rgba(15,23,42,.08);
  transform: translateY(-1px);
}
.lls-knowledge-note-card strong {
  display: block;
  margin: 8px 0 10px;
  font-size: 16px;
  line-height: 1.45;
}
.lls-knowledge-note-card > span:last-child {
  display: block;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}
.lls-note-card-cat {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: var(--primary, #3157c9);
  background: rgba(49,87,201,.08);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
}
.lls-product-image-preview {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-light, #eef2f7);
}
.points-product-card {
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border-light, #eef2f7);
}
.points-product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto !important;
  object-fit: cover;
}

@media (max-width: 900px) {
  .lls-note-backdrop {
    padding: 10px !important;
  }
  .lls-note-backdrop .lls-note-modal {
    width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 20px) !important;
  }
  .modal-backdrop {
    align-items: flex-start;
    padding: 12px;
  }
  .lls-editor-modal {
    max-height: calc(100vh - 24px);
  }
  .lls-modal-head,
  .lls-editor-modal-body,
  form.lls-editor-modal-body,
  div.lls-editor-modal-body,
  .modal-foot {
    padding-left: 14px;
    padding-right: 14px;
  }
  .lls-note-meta,
  .lls-form-grid,
  .lls-note-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .lls-note-workspace {
    overflow: auto;
  }
  .lls-note-textarea,
  .lls-note-preview {
    min-height: 360px;
  }
  .lls-knowledge-shell {
    height: auto;
    min-height: calc(100vh - 96px);
    display: block;
  }
  .lls-knowledge-sidebar {
    width: auto;
    min-width: 0;
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--border-light, #e5e7eb);
  }
  .lls-knowledge-sidebar.is-hidden {
    display: none;
  }
  .lls-knowledge-main {
    padding: 16px;
    overflow: visible;
  }
  .lls-reader-layout {
    display: block;
  }
  .lls-reader-toc {
    display: none;
  }
  .lls-reader-topbar {
    top: 0;
  }
  .lls-reader-title {
    font-size: 28px;
  }
  .lls-reader-content {
    font-size: 16px;
    line-height: 1.9;
  }
  .lls-knowledge-list-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .lls-knowledge-note-grid {
    grid-template-columns: 1fr;
  }
  .modal-foot {
    flex-wrap: wrap;
  }
}

/* ===== ADMIN READABILITY PATCH ===== */
:root {
  --text-primary: var(--text, #172033);
  --admin-bg: #f4f6fb;
  --admin-card: #ffffff;
  --admin-card-soft: #f8fafc;
  --admin-text: #172033;
  --admin-muted: #64748b;
  --admin-border: #d9e2ef;
  --admin-border-soft: #edf2f7;
  --admin-hover-bg: rgba(49, 87, 201, .08);
  --admin-active-bg: #3157c9;
  --admin-active-text: #ffffff;
  --admin-primary-solid: #3157c9;
  --admin-primary-contrast: #ffffff;
  --admin-danger-solid: #dc2626;
  --admin-success-solid: #15803d;
  --admin-warning-solid: #b45309;
}

html[data-hp-theme="starry"],
html[data-hp-theme="tech"],
html.theme-starry,
html.theme-tech {
  --text-primary: #e5edf8;
  --admin-bg: #0f172a;
  --admin-card: #111827;
  --admin-card-soft: #172033;
  --admin-text: #e5edf8;
  --admin-muted: #a8b4c7;
  --admin-border: rgba(148, 163, 184, .34);
  --admin-border-soft: rgba(148, 163, 184, .2);
  --admin-hover-bg: rgba(96, 165, 250, .14);
  --admin-active-bg: #2563eb;
  --admin-active-text: #ffffff;
  --admin-primary-solid: #60a5fa;
  --admin-primary-contrast: #08111f;
}

html[data-hp-theme="fresh"],
html.theme-fresh {
  --admin-active-bg: #047857;
  --admin-primary-solid: #047857;
}

html[data-hp-theme="warm"],
html.theme-warm {
  --admin-active-bg: #c2410c;
  --admin-primary-solid: #c2410c;
}

html[data-hp-theme="sakura"],
html.theme-sakura {
  --admin-active-bg: #be185d;
  --admin-primary-solid: #be185d;
}

html[data-hp-theme="deepblue"],
html.theme-deepblue {
  --admin-active-bg: #1d4ed8;
  --admin-primary-solid: #1d4ed8;
}

.app-shell {
  background: var(--admin-bg) !important;
  color: var(--admin-text) !important;
}

.app-shell main,
.app-shell .content,
.app-shell .page {
  background: var(--admin-bg) !important;
  color: var(--admin-text) !important;
}

.app-shell .panel,
.app-shell .card,
.app-shell .q-filter-bar,
.app-shell .stat-card,
.app-shell .form-panel,
.app-shell .points-product-card,
.app-shell .q-table-wrap,
.app-shell .q-table-wrapper,
.app-shell [style*="var(--card-bg)"] {
  background-color: var(--admin-card) !important;
  color: var(--admin-text) !important;
  border-color: var(--admin-border-soft) !important;
}

.app-shell .sidebar {
  background: var(--admin-card) !important;
  border-right-color: var(--admin-border-soft) !important;
}

.app-shell .sidebar .brand strong,
.app-shell .sidebar nav a,
.app-shell .nav-item {
  color: var(--admin-text) !important;
}

.app-shell .sidebar .brand span,
.app-shell .sidebar nav a small,
.app-shell .nav-item small,
.app-shell .text-muted,
.app-shell [style*="var(--text-muted)"] {
  color: var(--admin-muted) !important;
}

.app-shell .sidebar nav a:hover,
.app-shell .nav-item:hover {
  background: var(--admin-hover-bg) !important;
  color: var(--admin-text) !important;
}

.app-shell .sidebar nav a.active,
.app-shell .nav-item.active,
.app-shell .q-selected-bar {
  background: var(--admin-active-bg) !important;
  color: var(--admin-active-text) !important;
  border-color: var(--admin-active-bg) !important;
}

.app-shell .sidebar nav a.active *,
.app-shell .nav-item.active *,
.app-shell .q-selected-bar * {
  color: var(--admin-active-text) !important;
  stroke: currentColor !important;
}

.app-shell .sidebar nav a.active::before,
.app-shell .nav-item.active::before {
  background: var(--admin-active-text) !important;
}

.app-shell .header,
.app-shell .topbar {
  color: #ffffff !important;
}

.app-shell .header *,
.app-shell .topbar * {
  color: inherit;
}

.app-shell input,
.app-shell select,
.app-shell textarea,
.modal-backdrop input,
.modal-backdrop select,
.modal-backdrop textarea,
.drawer input,
.drawer select,
.drawer textarea {
  background-color: var(--admin-card-soft) !important;
  color: var(--admin-text) !important;
  border-color: var(--admin-border) !important;
}

.app-shell input::placeholder,
.app-shell textarea::placeholder,
.modal-backdrop input::placeholder,
.modal-backdrop textarea::placeholder {
  color: var(--admin-muted) !important;
}

.app-shell input:focus,
.app-shell select:focus,
.app-shell textarea:focus,
.modal-backdrop input:focus,
.modal-backdrop select:focus,
.modal-backdrop textarea:focus {
  border-color: var(--admin-primary-solid) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--admin-primary-solid) 18%, transparent) !important;
}

.app-shell .primary-button,
.app-shell .q-btn-primary,
.modal-backdrop .primary-button,
.modal-backdrop .q-btn-primary {
  background: var(--admin-active-bg) !important;
  border-color: var(--admin-active-bg) !important;
  color: var(--admin-active-text) !important;
}

.app-shell .primary-button *,
.app-shell .q-btn-primary *,
.modal-backdrop .primary-button *,
.modal-backdrop .q-btn-primary * {
  color: inherit !important;
  stroke: currentColor !important;
}

.app-shell .text-button,
.app-shell .q-btn,
.modal-backdrop .text-button,
.drawer .text-button {
  background: var(--admin-card) !important;
  border-color: var(--admin-border) !important;
  color: var(--admin-text) !important;
}

.app-shell .text-button:hover,
.app-shell .q-btn:hover,
.modal-backdrop .text-button:hover,
.drawer .text-button:hover {
  background: var(--admin-hover-bg) !important;
  border-color: var(--admin-primary-solid) !important;
  color: var(--admin-primary-solid) !important;
}

.app-shell .text-button.danger,
.app-shell .danger-button,
.modal-backdrop .text-button.danger,
.modal-backdrop .danger-button {
  color: var(--admin-danger-solid) !important;
  border-color: color-mix(in srgb, var(--admin-danger-solid) 42%, transparent) !important;
}

.app-shell .danger-button {
  background: var(--admin-danger-solid) !important;
  color: #ffffff !important;
}

.app-shell table,
.app-shell .data-table,
.app-shell .q-table {
  background: var(--admin-card) !important;
  color: var(--admin-text) !important;
}

.app-shell thead,
.app-shell .data-table thead,
.app-shell .q-table thead,
.app-shell .data-table th,
.app-shell .q-table th {
  background: var(--admin-card-soft) !important;
  color: var(--admin-muted) !important;
  border-color: var(--admin-border) !important;
}

.app-shell .data-table td,
.app-shell .q-table td,
.app-shell table td {
  color: var(--admin-text) !important;
  border-color: var(--admin-border-soft) !important;
}

.app-shell .data-table tbody tr:hover,
.app-shell .q-table tbody tr:hover,
.app-shell table tbody tr:hover {
  background: var(--admin-hover-bg) !important;
}

.app-shell .data-table tbody tr.selected,
.app-shell .q-table tbody tr.selected {
  background: color-mix(in srgb, var(--admin-active-bg) 14%, var(--admin-card)) !important;
}

.app-shell .badge {
  border-color: var(--admin-border) !important;
}

.app-shell .tag,
.app-shell .q-type-tag,
.app-shell .lls-note-card-cat {
  border-color: var(--admin-border) !important;
  color: var(--admin-text) !important;
}

.app-shell .badge-green {
  color: var(--admin-success-solid) !important;
  background: color-mix(in srgb, var(--admin-success-solid) 10%, var(--admin-card)) !important;
}

.app-shell .badge-orange {
  color: var(--admin-warning-solid) !important;
  background: color-mix(in srgb, var(--admin-warning-solid) 12%, var(--admin-card)) !important;
}

.app-shell .badge-red {
  color: var(--admin-danger-solid) !important;
  background: color-mix(in srgb, var(--admin-danger-solid) 10%, var(--admin-card)) !important;
}

.app-shell .badge-blue,
.app-shell .badge-purple {
  color: var(--admin-primary-solid) !important;
  background: color-mix(in srgb, var(--admin-primary-solid) 10%, var(--admin-card)) !important;
}

.modal-backdrop .modal,
.modal-backdrop .modal-card,
.modal-backdrop .q-form-card,
.drawer,
.drawer-section {
  background: var(--admin-card) !important;
  color: var(--admin-text) !important;
  border-color: var(--admin-border-soft) !important;
}

.modal-backdrop .modal-head,
.modal-backdrop .modal-body,
.modal-backdrop .modal-foot,
.drawer-head,
.drawer-foot {
  background: var(--admin-card) !important;
  color: var(--admin-text) !important;
  border-color: var(--admin-border-soft) !important;
}

.modal-backdrop .modal-head h2,
.modal-backdrop .modal-head h3,
.modal-backdrop label,
.drawer h2,
.drawer h3,
.drawer label {
  color: var(--admin-text) !important;
}

.modal-backdrop [style*="var(--text-muted)"],
.drawer [style*="var(--text-muted)"] {
  color: var(--admin-muted) !important;
}

.form-share-qr-modal {
  text-align: center;
}

.form-share-qr-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 8px;
  background: var(--admin-card-soft);
}

.form-share-qr-card img {
  width: 220px;
  height: 220px;
  display: block;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  border: 1px solid var(--admin-border);
}

.form-share-qr-title {
  color: var(--admin-text);
  font-size: 15px;
  font-weight: 700;
}

.form-share-qr-url {
  width: 100%;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

/* ===== FRONTEND THEME AND MOBILE POLISH ===== */
.topbar-actions .admin-home-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 32px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255,255,255,.32) !important;
  background: rgba(255,255,255,.14) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.topbar-actions .admin-home-btn:hover {
  background: rgba(255,255,255,.24) !important;
  border-color: rgba(255,255,255,.52) !important;
}

.topbar-actions .admin-home-btn svg,
.topbar-actions .admin-home-btn span {
  color: inherit !important;
  stroke: currentColor !important;
}

[data-s="honor"] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--hp-bg) 92%, #fff 8%), var(--hp-bg)) !important;
  border-color: var(--hp-border) !important;
  color: var(--hp-text) !important;
}

[data-s="honor"] > div {
  color: var(--hp-text) !important;
}

[data-s="honor"] h2,
[data-s="honor"] h3,
[data-s="honor"] strong,
[data-s="honor"] button div,
[data-s="honor"] [style*="#111827"],
[data-s="honor"] [style*="#0f172a"] {
  color: var(--hp-text) !important;
}

[data-s="honor"] p,
[data-s="honor"] [style*="#64748b"],
[data-s="honor"] [style*="#475569"],
[data-s="honor"] [style*="#94a3b8"] {
  color: var(--hp-text3) !important;
}

[data-s="honor"] button {
  border-color: var(--hp-border) !important;
}

[data-s="honor"] button[style*="background: #ffffff"],
[data-s="honor"] button[style*="background: #fff"],
[data-s="honor"] [style*="background: #fff"],
[data-s="honor"] [style*="background: \"#fff\""] {
  background: var(--hp-card) !important;
}

[data-s="honor"] button[style*="#eff6ff"],
[data-s="honor"] [style*="#eff6ff"] {
  background: color-mix(in srgb, var(--primary) 12%, var(--hp-card)) !important;
  border-color: var(--primary) !important;
}

[data-s="honor"] [style*="#fff7ed"] {
  background: color-mix(in srgb, var(--primary) 10%, var(--hp-card)) !important;
  color: var(--primary) !important;
  border-color: color-mix(in srgb, var(--primary) 30%, var(--hp-border)) !important;
}

[data-s="honor"] [style*="#eef2ff"] {
  background: color-mix(in srgb, var(--primary) 12%, var(--hp-card)) !important;
}

[data-s="honor"] [style*="#2563eb"] {
  color: var(--primary) !important;
}

html[data-hp-theme="starry"] [data-s="honor"],
html[data-hp-theme="tech"] [data-s="honor"] {
  background: linear-gradient(180deg, color-mix(in srgb, var(--hp-bg) 84%, #1e293b 16%), var(--hp-bg)) !important;
}

html[data-hp-theme="starry"] [data-s="honor"] button,
html[data-hp-theme="tech"] [data-s="honor"] button,
html[data-hp-theme="starry"] [data-s="honor"] [style*="background: #fff"],
html[data-hp-theme="tech"] [data-s="honor"] [style*="background: #fff"] {
  background: color-mix(in srgb, var(--hp-card) 94%, #fff 6%) !important;
}

.modal-backdrop,
.drawer-backdrop,
.q-form-modal {
  backdrop-filter: blur(8px);
}

.modal-backdrop .modal,
.modal-backdrop .modal-card,
.q-form-modal .q-form-card {
  max-width: min(920px, calc(100vw - 28px)) !important;
}

.app-shell .toolbar,
.app-shell .q-toolbar,
.app-shell .q-filter-row,
.app-shell .row-actions,
.app-shell td:last-child {
  min-width: 0;
}

.app-shell td:last-child button,
.app-shell .row-actions button,
.app-shell .toolbar button,
.app-shell .q-toolbar button {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .topbar-actions {
    gap: 6px;
    max-width: 58vw;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topbar-actions::-webkit-scrollbar {
    display: none;
  }
  .topbar-actions .theme-select {
    width: 86px;
    min-width: 86px;
  }
  .topbar-actions .admin-home-btn {
    min-width: 34px !important;
    width: 34px !important;
    padding: 0 !important;
    justify-content: center !important;
  }
  .topbar-actions .admin-home-btn .header-text-label {
    display: none !important;
  }
  .topbar-actions .account-profile-btn {
    display: none !important;
  }
  .app-shell .content {
    padding: 14px !important;
  }
  .app-shell .panel,
  .app-shell .card {
    padding: 14px !important;
  }
  .app-shell table {
    min-width: 680px;
  }
  .app-shell .q-table-wrap,
  .app-shell [style*="overflow: hidden"][style*="border-radius"] {
    overflow-x: auto !important;
  }
  .modal-backdrop,
  .q-form-modal {
    padding: 10px !important;
    align-items: flex-start !important;
  }
  .modal-backdrop .modal,
  .modal-backdrop .modal-card,
  .q-form-modal .q-form-card {
    width: calc(100vw - 20px) !important;
    max-height: calc(100vh - 20px) !important;
  }
  [data-s="honor"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  [data-s="honor"] h2 {
    font-size: 28px !important;
  }
  [data-s="honor"] button {
    max-width: 100%;
  }
  [data-s="honor"] [style*="grid-template-columns"] {
    min-width: 0;
  }
}

/* ===== FINAL ADMIN AND HOMEPAGE VISUAL SYSTEM ===== */
.app-shell {
  grid-template-columns: 224px minmax(0, 1fr) !important;
  min-width: 0;
  background: var(--admin-bg) !important;
}

.app-shell .sidebar {
  background: var(--admin-card) !important;
  border-right: 1px solid var(--admin-border-soft) !important;
  box-shadow: none !important;
}

.app-shell .sidebar .brand {
  min-height: 64px;
  padding: 14px 16px;
  border-bottom-color: var(--admin-border-soft) !important;
}

.app-shell .sidebar .brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: none;
}

.app-shell .sidebar .brand strong {
  font-size: 15px;
  font-weight: 800;
}

.app-shell .sidebar nav {
  gap: 2px;
  padding: 10px 8px 18px;
}

.app-shell .sidebar nav a,
.app-shell .nav-item {
  min-height: 38px;
  margin: 0 !important;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--admin-text) !important;
  font-size: 13px;
  font-weight: 600;
  transform: none !important;
}

.app-shell .sidebar nav a svg,
.app-shell .nav-item svg {
  width: 16px;
  height: 16px;
  color: var(--admin-muted);
}

.app-shell .sidebar nav a:hover,
.app-shell .nav-item:hover {
  background: var(--admin-hover-bg) !important;
  color: var(--admin-text) !important;
}

.app-shell .sidebar nav a.active,
.app-shell .nav-item.active {
  background: color-mix(in srgb, var(--admin-active-bg) 13%, var(--admin-card)) !important;
  color: var(--admin-primary-solid) !important;
  font-weight: 800;
}

.app-shell .sidebar nav a.active *,
.app-shell .nav-item.active * {
  color: inherit !important;
  stroke: currentColor !important;
}

.app-shell .sidebar nav a.active::before,
.app-shell .nav-item.active::before {
  left: 0;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--admin-primary-solid) !important;
}

.app-shell .topbar {
  height: 56px;
  padding: 0 24px;
  background: var(--header-bg) !important;
  border-bottom: 1px solid rgba(255,255,255,.14);
  box-shadow: none;
}

.app-shell .topbar h1 {
  font-size: 15px;
  font-weight: 800;
}

.app-shell .topbar-actions {
  gap: 8px;
}

.app-shell .topbar .theme-select,
.app-shell .topbar .icon-button,
.app-shell .topbar .header-btn {
  min-height: 32px;
  border-radius: 6px;
}

.app-shell .topbar .theme-select {
  color: #fff !important;
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.28) !important;
}

.app-shell .topbar .theme-select option {
  color: #172033;
  background: #fff;
}

.app-shell .topbar .icon-button,
.app-shell .topbar .header-btn {
  color: #fff !important;
}

.app-shell .topbar .icon-button:hover {
  background: rgba(255,255,255,.15) !important;
  color: #fff !important;
}

.app-shell .content {
  padding: 26px 28px 36px !important;
  background: var(--admin-bg) !important;
}

.app-shell .page {
  max-width: 1480px;
  margin: 0 auto;
}

.app-shell .panel,
.app-shell .card,
.app-shell .q-filter-bar,
.app-shell .form-panel,
.app-shell .stat-card {
  border: 1px solid var(--admin-border-soft) !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.04) !important;
  animation: none !important;
}

.app-shell .panel:hover,
.app-shell .card:hover,
.app-shell .stat-card:hover {
  box-shadow: 0 8px 22px rgba(15,23,42,.08) !important;
  transform: none !important;
}

.app-shell .q-filter-bar,
.app-shell .toolbar,
.app-shell .q-toolbar {
  gap: 8px;
}

.app-shell input,
.app-shell select,
.app-shell textarea {
  min-height: 36px;
  border-radius: 6px !important;
  font-size: 13px;
}

.app-shell .primary-button,
.app-shell .text-button,
.app-shell .q-btn {
  min-height: 34px;
  border-radius: 6px !important;
  font-size: 13px;
  font-weight: 700;
}

.app-shell .primary-button:active,
.app-shell .q-btn-primary:active {
  transform: none !important;
}

.app-shell .q-table-wrap,
.app-shell .q-table-wrapper {
  border: 1px solid var(--admin-border-soft) !important;
  border-radius: 8px;
  background: var(--admin-card) !important;
}

.app-shell .q-table th,
.app-shell .data-table th {
  height: 42px;
  padding: 0 14px;
  background: var(--admin-card-soft) !important;
  color: var(--admin-muted) !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.app-shell .q-table td,
.app-shell .data-table td {
  min-height: 48px;
  padding: 11px 14px;
  font-size: 13px;
}

.app-shell .q-table tbody tr,
.app-shell .data-table tbody tr {
  transform: none !important;
}

.app-shell .q-table tbody tr:hover,
.app-shell .data-table tbody tr:hover {
  background: var(--admin-hover-bg) !important;
}

.app-shell .badge,
.app-shell .tag {
  min-height: 22px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.homepage-shell {
  color: var(--hp-text);
  background: var(--hp-bg) !important;
}

.homepage-shell button,
.homepage-shell a {
  -webkit-tap-highlight-color: transparent;
}

.homepage-shell section {
  border-color: var(--hp-border);
}

/* Front page honor reveal. Uses only honor-wall-config and teaching_honor data. */
.honor-reveal-wall {
  --honor-ink: var(--hp-text);
  --honor-muted: var(--hp-text2);
  --honor-line: var(--hp-border);
  --honor-surface: var(--hp-card);
  --honor-accent: var(--primary);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, var(--hp-bg)), var(--hp-bg) 72%);
  border-top: 1px solid var(--hp-border);
  border-bottom: 1px solid var(--hp-border);
}

.honor-reveal-inner { max-width: 1180px; margin: 0 auto; }
.honor-reveal-head { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:24px; }
.honor-reveal-overline { display:flex; align-items:center; gap:7px; color:var(--honor-accent); font-size:12px; font-weight:800; }
.honor-reveal-head h2 { margin:8px 0 5px; color:var(--honor-ink); font-size:38px; line-height:1.12; font-weight:850; letter-spacing:0; }
.honor-reveal-head p { margin:0; color:var(--honor-muted); font-size:14px; line-height:1.65; }
.honor-reveal-controls { display:flex; align-items:center; gap:10px; color:var(--honor-muted); font-size:12px; font-variant-numeric:tabular-nums; }
.honor-reveal-controls button, .honor-reveal-close, .honor-reveal-modal-actions button { width:36px; height:36px; border:1px solid var(--honor-line); background:var(--honor-surface); color:var(--honor-ink); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; border-radius:8px; }
.honor-reveal-controls button:hover, .honor-reveal-close:hover, .honor-reveal-modal-actions button:hover:not(:disabled) { border-color:var(--honor-accent); color:var(--honor-accent); }
.honor-reveal-stage { min-height:392px; position:relative; display:flex; align-items:flex-end; justify-content:center; overflow:hidden; isolation:isolate; padding:30px; background:linear-gradient(115deg,#183454,#264f77 48%,#28746d); background-size:cover; background-position:center; border:1px solid rgba(255,255,255,.25); box-shadow:0 24px 56px rgba(15,23,42,.18); }
.honor-reveal-stage::before { content:""; position:absolute; inset:0; z-index:-1; background:radial-gradient(circle at 18% 20%,rgba(255,255,255,.28),transparent 28%), radial-gradient(circle at 80% 72%,rgba(252,211,77,.28),transparent 30%); }
.honor-reveal-stage-shade { position:absolute; inset:0; z-index:-1; background:linear-gradient(90deg,rgba(7,24,42,.84),rgba(7,24,42,.28) 54%,rgba(7,24,42,.64)); }
.honor-reveal-stage-copy { position:absolute; left:30px; top:30px; max-width:290px; color:#fff; }
.honor-reveal-stage-copy span { display:block; font-size:12px; font-weight:800; opacity:.75; }
.honor-reveal-stage-copy p { margin:8px 0 0; font-size:15px; line-height:1.7; }
.honor-reveal-feature { width:min(450px,100%); position:relative; z-index:1; padding:28px 28px 22px; border:1px solid rgba(255,255,255,.44); background:linear-gradient(145deg,rgba(255,255,255,.23),rgba(255,255,255,.08)); color:#fff; cursor:pointer; text-align:center; backdrop-filter:blur(14px); box-shadow:0 20px 46px rgba(0,0,0,.2); transition:transform .24s ease, background .24s ease; }
.honor-reveal-feature:hover { transform:translateY(-4px); background:linear-gradient(145deg,rgba(255,255,255,.31),rgba(255,255,255,.12)); }
.honor-reveal-orbit { position:absolute; width:230px; height:230px; top:23px; left:50%; transform:translateX(-50%); border:1px solid rgba(255,255,255,.36); border-radius:50%; box-shadow:0 0 0 18px rgba(255,255,255,.05),0 0 0 39px rgba(255,255,255,.035); animation:honorOrbit 7s linear infinite; }
.honor-reveal-portrait { width:126px; height:126px; margin:0 auto 17px; position:relative; z-index:1; border-radius:50%; overflow:visible; background:linear-gradient(145deg,#e0f2fe,#fef3c7); border:4px solid rgba(255,255,255,.92); box-shadow:0 12px 30px rgba(2,6,23,.3); display:flex; align-items:center; justify-content:center; color:#17324d; font-size:48px; font-weight:850; }
.honor-reveal-portrait img { width:100%; height:100%; border-radius:50%; object-fit:cover; }
.honor-reveal-icon { position:absolute; right:-9px; bottom:-5px; width:42px; height:42px; border-radius:50%; overflow:hidden; border:2px solid #fff; background:#fff; display:flex; align-items:center; justify-content:center; }
.honor-reveal-icon img { width:28px; height:28px; object-fit:contain; }
.honor-reveal-feature-text { position:relative; z-index:1; }
.honor-reveal-feature-text span { display:block; font-size:12px; opacity:.78; font-weight:700; }
.honor-reveal-feature-text strong { display:block; margin-top:5px; font-size:30px; line-height:1.14; font-weight:850; }
.honor-reveal-feature-text em { display:block; margin-top:6px; font-style:normal; font-size:14px; color:rgba(255,255,255,.82); }
.honor-reveal-action { position:relative; z-index:1; display:inline-flex; align-items:center; gap:7px; margin-top:18px; padding:8px 13px; border:1px solid rgba(255,255,255,.45); font-size:13px; font-weight:800; }
.honor-reveal-candidates { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); margin-top:14px; border-top:1px solid var(--honor-line); border-left:1px solid var(--honor-line); background:var(--honor-surface); }
.honor-reveal-candidate { min-width:0; min-height:78px; padding:10px; display:grid; grid-template-columns:42px minmax(0,1fr); grid-template-rows:auto auto; column-gap:10px; align-items:center; border:0; border-right:1px solid var(--honor-line); border-bottom:1px solid var(--honor-line); background:transparent; color:var(--honor-ink); cursor:pointer; text-align:left; transition:background .18s ease; }
.honor-reveal-candidate:hover, .honor-reveal-candidate.is-active { background:color-mix(in srgb, var(--primary) 10%, var(--honor-surface)); }
.honor-reveal-candidate img, .honor-reveal-initial { width:42px; height:42px; grid-row:span 2; border-radius:50%; object-fit:cover; background:linear-gradient(145deg,#dbeafe,#dcfce7); display:flex; align-items:center; justify-content:center; color:#1e3a5f; font-weight:850; }
.honor-reveal-candidate span:not(.honor-reveal-initial) { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:800; }
.honor-reveal-candidate small { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px; color:var(--honor-muted); font-size:11px; }
.honor-reveal-notes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:14px; }
.honor-reveal-note { min-width:0; color:inherit; text-decoration:none; border:1px solid var(--honor-line); background:var(--honor-surface); }
.honor-reveal-note-content { min-height:72px; padding:12px; display:grid; grid-template-columns:46px minmax(0,1fr); align-items:center; gap:10px; color:var(--honor-accent); }
.honor-reveal-note img { width:46px; height:46px; object-fit:cover; }
.honor-reveal-note strong, .honor-reveal-note span { display:block; color:var(--honor-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.honor-reveal-note strong { font-size:13px; }
.honor-reveal-note span { margin-top:4px; color:var(--honor-muted); font-size:12px; }
.honor-reveal-note[href]:hover { border-color:var(--honor-accent); }
.honor-reveal-empty { min-height:270px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; color:var(--honor-muted); border:1px dashed var(--honor-line); background:var(--honor-surface); text-align:center; }
.honor-reveal-empty strong { color:var(--honor-ink); font-size:16px; }
.honor-reveal-empty span { font-size:13px; }
.honor-reveal-modal { position:fixed; inset:0; z-index:3600; padding:24px; display:flex; align-items:center; justify-content:center; background:rgba(4,12,24,.78); backdrop-filter:blur(11px); animation:honorModalIn .25s ease both; }
.honor-reveal-modal-backdrop { position:absolute; inset:0; opacity:.18; background:linear-gradient(135deg,#17324d,#315f84); background-size:cover; background-position:center; filter:blur(12px) saturate(.75); transform:scale(1.06); }
.honor-draw-scene { width:min(780px,100%); min-height:min(580px,calc(100vh - 48px)); position:relative; z-index:1; overflow:hidden; display:flex; align-items:center; justify-content:center; border:1px solid rgba(255,255,255,.3); background:linear-gradient(160deg,#071b36 0%,#10406c 48%,#e7f4ff 100%); box-shadow:0 34px 100px rgba(0,0,0,.52); }
.honor-draw-scene::before { content:""; position:absolute; inset:-35%; opacity:.78; background:conic-gradient(from 120deg at 54% 66%,transparent 0 10%,rgba(255,255,255,.6) 11% 12%,transparent 13% 23%,rgba(255,238,190,.7) 24% 25%,transparent 26% 100%); animation:honorDrawRotate 9s linear infinite; }
.honor-draw-sky { position:absolute; inset:0; overflow:hidden; background:radial-gradient(circle at 72% 22%,rgba(255,255,255,.94),transparent 2%),radial-gradient(circle at 22% 42%,rgba(147,197,253,.3),transparent 30%),linear-gradient(142deg,#06152d 0%,#0b3563 42%,#7bc6eb 75%,#eaf6ff 100%); }
.honor-draw-sky i { position:absolute; width:3px; height:3px; border-radius:50%; background:#fff; box-shadow:0 0 8px 2px rgba(255,255,255,.65); animation:honorTwinkle 1.9s ease-in-out infinite; }.honor-draw-sky i:nth-child(1){left:15%;top:22%;}.honor-draw-sky i:nth-child(2){left:32%;top:58%;animation-delay:.4s;}.honor-draw-sky i:nth-child(3){left:71%;top:15%;animation-delay:.7s;}.honor-draw-sky i:nth-child(4){left:85%;top:46%;animation-delay:1.1s;}
.honor-draw-sky b { position:absolute; left:-24%; top:18%; width:48%; height:5px; border-radius:999px; background:linear-gradient(90deg,transparent,rgba(255,255,255,.3),#fff 72%,#fbbf24); box-shadow:0 0 12px 4px rgba(255,255,255,.7),0 0 36px 8px rgba(251,191,36,.38); transform:rotate(20deg); animation:honorMeteor 1.7s cubic-bezier(.08,.8,.28,1) infinite; }
.honor-draw-flash { position:absolute; inset:0; opacity:0; pointer-events:none; background:#fff; }
.honor-draw-skip { position:absolute; z-index:5; right:16px; top:16px; border:1px solid rgba(255,255,255,.38); background:rgba(4,15,30,.28); color:#fff; padding:8px 11px; cursor:pointer; font-size:12px; backdrop-filter:blur(7px); }
.honor-draw-result { position:relative; z-index:2; width:min(360px,calc(100% - 36px)); opacity:0; transform:translateY(26px) scale(.94); pointer-events:none; text-align:center; }
.honor-draw-result-card { padding:28px 24px 24px; color:#fff; border:1px solid rgba(255,255,255,.66); background:linear-gradient(155deg,rgba(24,66,106,.9),rgba(8,28,54,.92)); box-shadow:0 22px 66px rgba(0,0,0,.4); }
.honor-draw-result-image { width:150px; height:150px; margin:0 auto 17px; border-radius:50%; overflow:hidden; border:4px solid #fff1b8; background:linear-gradient(145deg,#e0f2fe,#fde68a); color:#17324d; display:flex; align-items:center; justify-content:center; font-size:60px; font-weight:850; box-shadow:0 0 0 9px rgba(255,243,190,.18),0 14px 35px rgba(0,0,0,.32); }
.honor-draw-result-image img { width:100%; height:100%; object-fit:cover; }.honor-draw-result-card > span { display:block; color:#fde68a; font-size:12px; font-weight:800; }.honor-draw-result-card h3 { margin:8px 0 5px; color:#fff; font-size:29px; line-height:1.16; }.honor-draw-result-card p { margin:0; color:rgba(255,255,255,.76); font-size:14px; line-height:1.65; }
.honor-draw-result-actions { display:flex; gap:9px; justify-content:center; margin-top:14px; }.honor-draw-result-actions button { min-height:38px; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:0 13px; border:1px solid #fef3c7; background:#fef3c7; color:#5b3a0a; cursor:pointer; font-size:13px; font-weight:800; }.honor-draw-result-actions button.secondary { border-color:rgba(255,255,255,.46); background:rgba(4,18,36,.55); color:#fff; }
.honor-draw-scene.phase-1 .honor-draw-sky b { animation-duration:.65s; filter:saturate(1.2) brightness(1.7); }.honor-draw-scene.phase-1 .honor-draw-flash { animation:honorDrawFlash 1.3s ease both; }.honor-draw-scene.phase-2 .honor-draw-sky { opacity:.22; filter:blur(3px); }.honor-draw-scene.phase-2::before { animation:none; }.honor-draw-scene.phase-2 .honor-draw-result { opacity:1; transform:translateY(0) scale(1); pointer-events:auto; animation:honorDrawResult .52s cubic-bezier(.16,1,.3,1) both; }.honor-draw-scene.phase-2 .honor-draw-flash { animation:honorDrawFlash .45s ease both; }
@keyframes honorMeteor { 0% { transform:translate(-16%,0) rotate(20deg); opacity:0; } 18% { opacity:1; } 76% { opacity:1; } 100% { transform:translate(280%,210%) rotate(20deg); opacity:0; } }
@keyframes honorTwinkle { 0%,100% { opacity:.22; transform:scale(.8); } 50% { opacity:1; transform:scale(1.65); } }
@keyframes honorDrawFlash { 0%,100% { opacity:0; } 30% { opacity:.96; } }
@keyframes honorDrawResult { from { opacity:0; transform:translateY(26px) scale(.94); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes honorDrawRotate { to { transform:rotate(360deg); } }
.honor-reveal-modal-card { width:min(470px,100%); position:relative; z-index:1; padding:32px; overflow:hidden; text-align:center; color:#f8fafc; border:1px solid rgba(255,255,255,.27); background:linear-gradient(145deg,rgba(18,45,69,.95),rgba(11,28,48,.95)); box-shadow:0 30px 90px rgba(0,0,0,.45); }
.honor-reveal-modal-card::before { content:""; position:absolute; inset:0; opacity:.48; background:radial-gradient(circle at 50% 12%,rgba(251,191,36,.38),transparent 32%),radial-gradient(circle at 80% 85%,rgba(56,189,248,.24),transparent 34%); pointer-events:none; }
.honor-reveal-close { position:absolute; top:14px; right:14px; z-index:2; color:#fff; background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.25); }
.honor-reveal-modal-status { position:relative; z-index:1; color:#fef3c7; font-size:12px; font-weight:800; }
.honor-reveal-modal-person { position:relative; z-index:1; width:148px; height:148px; margin:20px auto 16px; display:flex; align-items:center; justify-content:center; }
.honor-reveal-modal-avatar { width:126px; height:126px; border-radius:50%; overflow:hidden; border:4px solid #fef3c7; background:linear-gradient(145deg,#dbeafe,#fef3c7); color:#17324d; font-size:48px; font-weight:850; display:flex; align-items:center; justify-content:center; box-shadow:0 12px 38px rgba(0,0,0,.35); }
.honor-reveal-modal-avatar img { width:100%; height:100%; object-fit:cover; }
.honor-reveal-modal-icon { position:absolute; right:3px; bottom:5px; width:47px; height:47px; display:flex; align-items:center; justify-content:center; border-radius:50%; overflow:hidden; border:2px solid #fff; background:#fff; }
.honor-reveal-modal-icon img { width:31px; height:31px; object-fit:contain; }
.honor-reveal-modal-card h3, .honor-reveal-modal-card > strong, .honor-reveal-modal-card > p, .honor-reveal-modal-stats, .honor-reveal-modal-actions { position:relative; z-index:1; }
.honor-reveal-modal-card h3 { margin:0; font-size:29px; line-height:1.16; }
.honor-reveal-modal-card > strong { display:block; margin-top:7px; color:#fef3c7; font-size:17px; }
.honor-reveal-modal-card > p { margin:14px auto 0; max-width:360px; color:rgba(248,250,252,.8); line-height:1.75; font-size:14px; }
.honor-reveal-modal-stats { display:flex; justify-content:center; gap:10px; margin-top:18px; }
.honor-reveal-modal-stats span { display:inline-flex; align-items:center; gap:6px; padding:7px 10px; border:1px solid rgba(255,255,255,.22); background:rgba(255,255,255,.08); font-size:12px; }
.honor-reveal-modal-actions { display:grid; grid-template-columns:38px minmax(0,1fr) 38px; gap:10px; align-items:center; margin-top:22px; }
.honor-reveal-modal-actions button { background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.27); color:#fff; }
.honor-reveal-modal-actions button:disabled { opacity:.35; cursor:not-allowed; }
.honor-reveal-modal-actions .honor-reveal-profile { width:auto; gap:7px; font-size:13px; font-weight:800; }
.honor-reveal-modal-card:not(.is-revealed) .honor-reveal-modal-person, .honor-reveal-modal-card:not(.is-revealed) h3, .honor-reveal-modal-card:not(.is-revealed) > strong, .honor-reveal-modal-card:not(.is-revealed) > p, .honor-reveal-modal-card:not(.is-revealed) .honor-reveal-modal-stats, .honor-reveal-modal-card:not(.is-revealed) .honor-reveal-modal-actions { opacity:0; transform:translateY(12px) scale(.98); }
.honor-reveal-modal-card.is-revealed .honor-reveal-modal-person, .honor-reveal-modal-card.is-revealed h3, .honor-reveal-modal-card.is-revealed > strong, .honor-reveal-modal-card.is-revealed > p, .honor-reveal-modal-card.is-revealed .honor-reveal-modal-stats, .honor-reveal-modal-card.is-revealed .honor-reveal-modal-actions { animation:honorRevealUp .42s ease both; }
.honor-reveal-modal-card.is-revealed > strong { animation-delay:.05s; }.honor-reveal-modal-card.is-revealed > p { animation-delay:.1s; }.honor-reveal-modal-card.is-revealed .honor-reveal-modal-stats { animation-delay:.15s; }.honor-reveal-modal-card.is-revealed .honor-reveal-modal-actions { animation-delay:.2s; }
@keyframes honorOrbit { to { transform:translateX(-50%) rotate(360deg); } }
@keyframes honorModalIn { from { opacity:0; } to { opacity:1; } }
@keyframes honorRevealUp { from { opacity:0; transform:translateY(12px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }

@media (max-width: 760px) {
  .honor-reveal-head { align-items:flex-start; flex-direction:column; gap:15px; margin-bottom:18px; }
  .honor-reveal-head h2 { font-size:30px; }
  .honor-reveal-stage { min-height:366px; padding:18px; }
  .honor-reveal-stage-copy { left:18px; top:18px; max-width:220px; }.honor-reveal-stage-copy p { font-size:13px; }
  .honor-reveal-feature { align-self:flex-end; padding:22px 16px 17px; }.honor-reveal-orbit { width:194px; height:194px; top:16px; }.honor-reveal-portrait { width:112px; height:112px; }
  .honor-reveal-feature-text strong { font-size:25px; }
  .honor-reveal-candidates { grid-template-columns:repeat(2,minmax(0,1fr)); }.honor-reveal-candidate { min-height:72px; }
  .honor-reveal-notes { grid-template-columns:1fr; }.honor-reveal-modal { padding:12px; }.honor-reveal-modal-card { padding:29px 20px 22px; }.honor-reveal-modal-person { margin-top:16px; }
}

.home-honor-showcase {
  --honor-soft: color-mix(in srgb, var(--primary) 8%, var(--hp-card));
  --honor-border: color-mix(in srgb, var(--hp-border) 78%, var(--primary) 22%);
  background: linear-gradient(180deg, var(--honor-soft), var(--hp-bg) 58%) !important;
}

.home-honor-showcase .home-honor-kicker {
  background: color-mix(in srgb, var(--primary) 10%, var(--hp-card)) !important;
  border-color: color-mix(in srgb, var(--primary) 30%, var(--hp-border)) !important;
  color: var(--primary) !important;
  border-radius: 999px !important;
}

.home-honor-showcase .home-honor-nav {
  background: var(--hp-card) !important;
  color: var(--hp-text) !important;
  border-color: var(--hp-border) !important;
  box-shadow: 0 4px 12px rgba(15,23,42,.08) !important;
}

.home-honor-showcase .home-honor-nav:hover {
  background: var(--honor-soft) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.home-honor-showcase .home-honor-feature {
  background: var(--hp-card) !important;
  border-color: var(--honor-border) !important;
  box-shadow: 0 16px 38px rgba(15,23,42,.08) !important;
}

.home-honor-showcase .home-honor-feature:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 18px 42px color-mix(in srgb, var(--primary) 16%, transparent) !important;
}

.home-honor-showcase .home-honor-accent {
  background: var(--hp-gradient) !important;
}

.home-honor-showcase .home-honor-avatar-frame {
  background: var(--honor-soft) !important;
  border-color: var(--honor-border) !important;
}

.home-honor-showcase .home-honor-badge {
  background: var(--honor-soft) !important;
  color: var(--hp-text) !important;
  border: 1px solid var(--honor-border);
}

.home-honor-showcase .home-honor-level {
  color: var(--hp-text3) !important;
  letter-spacing: 1px !important;
}

.home-honor-showcase .home-honor-feature h3,
.home-honor-showcase .home-honor-config div[style*="fontWeight"] {
  color: var(--hp-text) !important;
}

.home-honor-showcase .home-honor-feature p,
.home-honor-showcase .home-honor-config div[style*="fontSize"] {
  color: var(--hp-text2) !important;
}

.home-honor-showcase .home-honor-link {
  color: var(--primary) !important;
}

.home-honor-showcase .home-honor-roster {
  gap: 8px !important;
}

.home-honor-showcase .home-honor-person {
  background: var(--hp-card) !important;
  border-color: var(--hp-border) !important;
  box-shadow: none !important;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.home-honor-showcase .home-honor-person:hover {
  background: var(--honor-soft) !important;
  border-color: color-mix(in srgb, var(--primary) 55%, var(--hp-border)) !important;
  transform: translateX(-2px);
}

.home-honor-showcase .home-honor-person.is-active {
  background: color-mix(in srgb, var(--primary) 12%, var(--hp-card)) !important;
  border-color: var(--primary) !important;
  box-shadow: inset 3px 0 0 var(--primary) !important;
}

.home-honor-showcase .home-honor-person > div:nth-child(2) > div:first-child {
  color: var(--hp-text) !important;
}

.home-honor-showcase .home-honor-person > div:nth-child(2) > div:last-child {
  color: var(--hp-text3) !important;
}

.home-honor-showcase .home-honor-person > div:last-child {
  color: var(--primary) !important;
}

.home-honor-showcase .home-honor-dot {
  background: color-mix(in srgb, var(--hp-border) 72%, var(--hp-text4)) !important;
}

.home-honor-showcase .home-honor-dot.is-active {
  background: var(--primary) !important;
}

.home-honor-showcase .home-honor-config {
  background: var(--hp-card) !important;
  border-color: var(--hp-border) !important;
  box-shadow: none !important;
}

.home-honor-showcase .home-honor-config:hover {
  border-color: var(--primary) !important;
  background: var(--honor-soft) !important;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .app-shell .topbar {
    height: 50px;
    padding: 0 12px;
  }

  .app-shell .content {
    padding: 16px 14px 28px !important;
  }

  .app-shell .page {
    max-width: none;
  }

  .app-shell .panel,
  .app-shell .card,
  .app-shell .q-filter-bar,
  .app-shell .form-panel {
    border-radius: 8px !important;
  }

  .home-honor-showcase > div {
    max-width: 100% !important;
  }

  .home-honor-showcase .home-honor-feature {
    min-height: 0 !important;
    padding: 18px !important;
  }

  .home-honor-showcase .home-honor-roster {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
  }

  .home-honor-showcase .home-honor-person {
    min-width: 0;
    grid-template-columns: 38px minmax(0, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
  }

  .home-honor-showcase .home-honor-person > :last-child {
    display: none;
  }

  .home-honor-showcase .home-honor-config {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .app-shell .topbar h1 {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .app-shell .q-table th,
  .app-shell .data-table th,
  .app-shell .q-table td,
  .app-shell .data-table td {
    padding-left: 10px;
    padding-right: 10px;
  }

  .homepage-shell {
    overflow-x: clip;
  }

  .home-honor-showcase .home-honor-roster {
    grid-template-columns: 1fr;
  }

  .home-honor-showcase .home-honor-feature h3 {
    font-size: 28px !important;
  }
}

/* Dashboard: quiet operational workspace */
.dashboard-page {
  max-width: 1320px;
  margin: 0 auto;
}

.dashboard-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.dashboard-page-head h2 {
  margin: 0;
  color: var(--admin-text);
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
}

.dashboard-page-head p {
  margin: 8px 0 0;
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.6;
}

.dashboard-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.dashboard-kpi {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  min-height: 94px;
  padding: 16px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 8px;
  background: var(--admin-card);
  color: var(--admin-text);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.dashboard-kpi:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--admin-border));
  background: color-mix(in srgb, var(--primary) 4%, var(--admin-card));
  box-shadow: 0 8px 20px rgba(15,23,42,.06);
}

.dashboard-kpi-icon,
.dashboard-action-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 10%, var(--admin-card));
  color: var(--primary);
}

.dashboard-kpi-copy,
.dashboard-action-copy {
  display: grid;
  min-width: 0;
}

.dashboard-kpi-copy strong {
  color: var(--admin-text);
  font-size: 25px;
  line-height: 1;
  font-weight: 800;
}

.dashboard-kpi-copy > span {
  margin-top: 6px;
  color: var(--admin-text);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-kpi-copy small,
.dashboard-action-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--admin-muted);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi-arrow {
  color: var(--admin-muted);
}

.dashboard-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr);
  gap: 14px;
  align-items: stretch;
}

.dashboard-section {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 8px;
  background: var(--admin-card);
}

.dashboard-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-section-head h3 {
  margin: 0;
  color: var(--admin-text);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 800;
}

.dashboard-section-head p {
  margin: 5px 0 0;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.5;
}

.dashboard-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-action {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 6px;
  background: transparent;
  color: var(--admin-text);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}

.dashboard-action:hover {
  border-color: color-mix(in srgb, var(--primary) 42%, var(--admin-border));
  background: color-mix(in srgb, var(--primary) 5%, var(--admin-card));
}

.dashboard-action .dashboard-action-icon {
  width: 36px;
  height: 36px;
}

.dashboard-action-copy strong {
  overflow: hidden;
  color: var(--admin-text);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-action > svg {
  color: var(--admin-muted);
}

.dashboard-guide-section {
  display: flex;
  flex-direction: column;
}

.dashboard-guide-list {
  display: grid;
  gap: 14px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.dashboard-guide-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
}

.dashboard-guide-list li > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 12%, var(--admin-card));
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.dashboard-guide-list strong {
  display: block;
  color: var(--admin-text);
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-guide-list small {
  display: block;
  margin-top: 3px;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.55;
}

.dashboard-guide-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  margin-top: auto;
  padding: 0 12px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-guide-link:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--admin-card));
}

/* Studio is the calm default for day-to-day teaching work. */
html[data-hp-theme="studio"],
html.theme-studio {
  --bg: #f4f7fb;
  --bg-card: #ffffff;
  --text: #18263a;
  --text-secondary: #53647a;
  --text-muted: #7b899b;
  --border: #dce5ef;
  --border-light: #eaf0f6;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;
  --primary-light: #eaf2ff;
  --primary-border: #bcd1ff;
  --header-bg: #ffffff;
  --header-text: #18263a;
  --sidebar-bg: #ffffff;
  --sidebar-text: #18263a;
  --sidebar-text-secondary: #64748b;
  --sidebar-hover: #f1f6fb;
  --sidebar-active-bg: #eaf2ff;
  --sidebar-active-text: #1d4ed8;
  --sidebar-active-border: #2563eb;
  --table-header-bg: #f7f9fc;
  --table-row-alt-bg: #fbfcfe;
  --card-bg: #ffffff;
  --bg-secondary: #edf3f8;
  --hp-bg: #f5f8fc;
  --hp-card: #ffffff;
  --hp-text: #18263a;
  --hp-text2: #42556d;
  --hp-text3: #718197;
  --hp-text4: #95a3b4;
  --hp-border: #dce5ef;
  --hp-border2: #d4e0ec;
  --hp-footer-bg: #18263a;
  --hp-footer-text: #9cadc0;
  --hp-nav-bg: rgba(255,255,255,.9);
  --hp-nav-bg-scr: rgba(255,255,255,.98);
  --hp-gradient: linear-gradient(135deg, #2563eb, #16a085);
  --hp-input-bg: #ffffff;
  --admin-bg: #f4f7fb;
  --admin-card: #ffffff;
  --admin-card-soft: #f8fafc;
  --admin-text: #18263a;
  --admin-muted: #64748b;
  --admin-border: #d9e3ee;
  --admin-border-soft: #e8eef5;
  --admin-hover-bg: #f1f6fb;
  --admin-active-bg: #2563eb;
  --admin-active-text: #ffffff;
  --admin-primary-solid: #2563eb;
  --admin-primary-contrast: #ffffff;
  --admin-danger-solid: #dc2626;
  --admin-success-solid: #0f8a5f;
  --admin-warning-solid: #b45309;
}

html[data-hp-theme="studio"] .app-shell .topbar {
  background: #ffffff !important;
  border-bottom-color: var(--admin-border-soft);
}

html[data-hp-theme="studio"] .app-shell .topbar,
html[data-hp-theme="studio"] .app-shell .topbar h1,
html[data-hp-theme="studio"] .app-shell .topbar p,
html[data-hp-theme="studio"] .app-shell .topbar .icon-button,
html[data-hp-theme="studio"] .app-shell .topbar .header-btn {
  color: var(--admin-text) !important;
}

html[data-hp-theme="studio"] .app-shell .topbar .theme-select {
  color: var(--admin-text) !important;
  background: var(--admin-card-soft) !important;
  border-color: var(--admin-border) !important;
}

html[data-hp-theme="studio"] .app-shell .topbar .icon-button:hover,
html[data-hp-theme="studio"] .app-shell .topbar .header-btn:hover {
  background: var(--admin-hover-bg) !important;
  color: var(--admin-primary-solid) !important;
}

html[data-hp-theme="studio"] .topbar-actions .admin-home-btn {
  border-color: var(--admin-border) !important;
  background: var(--admin-card-soft) !important;
  color: var(--admin-text) !important;
}

html[data-hp-theme="studio"] .topbar-actions .admin-home-btn:hover {
  background: var(--admin-hover-bg) !important;
  border-color: var(--admin-primary-solid) !important;
  color: var(--admin-primary-solid) !important;
}

html[data-hp-theme="studio"] .homepage-shell {
  background: var(--hp-bg) !important;
}

/* ===== STUDIO ADMIN SYSTEM =====
   One shell and component family for the high-frequency teaching workflow. */
:root {
  --studio-font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --studio-font-mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  --studio-space-1: 4px;
  --studio-space-2: 8px;
  --studio-space-3: 12px;
  --studio-space-4: 16px;
  --studio-space-5: 24px;
  --studio-space-6: 32px;
  --studio-radius: 8px;
  --studio-radius-sm: 6px;
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--studio-font-sans);
  letter-spacing: 0;
}

code,
pre,
.app-shell .q-table code {
  font-family: var(--studio-font-mono);
  letter-spacing: 0;
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr) !important;
  min-width: 0;
  background: var(--admin-bg) !important;
}

.app-shell > main {
  min-width: 0;
  background: var(--admin-bg) !important;
}

.app-shell .sidebar {
  width: auto;
  background: var(--admin-card) !important;
  border-right: 1px solid var(--admin-border-soft) !important;
  box-shadow: none !important;
}

.app-shell .sidebar .brand {
  min-height: 68px;
  padding: 0 18px;
  border-bottom: 1px solid var(--admin-border-soft) !important;
}

.app-shell .sidebar .brand .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--admin-primary-solid) !important;
  box-shadow: none !important;
}

.app-shell .sidebar .brand strong {
  color: var(--admin-text) !important;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.app-shell .sidebar .brand span {
  display: block;
  margin-top: 3px;
  color: var(--admin-muted) !important;
  font-size: 11px;
  font-weight: 500;
}

.app-shell .sidebar nav {
  gap: 2px;
  padding: 14px 10px 24px;
}

.app-shell .sidebar nav a,
.app-shell .nav-item {
  min-height: 38px;
  margin: 0 !important;
  padding: 0 10px;
  border-radius: var(--studio-radius-sm);
  color: var(--admin-text) !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transform: none !important;
}

.app-shell .sidebar nav a svg,
.app-shell .nav-item svg {
  width: 16px;
  height: 16px;
  color: var(--admin-muted);
  stroke-width: 1.8;
}

.app-shell .sidebar nav a:hover,
.app-shell .nav-item:hover {
  background: var(--admin-hover-bg) !important;
  color: var(--admin-text) !important;
}

.app-shell .sidebar nav a.active,
.app-shell .nav-item.active {
  background: color-mix(in srgb, var(--admin-primary-solid) 10%, var(--admin-card)) !important;
  color: var(--admin-primary-solid) !important;
  font-weight: 800;
}

.app-shell .sidebar nav a.active::before,
.app-shell .nav-item.active::before {
  left: -10px;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--admin-primary-solid) !important;
}

.app-shell .sidebar .nav-group {
  margin: 6px 0;
  padding-top: 6px;
  border-top: 1px solid var(--admin-border-soft);
}

.app-shell .sidebar .nav-group:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.app-shell .sidebar .nav-item-child {
  min-height: 34px;
  color: var(--admin-muted) !important;
  font-size: 12px;
}

.app-shell .sidebar .nav-item-child span {
  padding-left: 30px !important;
}

.app-shell .sidebar .nav-arrow {
  background: transparent !important;
  color: var(--admin-muted) !important;
}

.app-shell .topbar {
  height: 64px;
  padding: 0 32px;
  background: var(--admin-card) !important;
  border-bottom: 1px solid var(--admin-border-soft) !important;
  box-shadow: none !important;
}

.app-shell .topbar > div:first-of-type h1 {
  margin: 0;
  color: var(--admin-text) !important;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.app-shell .topbar > div:first-of-type p {
  display: none;
}

.app-shell .topbar .sidebar-toggle {
  color: var(--admin-text) !important;
}

.app-shell .topbar-actions {
  gap: 6px;
}

.app-shell .topbar .theme-select,
.app-shell .topbar .icon-button,
.app-shell .topbar .header-btn {
  min-height: 34px;
  border-radius: var(--studio-radius-sm);
  color: var(--admin-text) !important;
}

.app-shell .topbar .theme-select {
  padding: 0 9px;
  border: 1px solid var(--admin-border) !important;
  background: var(--admin-card-soft) !important;
  font-size: 12px;
  font-weight: 700;
}

.app-shell .topbar .icon-button,
.app-shell .topbar .header-btn {
  border: 1px solid transparent;
  background: transparent !important;
}

.app-shell .topbar .icon-button:hover,
.app-shell .topbar .header-btn:hover {
  border-color: var(--admin-border-soft);
  background: var(--admin-hover-bg) !important;
  color: var(--admin-primary-solid) !important;
}

.app-shell .topbar .admin-home-btn {
  padding: 0 10px !important;
  border-color: var(--admin-border) !important;
  background: var(--admin-card-soft) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.app-shell .topbar .user-menu-trigger {
  min-height: 34px;
  padding: 3px 8px 3px 3px;
  border: 1px solid transparent;
  border-radius: var(--studio-radius-sm);
  color: var(--admin-text) !important;
}

.app-shell .topbar .user-menu-trigger:hover {
  border-color: var(--admin-border-soft);
  background: var(--admin-hover-bg);
}

.app-shell .content {
  padding: 32px 40px 44px !important;
  background: var(--admin-bg) !important;
}

.app-shell .page,
.app-shell .question-page,
.app-shell .dashboard-page {
  width: min(100%, 1360px);
  margin-left: auto;
  margin-right: auto;
}

.app-shell .page > h2,
.app-shell .admin-page-title {
  margin: 0 0 22px;
  color: var(--admin-text) !important;
  font-size: 28px;
  font-weight: 850;
  line-height: 1.25;
}

.app-shell .panel,
.app-shell .card,
.app-shell .q-filter-bar,
.app-shell .form-panel,
.app-shell .stat-card,
.app-shell .q-table-wrapper,
.app-shell .q-table-wrap {
  border: 1px solid var(--admin-border-soft) !important;
  border-radius: var(--studio-radius) !important;
  box-shadow: none !important;
  animation: none !important;
}

.app-shell .panel:hover,
.app-shell .card:hover,
.app-shell .stat-card:hover {
  box-shadow: none !important;
  transform: none !important;
}

.app-shell .question-page > .q-filter-bar {
  margin-bottom: 10px;
  padding: 12px;
  background: var(--admin-card) !important;
}

.app-shell .question-page > .q-toolbar {
  min-height: 38px;
  margin: 0 0 12px;
  padding: 0 2px;
}

.app-shell .q-filter-row,
.app-shell .q-toolbar {
  gap: 8px;
}

.app-shell input,
.app-shell select,
.app-shell textarea {
  min-height: 38px;
  border: 1px solid var(--admin-border) !important;
  border-radius: var(--studio-radius-sm) !important;
  background: var(--admin-card) !important;
  color: var(--admin-text) !important;
  font-size: 13px;
}

.app-shell input::placeholder,
.app-shell textarea::placeholder {
  color: var(--admin-muted) !important;
}

.app-shell input:focus,
.app-shell select:focus,
.app-shell textarea:focus {
  border-color: var(--admin-primary-solid) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--admin-primary-solid) 14%, transparent) !important;
}

.app-shell .primary-button,
.app-shell .q-btn-primary {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--admin-primary-solid) !important;
  border-radius: var(--studio-radius-sm) !important;
  background: var(--admin-primary-solid) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--admin-primary-solid) 20%, transparent);
  font-size: 13px;
  font-weight: 800;
}

.app-shell .primary-button:hover,
.app-shell .q-btn-primary:hover {
  background: color-mix(in srgb, var(--admin-primary-solid) 88%, #000) !important;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--admin-primary-solid) 25%, transparent);
  transform: translateY(-1px) !important;
}

.app-shell .text-button,
.app-shell .q-btn {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--admin-border) !important;
  border-radius: var(--studio-radius-sm) !important;
  background: var(--admin-card) !important;
  color: var(--admin-text) !important;
  font-size: 13px;
  font-weight: 700;
}

.app-shell .text-button.subtle {
  border-color: transparent !important;
  background: transparent !important;
  color: var(--admin-muted) !important;
}

.app-shell .text-button:hover,
.app-shell .q-btn:hover,
.app-shell .text-button.subtle:hover {
  border-color: color-mix(in srgb, var(--admin-primary-solid) 38%, var(--admin-border)) !important;
  background: color-mix(in srgb, var(--admin-primary-solid) 6%, var(--admin-card)) !important;
  color: var(--admin-primary-solid) !important;
}

.app-shell .q-selected-bar {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--admin-primary-solid) 28%, var(--admin-border)) !important;
  border-radius: var(--studio-radius-sm) !important;
  background: color-mix(in srgb, var(--admin-primary-solid) 7%, var(--admin-card)) !important;
  color: var(--admin-primary-solid) !important;
}

.app-shell .question-page > .panel {
  overflow: hidden;
  padding: 0 !important;
  background: var(--admin-card) !important;
}

.app-shell .q-table-wrap,
.app-shell .q-table-wrapper {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.app-shell .q-table,
.app-shell .data-table {
  border-collapse: separate;
  border-spacing: 0;
  background: transparent !important;
}

.app-shell .q-table thead,
.app-shell .data-table thead,
.app-shell .q-table th,
.app-shell .data-table th {
  background: var(--admin-card-soft) !important;
}

.app-shell .q-table th,
.app-shell .data-table th {
  height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid var(--admin-border) !important;
  color: var(--admin-muted) !important;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
}

.app-shell .q-table td,
.app-shell .data-table td {
  min-height: 54px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--admin-border-soft) !important;
  color: var(--admin-text) !important;
  font-size: 13px;
  line-height: 1.5;
}

.app-shell .q-table tbody tr,
.app-shell .data-table tbody tr {
  background: var(--admin-card) !important;
  transform: none !important;
}

.app-shell .q-table tbody tr:nth-child(even),
.app-shell .data-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--admin-card-soft) 48%, var(--admin-card)) !important;
}

.app-shell .q-table tbody tr:hover,
.app-shell .data-table tbody tr:hover {
  background: color-mix(in srgb, var(--admin-primary-solid) 4%, var(--admin-card)) !important;
}

/* A table action cell should never turn a whole data row into a vertical toolbar. */
.app-shell .paper-actions-cell {
  width: 154px;
  min-width: 154px;
  padding: 8px 12px !important;
  white-space: nowrap;
}

.app-shell .paper-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  min-height: 32px;
}

.app-shell .paper-row-actions .icon-button-sm {
  display: inline-grid;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--admin-muted);
}

.app-shell .paper-row-actions .icon-button-sm:hover {
  border-color: var(--admin-border);
  background: var(--admin-hover-bg);
  color: var(--admin-primary-solid);
}

.app-shell .paper-row-actions .icon-button-sm.danger:hover {
  border-color: color-mix(in srgb, var(--admin-danger-solid) 35%, var(--admin-border));
  background: color-mix(in srgb, var(--admin-danger-solid) 8%, var(--admin-card));
  color: var(--admin-danger-solid);
}

.wrong-practice-panel {
  margin: 0 0 16px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--admin-primary-solid) 22%, var(--admin-border-soft));
  border-radius: var(--studio-radius);
  background: var(--admin-card);
}

.wrong-practice-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.wrong-practice-head h3 {
  margin: 0;
  color: var(--admin-text);
  font-size: 15px;
  font-weight: 800;
}

.wrong-practice-head p {
  margin: 5px 0 0;
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.6;
}

.wrong-practice-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--admin-border-soft);
  border-radius: 7px;
}

.wrong-practice-overview > div {
  min-height: 62px;
  padding: 10px 14px;
  border-right: 1px solid var(--admin-border-soft);
  background: var(--admin-card-soft);
}

.wrong-practice-overview > div:last-child { border-right: 0; }

.wrong-practice-overview strong,
.wrong-practice-overview span {
  display: block;
}

.wrong-practice-overview strong {
  color: var(--admin-text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.wrong-practice-overview span {
  margin-top: 4px;
  color: var(--admin-muted);
  font-size: 11px;
  font-weight: 700;
}

.wrong-practice-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wrong-practice-controls select {
  min-width: 170px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: var(--admin-card);
  color: var(--admin-text);
  font-size: 13px;
}

.wrong-practice-controls .primary-button { margin-left: auto; }

.wrong-practice-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.wrong-practice-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 7px;
  background: var(--admin-card);
  color: var(--admin-text);
  text-align: left;
  cursor: pointer;
}

.wrong-practice-group:hover,
.wrong-practice-group.active {
  border-color: color-mix(in srgb, var(--admin-primary-solid) 45%, var(--admin-border));
  background: color-mix(in srgb, var(--admin-primary-solid) 5%, var(--admin-card));
}

.wrong-practice-group span,
.wrong-practice-group strong,
.wrong-practice-group em { display: block; }
.wrong-practice-group span { color: var(--admin-primary-solid); font-size: 11px; font-weight: 800; }
.wrong-practice-group strong { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.wrong-practice-group em { margin-top: 4px; color: var(--admin-muted); font-size: 11px; font-style: normal; }

.wrong-practice-recent {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--admin-border-soft);
}

.wrong-practice-recent > span { color: var(--admin-muted); font-size: 12px; font-weight: 800; }
.wrong-practice-recent p { margin: 0 0 6px; color: var(--admin-text); font-size: 12px; line-height: 1.5; }
.wrong-practice-recent b { color: var(--admin-primary-solid); }
.wrong-practice-recent small { margin-left: 6px; color: var(--admin-muted); }

.wrong-practice-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 72px;
  color: var(--admin-muted);
  font-size: 13px;
}

.wrong-practice-empty.success { color: var(--admin-success-solid); }

@media (max-width: 760px) {
  .wrong-practice-panel { padding: 14px; }
  .wrong-practice-head { flex-direction: column; gap: 8px; }
  .wrong-practice-overview { grid-template-columns: 1fr; }
  .wrong-practice-overview > div { min-height: 54px; border-right: 0; border-bottom: 1px solid var(--admin-border-soft); }
  .wrong-practice-overview > div:last-child { border-bottom: 0; }
  .wrong-practice-controls { align-items: stretch; }
  .wrong-practice-controls select,
  .wrong-practice-controls .primary-button { width: 100%; margin-left: 0; }
  .wrong-practice-groups { grid-template-columns: 1fr; }
  .wrong-practice-recent { grid-template-columns: 1fr; gap: 6px; }
}

.app-shell .q-pagination {
  min-height: 64px;
  padding: 12px 16px;
  border-top: 1px solid var(--admin-border-soft);
  color: var(--admin-muted);
}

.app-shell .badge,
.app-shell .tag,
.app-shell .q-type-tag {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 22px;
}

.app-shell .modal-backdrop,
.app-shell .q-form-modal,
.app-shell .drawer-backdrop {
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(4px);
}

.app-shell .modal,
.app-shell .modal-card,
.app-shell .q-form-card,
.app-shell .drawer {
  border: 1px solid var(--admin-border-soft) !important;
  border-radius: 10px !important;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16) !important;
}

.dashboard-page-head {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--admin-border-soft);
}

.dashboard-page-head h2 {
  font-size: 30px;
  font-weight: 850;
}

.dashboard-page-head p {
  font-size: 14px;
}

.dashboard-kpi-grid {
  gap: 12px;
}

.dashboard-kpi {
  min-height: 88px;
  border-radius: var(--studio-radius);
}

.dashboard-section {
  border-radius: var(--studio-radius);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 208px minmax(0, 1fr) !important;
  }

  .app-shell .content {
    padding: 24px !important;
  }

  .app-shell .topbar {
    padding: 0 20px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .app-shell > .sidebar {
    width: 270px !important;
  }

  .app-shell .topbar {
    height: 56px;
    padding: 0 14px;
  }

  .app-shell .content {
    padding: 20px 14px 30px !important;
  }

  .app-shell .topbar .theme-select,
  .app-shell .topbar .admin-home-btn .header-text-label,
  .app-shell .topbar .user-name {
    display: none;
  }

  .app-shell .q-filter-row > input,
  .app-shell .q-filter-row > select {
    flex: 1 1 160px;
    width: auto !important;
  }
}

@media (max-width: 600px) {
  .app-shell .page > h2,
  .app-shell .admin-page-title,
  .dashboard-page-head h2 {
    font-size: 24px;
  }

  .app-shell .question-page > .q-filter-bar {
    padding: 10px;
  }

  .app-shell .q-filter-row > input,
  .app-shell .q-filter-row > select,
  .app-shell .q-filter-row > button {
    flex: 1 1 100%;
    width: 100% !important;
  }

  .app-shell .q-toolbar {
    align-items: stretch;
  }

  .app-shell .q-toolbar .primary-button,
  .app-shell .q-toolbar .text-button {
    flex: 1;
  }

  .app-shell .q-table th,
  .app-shell .q-table td {
    padding-left: 11px;
    padding-right: 11px;
  }
}

@media (max-width: 980px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-workspace {
    grid-template-columns: 1fr;
  }

  .dashboard-guide-link {
    margin-top: 18px;
  }
}

@media (max-width: 600px) {
  .dashboard-page-head {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 18px;
  }

  .dashboard-page-head h2 {
    font-size: 22px;
  }

  .dashboard-head-actions {
    width: 100%;
  }

  .dashboard-head-actions button {
    flex: 1;
  }

  .dashboard-kpi-grid,
  .dashboard-action-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-kpi {
    min-height: 78px;
  }
}

/* Desktop app shell: keep navigation stationary and scroll only the work area. */
@media (min-width: 901px) {
  .app-shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell > main {
    display: grid;
    grid-template-rows: 64px minmax(0, 1fr);
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell .sidebar {
    position: relative !important;
    top: auto !important;
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .app-shell .sidebar nav {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .app-shell .content {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Homepage theme switch */
.hp-theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--hp-border);
  border-radius: 8px;
  background: var(--hp-card);
  color: var(--hp-text);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .08);
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.hp-theme-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--hp-card));
  transform: translateY(-1px);
}

.hp-theme-toggle:focus-visible,
.certificate-stage-controls button:focus-visible,
.certificate-thumbnail:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* Honor gallery driven entirely by honor-wall configuration images. */
.certificate-hall {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--hp-border);
  border-bottom: 1px solid var(--hp-border);
  background: color-mix(in srgb, var(--primary) 5%, var(--hp-bg));
}

.certificate-hall-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.certificate-hall-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.certificate-hall-overline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b7791f;
  font-size: 12px;
  font-weight: 850;
}

.certificate-hall-head h2 {
  margin: 8px 0 5px;
  color: var(--hp-text);
  font-size: 38px;
  line-height: 1.12;
  font-weight: 850;
  letter-spacing: 0;
}

.certificate-hall-head p {
  margin: 0;
  color: var(--hp-text2);
  font-size: 14px;
  line-height: 1.65;
}

.certificate-hall-count {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: var(--hp-text3);
  font-variant-numeric: tabular-nums;
}

.certificate-hall-count strong {
  color: var(--hp-text);
  font-size: 26px;
  line-height: 1;
}

.certificate-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(270px, .7fr);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--hp-border);
  border-radius: 8px;
  background: var(--hp-card);
  box-shadow: 0 22px 52px rgba(15, 23, 42, .13);
}

.certificate-stage-media {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 520px;
  padding: 28px;
  overflow: hidden;
  background: #eef2f7;
}

html[data-hp-theme="tech"] .certificate-stage-media,
html[data-hp-theme="starry"] .certificate-stage-media {
  background: #111b2b;
}

.certificate-stage-media > a {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.certificate-stage-media img {
  display: block;
  width: 100%;
  height: 464px;
  object-fit: contain;
  object-position: center;
  color: transparent;
  filter: drop-shadow(0 15px 21px rgba(15, 23, 42, .18));
  transition: transform .35s ease, opacity .2s ease;
}

.certificate-stage-media a:hover img {
  transform: scale(1.015);
}

.certificate-stage-media img.is-error {
  opacity: .12;
}

.certificate-stage-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding: 38px 34px;
  border-left: 1px solid var(--hp-border);
}

.certificate-type {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, #d99a24 45%, var(--hp-border));
  border-radius: 5px;
  background: color-mix(in srgb, #f5c451 13%, var(--hp-card));
  color: #a56710;
  font-size: 11px;
  font-weight: 800;
}

.certificate-stage-info h3 {
  max-width: 100%;
  margin: 17px 0 10px;
  overflow-wrap: anywhere;
  color: var(--hp-text);
  font-size: 27px;
  line-height: 1.3;
  font-weight: 850;
  letter-spacing: 0;
}

.certificate-stage-info p {
  margin: 0;
  color: var(--hp-text2);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.certificate-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 18px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.certificate-stage-controls {
  display: flex;
  gap: 8px;
  margin-top: 28px;
}

.certificate-stage-controls button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--hp-border);
  border-radius: 7px;
  background: var(--hp-card);
  color: var(--hp-text);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.certificate-stage-controls button:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--hp-card));
}

.certificate-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding: 2px 2px 9px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--hp-border2) transparent;
}

.certificate-thumbnail {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  flex: 0 0 220px;
  gap: 1px 10px;
  min-width: 0;
  height: 76px;
  padding: 7px;
  scroll-snap-align: start;
  overflow: hidden;
  border: 1px solid var(--hp-border);
  border-radius: 7px;
  background: var(--hp-card);
  color: var(--hp-text);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.certificate-thumbnail:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 60%, var(--hp-border));
}

.certificate-thumbnail.is-active {
  border-color: #d99a24;
  background: color-mix(in srgb, #f5c451 9%, var(--hp-card));
  box-shadow: inset 0 -3px 0 #d99a24;
}

.certificate-thumbnail img {
  grid-row: 1 / 3;
  width: 74px;
  height: 60px;
  object-fit: contain;
  border-radius: 4px;
  background: color-mix(in srgb, var(--hp-bg) 80%, #fff);
}

.certificate-thumbnail span,
.certificate-thumbnail small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certificate-thumbnail span {
  align-self: end;
  font-size: 12px;
  font-weight: 750;
}

.certificate-thumbnail small {
  align-self: start;
  color: var(--hp-text3);
  font-size: 10px;
}

.certificate-hall-empty {
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: 40px 20px;
  border: 1px dashed var(--hp-border2);
  border-radius: 8px;
  background: var(--hp-card);
  color: var(--hp-text3);
  text-align: center;
}

.certificate-hall-empty > div {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: color-mix(in srgb, #f5c451 15%, var(--hp-card));
  color: #a56710;
}

.certificate-hall-empty strong {
  margin-top: 14px;
  color: var(--hp-text);
  font-size: 17px;
}

.certificate-hall-empty span {
  margin-top: 6px;
  font-size: 13px;
}

/* Competitive ranking surface. */
.live-ranking-section {
  position: relative;
  overflow: hidden;
  color: #f8fafc;
  border-top: 1px solid #1b2e45;
  border-bottom: 1px solid #1b2e45;
  background: #07111f;
}

.live-ranking-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  background-image: linear-gradient(rgba(79, 209, 197, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 209, 197, .08) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.live-ranking-inner {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.live-ranking-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.live-ranking-overline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5eead4;
  font-size: 12px;
  font-weight: 850;
}

.live-ranking-overline i {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid rgba(74, 222, 128, .42);
  border-radius: 4px;
  color: #86efac;
  font-size: 10px;
  font-style: normal;
}

.live-ranking-overline i::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 9px rgba(74, 222, 128, .8);
  animation: liveRankPulse 1.8s ease-in-out infinite;
}

.live-ranking-head h2 {
  margin: 8px 0 5px;
  color: #f8fafc;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: 0;
}

.live-ranking-head p {
  margin: 0;
  color: #8ea1b8;
  font-size: 14px;
  line-height: 1.6;
}

.live-ranking-meta {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: end;
  gap: 0 7px;
  text-align: right;
}

.live-ranking-meta strong {
  color: #5eead4;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.live-ranking-meta span {
  color: #c3cfdd;
  font-size: 12px;
}

.live-ranking-meta small {
  grid-column: 1 / 3;
  margin-top: 2px;
  color: #718399;
  font-size: 10px;
}

.live-ranking-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.live-podium-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 12px;
  min-height: 164px;
  padding: 24px 18px 17px;
  overflow: hidden;
  border: 1px solid #263b53;
  border-radius: 8px;
  background: #0d1b2c;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}

.live-podium-card.rank-1 {
  min-height: 184px;
  border-color: rgba(250, 204, 21, .62);
  background: #172033;
  box-shadow: inset 0 3px 0 #facc15, 0 18px 42px rgba(0, 0, 0, .28);
}

.live-podium-card.rank-2 {
  box-shadow: inset 0 3px 0 #a7b4c5, 0 16px 34px rgba(0, 0, 0, .22);
}

.live-podium-card.rank-3 {
  box-shadow: inset 0 3px 0 #e58b4a, 0 16px 34px rgba(0, 0, 0, .22);
}

.live-podium-rank {
  position: absolute;
  top: 12px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #718399;
  font-size: 9px;
  font-weight: 800;
}

.live-podium-rank strong {
  color: #d8e2ed;
  font-size: 19px;
  line-height: 1;
}

.rank-1 .live-podium-rank,
.rank-1 .live-podium-rank strong {
  color: #facc15;
}

.live-rank-avatar {
  display: block;
  flex: 0 0 auto;
  border: 2px solid #3a516c;
  border-radius: 50%;
  object-fit: cover;
  background: #15263a;
}

.rank-1 .live-rank-avatar {
  border-color: #facc15;
  box-shadow: 0 0 0 5px rgba(250, 204, 21, .1);
}

.live-rank-initial {
  display: grid;
  place-items: center;
  color: #e6fffb;
  font-size: 18px;
  font-weight: 850;
}

.live-podium-person {
  min-width: 0;
}

.live-podium-person h3 {
  margin: 0;
  overflow: hidden;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-podium-person span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #8295ab;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-podium-score {
  align-self: end;
  text-align: right;
}

.live-podium-score strong {
  display: block;
  color: #5eead4;
  font-size: 25px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.rank-1 .live-podium-score strong {
  color: #facc15;
}

.live-podium-score span {
  display: block;
  margin-top: 4px;
  color: #718399;
  font-size: 9px;
}

.live-podium-stats {
  grid-column: 1 / 4;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #22364d;
}

.live-podium-stats span {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: #718399;
  font-size: 10px;
}

.live-podium-stats strong {
  color: #dce6f1;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.live-ranking-table {
  overflow: hidden;
  border: 1px solid #1e334a;
  border-radius: 8px;
  background: rgba(10, 24, 40, .9);
}

.live-ranking-labels,
.live-ranking-row {
  display: grid;
  grid-template-columns: 56px minmax(170px, 1.5fr) minmax(70px, .55fr) minmax(90px, .65fr) minmax(90px, .65fr);
  align-items: center;
  gap: 14px;
}

.live-ranking-labels {
  min-height: 34px;
  padding: 0 16px;
  color: #64778e;
  font-size: 10px;
}

.live-ranking-labels span:not(:nth-child(2)) {
  text-align: right;
}

.live-ranking-row {
  min-height: 66px;
  padding: 7px 16px;
  border-top: 1px solid #1a2d43;
  transition: background .16s ease, border-color .16s ease;
}

.live-ranking-row:hover {
  background: #10263b;
  border-color: #28516a;
}

.live-row-rank {
  color: #718399;
  font-size: 17px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.live-row-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.live-row-person > div:last-child {
  min-width: 0;
}

.live-row-person strong,
.live-row-person span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-row-person strong {
  color: #e7eef7;
  font-size: 13px;
}

.live-row-person span {
  margin-top: 3px;
  color: #718399;
  font-size: 10px;
}

.live-row-stat,
.live-row-score {
  color: #7e91a8;
  font-size: 10px;
  text-align: right;
}

.live-row-stat strong,
.live-row-score strong {
  color: #dbe6f2;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.live-row-stat span,
.live-row-score span {
  margin-left: 3px;
}

.live-row-accuracy strong {
  color: #86efac;
}

.live-row-score strong {
  color: #5eead4;
  font-size: 17px;
}

.live-ranking-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 180px;
  border: 1px dashed #2b425b;
  border-radius: 8px;
  color: #8295ab;
  font-size: 13px;
}

@keyframes liveRankPulse {
  0%, 100% { opacity: .55; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 900px) {
  .certificate-stage {
    grid-template-columns: minmax(0, 1fr) 230px;
    min-height: 420px;
  }

  .certificate-stage-media {
    min-height: 420px;
    padding: 18px;
  }

  .certificate-stage-media img {
    height: 384px;
  }

  .certificate-stage-info {
    padding: 25px 21px;
  }

  .live-podium-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    padding: 24px 13px 14px;
  }

  .live-podium-score {
    grid-column: 1 / 3;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }

  .live-podium-stats {
    grid-column: 1 / 3;
  }
}

@media (max-width: 700px) {
  .hp-theme-toggle {
    width: 36px;
    height: 36px;
  }

  .certificate-hall-head,
  .live-ranking-head {
    align-items: flex-start;
  }

  .certificate-hall-head h2,
  .live-ranking-head h2 {
    font-size: 26px;
  }

  .certificate-hall-head p,
  .live-ranking-head p {
    font-size: 12px;
  }

  .certificate-hall-count {
    padding-top: 20px;
  }

  .certificate-hall-count strong {
    font-size: 20px;
  }

  .certificate-stage {
    display: block;
    min-height: 0;
  }

  .certificate-stage-media {
    min-height: 0;
    padding: 12px;
    aspect-ratio: 4 / 3;
  }

  .certificate-stage-media img {
    height: 100%;
    max-height: none;
  }

  .certificate-stage-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
    padding: 17px;
    border-top: 1px solid var(--hp-border);
    border-left: 0;
  }

  .certificate-type,
  .certificate-stage-info h3,
  .certificate-stage-info p,
  .certificate-detail-link {
    grid-column: 1 / 3;
  }

  .certificate-stage-info h3 {
    margin: 11px 0 5px;
    font-size: 19px;
  }

  .certificate-stage-info p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .certificate-detail-link {
    margin-top: 10px;
  }

  .certificate-stage-controls {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
  }

  .certificate-stage-controls button {
    width: 34px;
    height: 34px;
  }

  .certificate-thumbnail {
    flex-basis: 184px;
    grid-template-columns: 62px minmax(0, 1fr);
    height: 68px;
  }

  .certificate-thumbnail img {
    width: 62px;
    height: 52px;
  }

  .live-ranking-meta {
    padding-top: 19px;
  }

  .live-ranking-meta strong {
    font-size: 21px;
  }

  .live-ranking-meta span {
    display: none;
  }

  .live-ranking-meta small {
    grid-column: 1;
  }

  .live-ranking-podium {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .live-podium-card,
  .live-podium-card.rank-1 {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto;
    min-height: 82px;
    padding: 14px 13px;
  }

  .live-podium-card.rank-1 {
    order: -1;
  }

  .live-podium-rank {
    top: 9px;
    right: 10px;
  }

  .live-podium-score {
    grid-column: auto;
    display: block;
    align-self: center;
  }

  .live-podium-score strong {
    font-size: 20px;
  }

  .live-podium-stats {
    display: none;
  }

  .live-ranking-row {
    grid-template-columns: 38px minmax(0, 1fr) 58px;
    gap: 9px;
    min-height: 60px;
    padding: 7px 10px;
  }

  .live-row-rank {
    font-size: 14px;
    text-align: center;
  }

  .live-row-score strong {
    display: block;
    font-size: 15px;
  }

  .live-row-score span {
    display: block;
    margin: 2px 0 0;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-ranking-overline i::before {
    animation: none;
  }
}

/* Digital arena ranking refinements. */
.live-ranking-section {
  --live-cyan: #35f2d0;
  --live-blue: #4eb4ff;
  --live-lime: #b7f34a;
  --live-gold: #ffc857;
  isolation: isolate;
  border-color: rgba(53, 242, 208, .28);
  background-color: #050708;
  background-image:
    linear-gradient(115deg, rgba(53, 242, 208, .055), transparent 34%),
    linear-gradient(290deg, rgba(78, 180, 255, .05), transparent 30%);
}

.live-ranking-section::before {
  opacity: .72;
  background-image:
    linear-gradient(rgba(53, 242, 208, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 242, 208, .055) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px, 12px 12px, 12px 12px;
  mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
}

.live-ranking-section::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: -18%;
  bottom: -18%;
  left: 10%;
  width: 1px;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(53, 242, 208, .7), transparent);
  box-shadow: 360px 0 rgba(53, 242, 208, .13), 720px 0 rgba(78, 180, 255, .12), 1080px 0 rgba(53, 242, 208, .1);
  transform: rotate(18deg);
}

.live-ranking-inner {
  width: min(1220px, 100%);
}

.live-ranking-head {
  position: relative;
  align-items: center;
  margin-bottom: 38px;
  padding: 0 0 22px 18px;
  border-bottom: 1px solid rgba(53, 242, 208, .22);
}

.live-ranking-head::before,
.live-ranking-head::after {
  content: "";
  position: absolute;
  bottom: -2px;
  height: 3px;
  background: var(--live-cyan);
  box-shadow: 0 0 16px rgba(53, 242, 208, .65);
}

.live-ranking-head::before {
  left: 0;
  width: 108px;
}

.live-ranking-head::after {
  right: 0;
  width: 8px;
}

.live-ranking-overline {
  color: var(--live-cyan);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0;
}

.live-ranking-overline i {
  border-color: rgba(183, 243, 74, .58);
  border-radius: 2px;
  color: var(--live-lime);
  background: rgba(183, 243, 74, .07);
}

.live-ranking-overline i::before {
  background: var(--live-lime);
  box-shadow: 0 0 12px rgba(183, 243, 74, .9);
}

.live-ranking-head h2 {
  font-size: 38px;
  font-weight: 900;
  text-shadow: 0 0 24px rgba(78, 180, 255, .15);
}

.live-ranking-head p {
  color: #a9b3b8;
}

.live-ranking-meta {
  min-width: 190px;
  padding: 13px 16px 12px 20px;
  border: 1px solid rgba(78, 180, 255, .26);
  background: rgba(8, 14, 17, .86);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 12px);
}

.live-ranking-meta strong {
  color: var(--live-cyan);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  text-shadow: 0 0 16px rgba(53, 242, 208, .35);
}

.live-ranking-meta span {
  color: #d4dcdf;
}

.live-ranking-podium {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 20px;
}

.live-podium-card {
  grid-template-rows: auto 5px auto;
  min-height: 190px;
  border-color: rgba(78, 180, 255, .34);
  border-radius: 2px;
  background: linear-gradient(145deg, rgba(15, 24, 28, .98), rgba(7, 11, 13, .98));
  box-shadow: inset 0 1px rgba(255, 255, 255, .04), 0 18px 40px rgba(0, 0, 0, .35);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.live-podium-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 2px;
  background: var(--live-blue);
  box-shadow: 0 0 14px rgba(78, 180, 255, .65);
}

.live-podium-card.rank-1 {
  order: 2;
  min-height: 214px;
  transform: translateY(-14px);
  border-color: rgba(255, 200, 87, .66);
  background: linear-gradient(145deg, rgba(31, 29, 17, .96), rgba(10, 12, 12, .98) 65%);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 87, .12), 0 0 28px rgba(255, 200, 87, .08), 0 22px 46px rgba(0, 0, 0, .42);
}

.live-podium-card.rank-1::before {
  width: 58%;
  background: var(--live-gold);
  box-shadow: 0 0 16px rgba(255, 200, 87, .72);
}

.live-podium-card.rank-2 {
  order: 1;
  box-shadow: inset 0 2px 0 #b9c7cd, 0 18px 40px rgba(0, 0, 0, .35);
}

.live-podium-card.rank-3 {
  order: 3;
  box-shadow: inset 0 2px 0 #ff8f4d, 0 18px 40px rgba(0, 0, 0, .35);
}

.live-podium-rank {
  top: 14px;
  right: 16px;
  color: #7f9299;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.live-podium-rank strong {
  color: #eef7f8;
  font-size: 22px;
}

.rank-1 .live-podium-rank,
.rank-1 .live-podium-rank strong {
  color: var(--live-gold);
}

.live-rank-avatar {
  border-color: rgba(78, 180, 255, .72);
  box-shadow: 0 0 0 4px rgba(78, 180, 255, .08), 0 0 20px rgba(78, 180, 255, .12);
}

.rank-1 .live-rank-avatar {
  border-color: var(--live-gold);
  box-shadow: 0 0 0 5px rgba(255, 200, 87, .1), 0 0 24px rgba(255, 200, 87, .18);
}

.live-podium-person h3 {
  font-size: 17px;
}

.live-podium-person span {
  color: #7f9299;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.live-podium-score strong {
  color: var(--live-cyan);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 27px;
  text-shadow: 0 0 16px rgba(53, 242, 208, .28);
}

.rank-1 .live-podium-score strong {
  color: var(--live-gold);
  text-shadow: 0 0 16px rgba(255, 200, 87, .3);
}

.live-podium-meter {
  grid-column: 1 / 4;
  grid-row: 2;
  align-self: center;
}

.live-podium-meter i {
  display: block;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
}

.live-podium-meter b {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--live-blue), var(--live-cyan));
  box-shadow: 0 0 10px rgba(53, 242, 208, .65);
}

.rank-1 .live-podium-meter b {
  background: linear-gradient(90deg, #ff9f43, var(--live-gold));
  box-shadow: 0 0 10px rgba(255, 200, 87, .65);
}

.live-podium-stats {
  grid-row: 3;
  border-color: rgba(255, 255, 255, .09);
}

.live-podium-stats span {
  color: #7f9299;
}

.live-podium-stats strong {
  color: #edf6f7;
}

.live-ranking-table {
  border-color: rgba(53, 242, 208, .24);
  border-radius: 2px;
  background: rgba(6, 11, 13, .94);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .28);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.live-ranking-labels {
  min-height: 40px;
  color: #71858c;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: rgba(53, 242, 208, .035);
  border-bottom: 1px solid rgba(53, 242, 208, .15);
}

.live-ranking-row {
  position: relative;
  min-height: 70px;
  border-color: rgba(255, 255, 255, .065);
  background: linear-gradient(90deg, rgba(78, 180, 255, .028), transparent 42%);
}

.live-ranking-row::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 2px;
  background: rgba(78, 180, 255, .48);
  box-shadow: 0 0 9px rgba(78, 180, 255, .38);
}

.live-ranking-row::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--rank-score, 0%);
  height: 1px;
  background: linear-gradient(90deg, rgba(78, 180, 255, .65), rgba(53, 242, 208, .32), transparent);
}

.live-ranking-row > * {
  position: relative;
  z-index: 1;
}

.live-ranking-row:hover {
  background: linear-gradient(90deg, rgba(53, 242, 208, .085), rgba(78, 180, 255, .035) 58%, transparent);
  border-color: rgba(53, 242, 208, .22);
}

.live-row-rank,
.live-row-score strong {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.live-row-rank {
  color: #77929b;
}

.live-row-person strong {
  color: #f3f7f7;
}

.live-row-person span {
  color: #74878e;
}

.live-row-accuracy strong {
  color: var(--live-lime);
}

.live-row-score strong {
  color: var(--live-cyan);
  text-shadow: 0 0 12px rgba(53, 242, 208, .22);
}

.live-ranking-empty {
  border-color: rgba(53, 242, 208, .3);
  border-radius: 2px;
  color: #96a7ac;
  background: rgba(7, 12, 14, .72);
}

@media (max-width: 900px) {
  .live-podium-card {
    grid-template-rows: auto 5px auto;
  }

  .live-podium-meter {
    grid-column: 1 / 3;
  }
}

@media (max-width: 700px) {
  .live-ranking-head {
    margin-bottom: 24px;
    padding-left: 10px;
  }

  .live-ranking-head h2 {
    font-size: 28px;
  }

  .live-ranking-meta {
    min-width: 72px;
    padding: 10px 11px;
  }

  .live-ranking-podium {
    gap: 9px;
  }

  .live-podium-card,
  .live-podium-card.rank-1 {
    min-height: 92px;
    transform: none;
  }

  .live-podium-card.rank-1 { order: 1; }
  .live-podium-card.rank-2 { order: 2; }
  .live-podium-card.rank-3 { order: 3; }

  .live-podium-meter,
  .live-podium-stats {
    display: none;
  }

  .live-ranking-row {
    min-height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-ranking-section::after {
    animation: none;
  }
}

/* Final admin contrast fixes for dark themed management pages. */
.app-shell code {
  display: inline-block;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--admin-border-soft);
  border-radius: 5px;
  background: color-mix(in srgb, var(--admin-card-soft) 72%, var(--admin-bg));
  color: var(--admin-text) !important;
  line-height: 1.55;
  word-break: break-all;
}

.app-shell .q-type-tag,
.app-shell .tag,
.app-shell .lls-note-card-cat {
  background: color-mix(in srgb, var(--admin-primary-solid) 10%, var(--admin-card)) !important;
  border-color: color-mix(in srgb, var(--admin-primary-solid) 30%, var(--admin-border)) !important;
  color: var(--admin-primary-solid) !important;
}

.app-shell .badge-green {
  background: color-mix(in srgb, var(--admin-success-solid) 12%, var(--admin-card)) !important;
  border-color: color-mix(in srgb, var(--admin-success-solid) 34%, var(--admin-border)) !important;
  color: var(--admin-success-solid) !important;
}

.app-shell .badge-gray {
  background: color-mix(in srgb, var(--admin-muted) 12%, var(--admin-card)) !important;
  border-color: var(--admin-border) !important;
  color: var(--admin-muted) !important;
}

.app-shell .badge-orange {
  background: color-mix(in srgb, var(--admin-warning-solid) 13%, var(--admin-card)) !important;
  border-color: color-mix(in srgb, var(--admin-warning-solid) 36%, var(--admin-border)) !important;
  color: var(--admin-warning-solid) !important;
}

.app-shell .badge-red {
  background: color-mix(in srgb, var(--admin-danger-solid) 12%, var(--admin-card)) !important;
  border-color: color-mix(in srgb, var(--admin-danger-solid) 36%, var(--admin-border)) !important;
  color: var(--admin-danger-solid) !important;
}

.app-shell .badge-blue,
.app-shell .badge-purple {
  background: color-mix(in srgb, var(--admin-primary-solid) 12%, var(--admin-card)) !important;
  border-color: color-mix(in srgb, var(--admin-primary-solid) 36%, var(--admin-border)) !important;
  color: var(--admin-primary-solid) !important;
}

.app-shell .file-type-badge {
  min-height: 22px;
  padding: 2px 8px !important;
  border: 1px solid var(--admin-border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
}

.app-shell .file-type-1 {
  background: color-mix(in srgb, #f59e0b 14%, var(--admin-card)) !important;
  border-color: color-mix(in srgb, #f59e0b 38%, var(--admin-border)) !important;
  color: #f59e0b !important;
}

.app-shell .file-type-2 {
  background: color-mix(in srgb, #ef4444 13%, var(--admin-card)) !important;
  border-color: color-mix(in srgb, #ef4444 36%, var(--admin-border)) !important;
  color: #ef4444 !important;
}

.app-shell .file-type-3 {
  background: color-mix(in srgb, #a855f7 13%, var(--admin-card)) !important;
  border-color: color-mix(in srgb, #a855f7 36%, var(--admin-border)) !important;
  color: #a855f7 !important;
}

.app-shell .file-type-4 {
  background: color-mix(in srgb, #14b8a6 13%, var(--admin-card)) !important;
  border-color: color-mix(in srgb, #14b8a6 36%, var(--admin-border)) !important;
  color: #14b8a6 !important;
}

.app-shell .file-type-5 {
  background: color-mix(in srgb, var(--admin-success-solid) 13%, var(--admin-card)) !important;
  border-color: color-mix(in srgb, var(--admin-success-solid) 36%, var(--admin-border)) !important;
  color: var(--admin-success-solid) !important;
}

.app-shell .file-type-6 {
  background: color-mix(in srgb, #3b82f6 14%, var(--admin-card)) !important;
  border-color: color-mix(in srgb, #3b82f6 38%, var(--admin-border)) !important;
  color: #3b82f6 !important;
}

.app-shell .file-type-other {
  background: color-mix(in srgb, var(--admin-muted) 12%, var(--admin-card)) !important;
  border-color: var(--admin-border) !important;
  color: var(--admin-muted) !important;
}

.app-shell .q-table td:has(> .q-stem-cell) {
  display: none !important;
}

/* Homepage learning ranking */
.learning-rank-section {
  color: #18263a;
  background: #eef3f8;
  letter-spacing: 0;
}

.learning-rank-inner {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.learning-rank-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #d5e0eb;
}

.learning-rank-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.learning-rank-title-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: #2563eb;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .22);
}

.learning-rank-live {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: #52657c;
  font-size: 12px;
  font-weight: 700;
}

.learning-rank-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a085;
  box-shadow: 0 0 0 4px rgba(22, 160, 133, .12);
}

.learning-rank-title h2 {
  margin: 0;
  color: #132238;
  font-size: 30px;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0;
}

.learning-rank-title p {
  margin: 6px 0 0;
  color: #66788f;
  font-size: 13px;
  line-height: 1.55;
}

.learning-rank-meta {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 1px 7px;
  flex: 0 0 auto;
  text-align: right;
}

.learning-rank-meta strong {
  color: #2563eb;
  font-size: 28px;
  font-weight: 850;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.learning-rank-meta span {
  color: #52657c;
  font-size: 12px;
  font-weight: 700;
}

.learning-rank-meta small {
  grid-column: 1 / 3;
  margin-top: 4px;
  color: #8695a7;
  font-size: 10px;
}

.learning-rank-layout {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  align-items: start;
  gap: 22px;
}

.learning-rank-subhead {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.learning-rank-subhead strong {
  color: #24364d;
  font-size: 14px;
  font-weight: 800;
}

.learning-rank-subhead span {
  color: #8190a3;
  font-size: 10px;
  font-weight: 750;
}

.learning-rank-podium-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.learning-rank-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 15px;
  overflow: hidden;
  border: 1px solid #d5e0eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(25, 52, 82, .07);
}

.learning-rank-card.place-1 {
  grid-column: 1 / 3;
  min-height: 188px;
  padding: 26px 24px 20px;
  border-color: #213c60;
  color: #ffffff;
  background: linear-gradient(135deg, #10233c 0%, #173b63 58%, #0f6b78 100%);
  box-shadow: 0 18px 36px rgba(16, 35, 60, .2);
}

.learning-rank-card.place-2 {
  border-top: 3px solid #7f93a8;
}

.learning-rank-card.place-3 {
  border-top: 3px solid #d1763e;
}

.learning-rank-place {
  position: absolute;
  top: 12px;
  right: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7f93a8;
}

.learning-rank-place strong {
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.place-1 .learning-rank-place {
  top: 17px;
  right: 19px;
  color: #ffd166;
}

.place-3 .learning-rank-place {
  color: #d1763e;
}

.learning-rank-avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border: 2px solid #c9d7e6;
  border-radius: 50%;
  color: #1d4ed8;
  background: #eaf2ff;
  font-size: 17px;
  font-weight: 850;
}

.learning-rank-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.place-1 .learning-rank-avatar {
  border-color: #ffd166;
  color: #ffffff;
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 6px rgba(255, 209, 102, .11);
}

.learning-rank-card-person {
  min-width: 0;
}

.learning-rank-card-person h3 {
  margin: 0;
  overflow: hidden;
  color: #1c2e44;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-rank-card-person span {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #7b8b9f;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-1 .learning-rank-card-person h3 {
  color: #ffffff;
  font-size: 22px;
}

.place-1 .learning-rank-card-person span {
  color: #b9ccdf;
  font-size: 11px;
}

.learning-rank-card-score {
  padding-right: 23px;
  text-align: right;
}

.learning-rank-card-score strong {
  display: block;
  color: #2563eb;
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.learning-rank-card-score span {
  display: block;
  margin-top: 4px;
  color: #8493a5;
  font-size: 9px;
}

.place-1 .learning-rank-card-score {
  padding-right: 36px;
}

.place-1 .learning-rank-card-score strong {
  color: #ffd166;
  font-size: 34px;
}

.place-1 .learning-rank-card-score span {
  color: #b9ccdf;
}

.learning-rank-card-stats {
  grid-column: 1 / 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e6edf4;
}

.learning-rank-card-stats > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.learning-rank-card-stats small,
.learning-rank-card-stats em {
  overflow: hidden;
  color: #8493a5;
  font-size: 9px;
  font-style: normal;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-rank-card-stats strong {
  color: #2e4158;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.place-1 .learning-rank-card-stats {
  margin-top: 10px;
  padding-top: 16px;
  border-color: rgba(255, 255, 255, .16);
}

.place-1 .learning-rank-card-stats small,
.place-1 .learning-rank-card-stats em {
  color: #afc5d9;
}

.place-1 .learning-rank-card-stats strong {
  color: #ffffff;
  font-size: 15px;
}

.learning-rank-card.place-2 .learning-rank-card-stats,
.learning-rank-card.place-3 .learning-rank-card-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.learning-rank-card.place-2 .learning-rank-card-stats > span:nth-child(2),
.learning-rank-card.place-3 .learning-rank-card-stats > span:nth-child(2) {
  display: none;
}

.learning-rank-card-stats .is-good strong,
.learning-rank-accuracy.is-good strong {
  color: #0f8a6b;
}

.learning-rank-card-stats .is-mid strong,
.learning-rank-accuracy.is-mid strong {
  color: #b66a06;
}

.learning-rank-card-stats .is-low strong,
.learning-rank-accuracy.is-low strong {
  color: #dc4c4c;
}

.place-1 .learning-rank-card-stats .is-good strong {
  color: #76e6c5;
}

.place-1 .learning-rank-card-stats .is-mid strong {
  color: #ffd166;
}

.place-1 .learning-rank-card-stats .is-low strong {
  color: #ff9c9c;
}

.learning-rank-list {
  overflow: hidden;
  border: 1px solid #d5e0eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(25, 52, 82, .07);
}

.learning-rank-list > .learning-rank-subhead {
  min-height: 48px;
  margin: 0;
  padding: 0 16px;
  border-bottom: 1px solid #e3ebf3;
}

.learning-rank-list-head,
.learning-rank-row {
  display: grid;
  grid-template-columns: 44px minmax(132px, 1fr) 58px 92px 66px;
  align-items: center;
  gap: 10px;
}

.learning-rank-list-head {
  min-height: 30px;
  padding: 0 15px;
  color: #8a98a9;
  background: #f5f8fb;
  font-size: 9px;
  font-weight: 750;
}

.learning-rank-list-head span:nth-child(n + 3) {
  text-align: right;
}

.learning-rank-row {
  position: relative;
  min-height: 58px;
  padding: 7px 15px;
  border-top: 1px solid #edf2f6;
  transition: background-color .18s ease;
}

.learning-rank-row:first-child {
  border-top: 0;
}

.learning-rank-row:hover {
  background: #f7faff;
}

.learning-rank-number {
  color: #5c7189;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.learning-rank-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.learning-rank-person > div:last-child {
  min-width: 0;
}

.learning-rank-person strong,
.learning-rank-person span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-rank-person strong {
  color: #25384e;
  font-size: 12px;
  font-weight: 800;
}

.learning-rank-person span {
  margin-top: 3px;
  color: #8896a7;
  font-size: 9px;
}

.learning-rank-exams,
.learning-rank-accuracy,
.learning-rank-score {
  min-width: 0;
  text-align: right;
}

.learning-rank-exams strong,
.learning-rank-accuracy strong,
.learning-rank-score strong {
  color: #2d4158;
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.learning-rank-exams span,
.learning-rank-accuracy span,
.learning-rank-score span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: #8d9aaa;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-rank-score strong {
  color: #2563eb;
}

.learning-rank-list-empty,
.learning-rank-empty {
  display: flex;
  min-height: 160px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #7a899b;
  font-size: 13px;
}

html[data-hp-theme="tech"] .learning-rank-section,
html[data-hp-theme="starry"] .learning-rank-section {
  color: #dce7f4;
  background: #0d1723;
}

html[data-hp-theme="tech"] .learning-rank-head,
html[data-hp-theme="starry"] .learning-rank-head {
  border-color: #26394d;
}

html[data-hp-theme="tech"] .learning-rank-title h2,
html[data-hp-theme="starry"] .learning-rank-title h2,
html[data-hp-theme="tech"] .learning-rank-subhead strong,
html[data-hp-theme="starry"] .learning-rank-subhead strong {
  color: #eef6ff;
}

html[data-hp-theme="tech"] .learning-rank-title p,
html[data-hp-theme="starry"] .learning-rank-title p,
html[data-hp-theme="tech"] .learning-rank-live,
html[data-hp-theme="starry"] .learning-rank-live,
html[data-hp-theme="tech"] .learning-rank-meta span,
html[data-hp-theme="starry"] .learning-rank-meta span {
  color: #96a9bd;
}

html[data-hp-theme="tech"] .learning-rank-card:not(.place-1),
html[data-hp-theme="starry"] .learning-rank-card:not(.place-1),
html[data-hp-theme="tech"] .learning-rank-list,
html[data-hp-theme="starry"] .learning-rank-list {
  border-color: #2a4056;
  background: #132131;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .2);
}

html[data-hp-theme="tech"] .learning-rank-card-person h3,
html[data-hp-theme="starry"] .learning-rank-card-person h3,
html[data-hp-theme="tech"] .learning-rank-card-stats strong,
html[data-hp-theme="starry"] .learning-rank-card-stats strong,
html[data-hp-theme="tech"] .learning-rank-person strong,
html[data-hp-theme="starry"] .learning-rank-person strong,
html[data-hp-theme="tech"] .learning-rank-exams strong,
html[data-hp-theme="starry"] .learning-rank-exams strong {
  color: #e2edf8;
}

html[data-hp-theme="tech"] .learning-rank-card-stats,
html[data-hp-theme="starry"] .learning-rank-card-stats,
html[data-hp-theme="tech"] .learning-rank-list > .learning-rank-subhead,
html[data-hp-theme="starry"] .learning-rank-list > .learning-rank-subhead,
html[data-hp-theme="tech"] .learning-rank-row,
html[data-hp-theme="starry"] .learning-rank-row {
  border-color: #26394d;
}

html[data-hp-theme="tech"] .learning-rank-list-head,
html[data-hp-theme="starry"] .learning-rank-list-head {
  color: #8194a8;
  background: #0f1b29;
}

html[data-hp-theme="tech"] .learning-rank-row:hover,
html[data-hp-theme="starry"] .learning-rank-row:hover {
  background: #18293b;
}

@media (max-width: 1100px) {
  .learning-rank-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .learning-rank-head {
    align-items: flex-start;
    margin-bottom: 18px;
    padding-bottom: 16px;
  }

  .learning-rank-title {
    align-items: flex-start;
    gap: 10px;
  }

  .learning-rank-title-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .learning-rank-title h2 {
    font-size: 24px;
  }

  .learning-rank-title p {
    max-width: 240px;
    font-size: 11px;
  }

  .learning-rank-meta strong {
    font-size: 23px;
  }

  .learning-rank-meta span {
    font-size: 10px;
  }

  .learning-rank-meta small {
    display: none;
  }

  .learning-rank-podium-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .learning-rank-card.place-1 {
    grid-column: auto;
    min-height: 172px;
    padding: 22px 16px 16px;
  }

  .learning-rank-card-score {
    padding-right: 28px;
  }

  .place-1 .learning-rank-card-score {
    padding-right: 34px;
  }

  .place-1 .learning-rank-card-score strong {
    font-size: 28px;
  }

  .learning-rank-card.place-2 .learning-rank-card-stats,
  .learning-rank-card.place-3 .learning-rank-card-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .learning-rank-card.place-2 .learning-rank-card-stats > span:nth-child(2),
  .learning-rank-card.place-3 .learning-rank-card-stats > span:nth-child(2) {
    display: grid;
  }

  .learning-rank-list-head {
    display: none;
  }

  .learning-rank-row {
    grid-template-columns: 34px minmax(0, 1fr) 76px 58px;
    gap: 8px;
    min-height: 58px;
    padding: 8px 11px;
  }

  .learning-rank-exams {
    display: none;
  }

  .learning-rank-accuracy strong,
  .learning-rank-score strong {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .learning-rank-row {
    transition: none;
  }
}

.learning-rank-avatar-button {
  display: block;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.learning-rank-avatar-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .35);
  outline-offset: 3px;
}

.learning-rank-avatar-button:hover .learning-rank-avatar {
  transform: scale(1.05);
  box-shadow: 0 0 0 5px rgba(37, 99, 235, .14);
}

.learning-rank-avatar {
  transition: transform .18s ease, box-shadow .18s ease;
}

.learning-rank-questions,
.learning-rank-questions strong,
.learning-rank-questions span {
  min-width: 0;
  text-align: right;
}

.learning-rank-questions strong {
  color: #2d4158;
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.learning-rank-questions span {
  display: block;
  margin-top: 2px;
  color: #8d9aaa;
  font-size: 8px;
}

.learning-weekly-overlay {
  position: fixed;
  z-index: 4000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(12, 28, 48, .48);
  backdrop-filter: blur(8px);
}

.learning-weekly-modal {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid #d6e1ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(15, 35, 58, .24);
}

.learning-weekly-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e3ebf3;
}

.learning-weekly-student {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.learning-weekly-avatar {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  overflow: hidden;
  border: 2px solid #bcd1ff;
  border-radius: 50%;
  color: #1d4ed8;
  background: #eaf2ff;
  font-size: 17px;
  font-weight: 850;
}

.learning-weekly-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.learning-weekly-student strong,
.learning-weekly-student span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.learning-weekly-student strong {
  color: #1a2c43;
  font-size: 17px;
}

.learning-weekly-student span {
  margin-top: 4px;
  color: #7b8da2;
  font-size: 11px;
}

.learning-weekly-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid #d9e4ef;
  border-radius: 7px;
  color: #647991;
  background: #f7fafd;
  cursor: pointer;
}

.learning-weekly-close:hover {
  color: #1d4ed8;
  border-color: #bcd1ff;
  background: #eaf2ff;
}

.learning-weekly-close:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .25);
  outline-offset: 2px;
}

.learning-weekly-range {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
}

.learning-weekly-range strong {
  color: #24364d;
  font-size: 14px;
}

.learning-weekly-range span {
  color: #8697aa;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.learning-weekly-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding: 0 20px 18px;
}

.learning-weekly-summary > div {
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid #e0e9f2;
  border-radius: 8px;
  background: #f7fafd;
}

.learning-weekly-summary strong {
  color: #2563eb;
  font-size: 21px;
  font-weight: 850;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.learning-weekly-summary span {
  color: #74879d;
  font-size: 10px;
}

.learning-weekly-heatmap-panel {
  margin: 0 20px 20px;
  padding: 17px 17px 14px;
  border: 1px solid #dce7f1;
  border-radius: 8px;
  background: #fbfdff;
}

.learning-weekly-day-labels,
.learning-weekly-heatmap {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.learning-weekly-day-labels {
  margin-bottom: 8px;
  color: #8293a7;
  font-size: 10px;
  text-align: center;
}

.learning-weekly-cell {
  display: grid;
  aspect-ratio: 1.5;
  min-width: 0;
  place-items: center;
  padding: 0;
  border: 1px solid #e1eaf2;
  border-radius: 5px;
  background: #eef3f7;
  cursor: help;
}

.learning-weekly-cell span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(120, 140, 160, .28);
}

.learning-weekly-cell.level-1 {
  border-color: #b9e6d8;
  background: #e2f7ef;
}

.learning-weekly-cell.level-1 span {
  background: #8bd8bf;
}

.learning-weekly-cell.level-2 {
  border-color: #71cfb1;
  background: #b9ecd9;
}

.learning-weekly-cell.level-2 span {
  background: #37ae8a;
}

.learning-weekly-cell.level-3 {
  border-color: #2a9d78;
  background: #72d1b0;
}

.learning-weekly-cell.level-3 span,
.learning-weekly-cell.level-4 span {
  background: #0b7456;
}

.learning-weekly-cell.level-4 {
  border-color: #0d694f;
  background: #23a67d;
}

.learning-weekly-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 13px;
  color: #8494a7;
  font-size: 9px;
}

.learning-weekly-legend i {
  display: block;
  width: 11px;
  height: 11px;
  border: 1px solid #e1eaf2;
  border-radius: 3px;
  background: #eef3f7;
}

.learning-weekly-legend i.level-1 { background: #e2f7ef; border-color: #b9e6d8; }
.learning-weekly-legend i.level-2 { background: #b9ecd9; border-color: #71cfb1; }
.learning-weekly-legend i.level-3 { background: #72d1b0; border-color: #2a9d78; }
.learning-weekly-legend i.level-4 { background: #23a67d; border-color: #0d694f; }

.learning-weekly-state {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #778aa0;
  font-size: 13px;
}

html[data-hp-theme="tech"] .learning-rank-questions strong,
html[data-hp-theme="starry"] .learning-rank-questions strong,
html[data-hp-theme="tech"] .learning-weekly-student strong,
html[data-hp-theme="starry"] .learning-weekly-student strong,
html[data-hp-theme="tech"] .learning-weekly-range strong,
html[data-hp-theme="starry"] .learning-weekly-range strong {
  color: #e5effa;
}

html[data-hp-theme="tech"] .learning-weekly-modal,
html[data-hp-theme="starry"] .learning-weekly-modal {
  border-color: #2b4359;
  background: #132131;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

html[data-hp-theme="tech"] .learning-weekly-head,
html[data-hp-theme="starry"] .learning-weekly-head,
html[data-hp-theme="tech"] .learning-weekly-summary > div,
html[data-hp-theme="starry"] .learning-weekly-summary > div,
html[data-hp-theme="tech"] .learning-weekly-heatmap-panel,
html[data-hp-theme="starry"] .learning-weekly-heatmap-panel {
  border-color: #2b4359;
}

html[data-hp-theme="tech"] .learning-weekly-summary > div,
html[data-hp-theme="starry"] .learning-weekly-summary > div,
html[data-hp-theme="tech"] .learning-weekly-heatmap-panel,
html[data-hp-theme="starry"] .learning-weekly-heatmap-panel {
  background: #0f1b29;
}

html[data-hp-theme="tech"] .learning-weekly-close,
html[data-hp-theme="starry"] .learning-weekly-close {
  color: #afc0d1;
  border-color: #334e66;
  background: #182b3d;
}

html[data-hp-theme="tech"] .learning-weekly-cell.level-0,
html[data-hp-theme="starry"] .learning-weekly-cell.level-0 {
  border-color: #2b4359;
  background: #182b3d;
}

html[data-hp-theme="tech"] .learning-weekly-cell.level-0 span,
html[data-hp-theme="starry"] .learning-weekly-cell.level-0 span {
  background: #416078;
}

@media (max-width: 560px) {
  .learning-weekly-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .learning-weekly-modal {
    max-height: calc(100vh - 18px);
    border-radius: 12px 12px 0 0;
  }

  .learning-weekly-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .learning-weekly-heatmap-panel {
    margin-right: 14px;
    margin-left: 14px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .learning-weekly-day-labels,
  .learning-weekly-heatmap {
    gap: 5px;
  }

  .learning-weekly-cell {
    aspect-ratio: 1.15;
  }
}

@media (max-width: 700px) {
  .learning-rank-questions {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .learning-rank-avatar,
  .learning-rank-avatar-button:hover .learning-rank-avatar {
    transition: none;
    transform: none;
  }
}
