/* ============================================================
   002 学生参赛报名系统 · 共享样式
   设计基调：干净清爽 / 专业规范（企业级表单）
   - 浅灰底 + 白卡 + 单一主色（专业蓝），细边框、轻投影
   - 桌面双列表单、移动端单列；控件统一 44px 高、8px 圆角
   - 零外部依赖：图标均为内联 SVG / data-uri
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: rgba(37, 99, 235, .1);
  --ink: #1f2733;          /* 主文字 */
  --ink-2: #3a4657;        /* 次主文字/标签 */
  --ink-3: #6a7688;        /* 辅助文字 */
  --ink-4: #97a1b2;        /* 占位/弱提示 */
  --line: #d5dbe5;         /* 边框 */
  --line-soft: #edf0f5;    /* 分隔线 */
  --bg: #f3f5f9;           /* 页面底 */
  --card: #ffffff;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-line: #fecaca;
  --ok: #16a34a;
  --ok-bg: #e9f7ef;
  --radius-card: 14px;
  --radius-ctl: 8px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px rgba(16, 24, 40, .07);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- 页面骨架 ---------- */
.page { max-width: 860px; margin: 0 auto; padding: 44px 24px 64px; }

.site-head { margin-bottom: 22px; }
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, .25);
}
.brand-title { font-size: 21px; font-weight: 700; letter-spacing: .5px; margin: 0; }
.brand-sub { font-size: 13px; color: var(--ink-3); margin: 2px 0 0; }

.card {
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 30px 32px;
}

.site-foot { text-align: center; font-size: 12px; color: var(--ink-4); margin-top: 26px; }

/* ---------- 表单分区 ---------- */
.fsec + .fsec { margin-top: 26px; }
.fsec-t {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  letter-spacing: 1px; margin: 0 0 16px;
}
.fsec-t::before {
  content: ""; width: 3px; height: 13px; border-radius: 2px;
  background: var(--primary); flex: none;
}

.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.span2 { grid-column: 1 / -1; }

.field { min-width: 0; }
.field label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 7px;
}
.req { color: var(--danger); margin-left: 2px; font-weight: 700; }

/* ---------- 控件 ---------- */
input[type="text"], input[type="password"], input[type="tel"], select {
  width: 100%; height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  background: #fff;
  font-size: 15px; font-family: var(--font); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder { color: var(--ink-4); }
input:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a7688' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
.mono { font-variant-numeric: tabular-nums; letter-spacing: .3px; }

/* 固定值展示（所属区/所属学校由页面固定，随表单一并提交） */
.fixed-val {
  min-height: 44px;
  display: flex; align-items: center;
  padding: 0 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-ctl);
  background: #f8fafc;
  font-size: 15px; font-weight: 500; color: var(--ink);
  word-break: break-all;
}

.hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; min-height: 18px; }

/* 错误态 */
.field.err input, .field.err select { border-color: var(--danger); }
.field.err input:focus, .field.err select:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.err-msg { display: none; font-size: 12px; color: var(--danger); margin-top: 6px; }
.field.err .err-msg { display: block; }

