/* ============================================================
   长虹中学招生 · 一屏版
   首页：一屏、两个按钮、底部 QQ 群
   子页：apply.html 填报 / query.html 查询 / about.html 学校介绍
   ============================================================ */

:root {
  --red: #C62828;
  --red-dark: #A61B1B;
  --ink: #1A1D21;
  --body: #4A5058;
  --muted: #8A9099;
  --line: #E7EAEE;
  --bg: #FFFFFF;
  --bg-soft: #F7F8FA;
  --shadow: 0 2px 10px rgba(16, 24, 40, .05);
  --shadow-lg: 0 8px 30px rgba(16, 24, 40, .08);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 700; }
em { font-style: normal; }
input, select, textarea, button { font: inherit; color: inherit; }

.m-wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.m-narrow { max-width: 760px; }

/* ============================================================
   首页：一屏
   ============================================================ */
.home {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(30px + env(safe-area-inset-top)) 22px calc(20px + env(safe-area-inset-bottom));
  background:
    radial-gradient(760px 420px at 50% -12%, rgba(198, 40, 40, .075), transparent 68%),
    var(--bg);
  overflow: hidden;
}

.home-top { text-align: center; }

.home-logo {
  height: 38px; width: auto; margin: 0 auto 22px;
  opacity: .95;
}

.home-year {
  display: inline-block;
  font-size: 13px; font-weight: 700; letter-spacing: .08em;
  color: var(--red);
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(198, 40, 40, .08);
  margin-bottom: 14px;
}

.home h1 {
  font-size: 1.72rem;
  font-weight: 800;
  letter-spacing: -.6px;
  line-height: 1.28;
}
.home h1 span {
  display: block;
  color: var(--red);
  margin-top: 2px;
}

.home-facts {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 10px;
  margin-top: 14px;
  font-size: 13.5px; color: var(--body);
}
.home-facts b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.home-facts i { width: 1px; height: 11px; background: var(--line); display: block; }

/* 两个按钮：撑满剩余高度、垂直居中 */
.home-actions {
  flex: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 13px;
  padding: 26px 0;
}

.big-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 64px;
  padding: 0 20px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .5px;
  transition: transform .12s, box-shadow .2s, filter .2s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.big-btn .bb-left { display: flex; align-items: center; gap: 11px; }
.big-btn svg { width: 21px; height: 21px; flex-shrink: 0; }
.big-btn .bb-arrow { width: 18px; height: 18px; opacity: .55; }

.big-btn.primary {
  color: #fff;
  background: linear-gradient(180deg, #D32F2F, var(--red));
  box-shadow: 0 6px 20px rgba(198, 40, 40, .3);
}
.big-btn.primary:active { transform: translateY(1px); filter: brightness(.97); }

.big-btn.ghost {
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow);
}
.big-btn.ghost:active { transform: translateY(1px); background: var(--bg-soft); }

/* 底部 QQ 群 */
.home-bottom {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qq-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  font-size: 14.5px;
  font-weight: 600;
  color: #1F6FB2;
  background: rgba(31, 111, 178, .07);
  border-radius: 11px;
  transition: background .15s;
}
.qq-link:active { background: rgba(31, 111, 178, .14); }
.qq-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.qq-link .qq-num { font-variant-numeric: tabular-nums; }

.home-foot {
  font-size: 11.5px;
  color: #AEB4BB;
  letter-spacing: .02em;
  text-align: center;
}

/* ============================================================
   子页通用（填报 / 查询 / 学校介绍）
   ============================================================ */
.page {
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.p-head {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  height: 56px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.p-back {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px;
  font-size: 14px; color: var(--body);
  padding: 8px 12px 8px 6px; margin-left: -6px;
  border-radius: 8px;
}
.p-back:active { background: var(--bg-soft); }
.p-back svg { width: 17px; height: 17px; }
.p-title { font-size: 15.5px; font-weight: 700; }

.p-body { max-width: 620px; margin: 0 auto; padding: 22px 16px 0; }

.p-lead { margin-bottom: 16px; }
.p-lead h1 { font-size: 1.32rem; font-weight: 800; letter-spacing: -.3px; }
.p-lead p { font-size: 13.5px; color: var(--muted); margin-top: 5px; }

/* ============ 表单 ============ */
.m-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: var(--shadow);
}

/* 用 flex + gap 排版：绝不用相邻兄弟选择器加 margin，
   否则同一行内的第二列也会被推下去（就是之前的错位） */
.m-form { display: flex; flex-direction: column; gap: 13px; }
.m-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.m-row:has(.m-field-sm) { grid-template-columns: 1.55fr 1fr; }
.m-row.two-narrow { grid-template-columns: 1fr 1fr; }
.m-row > .m-field { margin: 0; }

.m-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.m-field > span {
  font-size: 13px; font-weight: 600; color: var(--body);
  display: flex; align-items: center; gap: 2px;
}
.m-field > span em { color: var(--red); }

.m-field input,
.m-field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color .15s, background .15s, box-shadow .15s;
  appearance: none;
}
.m-field select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A9099' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.m-field input:focus,
.m-field select:focus {
  outline: none;
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, .1);
}
.m-field input::placeholder { color: #B4B9C0; }

.m-field input[type="file"] {
  height: auto;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--body);
  cursor: pointer;
}
.m-field input[type="file"]::file-selector-button {
  font: inherit; font-size: 13px;
  padding: 5px 12px; margin-right: 10px;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink); cursor: pointer;
}

