:root {
  --bg-primary: #0b1020;
  --bg-secondary: #0a0f1f;
  --bg-gradient-1: rgba(79, 70, 229, 0.16);
  --bg-gradient-2: rgba(2, 132, 199, 0.14);
  --header-bg-1: rgba(15, 23, 42, 0.9);
  --header-bg-2: rgba(30, 41, 59, 0.75);
  --header-border: rgba(148, 163, 184, 0.2);
  --text-primary: #e2e8f0;
  --text-secondary: rgba(226, 232, 240, 0.8);
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-border: rgba(148, 163, 184, 0.18);
  --section-title: #0f172a;
  --section-hint: #475569;
  --stepper-bg: rgba(248, 250, 252, 0.9);
  --stepper-border: rgba(148, 163, 184, 0.35);
  --stepper-hover: rgba(99, 102, 241, 0.55);
  --stepper-active: rgba(99, 102, 241, 0.9);
  --stepper-active-bg: rgba(99, 102, 241, 0.08);
  --stepper-num-bg: rgba(99, 102, 241, 0.15);
  --stepper-num-color: #4f46e5;
  --chart-bg: rgba(15, 23, 42, 0.03);
  --chart-border: rgba(100, 116, 139, 0.4);
  --btn-outline: btn-outline-light;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-gradient-1: rgba(59, 130, 246, 0.08);
  --bg-gradient-2: rgba(139, 92, 246, 0.06);
  --header-bg-1: rgba(255, 255, 255, 0.95);
  --header-bg-2: rgba(248, 250, 252, 0.9);
  --header-border: rgba(148, 163, 184, 0.25);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --card-bg: rgba(255, 255, 255, 0.98);
  --card-border: rgba(148, 163, 184, 0.2);
  --section-title: #0f172a;
  --section-hint: #475569;
  --stepper-bg: rgba(255, 255, 255, 0.95);
  --stepper-border: rgba(148, 163, 184, 0.3);
  --stepper-hover: rgba(59, 130, 246, 0.5);
  --stepper-active: rgba(59, 130, 246, 0.8);
  --stepper-active-bg: rgba(59, 130, 246, 0.06);
  --stepper-num-bg: rgba(59, 130, 246, 0.12);
  --stepper-num-color: #2563eb;
  --chart-bg: rgba(241, 245, 249, 0.8);
  --chart-border: rgba(148, 163, 184, 0.3);
}

.app-shell {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% 0%, var(--bg-gradient-1), transparent 50%),
    radial-gradient(900px 500px at 90% 10%, var(--bg-gradient-2), transparent 55%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 35%, var(--bg-secondary) 100%);
  transition: background 0.3s ease;
}

.app-header {
  background: linear-gradient(90deg, var(--header-bg-1), var(--header-bg-2));
  border-bottom: 1px solid var(--header-border);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.app-title {
  font-weight: 800;
  letter-spacing: 0.2px;
  font-size: 1.1rem;
}

.app-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.card {
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.section-title {
  font-weight: 800;
  color: var(--section-title);
}

.section-hint {
  color: var(--section-hint);
  font-size: 0.9rem;
  margin-top: 4px;
}

.stepper {
  display: grid;
  gap: 8px;
}

.stepper-item {
  width: 100%;
  border: 1px solid var(--stepper-border);
  background: var(--stepper-bg);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  text-align: left;
}

.stepper-item:hover {
  transform: translateY(-1px);
  border-color: var(--stepper-hover);
}

.stepper-item.active {
  border-color: var(--stepper-active);
  background: var(--stepper-active-bg);
}

.stepper-item .num {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--stepper-num-bg);
  color: var(--stepper-num-color);
  font-weight: 800;
}

.stepper-item.active .num {
  background: var(--stepper-active-bg);
}

.stepper-item .txt {
  font-weight: 700;
  color: var(--section-title);
  font-size: 0.95rem;
}

.stepper-item.disabled {
  cursor: not-allowed;
  opacity: 0.4;
  pointer-events: none;
}

.sticky-card {
  position: sticky;
  top: 16px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
}

textarea.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
}

.table thead th {
  white-space: nowrap;
}

.table td,
.table th {
  vertical-align: middle;
}

.input-mini {
  min-width: 90px;
}

.sum-cell {
  background: rgba(15, 23, 42, 0.04);
  font-weight: 700;
}

.chart-wrap {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  padding: 16px 12px 12px;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  position: relative;
  min-height: 120px;
}

