:root {
  --navy-900: #08213f;
  --navy-800: #0b2e59;
  --navy-700: #14426f;
  --navy-500: #2e74b5;
  --navy-100: #eaf1fa;
  --orange-600: #e0640a;
  --orange-500: #ff7a18;
  --orange-100: #fff2e6;
  --text: #1f2a37;
  --text-2: #5b6879;
  --line: #e3e9f2;
  --bg: #f2f5f9;
  --danger: #d92d20;
  --ok: #0f9d58;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(11, 46, 89, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* hidden 属性必须优先于任何 display 规则 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { display: flex; justify-content: center; }

.page {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 24px;
  position: relative;
  box-shadow: 0 0 0 1px rgba(11, 46, 89, 0.04);
}

/* ---------------- 顶部信息区 ---------------- */
.hero {
  background: linear-gradient(160deg, var(--navy-800) 0%, var(--navy-700) 55%, #1b5292 100%);
  color: #fff;
  padding: 20px 18px 22px;
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -60px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 24, 0.35), rgba(255, 122, 24, 0) 68%);
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.logo { display: flex; flex-direction: column; line-height: 1.25; }
.logo-mark {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 1px;
}
.logo-mark::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 6px;
  border-radius: 2px;
  background: var(--orange-500);
  transform: translateY(-1px);
}
.logo-sub { font-size: 11px; opacity: 0.72; }
.hero-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 122, 24, 0.18);
  border: 1px solid rgba(255, 122, 24, 0.55);
  color: #ffd7b0;
  white-space: nowrap;
}
.hero-title {
  font-size: 22px;
  line-height: 1.35;
  margin: 16px 0 8px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.hero-title em { font-style: normal; color: var(--orange-500); }
.hero-host { font-size: 12px; opacity: 0.8; margin: 0 0 14px; }
.keyinfo { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.keyinfo li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
}
.keyinfo b { color: #ffcaa0; font-weight: 600; flex: 0 0 60px; font-size: 12px; }
.keyinfo span { color: #fff; font-weight: 600; }
.hero-note {
  margin: 12px 0 0;
  font-size: 11.5px;
  color: #ffd9b8;
  text-align: center;
  letter-spacing: 0.2px;
}

/* ---------------- 卡片 ---------------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 12px 12px 0;
  padding: 16px 15px 18px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--navy-800);
}
.card-title i {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--navy-700);
  border-radius: 6px;
  padding: 3px 6px;
  letter-spacing: 0.5px;
}

/* ---------------- 组别选择 ---------------- */
.group-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
.group-option { cursor: pointer; height: 100%; }
.group-option input { position: absolute; opacity: 0; pointer-events: none; }
.group-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
  transition: all 0.18s ease;
  background: #fbfcfe;
}
.group-box b { display: block; font-size: 15px; color: var(--navy-800); }
.group-box small { display: block; font-size: 11px; color: var(--text-2); margin-top: 2px; }
.group-option input:checked + .group-box {
  border-color: var(--orange-500);
  background: var(--orange-100);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.12);
}
.group-option input:checked + .group-box b { color: var(--orange-600); }
.group-option input:focus-visible + .group-box { outline: 2px solid var(--navy-500); outline-offset: 2px; }

/* ---------------- 字段 ---------------- */
.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}
.field > label em { color: var(--danger); font-style: normal; margin-left: 2px; }
.optional { color: var(--text-2); font-weight: 400; font-size: 11.5px; }

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  color: var(--text);
  background: #fbfcfe;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b6879' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
textarea { min-height: 104px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  border-color: var(--navy-500);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(46, 116, 181, 0.12);
}
input.invalid, select.invalid, textarea.invalid {
  border-color: var(--danger);
  background: #fff6f5;
}
.err { color: var(--danger); font-size: 12px; margin: 5px 0 0; min-height: 0; display: none; }
.err.show { display: block; }
.hint { font-size: 12px; color: var(--text-2); background: var(--navy-100); border-radius: 8px; padding: 9px 11px; margin: 8px 0 0; }
#exemptTip { background: var(--orange-100); color: #8a4708; border: 1px solid #ffd9b3; }
.counter { text-align: right; font-size: 11.5px; color: var(--text-2); margin-top: 4px; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.check-group { display: grid; gap: 8px; }
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 13.5px;
  background: #fbfcfe;
  cursor: pointer;
  line-height: 1.45;
}
.check-item input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--orange-500); flex: 0 0 auto; }
.check-item.checked { border-color: var(--orange-500); background: var(--orange-100); }

