:root {
  --red-primary: #b91c1c;
  --red-dark: #7f1d1d;
  --red-deeper: #5c1111;
  --red-light: #fef2f2;
  --red-border: #fecaca;
  --gold-primary: #d97706;
  --gold-bright: #f59e0b;
  --gold-light: #fffbeb;
  --e10-blue: #1d4ed8;
  --e10-blue-light: #eff6ff;
  --bg-page: #f1f5f9;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --warning: #c2410c;
  --warning-bg: #fff7ed;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 10px -3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 38px -10px rgba(127, 29, 29, 0.18);
  --radius: 12px;
}

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==================== Top Header (泛微 E10 数智协同门户顶栏) ==================== */
.top-header {
  min-height: 66px;
  background: linear-gradient(100deg, #5c1111 0%, #991b1b 48%, #b91c1c 85%, #92400e 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(92, 17, 17, 0.28);
  z-index: 30;
  flex-shrink: 0;
  position: relative;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 100%);
  color: #7f1d1d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  font-weight: 900;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
  flex-shrink: 0;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.platform-badge {
  font-size: 11.5px;
  background: rgba(254, 243, 199, 0.18);
  border: 1px solid rgba(253, 224, 71, 0.55);
  color: #fef08a;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.role-switcher {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.28);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(253, 224, 71, 0.35);
  gap: 8px;
  font-size: 12.5px;
}

.role-switcher select {
  background: transparent;
  color: #fef08a;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
}

.role-switcher select option {
  color: var(--text-main);
  background: #ffffff;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.dot-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.btn-reset-top {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reset-top:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==================== App Layout ==================== */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left Sidebar */
.sidebar {
  width: 266px;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 2px 0 8px rgba(15, 23, 42, 0.03);
}

.role-status-banner {
  margin: 14px 14px 4px;
  padding: 11px 12px;
  border-radius: 9px;
  background: linear-gradient(135deg, #fef2f2 0%, #fffbeb 100%);
  border: 1px solid #fecaca;
  font-size: 12px;
  line-height: 1.5;
}

.role-status-banner strong {
  color: var(--red-primary);
  display: block;
  margin-bottom: 2px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 14px 20px 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.nav-list {
  list-style: none;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  transition: all 0.18s ease;
  position: relative;
}

.nav-item:hover {
  background: var(--red-light);
  color: var(--red-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, #991b1b, #dc2626);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.28);
}

.nav-item .nav-tag {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #475569;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 600;
}

.nav-item.active .nav-tag {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.nav-badge-count {
  background: #f59e0b;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 14px;
  margin: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.55;
}

/* Main Content Area */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px 36px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.22s ease;
}

.tab-panel.active {
  display: block;
}

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

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  background: #ffffff;
  padding: 16px 22px;
  border-radius: var(--radius);
  border-left: 5px solid var(--red-primary);
  box-shadow: var(--shadow-sm);
}

.section-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.section-header p {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 4px;
}

.engine-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.engine-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
  background: var(--e10-blue-light);
  color: var(--e10-blue);
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

.engine-tag.ai {
  background: #fef2f2;
  color: var(--red-primary);
  border-color: #fecaca;
}

/* ==================== Module 1: Illustrated Base Cards ==================== */
.base-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.base-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  overflow: hidden;
}

.base-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #f87171;
}

.base-card-hero {
  height: 88px;
  padding: 12px 14px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.base-card-hero::after {
  content: "★";
  position: absolute;
  right: -8px;
  bottom: -18px;
  font-size: 82px;
  color: rgba(255, 255, 255, 0.11);
  pointer-events: none;
}

.base-hero-tag {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
  width: fit-content;
  font-weight: 600;
}

.base-card-hero h3 {
  font-size: 15.5px;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.base-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.base-spirit-line {
  font-size: 12px;
  font-weight: 700;
  color: var(--red-primary);
  background: var(--red-light);
  padding: 4px 8px;
  border-radius: 5px;
  margin-bottom: 8px;
}

.base-card-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
  margin-bottom: 10px;
}

.capacity-box {
  background: #f8fafc;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  margin-bottom: 12px;
}

.capacity-header {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #475569;
  margin-bottom: 5px;
  font-weight: 600;
}

.capacity-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #ea580c);
  border-radius: 999px;
}

.base-card-actions {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 8px;
}

/* ==================== Layout Cards & Forms ==================== */
.two-col-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr;
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.card-title {
  font-size: 15.5px;
  font-weight: 800;
  margin-bottom: 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full {
  grid-column: span 2;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.form-group label .req {
  color: #dc2626;
  margin-left: 2px;
}

.form-control {
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s;
  background: #ffffff;
}

.form-control:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12);
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
  line-height: 1.55;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(90deg, #991b1b, #dc2626);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(185, 28, 28, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(90deg, #7f1d1d, #b91c1c);
}

.btn-outline {
  background: #ffffff;
  color: var(--red-primary);
  border: 1px solid #fca5a5;
}

.btn-outline:hover {
  background: var(--red-light);
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-ai {
  background: linear-gradient(90deg, #7f1d1d, #d97706);
  color: #ffffff;
  font-size: 12px;
  padding: 6px 12px;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.25);
}

.btn-ai:hover {
  opacity: 0.94;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background: #166534;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Workflow Step Bar */
.workflow-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 14px;
  font-size: 12px;
}

.wf-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #475569;
}

.wf-step .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.wf-step.done .step-num {
  background: var(--red-primary);
  color: #ffffff;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  text-align: left;
  padding: 10px 11px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 11px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #fcfcfd;
}

.badge-status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-pending {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid #fed7aa;
}

.badge-approved {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.badge-rejected {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* ==================== Module 2: On-site Spot Sandbox & AI RAG Guide ==================== */
.spot-sandbox-bar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.spot-sandbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.base-tabs-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.base-pill-tab {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  color: var(--text-sub);
  transition: all 0.15s;
}

.base-pill-tab.active {
  background: var(--red-primary);
  color: #ffffff;
  border-color: var(--red-primary);
}

.spot-timeline-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
}

.spot-node-card {
  background: #fffafa;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}

.spot-node-card:hover {
  background: #fef2f2;
  border-color: var(--red-primary);
  transform: translateY(-2px);
}

.spot-node-order {
  font-size: 11px;
  font-weight: 800;
  color: var(--red-primary);
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.spot-node-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.chat-layout {
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  gap: 18px;
  height: 510px;
}

.chat-box-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.chat-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.quick-prompts {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.prompt-chip {
  font-size: 12px;
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.prompt-chip:hover {
  background: var(--red-primary);
  color: #ffffff;
  border-color: var(--red-primary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
  border-radius: 9px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
}

.msg {
  max-width: 88%;
  padding: 12px 15px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.65;
}

.msg-ai {
  align-self: flex-start;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.msg-user {
  align-self: flex-end;
  background: linear-gradient(90deg, #991b1b, #b91c1c);
  color: #ffffff;
}

.rag-trace-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 3px 9px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-weight: 600;
}

.msg-actions-bar {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--red-primary);
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.voice-btn:hover {
  background: var(--red-primary);
  color: #ffffff;
}

.kb-doc-item {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 10px;
  background: #f8fafc;
  transition: all 0.2s;
  cursor: pointer;
}

.kb-doc-item:hover {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.kb-doc-item.hit {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.16);
}

/* ==================== Module 3: Quiz & Ceremonial Certificate ==================== */
.quiz-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.quiz-stage-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.stage-pill {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  color: var(--text-sub);
}

.stage-pill.current {
  background: var(--red-light);
  border-color: var(--red-primary);
  color: var(--red-primary);
}

.question-box {
  background: #fffafa;
  border: 1px solid #fecaca;
  padding: 18px 20px;
  border-radius: 10px;
}

.question-title {
  font-size: 15.5px;
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.55;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.option-btn {
  text-align: left;
  padding: 11px 15px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--red-primary);
  background: var(--red-light);
}

.option-btn.correct {
  background: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
  font-weight: 700;
}

.option-btn.wrong {
  background: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d;
}

.quiz-explanation {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 13px;
  color: #78350f;
  line-height: 1.6;
}

/* Digital Honor Certificate Styling */
.certificate-frame {
  background: linear-gradient(135deg, #fffdf5 0%, #fef9c3 100%);
  border: 6px double #b91c1c;
  border-radius: 12px;
  padding: 24px 28px;
  position: relative;
  text-align: center;
  color: #451a03;
  box-shadow: 0 12px 30px rgba(185, 28, 28, 0.15);
  margin: 10px auto;
  max-width: 560px;
}

.cert-star-header {
  font-size: 32px;
  color: #dc2626;
  line-height: 1;
  margin-bottom: 6px;
}

.cert-main-title {
  font-size: 22px;
  font-weight: 900;
  color: #991b1b;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.cert-sub-title {
  font-size: 12px;
  color: #92400e;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.cert-body-text {
  font-size: 14px;
  line-height: 1.85;
  text-align: left;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.65);
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid rgba(185, 28, 28, 0.18);
}

.cert-seal-stamp {
  position: absolute;
  right: 32px;
  bottom: 22px;
  width: 96px;
  height: 96px;
  border: 3px solid rgba(220, 38, 38, 0.78);
  border-radius: 50%;
  color: rgba(220, 38, 38, 0.82);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  transform: rotate(-14deg);
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(220, 38, 38, 0.35);
}

/* ==================== Module 4: Dashboard KPIs & Charts ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: #ffffff;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--red-primary);
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-main);
}

.kpi-trend {
  font-size: 12px;
  color: var(--success);
  margin-top: 6px;
  font-weight: 600;
}

.bar-chart-row {
  margin-bottom: 13px;
}

.bar-label-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 5px;
  font-weight: 600;
}

.bar-track {
  height: 11px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #991b1b, #ef4444);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ==================== Modals (弹窗系统) ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.18s ease;
}

.modal-card {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.modal-header {
  padding: 16px 22px;
  background: linear-gradient(90deg, #7f1d1d, #b91c1c);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 800;
}

.modal-close {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 22px;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Code Copy Box */
.code-block-box {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px 16px;
  border-radius: 8px;
  font-family: Consolas, Monaco, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 8px;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 9px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  font-size: 13.5px;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.25s ease;
  border-left: 4px solid #f59e0b;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== Mobile & Tablet Responsive Layout (手机端原生App级深度适配) ==================== */
html, body {
  max-width: 100%;
}

@media (max-width: 960px) {
  html, body {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .top-header {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    gap: 10px;
  }

  .brand-area {
    gap: 10px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
    font-size: 19px;
  }

  .brand-title {
    font-size: 15px;
    gap: 6px;
  }

  .platform-badge {
    font-size: 10.5px;
    padding: 1px 7px;
    white-space: normal;
  }

  .brand-subtitle {
    font-size: 11px;
    line-height: 1.4;
  }

  .header-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
  }

  .role-switcher {
    grid-column: 1 / -1;
    width: 100%;
    padding: 7px 10px;
    gap: 6px;
  }

  .role-switcher span {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 12px;
  }

  .role-switcher select {
    flex: 1;
    min-width: 0;
    width: 100%;
    font-size: 12.5px;
    text-overflow: ellipsis;
  }

  .status-pill {
    font-size: 11.5px;
    padding: 5px 10px;
    justify-content: center;
  }

  .btn-reset-top {
    font-size: 11.5px;
    padding: 5px 10px;
    white-space: nowrap;
  }

  .app-body {
    flex-direction: column;
    overflow: visible;
    width: 100%;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 25;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  }

  .role-status-banner,
  .sidebar-footer,
  .nav-group-title {
    display: none;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 8px 10px;
  }

  .nav-item {
    margin-bottom: 0;
    padding: 9px 8px;
    font-size: 12.5px;
    gap: 6px;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
  }

  .nav-item.active {
    border-color: transparent;
  }

  .nav-item .nav-tag {
    display: none;
  }

  .nav-badge-count {
    font-size: 10px;
    padding: 1px 5px;
    margin-left: 2px;
  }

  .main-content {
    padding: 12px 12px 36px;
    overflow: visible;
    width: 100%;
    max-width: 100vw;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 13px 14px;
    gap: 10px;
    margin-bottom: 14px;
  }

  .section-header h2 {
    font-size: 16px;
    line-height: 1.4;
  }

  .section-header p {
    font-size: 12.5px;
    line-height: 1.5;
  }

  .engine-tags {
    gap: 6px;
  }

  .engine-tag {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* 基地名录在手机端改为原生横滑卡片轮播，省空间且体验极佳 */
  .base-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 8px;
    margin-bottom: 14px;
    -webkit-overflow-scrolling: touch;
  }

  .base-card {
    flex: 0 0 85%;
    scroll-snap-align: start;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
  }

  .kpi-card {
    padding: 13px 14px;
  }

  .kpi-value {
    font-size: 21px;
  }

  .two-col-grid,
  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .two-col-grid > *,
  .card {
    min-width: 0;
    width: 100%;
  }

  .card {
    padding: 14px;
  }

  .card-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 14.5px;
  }

  .form-group.full {
    grid-column: span 1;
  }

  .form-control {
    font-size: 14px;
    width: 100%;
    max-width: 100%;
  }

  /* 表单底部操作按钮与AI生成头部在手机端自动换行对齐 */
  .form-ai-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .form-submit-row {
    flex-direction: column-reverse;
    align-items: stretch !important;
    gap: 10px;
  }

  .form-submit-row .btn-primary {
    width: 100%;
    padding: 11px 15px;
  }

  /* 流程节点横排改双列紧凑卡片 */
  .workflow-steps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }

  .workflow-steps > span {
    display: none;
  }

  /* 手机端表格彻底改造为原生垂直卡片列表，绝不挤压变形或撑爆宽度 */
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 11px 12px;
    margin-bottom: 10px;
  }

  .data-table td {
    padding: 4px 0;
    border-bottom: none;
    word-break: break-word;
  }

  .data-table td:last-child {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed #cbd5e1;
  }

  .data-table td:last-child .btn {
    width: 100%;
  }

  /* 模块二：沙盘点位横滑 + 对话框高度自适应 */
  .spot-timeline-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 6px;
  }

  .spot-node-card {
    flex: 0 0 72%;
    scroll-snap-align: start;
  }

  .chat-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .chat-box-card {
    height: 490px;
  }

  .chat-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .chat-toolbar select {
    width: 100% !important;
  }

  .chat-toolbar > span:last-child {
    margin-left: 0 !important;
  }

  /* 模块三：闯关筛选与荣誉证书适配 */
  .quiz-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .quiz-filter-bar select {
    width: 100% !important;
  }

  .quiz-stage-bar {
    flex-direction: column;
    gap: 6px;
  }

  .certificate-frame {
    padding: 16px 12px;
  }

  .cert-main-title {
    font-size: 18px;
  }

  .cert-seal-stamp {
    width: 72px;
    height: 72px;
    right: 10px;
    bottom: 10px;
    font-size: 9.5px;
  }

  /* 模块四：SVG 环形图与折线图手机居中堆叠 */
  .donut-responsive-wrap {
    grid-template-columns: 1fr !important;
    justify-items: center;
  }

  .donut-responsive-wrap > div {
    width: 100%;
  }

  /* 弹窗适配手机屏幕 */
  .modal-overlay {
    padding: 8px;
  }

  .modal-card {
    max-height: 92vh;
    border-radius: 12px;
  }

  .modal-header {
    padding: 13px 14px;
  }

  .modal-header h3 {
    font-size: 14.5px;
  }

  .modal-body {
    padding: 14px;
  }

  .modal-footer {
    padding: 10px 14px;
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 120px;
  }
}