.chart-resize-handle {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 26px;
  height: 26px;
  cursor: nwse-resize;
  background: 
    linear-gradient(135deg, transparent 50%, rgba(148, 163, 184, 0.55) 50%, rgba(148, 163, 184, 0.55) 60%, transparent 60%),
    linear-gradient(135deg, transparent 50%, rgba(148, 163, 184, 0.55) 50%, rgba(148, 163, 184, 0.55) 80%, transparent 80%),
    linear-gradient(135deg, transparent 50%, rgba(148, 163, 184, 0.55) 50%);
  background-size: 7px 7px, 11px 11px, 15px 15px;
  background-position: bottom right;
  background-repeat: no-repeat;
  border-radius: 0 0 4px 0;
  z-index: 10;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
  pointer-events: auto;
}

.chart-resize-handle::after {
  content: "";
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(148, 163, 184, 0.7);
  border-bottom: 2px solid rgba(148, 163, 184, 0.7);
}

.chart-resize-handle:hover {
  opacity: 1;
  background: 
    linear-gradient(135deg, transparent 50%, rgba(59, 130, 246, 0.8) 50%, rgba(59, 130, 246, 0.8) 60%, transparent 60%),
    linear-gradient(135deg, transparent 50%, rgba(59, 130, 246, 0.8) 50%, rgba(59, 130, 246, 0.8) 80%, transparent 80%),
    linear-gradient(135deg, transparent 50%, rgba(59, 130, 246, 0.8) 50%);
  background-size: 7px 7px, 11px 11px, 15px 15px;
  background-position: bottom right;
  background-repeat: no-repeat;
}

.chart-resize-handle:hover::after {
  border-right-color: rgba(59, 130, 246, 0.9);
  border-bottom-color: rgba(59, 130, 246, 0.9);
}

.badge {
  letter-spacing: 0.2px;
}


/* AI流程相关样式 */
#aiFlowSyllabusBlock,
#aiFlowScoresBlock {
  animation: fadeIn 0.3s ease-in;
}

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

#syllabusConfirmBlock,
#scoresConfirmBlock {
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#btnConfirmSyllabus,
#btnConfirmScores {
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
  transition: all 0.2s ease;
}

#btnConfirmSyllabus:hover,
#btnConfirmScores:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

#btnStartAiFlow {
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
  transition: all 0.2s ease;
}

#btnStartAiFlow:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.license-verify-btn:hover {
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
}
.license-msg {
  color: #dc2626;
}

/* 表格数值居中 */
.num-cell {
  text-align: center;
}

/* 课程归档：拖拽排序（拖到某行 = 插入到该行上方） */
.archive-drag-handle:active {
  cursor: grabbing;
}
.archive-list-item.archive-dragging {
  opacity: 0.6;
}
.archive-list-item.archive-drag-over {
  border-top: 3px solid var(--bs-primary, #0d6efd) !important;
}

/* 归档上传成功浮层提示 */
.archive-toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.archive-toast-msg.archive-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 步骤 3 粘贴区 placeholder：红色加粗 */
#textareaPaste::placeholder {
  color: #dc3545;
  font-weight: bold;
}

/* 权重矩阵中表内权重与列合计不一致的考核项列高亮 */
.highlight-weight-mismatch {
  background-color: rgba(220, 53, 69, 0.15) !important;
  color: #b02a37;
  font-weight: bold;
}

/* 第三步成绩表：0 分高亮 */
.score-zero {
  background-color: rgba(255, 193, 7, 0.25) !important;
}
.score-zero input {
  background-color: rgba(255, 193, 7, 0.2);
  font-weight: bold;
}

/* 第三步成绩表：成绩缺失高亮 */
.score-missing {
  background-color: rgba(220, 53, 69, 0.2) !important;
}
.score-missing input {
  background-color: rgba(220, 53, 69, 0.15);
  font-weight: bold;
}

/* 有悬停说明时的提示符号，红色加粗更显眼，提醒用户可鼠标悬停查看 */
.hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  margin-left: 4px;
  font-size: 0.95em;
  line-height: 1;
  color: #dc2626;
  font-weight: bold;
  cursor: help;
  border-radius: 50%;
  font-style: normal;
}
.hint-icon:hover {
  color: #b91c1c;
}

/* 权重输入框的placeholder颜色更浅 */
.weight-placeholder::placeholder {
  color: rgba(0, 0, 0, 0.3);
  opacity: 1;
}

/* 第三步主观问卷两个表：内容居中 */
.table-subjective-center th,
.table-subjective-center td {
  text-align: center;
}
.table-subjective-center input.text-center {
  text-align: center;
}

/* 导出 HTML 时把步骤5/6移到屏幕外采集图表，避免用户看到散点图闪现 */
.export-capture-offscreen {
  position: fixed !important;
  left: -9999px !important;
  top: 0 !important;
  width: 100vw !important;
  z-index: -1 !important;
  pointer-events: none !important;
}