/* 提交级错误横幅 */
.form-alert {
  display: none;
  background: var(--danger-bg); border: 1px solid var(--danger-line);
  border-radius: var(--radius-ctl);
  color: #b91c1c; font-size: 13px;
  padding: 11px 14px; margin-bottom: 20px;
}
.form-alert.show { display: block; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 26px;
  border: none; border-radius: var(--radius-ctl);
  font-size: 15px; font-weight: 600; font-family: var(--font);
  cursor: pointer; transition: background .15s, transform .05s, color .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: #9db8f0; cursor: default; transform: none; }
.btn-ghost {
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
}
.btn-ghost:hover { background: #f7f9fc; border-color: #c3ccd9; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 7px; }
.btn-link {
  background: none; border: none; color: var(--primary);
  font-size: 13px; cursor: pointer; padding: 4px 6px;
}
.btn-link:hover { text-decoration: underline; }

/* 加载圈 */
.spin {
  width: 16px; height: 16px; flex: none;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff; border-radius: 50%;
  animation: rot .7s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- 表单底部 ---------- */
.form-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 28px; padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}
.privacy { font-size: 12px; color: var(--ink-4); margin: 0; }

/* ---------- 成功面板 ---------- */
.success-card { text-align: center; padding: 46px 32px 40px; }
.ok-ico {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--ok-bg); color: var(--ok);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.ok-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.ok-sub { font-size: 13px; color: var(--ink-3); margin: 0 0 26px; }

.sum-list {
  max-width: 460px; margin: 0 auto 28px; text-align: left;
  border: 1px solid var(--line-soft); border-radius: 10px;
  overflow: hidden;
}
.sum-row {
  display: flex; gap: 14px; padding: 10px 16px; font-size: 13.5px;
}
.sum-row + .sum-row { border-top: 1px solid var(--line-soft); }
.sum-row dt { width: 88px; flex: none; color: var(--ink-3); margin: 0; }
.sum-row dd { margin: 0; color: var(--ink); font-weight: 500; word-break: break-all; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .page { padding: 26px 14px 48px; }
  .card { padding: 22px 18px; border-radius: 12px; }
  .fgrid { grid-template-columns: 1fr; gap: 14px; }
  .form-foot { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .form-foot .btn { width: 100%; }
  .privacy { text-align: center; }
  .brand-title { font-size: 19px; }
}

/* ============================================================
   查看页（view.html）专用
   ============================================================ */

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-in {
  max-width: 1180px; margin: 0 auto; padding: 13px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.tb-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.tb-title .brand-mark { width: 32px; height: 32px; border-radius: 8px; font-size: 15px; }
.count-pill {
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: var(--primary-soft); border-radius: 999px;
  padding: 2px 10px; margin-left: 2px;
}
.tb-acts { display: flex; align-items: center; gap: 8px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 24px 56px; }

/* 工具栏 */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 16px;
}
.toolbar input[type="text"], .toolbar select { height: 38px; font-size: 13.5px; }
.tb-search { flex: 1 1 220px; min-width: 180px; max-width: 340px; }
.tb-sel { width: 130px; flex: none; }

/* 表格 */
.table-card {
  background: var(--card); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table.rt { width: 100%; border-collapse: collapse; }
.rt th {
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  text-align: left; white-space: nowrap;
  background: #f8fafc; padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.rt td {
  font-size: 13px; color: var(--ink);
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft);
  vertical-align: middle; white-space: nowrap;
}
.rt tbody tr:hover { background: #f8fafc; }
.rt tbody tr:last-child td { border-bottom: none; }
.rt .c-name { font-weight: 600; }
.rt .c-act { width: 1%; }
.row-copy {
  border: none; background: none; color: var(--primary);
  font-size: 12.5px; cursor: pointer; padding: 3px 7px; border-radius: 6px;
}
.row-copy:hover { background: var(--primary-soft); }
.row-copy.done { color: var(--ok); }

/* 空态 */
.empty { text-align: center; padding: 72px 20px; color: var(--ink-3); }
.empty-ico {
  width: 54px; height: 54px; border-radius: 50%;
  background: #f1f4f9; color: #aab4c5;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.empty p { margin: 0; font-size: 13.5px; }

/* 密码门 */
.gate-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate-card { width: 100%; max-width: 380px; text-align: center; }
.gate-card .ok-ico, .gate-card .lock-ico {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.gate-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.gate-sub { font-size: 13px; color: var(--ink-3); margin: 0 0 22px; }
.gate-card .field { text-align: left; margin-bottom: 14px; }
.gate-card .btn { width: 100%; }
.gate-err {
  display: none; font-size: 12.5px; color: var(--danger);
  text-align: left; margin-bottom: 12px;
}
.gate-err.show { display: block; }

/* 移动端：表格转卡片 */
@media (max-width: 760px) {
  .topbar-in { padding: 11px 14px; }
  .wrap { padding: 16px 14px 44px; }
  .tb-search { max-width: none; }
  .tb-sel { width: calc(50% - 5px); }
  .rt thead { display: none; }
  .rt, .rt tbody, .rt tr, .rt td { display: block; width: 100%; }
  .rt tr {
    background: #fff; border: 1px solid var(--line-soft);
    border-radius: 10px; margin-bottom: 10px; padding: 6px 12px;
  }
  .rt tbody tr:hover { background: #fff; }
  .rt td {
    border-bottom: none; padding: 6px 0;
    display: flex; align-items: baseline; gap: 12px; white-space: normal;
  }
  .rt td::before {
    content: attr(data-label);
    flex: none; width: 76px;
    font-size: 12px; color: var(--ink-3);
  }
  .rt td.c-act { justify-content: flex-end; padding-top: 8px; }
  .rt td.c-act::before { width: auto; margin-right: auto; }
}