.m-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* 填写说明折叠块 */
.m-note {
  margin-bottom: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--body);
}
.m-note > summary {
  cursor: pointer; list-style: none; user-select: none;
  font-weight: 600; color: var(--body);
  display: flex; align-items: center; gap: 6px;
  min-height: 24px;
}
.m-note > summary::-webkit-details-marker { display: none; }
.m-note > summary::before { content: "+"; font-weight: 700; color: var(--muted); }
.m-note[open] > summary::before { content: "−"; }
.m-note[open] > summary { margin-bottom: 8px; }
.m-note ol { margin: 0; padding-left: 17px; display: grid; gap: 5px; line-height: 1.6; }

/* 标签右侧的小字提示 */
.m-tip {
  margin-left: 6px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}

/* 分段单选：班型三选一 */
.m-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.m-seg label { position: relative; display: block; cursor: pointer; }
.m-seg input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.m-seg span {
  display: flex; align-items: center; justify-content: center;
  height: 46px;
  font-size: 14.5px; font-weight: 600;
  color: var(--body);
  background: var(--bg-soft);
  border: 1.5px solid var(--line);
  border-radius: 9px;
  transition: all .15s;
}
.m-seg input:checked + span {
  color: var(--red);
  background: rgba(198, 40, 40, .06);
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(198, 40, 40, .08);
}
.m-seg label:active span { transform: scale(.985); }

.m-more { border-top: 1px dashed var(--line); padding-top: 12px; }
.m-more > summary {
  font-size: 13.5px; color: var(--muted); cursor: pointer;
  list-style: none; user-select: none;
  display: flex; align-items: center; gap: 6px;
}
.m-more > summary::-webkit-details-marker { display: none; }
.m-more > summary::before { content: "+"; font-size: 15px; font-weight: 700; }
.m-more[open] > summary::before { content: "−"; }
.m-more-body { padding-top: 12px; }

.m-agree {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 12.5px; color: var(--muted); line-height: 1.55;
  cursor: pointer;
}
.m-agree input {
  width: 18px; height: 18px; margin-top: 1px;
  flex-shrink: 0; accent-color: var(--red); cursor: pointer;
}