.admin-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #eff6ff 0%, #eef2ff 38%, #f8fafc 100%);
}

.admin-shell {
  min-height: 100vh;
}

.admin-hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(900px 420px at 12% 0%, rgba(59, 130, 246, 0.2), transparent 58%),
    radial-gradient(780px 360px at 92% 20%, rgba(99, 102, 241, 0.16), transparent 56%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #0f172a 100%);
  color: #e2e8f0;
}

.admin-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.admin-hero-panel {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.56));
  backdrop-filter: blur(16px);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.admin-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(191, 219, 254, 0.92);
  margin-bottom: 10px;
}

.admin-title {
  font-size: clamp(1.8rem, 2.5vw, 2.5rem);
  font-weight: 800;
  color: #f8fafc;
}

.admin-subtitle {
  max-width: 760px;
  color: rgba(226, 232, 240, 0.82);
  line-height: 1.7;
}

.admin-main {
  margin-top: -26px;
  position: relative;
  z-index: 2;
}

.admin-login-card {
  max-width: 840px;
  margin: 0 auto 2rem;
  border-radius: 24px;
}

.admin-stat-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: all 0.2s ease;
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.admin-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.admin-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 0.25rem;
}

.chart-container {
  position: relative;
  width: 100%;
}

.admin-workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.admin-sidebar {
  min-width: 0;
}

.admin-tabs-shell,
.admin-module-card {
  border-radius: 24px;
}

.admin-tabs-shell .card-body,
.admin-module-card .card-body {
  padding: 24px;
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-chip-primary {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.admin-tabs {
  display: grid;
  gap: 12px;
}

.admin-tab {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.82);
  color: #334155;
  border-radius: 18px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.admin-tab:hover {
  border-color: rgba(59, 130, 246, 0.5);
  color: #1d4ed8;
  transform: translateY(-1px);
}

.admin-tab.active {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.22);
}

.admin-module-viewport {
  min-width: 0;
}

.admin-module-panel + .admin-module-panel {
  margin-top: 24px;
}

.admin-table-wrap {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
}

.admin-search {
  min-width: 220px;
}

.admin-filter {
  min-width: 130px;
}

.admin-selected-user {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-page .form-control,
.admin-page .form-select {
  border-radius: 12px;
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.92);
}

.admin-page .form-control:focus,
.admin-page .form-select:focus {
  border-color: rgba(59, 130, 246, 0.72);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.admin-page .btn {
  border-radius: 12px;
}

.admin-page .table thead th {
  background: rgba(241, 245, 249, 0.95);
}

.admin-row-selected > td {
  background: rgba(59, 130, 246, 0.08) !important;
}

@media (max-width: 1199.98px) {
  .admin-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .admin-search {
    min-width: 180px;
  }
}

@media (max-width: 991.98px) {
  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .admin-sidebar .sticky-card {
    position: static;
  }

  .admin-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .admin-hero-panel,
  .admin-tabs-shell .card-body,
  .admin-module-card .card-body {
    padding: 18px;
  }

  .admin-main {
    margin-top: -18px;
  }

  .admin-search,
  .admin-filter {
    min-width: 100%;
  }

  .admin-tab {
    width: 100%;
  }

  .admin-tabs {
    grid-template-columns: 1fr;
  }
}

/* 主题切换按钮 */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.theme-toggle-btn.light-mode {
  background: rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.3);
}

.theme-toggle-btn.light-mode:hover {
  background: rgba(255, 255, 255, 0.25);
}

.theme-toggle-btn.dark-mode {
  background: rgba(15, 23, 42, 0.1);
  color: #1e293b;
  border-color: rgba(148, 163, 184, 0.3);
}

.theme-toggle-btn.dark-mode:hover {
  background: rgba(15, 23, 42, 0.15);
}

/* 浅色主题下的按钮样式调整 */
[data-theme="light"] .btn-outline-light {
  color: #475569;
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .btn-outline-light:hover {
  background: rgba(241, 245, 249, 1);
  border-color: rgba(148, 163, 184, 0.6);
  color: #1e293b;
}

[data-theme="light"] .btn-light {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
}

[data-theme="light"] .btn-light:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
}

/* 浅色主题下的 dropdown 样式 */
[data-theme="light"] .dropdown-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .dropdown-item:hover {
  background: rgba(59, 130, 246, 0.08);
}

/* 浅色主题下的模态框 */
[data-theme="light"] .modal-content {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(148, 163, 184, 0.2);
}

/* 浅色主题下的输入框 */
[data-theme="light"] .form-control {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .form-control:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 用户信息文字颜色 */
.user-info-text {
  color: rgba(226, 232, 240, 0.9);
}

[data-theme="light"] .user-info-text {
  color: #475569;
}
