/* ── ETMP v2 — Phase 1 基础样式 ── */
:root {
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #3b82f6;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }

/* Layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.nav-link { display: block; padding: .65rem 1.25rem; color: var(--sidebar-text); text-decoration: none; transition: background .15s; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-divider { height: 1px; background: rgba(255,255,255,.1); margin: .75rem 0; }
.nav-label { display: block; padding: .4rem 1.25rem; font-size: .75rem; text-transform: uppercase; opacity: .5; }
.sidebar-footer { padding: .75rem 0; border-top: 1px solid rgba(255,255,255,.1); }
.main-content { margin-left: 240px; flex: 1; padding: 2rem; }

/* Auth */
.auth-wrapper { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--sidebar-bg); }
.auth-card { background: var(--card-bg); border-radius: var(--radius); padding: 2.5rem; width: 400px; max-width: 95vw; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 1.5rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .3rem; font-weight: 500; font-size: .875rem; }
.form-input { width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .9rem; }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.field-error { color: var(--danger); font-size: .8rem; }
.form-errors { color: var(--danger); margin-bottom: 1rem; font-size: .85rem; }

/* Buttons */
.btn { display: inline-block; padding: .6rem 1.25rem; border: none; border-radius: var(--radius); font-size: .875rem; cursor: pointer; text-decoration: none; color: #fff; background: var(--primary); transition: background .15s; }
.btn:hover { background: var(--primary-hover); }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: .4rem .85rem; font-size: .8rem; }