.m-submit {
  width: 100%; height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 16.5px; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, #D32F2F, var(--red));
  border: none; border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(198, 40, 40, .28);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.m-submit:active { transform: translateY(1px); }
.m-submit:disabled { opacity: .62; cursor: not-allowed; box-shadow: none; }
.m-submit svg { width: 18px; height: 18px; }

.m-foot { font-size: 12px; color: #A8AEB6; text-align: center; margin: -4px 0 0; }

/* ============ 查询 ============ */
.m-query {
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 22px;
  box-shadow: var(--shadow);
}
.m-btn-line {
  width: 100%; height: 48px; margin-top: 16px;
  font-size: 15.5px; font-weight: 600; color: var(--ink);
  background: #fff; border: 1.5px solid var(--ink);
  border-radius: 10px; cursor: pointer;
  transition: background .15s, color .15s;
}
.m-btn-line:active { background: var(--ink); color: #fff; }
.m-btn-line:disabled { opacity: .55; cursor: not-allowed; }

/* ============ 结果卡片 ============ */
.query-result { margin-top: 16px; }

.qr-card {
  padding: 20px 22px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}
.qr-card + .qr-card { margin-top: 12px; }
.qr-card h3 { font-size: 16.5px; font-weight: 800; margin-bottom: 6px; }
.qr-card.success { border-color: #BFE3CB; background: #F5FBF7; }
.qr-card.success h3 { color: #1B7A3E; }
.qr-card.info { border-color: #CFE0F0; background: #F6FAFE; }
.qr-card.info h3 { color: #1F5C93; }
.qr-card.warn { border-color: #F0D9B5; background: #FFFBF3; }
.qr-card.warn h3 { color: #8A6D3B; }

.qr-status { font-size: 14px; color: var(--body); margin-bottom: 14px; }
.qr-status b { color: var(--ink); }

.qr-meta { display: grid; gap: 8px; }
.qr-meta > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 13.5px; color: var(--muted);
  padding-bottom: 8px; border-bottom: 1px dashed var(--line);
}
.qr-meta > div:last-child { border-bottom: none; padding-bottom: 0; }
.qr-meta b { color: var(--ink); font-weight: 600; text-align: right; }

.qr-signs { margin-top: 14px; display: grid; gap: 8px; }
.qr-sign {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13.5px; padding: 9px 12px;
  background: var(--bg-soft); border-radius: 7px;
}
.qr-sign span { color: var(--muted); }
.qr-sign b { color: var(--ink); }

.qr-foot { font-size: 12.5px; color: var(--muted); margin-top: 12px; }

/* ============ 分数测算 ============ */
.m-calc {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px;
  align-items: center;
  margin-top: 22px; padding: 14px 16px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 10px;
}
.m-calc > span { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.m-calc input {
  height: 42px; padding: 0 12px; font-size: 16px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 7px; min-width: 0;
}
.m-calc input:focus { outline: none; border-color: var(--red); }
.m-calc .m-btn-line {
  width: auto; margin: 0; padding: 0 18px; height: 42px;
  font-size: 14px; white-space: nowrap;
}

.calc-result { margin-top: 12px; padding: 14px 16px; border-radius: 10px; font-size: 14px; line-height: 1.7; }
.calc-result.good { background: #F5FBF7; border: 1px solid #BFE3CB; color: #1B7A3E; }
.calc-result.mid { background: #FFFBF3; border: 1px solid #F0D9B5; color: #8A6D3B; }
.calc-result.warn { background: #FFF5F5; border: 1px solid #F3C9C9; color: #A83232; }
.calc-result b { font-weight: 700; }

/* ============ 事实列表 ============ */
.m-facts { display: grid; gap: 0; }
.m-facts > div {
  display: grid; grid-template-columns: 100px 1fr; gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.m-facts > div:last-child { border-bottom: none; }
.m-facts dt { color: var(--muted); font-size: 13.5px; }
.m-facts dd { color: var(--ink); font-weight: 500; }
.m-facts dd b { color: var(--red); font-weight: 700; }
.m-facts dd a { color: var(--red); }

.m-warn {
  margin-top: 16px; padding: 12px 14px;
  font-size: 12.5px; color: #8A6D3B; line-height: 1.6;
  background: #FFFBF0; border: 1px solid #F5E3BC; border-radius: 8px;
}

.m-links { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.m-links a { font-size: 14px; font-weight: 600; color: var(--red); padding: 4px 0; }

.p-sec { margin-top: 26px; }
.p-sec > h2 {
  font-size: 1.05rem; font-weight: 800;
  margin-bottom: 10px; letter-spacing: -.2px;
}

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 90px;
  transform: translate(-50%, 14px);
  z-index: 200;
  max-width: min(88vw, 380px);
  padding: 11px 18px;
  font-size: 14px; font-weight: 500;
  color: #fff; background: rgba(26, 29, 33, .93);
  border-radius: 9px;
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s;
  text-align: center;
  backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #B3261E; }

/* ============================================================
   大屏适配
   ============================================================ */
@media (min-width: 700px) {
  .home h1 { font-size: 2.15rem; }
  .home-logo { height: 46px; }
  .big-btn { min-height: 70px; font-size: 19px; }
  .home-actions { gap: 15px; padding: 32px 0; }
  .home-facts { font-size: 14px; }

}

@media (max-width: 380px) {
  .home { padding-left: 16px; padding-right: 16px; }
  .home h1 { font-size: 1.52rem; }
  .home-facts { font-size: 12.5px; gap: 8px; }
  .big-btn { min-height: 58px; font-size: 17px; }
  .p-body { padding-left: 13px; padding-right: 13px; }
  .m-form, .m-query { padding: 16px; }
  .m-row { gap: 9px; }
}

/* 极矮屏：压缩留白，保证两个按钮同屏 */
@media (max-height: 640px) {
  .home { padding-top: calc(16px + env(safe-area-inset-top)); }
  .home-logo { height: 30px; margin-bottom: 12px; }
  .home-year { margin-bottom: 9px; font-size: 12px; }
  .home h1 { font-size: 1.42rem; }
  .home-facts { margin-top: 9px; }
  .home-actions { padding: 14px 0; gap: 10px; }
  .big-btn { min-height: 54px; font-size: 16.5px; }
  .qq-link { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
