/* ============================================================
   QuThinking 课件分发平台 — Platform Design System
   沿用 QuThinking 品牌色 (quthinking-ai-saas/assets/css/main.css)
   并新增课件分发平台专属组件
   ============================================================ */

:root {
  /* Brand Colors — 与 QuThinking教学系统保持一致 */
  --brand-primary: #7C3AED;
  --brand-primary-light: #EDE9FE;
  --brand-primary-dark: #5B21B6;
  --brand-secondary: #0EA5E9;
  --brand-secondary-light: #E0F2FE;
  --brand-accent: #F472B6;

  /* Status */
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  /* Neutrals */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Surfaces */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-tertiary: #F3F4F6;
  --bg-dark: #0F172A;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-tertiary: #6B7280;
  --text-muted: #9CA3AF;
  --text-inverse: #FFFFFF;

  /* Border */
  --border-color: #E5E7EB;
  --border-light: #F3F4F6;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Spacing */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;

  --text-xs: 12px; --text-sm: 14px; --text-base: 16px; --text-lg: 18px;
  --text-xl: 20px; --text-2xl: 24px; --text-3xl: 30px; --text-4xl: 36px;

  --font-normal: 400; --font-medium: 500; --font-semibold: 600; --font-bold: 700; --font-extrabold: 800;

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--brand-primary-dark); }

button { font-family: inherit; cursor: pointer; border: none; outline: none; transition: all var(--transition-fast); }
input, select, textarea { font-family: inherit; font-size: inherit; outline: none; }

/* ============================================================
   Components
   ============================================================ */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: var(--font-medium);
  transition: all var(--transition-fast); cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--brand-primary); color: white; }
.btn-primary:hover { background: var(--brand-primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: white; color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-lg { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
.btn-sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Card */
.card { background: var(--bg-primary); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); }
.card-header { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: var(--text-base); font-weight: var(--font-semibold); }
.card-body { padding: var(--space-5); }
.card-footer { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-light); }

/* Badge */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full); font-size: var(--text-xs); font-weight: var(--font-medium); line-height: 1.5; }
.badge-primary { background: var(--brand-primary-light); color: var(--brand-primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* Forms */
.form-group { margin-bottom: var(--space-4); }
.form-label { display: block; font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-primary); margin-bottom: var(--space-2); }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  font-size: var(--text-sm); transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background: white;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}
.form-textarea { min-height: 96px; resize: vertical; }
.form-hint { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: var(--space-1); }
.form-error { font-size: var(--text-xs); color: var(--danger); margin-top: var(--space-1); }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: var(--space-3) var(--space-4); background: var(--bg-secondary); font-weight: var(--font-medium); font-size: var(--text-xs); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-color); }
.data-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border-light); font-size: var(--text-sm); }
.data-table tr:hover td { background: var(--bg-secondary); }

/* Avatar */
.avatar { width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--brand-primary-light); color: var(--brand-primary); display: inline-flex; align-items: center; justify-content: center; font-weight: var(--font-medium); font-size: var(--text-sm); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--text-lg); }
.avatar-xl { width: 64px; height: 64px; font-size: var(--text-2xl); }

/* ============================================================
   Layout
   ============================================================ */
.platform-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: white; border-right: 1px solid var(--border-color); position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; display: flex; flex-direction: column; }
.sidebar-logo { padding: var(--space-5); border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: var(--space-3); }
.sidebar-logo .logo-icon { width: 36px; height: 36px; background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary)); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: white; font-weight: var(--font-bold); font-size: 18px; }
.sidebar-logo .logo-text { font-weight: var(--font-semibold); font-size: var(--text-base); }
.sidebar-logo .logo-sub { font-size: 10px; color: var(--text-tertiary); margin-top: 2px; }
.sidebar-menu { flex: 1; padding: var(--space-4) 0; overflow-y: auto; }
.sidebar-section-label { font-size: 11px; color: var(--text-muted); padding: var(--space-3) var(--space-5) var(--space-1); text-transform: uppercase; letter-spacing: 0.6px; }
.menu-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-5); color: var(--text-secondary); cursor: pointer; transition: all var(--transition-fast); border-left: 3px solid transparent; font-size: var(--text-sm); }
.menu-item:hover { background: var(--bg-secondary); color: var(--text-primary); }
.menu-item.active { background: var(--brand-primary-light); color: var(--brand-primary); border-left-color: var(--brand-primary); font-weight: var(--font-medium); }
.menu-item .menu-icon { width: 20px; text-align: center; font-size: 16px; }
.menu-item .menu-badge { margin-left: auto; }