/* Cards */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.card.locked { opacity: .55; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

/* Tasks */
.page-header { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 1rem; }
.page-header h2 { font-size: 1.35rem; }
.task-status { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.status-not_started { background: #e2e8f0; color: #475569; }
.status-learning { background: #dbeafe; color: #1d4ed8; }
.status-exam_pending { background: #fef3c7; color: #92400e; }
.status-passed { background: #dcfce7; color: #166534; }
.status-failed { background: #fee2e2; color: #991b1b; }
.status-overdue { background: #fee2e2; color: #991b1b; }

/* Lessons */
.lesson-list { display: flex; flex-direction: column; gap: .75rem; }
.lesson-card { display: flex; align-items: center; justify-content: space-between; }
.lesson-info { display: flex; align-items: center; gap: .75rem; }
.lesson-order { font-weight: 600; }
.badge { padding: .15rem .5rem; border-radius: 999px; font-size: .7rem; }
.badge-success { background: #dcfce7; color: #166534; }

/* Content blocks */
.content-block { margin-bottom: 1rem; }
.video-player { width: 100%; max-height: 480px; border-radius: var(--radius); }
.content-image { max-width: 100%; border-radius: var(--radius); }
.block-text { margin-top: .75rem; line-height: 1.7; }

/* Messages */
.messages { margin-bottom: 1rem; }
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: .5rem; font-size: .875rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-error { background: #fee2e2; color: #991b1b; }

.text-muted { color: var(--text-muted); font-size: .85rem; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; padding: 1rem; }
}

/* ── 管理端补充样式 ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h2 { margin: 0; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.data-table th { background: #f8fafc; text-align: left; padding: .7rem .85rem; font-size: .8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; border-bottom: 2px solid var(--border); }
.data-table td { padding: .65rem .85rem; border-bottom: 1px solid var(--border); font-size: .875rem; }
.data-table tr:hover { background: #f8fafc; }
.text-center { text-align: center; }

/* 筛选栏 */
.filter-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* 批量操作栏 */
.batch-bar { display: flex; gap: .5rem; align-items: center; margin-bottom: .75rem; padding: .5rem .75rem; background: #f8fafc; border-radius: var(--radius); border: 1px solid var(--border); }
.batch-bar label { font-size: .85rem; }

/* 分页 */
.pagination { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-top: 1.25rem; }
.page-info { font-size: .85rem; color: var(--text-muted); }

/* 表单操作 */
.form-actions { display: flex; gap: .5rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* 统计卡片 */
.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .85rem; color: var(--text-muted); margin-top: .25rem; }
.card-link { text-decoration: none; color: inherit; transition: box-shadow .15s; }
.card-link:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }

/* 按钮 */
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

/* 徽章 */
.badge-draft { background: #e2e8f0; color: #475569; }
.badge-published, .badge-active { background: #dcfce7; color: #166534; }
.badge-archived, .badge-closed { background: #f1f5f9; color: #64748b; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-role-employee { background: #dbeafe; color: #1d4ed8; }
.badge-role-training_admin { background: #fef3c7; color: #92400e; }
.badge-role-super_admin { background: #ede9fe; color: #6d28d9; }

/* 选项行 */
.choice-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }

/* 侧边栏激活 */
.nav-link.active { background: rgba(255,255,255,.12); color: #fff; border-left: 3px solid var(--sidebar-active); }

/* ── 品牌样式 ── */

/* ── 考试页补充 ── */
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; margin: 0; }

/* ── 交互式培训内容 ── */
.scenario-box { background:linear-gradient(135deg,#1e293b,#334155); color:#e2e8f0; border-radius:12px; padding:1.5rem; margin:1rem 0; }
.scenario-box h4 { color:#4ade80; margin-bottom:.75rem; font-size:1.1rem; }
.scenario-step { background:rgba(255,255,255,.08); border-radius:8px; padding:1rem; margin:.5rem 0; border-left:3px solid #3b82f6; }
.scenario-step.danger { border-left-color:#ef4444; }
.scenario-step.success { border-left-color:#22c55e; }

.reveal-box { margin:1rem 0; }
.reveal-btn { background:var(--primary); color:#fff; border:none; padding:.5rem 1.25rem; border-radius:6px; cursor:pointer; font-size:.9rem; transition:all .2s; }
.reveal-btn:hover { background:var(--primary-hover); transform:translateY(-1px); }
.reveal-content { display:none; background:#f0fdf4; border:1px solid #bbf7d0; border-radius:8px; padding:1rem; margin-top:.5rem; }
.reveal-content.show { display:block; animation:fadeIn .3s; }

.mini-quiz { background:#eff6ff; border:1px solid #bfdbfe; border-radius:12px; padding:1.25rem; margin:1rem 0; }
.mini-quiz h4 { color:#1d4ed8; margin-bottom:.75rem; }
.quiz-option { display:block; padding:.5rem .75rem; margin:.3rem 0; border:1px solid #d1d5db; border-radius:6px; cursor:pointer; transition:all .15s; }
.quiz-option:hover { background:#dbeafe; border-color:#93c5fd; }
.quiz-option.correct { background:#dcfce7 !important; border-color:#22c55e !important; }
.quiz-option.wrong { background:#fee2e2 !important; border-color:#ef4444 !important; }
.quiz-feedback { display:none; padding:.75rem; border-radius:6px; margin-top:.5rem; font-size:.9rem; }

.case-card { background:#fff; border:1px solid var(--border); border-radius:12px; padding:1.25rem; margin:.75rem 0; box-shadow:0 1px 3px rgba(0,0,0,.05); transition:box-shadow .2s; }
.case-card:hover { box-shadow:0 4px 12px rgba(0,0,0,.1); }
.case-card .tag { display:inline-block; padding:.15rem .5rem; border-radius:4px; font-size:.75rem; font-weight:600; margin-bottom:.5rem; }
.tag-danger { background:#fee2e2; color:#991b1b; }
.tag-warning { background:#fef3c7; color:#92400e; }
.tag-info { background:#dbeafe; color:#1e40af; }

.tip-box { background:linear-gradient(135deg,#fef3c7,#fde68a); border-radius:8px; padding:1rem 1.25rem; margin:1rem 0; border-left:4px solid #f59e0b; }
.danger-box { background:linear-gradient(135deg,#fee2e2,#fecaca); border-radius:8px; padding:1rem 1.25rem; margin:1rem 0; border-left:4px solid #ef4444; }

.progress-steps { display:flex; gap:.5rem; margin:1rem 0; flex-wrap:wrap; }
.p-step { flex:1; min-width:120px; text-align:center; padding:.75rem .5rem; background:#f1f5f9; border-radius:8px; font-size:.8rem; position:relative; }
.p-step.active { background:#dbeafe; color:#1d4ed8; font-weight:600; }
.p-step.done { background:#dcfce7; color:#166534; }

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

/* 语言标签 */
.lang-tag { display:inline-block; padding:.1rem .35rem; border-radius:3px; font-size:.65rem; font-weight:700; margin-right:.15rem; }
.lang-tag.lang-zh-hans { background:#dbeafe; color:#1e40af; }
.lang-tag.lang-zh-hant { background:#fce7f3; color:#9d174d; }
.lang-tag.lang-en { background:#dcfce7; color:#166534; }
.lang-tag.lang-ja { background:#fef3c7; color:#92400e; }

/* 修复侧边栏底部固定 */
.sidebar { display:flex; flex-direction:column; }
.sidebar-nav { flex:1; overflow-y:auto; }
.sidebar-footer { 
  padding:.75rem 0 !important; 
  border-top:1px solid rgba(255,255,255,.1) !important; 
  flex-shrink:0;
}