/* ---------------- 上传 ---------------- */
.upload-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1.5px dashed #b9cbe4;
  border-radius: 12px;
  background: #fbfcfe;
  padding: 18px 12px;
  cursor: pointer;
  text-align: center;
  margin-top: 10px;
}
.upload-box:active { background: var(--navy-100); }
.upload-plus { font-size: 22px; color: var(--navy-500); line-height: 1; }
.upload-text { font-size: 14px; font-weight: 600; color: var(--navy-700); }
.upload-sub { font-size: 11.5px; color: var(--text-2); }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  background: var(--navy-100);
  border-radius: 8px;
  padding: 8px 10px;
}
.file-list .fname { flex: 1; word-break: break-all; }
.file-list .fsize { color: var(--text-2); white-space: nowrap; font-size: 11.5px; }
.file-list .del {
  border: none; background: transparent; color: var(--danger);
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px;
}

/* ---------------- 隐私 / 验证码 / 提交 ---------------- */
.privacy {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.55;
  background: var(--navy-100);
  border-radius: 10px;
  padding: 11px;
  cursor: pointer;
}
.privacy input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--orange-500); flex: 0 0 auto; }
.privacy b { color: var(--navy-700); }

.row-captcha { display: grid; grid-template-columns: 1fr 118px; gap: 8px; align-items: stretch; }
.captcha-box {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef3fa;
  cursor: pointer;
  min-height: 44px;
}
.captcha-box img { width: 100%; height: 44px; display: block; object-fit: cover; }

