:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #5c6b80;
  --line: #e4e9f0;
  --card: #ffffff;
  --bg: #f3f6f8;
  --brand: #0f4c81;
  --brand-press: #0c3d68;
  --danger: #b42318;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --warn-bg: #fffaeb;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

button, input, select { font: inherit; }

.page {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 20px 16px calc(96px + env(safe-area-inset-bottom));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

h1 {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.3;
}

h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.muted { color: var(--muted); margin: 0; }

.identity {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.pill {
  background: #eef3f8;
  color: #23405f;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}

.banner {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: #93370d; }
.banner.err { background: #fef3f2; color: var(--danger); }

label.field {
  display: block;
  margin-bottom: 12px;
}

label.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #31445c;
}

input[type="text"],
input[type="date"],
select {
  width: 100%;
  height: 44px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  width: 100%;
  min-height: 88px;
  border: 1px solid #cfd8e3;
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f7f8fa;
  color: #66788a;
}

.choices {
  display: flex;
  gap: 8px;
}

.choices button {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #cfd8e3;
  background: #fff;
  color: var(--ink);
}

.choices button.on {
  border-color: var(--brand);
  background: #e8f1f8;
  color: var(--brand);
  font-weight: 600;
}

.actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.actions button {
  flex: 1;
  height: 46px;
  border-radius: 12px;
  border: 0;
}

.btn-ghost {
  background: #eef2f6;
  color: var(--ink);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:active { background: var(--brand-press); }

button:disabled { opacity: 0.55; }

.pick {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.pick strong { display: block; }
.pick span { color: var(--muted); font-size: 14px; }
