/**
 * QClaw 升学顾问系统 - 全局公共样式
 * frontend/assets/common.css
 *
 * 设计规范 V1.0：
 *   - 主色：深蓝 (Navy) + 金色 (Gold) — 专业、可信赖
 *   - 字体：Noto Sans SC（Google CDN）
 *   - 组件：Sidebar / Topbar / Card / Toast / Modal / Button / Form / Table / Status Badge / Pagination
 *   - 所有前端页面统一引入此文件，覆盖各自 :root 变量
 *
 * 角色端差异化：
 *   默认变量适用于 顾问/Agent/管理员 后台管理系统
 *   学生端/家长端如需不同风格，通过覆盖 :root 变量实现（如 --primary）
 */

/* ============================================================
   1. CSS Variables（Design Tokens）
   ============================================================ */
:root {
  /* 主色 */
  --navy: #1a3a6e;
  --navy-light: #2a5caa;
  --navy-dark: #0f2450;
  --gold: #d4a574;
  --gold-light: #e8c9a0;
  --gold-dim: rgba(212, 165, 116, 0.12);

  /* 通用别名（供所有端使用） */
  --primary: #1a3a6e;
  --primary-light: #2a5caa;
  --primary-dark: #0f2450;
  --accent: #d4a574;
  --accent-light: #e8c9a0;

  /* 表面与背景 */
  --surface: #ffffff;
  --bg: #f0f3f9;
  --bg-hover: #e8ecf4;

  /* 文字 */
  --text: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #a0aec0;
  --text-inverse: #ffffff;

  /* 边框与阴影 */
  --border: #e2e8f0;
  --border-light: #edf2f7;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow: 0 2px 12px rgba(26, 58, 110, 0.08);
  --shadow-lg: 0 8px 30px rgba(26, 58, 110, 0.12);

  /* 功能色 */
  --danger: #e53e3e;
  --danger-bg: #fff5f5;
  --success: #38a169;
  --success-bg: #f0fff4;
  --warning: #dd6b20;
  --warning-bg: #fffaf0;
  --info: #3182ce;
  --info-bg: #ebf8ff;

  /* 圆角 */
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --radius-full: 9999px;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* 布局 */
  --sidebar-width: 250px;
  --topbar-height: 60px;
  --container-max: 1200px;

  /* 字体 */
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
  --font-serif: 'Noto Serif SC', 'Georgia', serif;

  /* 过渡 */
  --transition: all 0.2s ease;
  --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   2. Reset & Base
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  display: block;
}

input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================================
   3. Typography
   ============================================================ */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.3; color: var(--text); }
h2 { font-size: 1.5rem;  font-weight: 600; line-height: 1.35; color: var(--text); }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; color: var(--text); }
h4 { font-size: 1.1rem;  font-weight: 600; line-height: 1.4; color: var(--text); }

.text-sm  { font-size: 0.875rem; }
.text-xs  { font-size: 0.75rem; }
.text-lg  { font-size: 1.125rem; }
.text-muted { color: var(--text-secondary); }
.text-dim   { color: var(--text-muted); }

/* ============================================================
   4. Sidebar（后台管理通用）
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: linear-gradient(175deg, var(--navy-dark) 0%, var(--navy) 100%);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy-dark);
  flex-shrink: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: white;
  line-height: 1.3;
}

.brand-role {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 10px 12px 5px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.6);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
}

.nav-item.active {
  background: var(--gold-dim);
  color: var(--gold);
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.user-role-sm {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.4);
}

.logout-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover {
  background: rgba(255, 77, 106, 0.15);
  color: var(--danger);
}

/* ============================================================
   5. Main Content Area
   ============================================================ */
.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.main--no-sidebar {
  margin-left: 0;
}

