/* ============================================================
   活动报名系统 · 设计系统
   ============================================================ */
:root {
  --brand: #2f5bff;
  --brand-dark: #1e42d6;
  --brand-soft: #eef2ff;
  --brand-grad: linear-gradient(135deg, #3b66ff 0%, #6f4dff 100%);

  --ink: #0f172a;
  --ink-2: #344054;
  --ink-3: #667085;
  --ink-4: #98a2b3;

  --bg: #f5f6f9;
  --surface: #ffffff;
  --line: #e8eaf0;
  --line-2: #f1f3f7;

  --green: #12b76a;
  --green-soft: #e8f8f0;
  --amber: #f79009;
  --amber-soft: #fff6e8;
  --red: #f04438;
  --red-soft: #feecea;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px rgba(16, 24, 40, .07);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .12);

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

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { padding-left: 1.25em; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: all .16s ease;
  border: 1px solid transparent;
  user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(47, 91, 255, .3); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: #fafbfc; border-color: #d5d9e2; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover:not(:disabled) { background: #e3e9ff; }
.btn-danger { background: #fff; color: var(--red); border-color: #f5c6c2; }
.btn-danger:hover:not(:disabled) { background: var(--red-soft); }
.btn-lg { height: 48px; font-size: 16px; border-radius: var(--r-md); padding: 0 28px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn-link { color: var(--brand); padding: 0 4px; height: auto; font-weight: 500; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--red); }
/* 不可删除时保持可读，用灰色+禁用光标表达「规则不允许」而不是「按钮坏了」 */
.btn-link.danger:disabled { color: var(--ink-4); cursor: not-allowed; text-decoration: none; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.card-pad { padding: 20px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px;
}
.field-label .req { color: var(--red); font-weight: 600; }
.field-hint { font-size: 12px; color: var(--ink-4); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--red); margin-top: 4px; display: none; }
.field.has-error .field-error { display: block; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--red); }

.input, .select, .textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 91, 255, .12);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:disabled, .input[readonly] { background: #f8f9fb; color: var(--ink-3); }

.input-group { display: flex; align-items: center; gap: 8px; }
.input-group .input { flex: 1; }
.range-sep { color: var(--ink-4); }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; background: #d0d5dd; border-radius: 22px;
  transition: .2s; cursor: pointer;
}
.switch span::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm);
}
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--brand-soft); color: var(--brand);
}
.tag-gray { background: #f2f4f7; color: var(--ink-3); }
.tag-green { background: var(--green-soft); color: var(--green); }
.tag-amber { background: var(--amber-soft); color: #b54708; }
.tag-red { background: var(--red-soft); color: var(--red); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: #f6f7fa; color: var(--ink-2); font-size: 13px;
  border: 1px solid var(--line-2);
}
.chip svg { opacity: .6; }

/* ---------------- 进度条 ---------------- */
.progress { height: 8px; background: #eef0f5; border-radius: 999px; overflow: hidden; }
.progress > i {
  display: block; height: 100%; border-radius: 999px;
  background: var(--brand-grad); transition: width .5s ease;
}
.progress.warn > i { background: linear-gradient(135deg, #fdb022, #f79009); }
.progress.danger > i { background: linear-gradient(135deg, #f97066, #f04438); }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3);
  padding: 10px 12px; background: #fafbfc; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle;
}
.table tbody tr:hover { background: #fafbff; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { font-variant-numeric: tabular-nums; }

/* ---------------- 空态 ---------------- */
.empty { padding: 56px 20px; text-align: center; color: var(--ink-4); }
.empty svg { margin: 0 auto 12px; opacity: .5; }
.empty-title { font-size: 14px; color: var(--ink-3); margin-bottom: 4px; }

/* ---------------- 提示 ---------------- */
.toast-wrap {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  padding: 10px 18px; border-radius: 10px; background: rgba(15, 23, 42, .92);
  color: #fff; font-size: 14px; box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease; max-width: 90vw;
}
.toast.success { background: #0b8a52; }
.toast.error { background: #d92d20; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------- 弹窗（桌面） ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px; backdrop-filter: blur(2px);
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.dialog {
  background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 520px;
  max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: popIn .2s cubic-bezier(.2, .8, .3, 1);
}
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }
.dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line-2);
}
.dialog-title { font-size: 16px; font-weight: 600; }
.dialog-body { padding: 20px; overflow-y: auto; }
.dialog-foot {
  padding: 14px 20px; border-top: 1px solid var(--line-2);
  display: flex; justify-content: flex-end; gap: 10px;
}
.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  color: var(--ink-4); transition: all .15s;
}
.icon-btn:hover { background: #f2f4f7; color: var(--ink-2); }

/* ---------------- 移动端底部弹窗 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .5);
  z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .2s ease;
}
.sheet {
  width: 100%; max-width: 560px; background: #fff;
  border-radius: 20px 20px 0 0; max-height: 92vh;
  display: flex; flex-direction: column;
  animation: sheetUp .26s cubic-bezier(.2, .8, .3, 1);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle {
  width: 36px; height: 4px; border-radius: 4px; background: #e4e7ec;
  margin: 10px auto 0;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 8px;
}
.sheet-title { font-size: 17px; font-weight: 600; }
.sheet-body { padding: 8px 20px 4px; overflow-y: auto; flex: 1; }
.sheet-foot {
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-2);
  background: #fff;
}

/* ---------------- 每人限报一个场次：改报引导 ---------------- */
.dup-note {
  background: var(--amber-soft); border: 1px solid #fde3bf;
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 12px;
}
.dup-note-title { font-size: 14px; font-weight: 600; color: #b54708; margin-bottom: 4px; }
.dup-tips { font-size: 12.5px; line-height: 1.9; color: var(--ink-3); padding: 0 2px; }
.dup-foot { display: flex; flex-direction: column; gap: 8px; }

/* ---------------- 删除确认弹窗（v1.6） ---------------- */
.confirm-name {
  font-size: 15px; font-weight: 600; color: var(--ink);
  background: var(--bg); border-radius: var(--r-md);
  padding: 10px 12px; margin-bottom: 12px;
  word-break: break-all;
}
.confirm-list { font-size: 13px; line-height: 1.85; color: var(--ink-3); display: flex; flex-direction: column; gap: 6px; }
.confirm-list > div { position: relative; padding-left: 14px; }
.confirm-list > div::before { content: '·'; position: absolute; left: 2px; color: var(--ink-4); font-weight: 700; }
.confirm-danger {
  color: #b42318; background: #fef3f2; border: 1px solid #fecdca;
  border-radius: 8px; padding: 8px 10px 8px 12px;
}
.confirm-danger::before { color: #b42318 !important; }

/* ---------------- 工具类 ---------------- */
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }
.scroll-x { overflow-x: auto; }

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #eef0f4 25%, #f7f8fa 37%, #eef0f4 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d8dce4; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #c4c9d4; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------- v1.2：状态标签 / 危险操作按钮 / 文本按钮 ---------------- */
.tag-blue { background: var(--brand-soft); color: var(--brand); }
.btn-danger-ghost {
  background: #fff; color: var(--red); border-color: #f5c6c2;
}
.btn-danger-ghost:hover:not(:disabled) { background: var(--red-soft); border-color: #f0a9a2; }
.text-link {
  background: none; border: none; padding: 4px 8px; cursor: pointer;
  font-size: 13px; color: var(--brand); font-family: inherit;
  border-bottom: 1px dashed rgba(37, 99, 235, .35);
}
.text-link:hover { color: var(--brand-dark, #1d4ed8); }