.sidebar-footer { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-light); }
.user-chip { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2); border-radius: var(--radius-md); cursor: pointer; }
.user-chip:hover { background: var(--bg-secondary); }
.user-chip .avatar { width: 32px; height: 32px; }

.main-content { flex: 1; margin-left: 240px; min-width: 0; }
.topbar { height: 64px; background: white; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-6); position: sticky; top: 0; z-index: 50; }
.topbar-title { font-size: var(--text-lg); font-weight: var(--font-semibold); }
.topbar-actions { display: flex; align-items: center; gap: var(--space-3); }

.content-area { padding: var(--space-6); max-width: 1400px; margin: 0 auto; }

/* ============================================================
   Market / Courseware cards
   ============================================================ */
.market-hero { background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%); border-radius: var(--radius-2xl); padding: var(--space-10); color: white; margin-bottom: var(--space-6); position: relative; overflow: hidden; }
.market-hero h1 { font-size: var(--text-3xl); font-weight: var(--font-extrabold); margin-bottom: var(--space-2); }
.market-hero p { font-size: var(--text-base); opacity: 0.9; max-width: 560px; }
.market-hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,0.1); }

.filter-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-5); }
.search-box { flex: 1; min-width: 280px; position: relative; }
.search-box input { width: 100%; padding: 10px 12px 10px 38px; border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: var(--text-sm); background: white; }
.search-box input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(124,58,237,0.1); }
.search-box::before { content: '🔍'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: 0.6; }

.category-tabs { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.cat-tab { padding: 6px 14px; border-radius: var(--radius-full); font-size: var(--text-sm); color: var(--text-secondary); background: white; border: 1px solid var(--border-color); cursor: pointer; transition: all var(--transition-fast); }
.cat-tab:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.cat-tab.active { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }

.courseware-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-5); }
.courseware-card { background: white; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border-light); cursor: pointer; transition: transform var(--transition-base), box-shadow var(--transition-base); display: flex; flex-direction: column; }
.courseware-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.courseware-cover { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; position: relative; color: white; font-weight: var(--font-extrabold); font-size: 56px; }
.courseware-cover .drm-shield { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px; display: flex; align-items: center; gap: 4px; font-weight: var(--font-medium); }
.courseware-cover .free-badge { position: absolute; top: 10px; left: 10px; background: var(--success); padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: var(--font-bold); color: white; }
.courseware-body { padding: var(--space-4); flex: 1; display: flex; flex-direction: column; }
.courseware-title { font-size: var(--text-base); font-weight: var(--font-semibold); margin-bottom: var(--space-2); color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 48px; }
.courseware-meta { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-xs); color: var(--text-tertiary); margin-bottom: var(--space-3); }
.courseware-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--space-3); }
.courseware-tags .tag { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-full); background: var(--bg-tertiary); color: var(--text-secondary); }
.courseware-footer { display: flex; align-items: center; justify-content: space-between; padding-top: var(--space-3); border-top: 1px solid var(--border-light); margin-top: auto; }
.courseware-price { font-size: var(--text-xl); font-weight: var(--font-extrabold); color: var(--brand-primary); }
.courseware-price .free { color: var(--success); }
.courseware-sales { font-size: 11px; color: var(--text-tertiary); }

/* ============================================================
   Detail page
   ============================================================ */
.detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: var(--space-6); align-items: start; }
@media (max-width: 1024px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-hero { display: flex; gap: var(--space-6); padding: var(--space-6); background: white; border-radius: var(--radius-lg); border: 1px solid var(--border-light); margin-bottom: var(--space-5); }
.detail-cover { width: 240px; aspect-ratio: 16/9; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; color: white; font-size: 64px; font-weight: var(--font-extrabold); flex-shrink: 0; }
.detail-info { flex: 1; min-width: 0; }
.detail-info h1 { font-size: var(--text-2xl); font-weight: var(--font-bold); margin-bottom: var(--space-3); }
.detail-info .meta-row { display: flex; align-items: center; gap: var(--space-4); color: var(--text-secondary); font-size: var(--text-sm); margin-bottom: var(--space-4); flex-wrap: wrap; }
.detail-info .desc { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.7; margin-bottom: var(--space-4); }

.buy-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border-light); padding: var(--space-5); position: sticky; top: 80px; }
.buy-price { font-size: 32px; font-weight: var(--font-extrabold); color: var(--brand-primary); margin-bottom: var(--space-1); }
.buy-price .free { color: var(--success); }
.buy-meta { font-size: var(--text-xs); color: var(--text-tertiary); margin-bottom: var(--space-4); }

.drm-shield-card { background: linear-gradient(135deg, #0F172A, #1E293B); border-radius: var(--radius-lg); padding: var(--space-5); color: white; margin-top: var(--space-4); }
.drm-shield-card h3 { font-size: var(--text-base); font-weight: var(--font-semibold); margin-bottom: var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.drm-list { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-3); }
.drm-item { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: rgba(255,255,255,0.85); }
.drm-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex-shrink: 0; }

/* ============================================================
   Viewer (核心)
   ============================================================ */
.viewer-shell { background: #0B0F17; min-height: 100vh; display: flex; flex-direction: column; color: white; user-select: none; -webkit-user-select: none; }
.viewer-topbar { height: 56px; background: rgba(255,255,255,0.04); border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-5); }
.viewer-topbar .title { font-size: var(--text-sm); font-weight: var(--font-medium); color: rgba(255,255,255,0.9); }
.viewer-topbar .tools { display: flex; align-items: center; gap: var(--space-2); }

.viewer-stage { flex: 1; display: flex; position: relative; overflow: hidden; }
.viewer-thumbs { width: 200px; background: rgba(255,255,255,0.04); border-right: 1px solid rgba(255,255,255,0.08); overflow-y: auto; padding: var(--space-3); }
.thumb-item { aspect-ratio: 16/9; border-radius: var(--radius-md); cursor: pointer; border: 2px solid transparent; margin-bottom: var(--space-2); overflow: hidden; background: white; position: relative; }
.thumb-item.active { border-color: var(--brand-primary); }
.thumb-item .num { position: absolute; top: 4px; left: 4px; background: rgba(0,0,0,0.6); color: white; font-size: 10px; padding: 1px 6px; border-radius: var(--radius-full); }
.thumb-item .preview-mini { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold; color: var(--brand-primary); }

.viewer-canvas-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--space-5); position: relative; background: #0B0F17; }
.viewer-canvas { width: 100%; max-width: 1280px; aspect-ratio: 16/9; background: white; border-radius: var(--radius-md); box-shadow: 0 24px 60px rgba(0,0,0,0.5); position: relative; overflow: hidden; }
.viewer-step-indicator { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,0.6); backdrop-filter: blur(6px); padding: 4px 10px; border-radius: var(--radius-full); font-size: 11px; z-index: 50; display: flex; align-items: center; gap: 6px; }

.viewer-controls { background: rgba(255,255,255,0.06); border-top: 1px solid rgba(255,255,255,0.08); padding: var(--space-3) var(--space-5); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.viewer-nav { display: flex; align-items: center; gap: var(--space-2); }
.viewer-progress { flex: 1; height: 4px; background: rgba(255,255,255,0.1); border-radius: var(--radius-full); overflow: hidden; position: relative; }
.viewer-progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary)); transition: width var(--transition-base); }
.viewer-mode-switch { display: flex; gap: var(--space-2); }
.mode-btn { padding: 6px 12px; border-radius: var(--radius-md); background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); font-size: 12px; cursor: pointer; transition: all var(--transition-fast); border: 1px solid transparent; }
.mode-btn:hover { color: white; background: rgba(255,255,255,0.1); }
.mode-btn.active { background: var(--brand-primary); color: white; border-color: var(--brand-primary); }