/* ============================================================
   6. Topbar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* ============================================================
   7. Card
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: var(--space-lg);
}

.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* ============================================================
   8. Stat Cards（统计卡片行）
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-icon--navy   { background: rgba(26, 58, 110, 0.08); color: var(--navy); }
.stat-icon--gold   { background: var(--gold-dim); color: var(--gold); }
.stat-icon--danger { background: var(--danger-bg); color: var(--danger); }
.stat-icon--success { background: var(--success-bg); color: var(--success); }

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.stat-change {
  font-size: 11.5px;
  margin-top: 4px;
  font-weight: 500;
}

.stat-change--up   { color: var(--success); }
.stat-change--down { color: var(--danger); }

/* ============================================================
   9. Button
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-xs);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: white;
  border-color: var(--navy);
}

.btn--primary:hover {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
}

.btn--gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-dark);
  border-color: var(--gold);
}

.btn--outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn--outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(26, 58, 110, 0.04);
}

.btn--danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn--success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

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

.btn--lg {
  padding: 12px 28px;
  font-size: 15px;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn:disabled,
.btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================================
   10. Form
   ============================================================ */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.form-label--required::after {
  content: ' *';
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42, 92, 170, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

.form-input--error {
  border-color: var(--danger);
}

/* ============================================================
   11. Table
   ============================================================ */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table th {
  background: var(--bg);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12.5px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   12. Badge / Status Tag
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge--primary  { background: rgba(26, 58, 110, 0.08); color: var(--navy); }
.badge--success  { background: var(--success-bg); color: var(--success); }
.badge--warning  { background: var(--warning-bg); color: var(--warning); }
.badge--danger   { background: var(--danger-bg);  color: var(--danger); }
.badge--info     { background: var(--info-bg);     color: var(--info); }
.badge--gold     { background: var(--gold-dim);    color: var(--gold); }
.badge--muted    { background: var(--bg);          color: var(--text-muted); }

/* ============================================================
   13. Toast / Alert
   ============================================================ */
.toast {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 9999;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease;
  max-width: 380px;
}

.toast--success { background: var(--success); color: white; }
.toast--error   { background: var(--danger);  color: white; }
.toast--warning { background: var(--warning); color: white; }
.toast--info    { background: var(--info);    color: white; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================================
   14. Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  animation: scaleIn 0.2s ease;
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
}

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

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ============================================================
   15. Pagination
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin-top: var(--space-lg);
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.pagination-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.pagination-btn.active {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   16. Search / Filter Bar
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13.5px;
  outline: none;
  transition: var(--transition);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0aec0' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 10-1.397 1.398h-.001l3.85 3.85a1 1 0 001.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 110-10 5 5 0 010 10z'/%3E%3C/svg%3E") 12px center no-repeat;
  color: var(--text);
}

.search-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(42, 92, 170, 0.1);
}

.filter-select {
  padding: 9px 32px 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 13.5px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234a5568' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: var(--transition);
}

.filter-select:focus {
  border-color: var(--primary-light);
}

/* ============================================================
   17. Progress Bar
   ============================================================ */
.progress {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--navy), var(--navy-light));
  transition: width 0.5s ease;
}

.progress-bar--gold {
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.progress-bar--success {
  background: linear-gradient(90deg, var(--success), #68d391);
}

/* ============================================================
   18. Empty State
   ============================================================ */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

.empty-state p {
  font-size: 14px;
}

/* ============================================================
   19. Loading Spinner
   ============================================================ */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   20. Utility Classes
   ============================================================ */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-xs  { gap: var(--space-xs); }
.gap-sm  { gap: var(--space-sm); }
.gap-md  { gap: var(--space-md); }
.gap-lg  { gap: var(--space-lg); }

.text-center { text-align: center; }
.text-right  { text-align: right; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

.w-full { width: 100%; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden { display: none !important; }

/* ============================================================
   21. Responsive
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    width: 260px;
  }

  .main {
    margin-left: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
  }

  .search-input {
    min-width: 100%;
  }
}

/* ============================================================
   扩展公共组件（从页面内联 CSS 提取的跨页面高频模式）
   ============================================================ */

/* --- 页面 Header（学生端渐变/顾问端/家长端共用） --- */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--surface, #fff);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header h1 {
  font-size: 18px;
  font-weight: 500;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-nav a {
  color: var(--surface, #fff);
  text-decoration: none;
  font-size: 14px;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.header-nav a:hover {
  opacity: 1;
}
.header-nav a.active {
  opacity: 1;
  font-weight: 500;
  border-bottom: 2px solid var(--surface, #fff);
  padding-bottom: 2px;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}
.user-info span {
  font-size: 14px;
}

/* --- 页面容器（各页面覆盖 max-width） --- */
.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

/* --- 页面标题区 --- */
.page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

/* --- Section 标题 --- */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}

/* --- 操作栏 --- */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

/* --- 按钮组 --- */
.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- 消息提示（替代页内 .message） --- */
.message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  display: none;
}
.message.error {
  background: var(--danger-bg, #fff2f0);
  color: var(--danger, #f5222d);
  border: 1px solid var(--danger, #f5222d);
  display: block;
}
.message.success {
  background: var(--success-bg, #f6ffed);
  color: var(--success, #52c41a);
  border: 1px solid var(--success, #52c41a);
  display: block;
}

/* --- Loading 遮罩层 --- */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.loading-overlay.active,
.loading-overlay[style*="display: flex"],
.loading-overlay[style*="display:flex"] {
  display: flex !important;
}
.loading-text {
  font-size: 14px;
  color: var(--text-secondary, #666);
}
.loading-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  z-index: 300;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.loading-mask.active {
  display: flex;
}

/* --- 步骤条 --- */
.step {
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}
.step-circle.active {
  background: var(--primary);
  color: var(--surface, #fff);
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
}

/* --- Logo --- */
.logo {
  text-align: center;
  margin-bottom: 30px;
}
.logo h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}
.logo p {
  color: var(--text-secondary, #666);
  font-size: 14px;
}

/* --- Plan Header --- */
.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- 风险标签 --- */
.risk-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.risk-tag.low {
  background: var(--success-bg, #f6ffed);
  color: var(--success, #52c41a);
}
.risk-tag.high {
  background: var(--danger-bg, #fff2f0);
  color: var(--danger, #f5222d);
}
.risk-tag.medium {
  background: var(--warning-bg, #fff7e6);
  color: var(--warning, #fa8c16);
}

/* --- Input 扩展（补充页面常用 input/select/textarea 样式） --- */
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
}

/* --- @keyframes 补充 --- */
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

