/* 共用设计变量与基础组件 —— 浅色、克制、留白充足
 * 设计 token 体系：色彩 / 字阶 / 间距 / 圆角 / 阴影 / 动效 / 层级
 * 所有页面共用同一套语义变量，保证 H5、我的报名、PC 后台视觉一致。 */
:root {
  /* 中性 */
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --surface-3: #F0F2F5;
  --ink: #172033;
  --ink-2: #4A5568;
  --ink-3: #8A93A3;
  --line: #E7EAF0;
  --line-soft: #F0F2F5;

  /* 品牌：墨蓝色阶 */
  --primary-50: #EEF3FA;
  --primary-100: #DCE7F5;
  --primary-200: #B8CCE8;
  --primary-300: #8FAED6;
  --primary-400: #5C82B8;
  --primary-500: #33578A;
  --primary-600: #274671;
  --primary-700: #223A5E;
  --primary-800: #1A2E4A;
  --primary-900: #122238;
  --primary: #223A5E;
  --primary-2: #33578A;
  --primary-soft: #EDF2F9;

  /* 点缀：暖金色阶 */
  --gold-100: #FBF6EA;
  --gold-200: #F3E7CD;
  --gold-300: #E4CE9D;
  --gold-500: #B1863F;
  --gold-600: #8F6A2F;
  --accent: #B1863F;
  --accent-soft: #F8F2E6;

  /* 语义色，均满足正文 4.5:1 对比度 */
  --success: #2E7D5B;
  --success-soft: #EAF5EF;
  --warn: #A8581F;
  --warn-soft: #FBF0E6;
  --danger: #B93B32;
  --danger-soft: #FBEEEC;
  --info: #274671;
  --info-soft: #EDF2F9;

  /* 圆角 */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* 阴影：四级高度 */
  --shadow-xs: 0 1px 2px rgba(23, 32, 51, .04);
  --shadow-sm: 0 2px 8px rgba(23, 32, 51, .05);
  --shadow: 0 6px 24px rgba(23, 32, 51, .06);
  --shadow-md: 0 10px 32px rgba(23, 32, 51, .09);
  --shadow-lg: 0 16px 48px rgba(23, 32, 51, .12);
  --shadow-gold: 0 8px 24px rgba(177, 134, 63, .18);

  /* 间距：4px 基准 */
  --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; --space-16: 64px;

  /* 字阶 */
  --text-xs: 11px; --text-sm: 12px; --text-base: 14px; --text-md: 15px;
  --text-lg: 17px; --text-xl: 20px; --text-2xl: 24px; --text-3xl: 30px; --text-4xl: 36px;
  --leading-tight: 1.3; --leading-snug: 1.45; --leading-normal: 1.7; --leading-relaxed: 1.85;

  /* 动效 */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur-fast: 150ms; --dur-normal: 240ms; --dur-slow: 400ms;

  /* 层级 */
  --z-bar: 40; --z-mask: 90; --z-modal: 91; --z-toast: 120; --z-progress: 130;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #EDF0F4;
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding-left: 0; list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--primary-2); text-decoration: none; }
img { max-width: 100%; display: block; }