/* Step-by-step animation indicator (核心特色) */
.step-track { display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: rgba(0,0,0,0.4); border-radius: var(--radius-full); }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.25); transition: all var(--transition-fast); }
.step-dot.done { background: var(--brand-primary); }
.step-dot.current { background: var(--brand-secondary); box-shadow: 0 0 0 3px rgba(14,165,233,0.3); transform: scale(1.4); }

/* Pen / laser overlay */
.tool-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.tool-overlay.active { pointer-events: auto; }

/* Watermark layer */
.watermark-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.watermark-cell { position: absolute; color: rgba(124, 58, 237, 0.18); font-size: 13px; transform: rotate(-30deg); white-space: nowrap; user-select: none; }

/* Blackout overlay (anti-screenshot) */
.blackout-overlay { position: fixed; inset: 0; background: #000; z-index: 9999; display: none; align-items: center; justify-content: center; color: white; font-size: 18px; }
.blackout-overlay.active { display: flex; }

/* ============================================================
   Creator dashboard
   ============================================================ */
.creator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-5); margin-bottom: var(--space-6); }
.metric-card { background: white; border-radius: var(--radius-lg); padding: var(--space-5); border: 1px solid var(--border-light); }
.metric-card .label { font-size: var(--text-xs); color: var(--text-tertiary); margin-bottom: var(--space-2); }
.metric-card .value { font-size: var(--text-2xl); font-weight: var(--font-extrabold); color: var(--text-primary); }
.metric-card .sub { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: var(--space-2); }
.metric-card.brand .value { color: var(--brand-primary); }
.metric-card.success .value { color: var(--success); }
.metric-card.warning .value { color: var(--warning); }

.realtime-feed { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border-light); overflow: hidden; }
.realtime-feed .feed-header { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.feed-list { max-height: 480px; overflow-y: auto; }
.feed-item { padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: var(--space-3); animation: slideIn 0.4s ease; }
.feed-item:last-child { border-bottom: none; }
.feed-item .feed-icon { width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--success-light); color: var(--success); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.feed-item .feed-content { flex: 1; min-width: 0; }
.feed-item .feed-title { font-size: var(--text-sm); font-weight: var(--font-medium); }
.feed-item .feed-meta { font-size: var(--text-xs); color: var(--text-tertiary); }
.feed-item .feed-amount { font-weight: var(--font-bold); color: var(--success); font-size: var(--text-base); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }

/* Trend chart (pure SVG) */
.trend-chart { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border-light); padding: var(--space-5); }

/* ============================================================
   Upload wizard
   ============================================================ */
.wizard-steps { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-6); }
.wizard-step { display: flex; align-items: center; gap: var(--space-2); }
.wizard-step .step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-tertiary); color: var(--text-tertiary); display: flex; align-items: center; justify-content: center; font-weight: var(--font-semibold); flex-shrink: 0; }
.wizard-step.active .step-num { background: var(--brand-primary); color: white; }
.wizard-step.done .step-num { background: var(--success); color: white; }
.wizard-step .step-label { font-size: var(--text-sm); color: var(--text-tertiary); }
.wizard-step.active .step-label, .wizard-step.done .step-label { color: var(--text-primary); font-weight: var(--font-medium); }
.wizard-connector { flex: 1; height: 2px; background: var(--border-color); margin: 0 var(--space-2); }
.wizard-connector.done { background: var(--success); }

.upload-drop { border: 2px dashed var(--border-color); border-radius: var(--radius-lg); padding: var(--space-10); text-align: center; cursor: pointer; transition: all var(--transition-base); background: var(--bg-secondary); }
.upload-drop:hover, .upload-drop.dragover { border-color: var(--brand-primary); background: var(--brand-primary-light); }
.upload-drop .icon { font-size: 48px; margin-bottom: var(--space-3); }
.upload-drop .hint { color: var(--text-tertiary); font-size: var(--text-sm); }