.submit-btn {
  width: 100%;
  margin-top: 16px;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 16.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  box-shadow: 0 8px 18px rgba(224, 100, 10, 0.28);
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.12s ease, opacity 0.2s ease;
  font-family: inherit;
}
.submit-btn:active { transform: scale(0.985); }
.submit-btn[disabled] { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.submit-tip { text-align: center; font-size: 11.5px; color: var(--text-2); margin: 9px 0 0; }

/* ---------------- 结果页 ---------------- */
.result-panel { text-align: center; padding: 26px 18px 22px; }
.result-check {
  width: 58px; height: 58px; line-height: 58px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #16b364, #0f9d58);
  color: #fff; font-size: 30px; font-weight: 700;
  box-shadow: 0 8px 20px rgba(15, 157, 88, 0.25);
}
.result-panel h2 { margin: 0 0 14px; font-size: 19px; color: var(--navy-800); }
.result-code-label { font-size: 12px; color: var(--text-2); margin: 0; }
.result-code {
  font-size: 27px; font-weight: 800; letter-spacing: 2px;
  color: var(--orange-600); margin: 4px 0 16px;
  font-family: "SF Mono", Consolas, Monaco, monospace;
}
.result-meta { margin: 0 0 14px; padding: 12px; background: var(--navy-100); border-radius: 10px; text-align: left; }
.result-meta div { display: flex; gap: 10px; font-size: 13px; padding: 3px 0; }
.result-meta dt { flex: 0 0 70px; color: var(--text-2); margin: 0; }
.result-meta dd { margin: 0; flex: 1; color: var(--text); font-weight: 600; word-break: break-all; }
.result-notice { font-size: 13px; color: var(--navy-700); background: #eaf2fd; border-radius: 9px; padding: 10px; margin: 0 0 10px; }
.result-warn { font-size: 12.5px; color: #8a4708; background: var(--orange-100); border-radius: 9px; padding: 10px; margin: 0 0 16px; text-align: left; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ghost-btn {
  border: 1.5px solid var(--navy-500); background: #fff; color: var(--navy-700);
  border-radius: 10px; padding: 11px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.ghost-btn:active { background: var(--navy-100); }

/* ---------------- 已结束 ---------------- */
.closed-panel { text-align: center; padding: 30px 20px; }
.closed-icon {
  width: 54px; height: 54px; line-height: 54px; margin: 0 auto 12px;
  border-radius: 50%; background: var(--navy-100); color: var(--navy-700);
  font-size: 28px; font-weight: 800;
}
.closed-panel h2 { margin: 0 0 8px; font-size: 19px; color: var(--navy-800); }
.closed-tip { font-size: 13.5px; color: var(--text-2); margin: 0 0 14px; }
.closed-contact { font-size: 13px; color: var(--text); background: var(--navy-100); border-radius: 10px; padding: 12px; margin: 0; }

/* ---------------- 页脚 ---------------- */
.site-footer {
  margin: 18px 12px 0;
  padding: 16px 14px 4px;
  font-size: 12.5px;
  color: var(--text-2);
  border-top: 1px dashed var(--line);
}
.site-footer p { margin: 0 0 7px; }
.site-footer b { color: var(--text); }
.footer-warn { color: #8a4708; background: var(--orange-100); border-radius: 8px; padding: 9px 10px; }
.footer-copy { text-align: center; font-size: 11.5px; opacity: 0.8; margin-top: 12px; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  background: rgba(20, 30, 45, 0.92);
  color: #fff;
  font-size: 13.5px;
  padding: 11px 18px;
  border-radius: 10px;
  max-width: 82vw;
  text-align: center;
  z-index: 99;
  animation: toastIn 0.22s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------------- 桌面端 ---------------- */
@media (min-width: 520px) {
  body { background: #e8edf4; padding: 20px 0; }
  .page { border-radius: 18px; overflow: hidden; box-shadow: 0 18px 50px rgba(11, 46, 89, 0.14); }
  .hero { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
}

/* ---------------- 提交身份登录行 ---------------- */
.login-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--navy-100); border-radius: 10px; padding: 11px 13px;
}
.login-state { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; word-break: break-all; }
.login-state.ok { color: var(--navy-600, #15509a); font-weight: 600; }
.login-row .ghost-btn.sm { padding: 7px 14px; font-size: 13px; white-space: nowrap; flex-shrink: 0; }

/* ---------------- 手机号验证码登录 ---------------- */
.otp-block { margin-top: 10px; }
.otp-title {
  font-size: 12.5px; color: var(--text-2); margin: 0 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.otp-title::before, .otp-title::after {
  content: ''; flex: 1; height: 1px; background: #e4eaf2;
}
.otp-block .row-otp { display: flex; gap: 8px; margin-bottom: 8px; align-items: stretch; }
.otp-block .row-otp:last-child { margin-bottom: 0; }
.otp-block .row-otp input { flex: 1; min-width: 0; }
.otp-block .row-otp .ghost-btn {
  white-space: nowrap; flex-shrink: 0; padding: 0 14px; font-size: 13px;
}
.otp-block .row-otp .ghost-btn:disabled { opacity: 0.55; cursor: default; }

/* ---------------- 参赛条件（组别说明） ---------------- */
.group-conditions { margin-top: 12px; }
.cond-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-800);
}
.group-conditions ol {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}
.group-conditions li + li { margin-top: 2px; }

/* ---------------- 参赛方向说明 ---------------- */
.dir-details { margin-top: 8px; }
.dir-details summary {
  font-size: 13px;
  color: var(--navy-500);
  cursor: pointer;
  user-select: none;
}
.dir-details .dir-list { margin: 8px 0 0; }
.dir-details dt {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-800);
  margin-top: 8px;
}
.dir-details dd {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.65;
}

/* ---------------- 园区风采 ---------------- */
.gallery-card .card-title { margin-bottom: 12px; }
.video-box video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  object-fit: contain;
}
.video-tip {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-2);
  text-align: center;
}
.pic-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.pic-grid figure { margin: 0; }
.pic-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--navy-100);
}
.pic-grid figcaption {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-2);
  text-align: center;
}