/* 文本 */
.t-title { font-size: 20px; font-weight: 600; letter-spacing: .01em; line-height: 1.45; }
.t-sub { font-size: 15px; font-weight: 600; color: var(--ink); }
.t-body { font-size: 14px; color: var(--ink-2); line-height: 1.85; }
.t-small { font-size: 12px; color: var(--ink-3); line-height: 1.7; }
.t-num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.strong { font-weight: 600; color: var(--ink); }
.accent { color: var(--accent); }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* 卡片与分区 */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 17px; font-weight: 600; letter-spacing: .02em; }
.section-head .eyebrow { font-size: 11px; letter-spacing: .16em; color: var(--accent); text-transform: uppercase; }
.eyebrow { font-size: 11px; letter-spacing: .16em; color: var(--accent); }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; line-height: 1.6; font-weight: 500;
  background: var(--primary-soft); color: var(--primary);
}
.tag-accent { background: var(--accent-soft); color: var(--accent); }
.tag-success { background: var(--success-soft); color: var(--success); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-danger { background: var(--danger-soft); color: var(--danger); }
.tag-gray { background: #F0F2F5; color: var(--ink-3); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 20px; border-radius: 10px;
  font-size: 14px; font-weight: 600; letter-spacing: .02em;
  transition: transform .15s, opacity .15s, background .15s;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline { border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); }
.btn-outline:hover { border-color: var(--primary-2); color: var(--primary); }
.btn-ghost { color: var(--primary); padding: 0 10px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 48px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-danger { background: var(--danger-soft); color: var(--danger); }

/* 表单 */
.field { display: block; margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(51, 87, 138, .08); }
.textarea { min-height: 84px; resize: vertical; line-height: 1.7; }
.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--ink-3); }
.checkline input { margin-top: 4px; }

/* 进度条 */
.progress { height: 6px; border-radius: 99px; background: #EDF0F4; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary-2), #6E8FBF); transition: width .5s; }

/* 表格 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
table.grid th {
  text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12px;
  padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.grid td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tr:hover td { background: #FBFCFE; }
table.grid td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 提示条 */
.notice {
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; line-height: 1.75;
  background: var(--primary-soft); color: var(--primary);
}
.notice-accent { background: var(--accent-soft); color: #8A6528; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-danger { background: var(--danger-soft); color: var(--danger); }
.notice-success { background: var(--success-soft); color: var(--success); }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(18, 26, 40, .45); z-index: 90; display: none; }
.mask.show { display: block; }
.modal {
  position: fixed; z-index: 91; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 420px); max-height: 84vh; overflow-y: auto;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  padding: 22px; display: none;
}
.modal.show { display: block; }
.modal h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.modal .modal-foot { display: flex; gap: 10px; margin-top: 20px; }
.modal .modal-foot .btn { flex: 1; }

/* Toast */
.toast {
  position: fixed; z-index: 120; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(10px);
  background: rgba(23, 32, 51, .92); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 小工具 */
.empty { text-align: center; color: var(--ink-3); padding: 36px 12px; font-size: 13px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13px; }
.kv .k { color: var(--ink-3); }
.kv .v { color: var(--ink); font-weight: 500; text-align: right; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.hidden { display: none !important; }

/* ---------- 可访问性与状态基线（所有页面共用） ---------- */
:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 3px;
  border-radius: 3px;
}
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 3px;
}
::selection { background: var(--primary-200); color: var(--primary-900); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; z-index: 200; top: 8px; left: 50%; transform: translate(-50%, -180%);
  padding: 10px 18px; border-radius: var(--radius-sm);
  background: var(--primary-700); color: #fff; font-size: 13px; font-weight: 600;
  transition: transform var(--dur-normal) var(--ease-out);
}
.skip-link:focus { transform: translate(-50%, 0); color: #fff; }

/* 加载中：按钮与骨架屏 */
.btn.is-loading { pointer-events: none; opacity: .78; }
.btn.is-loading::before {
  content: ''; width: 14px; height: 14px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: oc-spin .7s linear infinite;
}
@keyframes oc-spin { to { transform: rotate(360deg); } }
.skeleton {
  position: relative; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--surface-3); color: transparent !important;
}
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: translateX(-100%); animation: oc-shimmer 1.4s infinite;
}
@keyframes oc-shimmer { to { transform: translateX(100%); } }

/* 表单错误态 */
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger); background: var(--danger-soft);
}
.field-error { display: block; margin-top: 5px; font-size: 12px; color: var(--danger); }

/* Toast 语义变体 */
.toast.is-success { background: rgba(30, 96, 70, .95); }
.toast.is-error   { background: rgba(150, 45, 38, .95); }

/* Toast 类型化 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .skeleton::after { display: none; }
}
