/* 安全培训报名 —— 明亮产品风: 浅灰底 + 白面板; 主色深蓝只给主按钮/选中态/图标;
   「法人必须参加」这类提醒用琥珀色; 已确认用绿, 已取消用灰
   字阶 13 / 15 / 17 / 20 / 25   间距 4px 栅格   圆角 8 / 16   阴影两级 */
:root {
  --bg: #F3F5F8;
  --surface: #FDFDFE;
  --sunk: #ECEFF4;
  --line: #E1E5EC;
  --ink: #111827;
  --ink-2: #464E5E;
  --ink-3: #737B8C;
  --pri: #1D4E9E;
  --pri-d: #163C7A;
  --pri-l: #E8EFFA;
  --hot: #9A4A06;
  --hot-l: #FDF1DF;
  --ok: #23704A;
  --ok-l: #E2F2E9;
  --err: #B42318;
  --err-l: #FDECEA;
  --r1: 8px;
  --r2: 16px;
  --sh1: 0 1px 2px rgba(17, 24, 39, .06);
  --sh2: 0 8px 24px rgba(17, 24, 39, .10);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; }   /* 小于 16px iOS 点进去会整页放大 */
button { cursor: pointer; }
a { color: var(--pri); }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
.i { width: var(--s, 20px); height: var(--s, 20px); stroke-width: 1.5; flex: none; vertical-align: middle; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

.view { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(96px + var(--safe-b)); }

/* ---------- 抬头 ---------- */
.hero { background: var(--surface); padding: 32px 16px 24px; border-bottom: 1px solid var(--line); }
@media (min-width: 560px) { .hero { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r2) var(--r2); } }
.eyebrow { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--pri-l); color: var(--pri); font-size: 13px; font-weight: 500; }
.eyebrow .i { --s: 14px; }
.hero h1 { font-size: 25px; margin-top: 12px; letter-spacing: .01em; }
.hero .org { color: var(--ink-2); margin-top: 8px; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 24px; }
.fact { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: start; align-content: start; padding: 12px; border-radius: var(--r1); background: var(--sunk); }
.fact .i { --s: 18px; color: var(--pri); margin-top: 2px; grid-row: span 2; }
.fact small { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.fact b { font-size: 15px; font-weight: 600; line-height: 1.45; }
.fact b .w { font-weight: 400; color: var(--ink-2); font-size: 13px; margin-left: 4px; }

.notice { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; padding: 12px; border-radius: var(--r1); background: var(--hot-l); color: var(--hot); }
.notice .i { --s: 18px; margin-top: 2px; }
.notice b { font-weight: 600; }

.hero-cta { display: flex; gap: 8px; margin-top: 24px; }
.hero-cta .btn { flex: 1; }

/* ---------- 分段 ---------- */
.sec { margin-top: 32px; }
.sec-h { display: flex; align-items: baseline; gap: 8px; padding: 0 16px 12px; }
.sec-h h2 { font-size: 20px; }
.sec-h .sub { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.panel { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (min-width: 560px) { .panel { border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; } }
.sec-foot { padding: 12px 16px 0; font-size: 13px; color: var(--ink-3); }

/* 班次 */
.course { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.course:last-child { border-bottom: 0; }
.course .t { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.course .full { grid-column: 1 / -1; font-size: 13px; color: var(--ink-3); word-break: break-all; }
.course .when { text-align: right; font-size: 15px; color: var(--ink-2); white-space: nowrap; }
.course .when b { display: block; font-size: 17px; color: var(--ink); }
.kind { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 13px; font-weight: 500; }
.kind.first { background: var(--pri-l); color: var(--pri); }
.kind.renew { background: var(--sunk); color: var(--ink-2); }

/* 当天安排 */
.steps { list-style: none; margin: 0; padding: 16px; }
.steps li { position: relative; padding: 0 0 20px 32px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before { content: attr(data-n); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--pri); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; line-height: 1; }
.steps li::after { content: ""; position: absolute; left: 10px; top: 28px; bottom: 4px; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps b { display: block; font-size: 17px; font-weight: 600; }
.steps .t { color: var(--pri); font-weight: 600; margin-right: 4px; }
.steps p { color: var(--ink-2); margin-top: 2px; }

/* 地点 */
.place { padding: 16px; }
.place b { display: block; font-size: 17px; font-weight: 600; }
.place p { color: var(--ink-2); margin-top: 4px; }
.place .acts { display: flex; gap: 8px; margin-top: 16px; }
.place .acts .btn { flex: 1; }

/* 电话 */
.tel { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.tel:last-child { border-bottom: 0; }
.tel .i { color: var(--pri); }
.tel span { flex: 1; font-size: 17px; letter-spacing: .02em; }
.tel em { font-style: normal; color: var(--pri); font-size: 15px; }

/* ---------- 报名表 ---------- */
.field { padding: 16px; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field > .lab { display: flex; align-items: baseline; gap: 8px; color: var(--ink); font-weight: 500; margin-bottom: 8px; }
.field > .lab .opt { color: var(--ink-3); font-weight: 400; font-size: 13px; }
.field > .lab .req { color: var(--err); }
.field .tip { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.field .msg { font-size: 13px; color: var(--err); margin-top: 8px; }
.field.err > .lab { color: var(--err); }
.field.err .input, .field.err textarea { border-color: var(--err); background: var(--err-l); }
.field.err .seg button { border-color: #F0B3AD; }

.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg button { min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r1); background: #fff; text-align: left; display: grid; gap: 0; align-content: center; transition: border-color .15s ease-out, background .15s ease-out; }
.seg button b { font-size: 15px; font-weight: 600; }
.seg button small { font-size: 13px; color: var(--ink-3); }
.seg button[aria-pressed="true"] { border-color: var(--pri); background: var(--pri-l); box-shadow: inset 0 0 0 1px var(--pri); }
.seg button[aria-pressed="true"] b { color: var(--pri-d); }

.pick { display: flex; gap: 8px; align-items: flex-start; margin: 0 16px; padding: 12px; border-radius: var(--r1); background: var(--pri-l); color: var(--pri-d); font-size: 13px; }
.pick .i { --s: 16px; margin-top: 2px; }
.pick b { font-size: 15px; display: block; color: var(--ink); }
.pick span { display: block; color: var(--ink-2); }
.pick-wrap { padding-bottom: 16px; border-bottom: 1px solid var(--line); }

.input { width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r1); background: #fff; outline: none; }
.input:focus, textarea:focus { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(29, 78, 158, .12); }
.input::placeholder, textarea::placeholder { color: #9AA1AE; }
textarea { width: 100%; min-height: 80px; resize: vertical; border: 1px solid var(--line); border-radius: var(--r1); padding: 12px; background: #fff; outline: none; line-height: 1.6; }

.submit { padding: 16px; }
.submit .fine { font-size: 13px; color: var(--ink-3); margin-top: 12px; }

/* 我的报名 */
.mine a, .mine div.it { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.mine > :last-child { border-bottom: 0; }
.mine b { font-weight: 600; }
.mine small { grid-column: 1; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine .pill { grid-row: 1 / span 2; grid-column: 2; align-self: center; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 20px; border-radius: var(--r1); border: 1px solid var(--pri); background: var(--pri); color: #fff; font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background .15s ease-out; }
.btn:hover { background: var(--pri-d); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--sunk); }
.btn.ghost .i { color: var(--pri); }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; height: 52px; font-size: 17px; }
.text-btn { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 8px; border: 0; background: none; color: var(--pri); font-size: 15px; text-decoration: none; border-radius: var(--r1); }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 12px 16px calc(12px + var(--safe-b)); background: rgba(253, 253, 254, .96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .2s ease-out, opacity .2s ease-out; }
.bottom-bar > div { max-width: 528px; margin: 0 auto; display: flex; gap: 8px; }
.bottom-bar .btn { flex: 1; }
.bottom-bar .btn.ghost { flex: none; width: 52px; padding: 0; }
.bottom-bar.away { transform: translateY(100%); opacity: 0; pointer-events: none; }

/* ---------- 状态 ---------- */
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 999px; font-size: 13px; font-weight: 500; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.pill.new { background: var(--hot-l); color: var(--hot); }
.pill.confirmed { background: var(--ok-l); color: var(--ok); }
.pill.canceled { background: var(--sunk); color: var(--ink-3); }

/* 提交成功 */
.done-box { padding: 48px 24px 24px; text-align: center; }
.done-box > .i { --s: 56px; color: var(--ok); stroke-width: 1.25; }
.done-box h2 { font-size: 25px; margin-top: 12px; }
.done-box p { color: var(--ink-2); margin: 8px auto 0; max-width: 30em; }
.kv { padding: 4px 16px; margin: 0; }
.kv > div { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv > div:last-child { border-bottom: 0; }
.kv dt { width: 64px; flex: none; color: var(--ink-3); }
.kv dd { margin: 0; flex: 1; min-width: 0; word-break: break-all; }
.todo { list-style: none; margin: 0; padding: 8px 16px; }
.todo li { display: flex; gap: 8px; padding: 8px 0; }
.todo .i { --s: 18px; color: var(--pri); margin-top: 3px; }
.acts-col { display: grid; gap: 8px; padding: 24px 16px 0; }

/* 空 / 加载 / 出错 */
.empty { padding: 64px 24px; text-align: center; color: var(--ink-3); }
.empty .i { --s: 40px; color: #B3BBC8; }
.empty b { display: block; color: var(--ink-2); font-size: 17px; margin-top: 12px; font-weight: 500; }
.empty p { margin-top: 4px; }
.empty .btn { margin-top: 16px; }
.skeleton { padding: 32px 16px; display: grid; gap: 12px; background: var(--surface); }
.skeleton i { display: block; height: 16px; border-radius: 4px; background: linear-gradient(90deg, var(--sunk), #F7F8FA, var(--sunk)); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
.skeleton i:nth-child(1) { width: 30%; height: 20px; }
.skeleton i:nth-child(2) { width: 90%; height: 28px; }
.skeleton i:nth-child(4) { height: 72px; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.foot { padding: 40px 16px 0; text-align: center; color: var(--ink-3); font-size: 13px; }
.foot p + p { margin-top: 4px; }

/* ---------- 弹层 ---------- */
.toast { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); z-index: 50; max-width: 80vw; padding: 12px 16px; border-radius: var(--r1); background: rgba(17, 24, 39, .88); color: #fff; font-size: 15px; text-align: center; }
.mask { position: fixed; inset: 0; z-index: 40; background: rgba(17, 24, 39, .45); display: grid; place-items: center; padding: 24px; animation: fade .15s ease-out backwards; }
.dialog { width: 100%; max-width: 320px; background: var(--surface); border-radius: var(--r2); overflow: hidden; box-shadow: var(--sh2); }
.dialog-body { padding: 24px 20px 20px; text-align: center; }
.dialog-body h3 { font-size: 17px; margin-bottom: 8px; }
.dialog-body p { color: var(--ink-2); white-space: pre-wrap; }
.dialog-acts { display: flex; border-top: 1px solid var(--line); }
.dialog-acts button { flex: 1; height: 48px; border: 0; background: none; font-size: 17px; color: var(--ink-2); }
.dialog-acts button + button { border-left: 1px solid var(--line); }
.dialog-acts .ok { color: var(--pri); font-weight: 600; }
.sheet-mask { place-items: end center; padding: 0; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r2) var(--r2) 0 0; animation: up .2s ease-out backwards; padding-bottom: var(--safe-b); }
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 12px 8px 12px 16px; border-bottom: 1px solid var(--line); }
.sheet-h h3 { flex: 1; font-size: 17px; }
.sheet-b { overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
.sheet-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.sheet-f .btn { flex: 1; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r1); color: var(--ink-2); flex: none; text-decoration: none; }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