.share-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); background: var(--bg-secondary); border-radius: var(--radius-md); margin-bottom: var(--space-2); }
.share-row .share-name { flex: 1; }
.share-row .share-pct { width: 80px; text-align: right; }
.share-summary { background: var(--brand-primary-light); padding: var(--space-4); border-radius: var(--radius-md); margin-top: var(--space-4); }
.share-summary.total-ok { background: var(--success-light); color: var(--success); }
.share-summary.total-bad { background: var(--danger-light); color: var(--danger); }

/* ============================================================
   Admin
   ============================================================ */
.admin-tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border-color); margin-bottom: var(--space-5); }
.admin-tab { padding: var(--space-3) var(--space-4); cursor: pointer; font-size: var(--text-sm); color: var(--text-secondary); border-bottom: 2px solid transparent; transition: all var(--transition-fast); }
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); font-weight: var(--font-medium); }

/* ============================================================
   Bridge (QuThinking integration)
   ============================================================ */
.bridge-status { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); margin-bottom: var(--space-4); }
.bridge-status.connected { background: var(--success-light); color: var(--success); }
.bridge-status.disconnected { background: var(--gray-100); color: var(--text-secondary); }
.bridge-status .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }

/* ============================================================
   Toast
   ============================================================ */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: white; border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-lg); border-left: 4px solid var(--brand-primary); display: flex; align-items: center; gap: var(--space-3); min-width: 280px; max-width: 420px; animation: slideInRight 0.3s ease; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .toast-icon { font-size: 18px; }
.toast .toast-msg { font-size: var(--text-sm); flex: 1; }
@keyframes slideInRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.6); backdrop-filter: blur(4px); z-index: 9999; display: none; align-items: center; justify-content: center; padding: var(--space-4); }
.modal-backdrop.active { display: flex; }
.modal { background: white; border-radius: var(--radius-lg); max-width: 540px; width: 100%; max-height: 88vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-xl); }
.modal-header { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-light); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: var(--space-5); overflow-y: auto; flex: 1; }
.modal-footer { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border-light); display: flex; justify-content: flex-end; gap: var(--space-2); }

/* ============================================================
   Utilities
   ============================================================ */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-brand { color: var(--brand-primary); }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.hidden { display: none; }
.no-select { user-select: none; -webkit-user-select: none; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.7; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-pulse { animation: pulse 2s infinite; }
.spin { animation: spin 1s linear infinite; }

/* Slide element animation classes (used by viewer step player) */
.anim-hidden { opacity: 0; }
.anim-fade { animation: animFade 0.6s ease forwards; }
.anim-slide-down { animation: animSlideDown 0.5s ease forwards; }
.anim-slide-right { animation: animSlideRight 0.5s ease forwards; }
.anim-slide-up { animation: animSlideUp 0.5s ease forwards; }
.anim-zoom-in { animation: animZoomIn 0.7s ease forwards; }
.anim-pop-in { animation: animPopIn 0.6s cubic-bezier(0.5, 1.6, 0.5, 1) forwards; }
.anim-bounce-in { animation: animBounceIn 0.8s cubic-bezier(0.5, 1.6, 0.5, 1) forwards; }
.anim-wipe-up { animation: animWipeUp 0.6s ease forwards; clip-path: inset(100% 0 0 0); }
@keyframes animFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes animSlideDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes animSlideRight { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes animSlideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes animZoomIn { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
@keyframes animPopIn { 0% { opacity: 0; transform: scale(0.4); } 60% { opacity: 1; transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }
@keyframes animBounceIn { 0% { opacity: 0; transform: scale(0.3) translateY(-20px); } 50% { opacity: 1; transform: scale(1.15) translateY(0); } 70% { transform: scale(0.95); } 100% { transform: scale(1); } }
@keyframes animWipeUp { from { clip-path: inset(100% 0 0 0); opacity: 0; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