/* ---------------- 「用电脑打开」提示 ---------------- */
.base-list { display: none; }
.pc-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--navy-100);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--navy-700);
  line-height: 1.5;
}
.pc-tip span { flex: 1; min-width: 0; }
.pc-tip .ghost-btn.sm {
  padding: 7px 12px;
  font-size: 12.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ================= 网页端（平板 / 桌面）双排版 ================= */
@media (min-width: 700px) {
  body { padding: 26px 0 46px; align-items: flex-start; }

  .page {
    max-width: 920px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(11, 46, 89, 0.16);
    padding-bottom: 34px;
  }

  /* ---- 顶部信息区 ---- */
  .hero { border-radius: 0 0 20px 20px; padding: 28px 34px 26px; }
  .hero-title { font-size: 28px; margin: 18px 0 8px; }
  .hero-host { font-size: 13px; }
  .keyinfo { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .keyinfo li { flex-direction: column; align-items: flex-start; gap: 3px; padding: 11px 13px; }
  .keyinfo b { flex: none; }
  .keyinfo span { font-size: 14px; }
  .hero-note { font-size: 12.5px; margin-top: 14px; }

  /* ---- 卡片 ---- */
  .card { margin: 18px 26px 0; padding: 20px 24px 22px; }
  .card-title { font-size: 17px; margin-bottom: 16px; }

  /* ---- 园区风采：左视频 + 右图片墙 ---- */
  .gallery-card {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    column-gap: 20px;
    align-items: start;
  }
  .gallery-card .card-title { grid-column: 1 / -1; grid-row: 1; }
  .video-box { grid-column: 1; grid-row: 2; }
  .video-tip { text-align: left; }
  .base-list {
    grid-column: 1;
    grid-row: 3;
    display: grid;
    gap: 7px;
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
  }
  .base-list li {
    font-size: 12.5px;
    color: var(--text-2);
    background: var(--navy-100);
    border-radius: 8px;
    padding: 8px 11px;
    line-height: 1.5;
  }
  .base-list b { color: var(--navy-800); margin-right: 6px; }
  .pic-grid {
    grid-column: 2;
    grid-row: 2 / span 2;
    margin-top: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  /* ---- 表单：字段两列排布 ---- */
  #signupForm > .card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
  }
  #signupForm > .card > * { grid-column: 1 / -1; }
  #signupForm > .card > .field:not(.span-2) { grid-column: auto; }

  /* ---- 组别选择 ---- */
  .group-switch { gap: 14px; }
  .group-box { padding: 16px 12px; }
  .group-box b { font-size: 16px; }
  .group-box small { font-size: 12px; margin-top: 4px; }
  .group-conditions ol { font-size: 13px; }

  /* ---- 上传与提交 ---- */
  .upload-box { padding: 26px 12px; }
  .submit-btn { display: block; max-width: 340px; margin: 18px auto 0; }
  .submit-tip { text-align: center; }

  /* ---- 结果页 / 已结束 / 页脚 ---- */
  .result-panel { padding: 36px 30px 30px; }
  .closed-panel { padding: 40px 30px; }
  .site-footer { margin: 22px 26px 0; padding: 18px 6px 4px; }
}

/* 宽屏再放宽一点，阅读更舒展 */
@media (min-width: 1200px) {
  .page { max-width: 1000px; }
  .hero { padding: 32px 40px 28px; }
  .hero-title { font-size: 30px; }
  .card { margin: 20px 32px 0; padding: 22px 26px 24px; }
  .site-footer { margin: 24px 32px 0; }
}

/* ---------------- 赛事介绍（后台可编辑） ---------------- */
.intro-body p {
  margin: 0 0 10px;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--text-1);
}
.intro-body p:last-child { margin-bottom: 0; }

/* ---------------- ICP 备案号 ---------------- */
.footer-icp,
.foot-icp {
  text-align: center;
  font-size: 11.5px;
  margin-top: 8px;
  opacity: 0.85;
}
.footer-icp a,
.foot-icp a {
  color: inherit;
  text-decoration: none;
}
.footer-icp a:hover,
.foot-icp a:hover {
  text-decoration: underline;
}
