:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #66727d;
  --line: #dbe1e6;
  --surface: #ffffff;
  --canvas: #f3f5f7;
  --brand: #1769aa;
  --brand-strong: #0f568d;
  --success: #188052;
  --warning: #b56417;
  --danger: #b43a3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select { font: inherit; letter-spacing: 0; }

button { cursor: pointer; }

.topbar {
  color: #fff;
  background: #1f2930;
  border-bottom: 4px solid #2b83c6;
}

.topbar-inner {
  width: min(100% - 32px, 720px);
  min-height: 94px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  color: #b9c5cd;
}

h1 { margin: 0; font-size: 24px; font-weight: 700; }

.service-state {
  min-width: 76px;
  padding: 6px 8px;
  border: 1px solid #53616b;
  border-radius: 4px;
  color: #d7e0e5;
  font-size: 12px;
  text-align: center;
}

.service-state.online { border-color: #48a877; color: #a9e1c2; }
.service-state.offline { border-color: #cc6a6a; color: #ffc1c1; }

main {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 20px 0 56px;
}

.view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  background: #e9edf0;
  border-radius: 6px;
  padding: 3px;
  margin-bottom: 20px;
}

.view-tab {
  height: 40px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-weight: 600;
}

.view-tab.active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(23, 33, 43, .12); }

.view {
  display: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.view.active { display: block; }

.section-heading {
  min-height: 82px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.section-heading .section-kicker { color: var(--brand); }
h2 { margin: 0; font-size: 20px; }

.date-window {
  padding: 5px 8px;
  color: var(--brand-strong);
  background: #eaf4fb;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.date-field {
  display: grid;
  gap: 8px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.date-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid #b9c3ca;
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
  font-size: 17px;
}

.fixed-values {
  margin: 0;
  padding: 6px 20px;
  border-bottom: 1px solid var(--line);
}

.fixed-values div {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.fixed-values dt { color: var(--muted); font-size: 13px; }
.fixed-values dd { margin: 0; font-size: 14px; font-weight: 600; }

.auth-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 18px 20px;
}

.auth-summary > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.auth-summary strong, .auth-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-summary strong { font-size: 13px; }
.auth-summary small { margin-top: 2px; color: var(--muted); font-size: 12px; }

.status-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; background: #aab3ba; }
.status-dot.ready { background: var(--success); }

.primary-action,
.secondary-action {
  min-height: 48px;
  border-radius: 5px;
  font-weight: 700;
}

.primary-action {
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  border: 1px solid var(--brand);
  color: #fff;
  background: var(--brand);
}

.primary-action:hover { background: var(--brand-strong); }
.primary-action:disabled, .secondary-action:disabled { cursor: wait; opacity: .58; }

.secondary-action {
  width: 100%;
  margin-top: 12px;
  border: 1px solid #aab8c2;
  color: var(--brand-strong);
  background: #f7fafc;
}

.text-action { border: 0; color: var(--danger); background: transparent; font-size: 13px; }

.result,
.inline-result { display: none; font-size: 13px; line-height: 1.55; }
.result { margin: 0 20px 20px; padding: 12px; border-radius: 5px; }
.inline-result { margin-top: 10px; }
.result.show, .inline-result.show { display: block; }
.success { color: var(--success); background: #edf8f2; }
.error { color: var(--danger); background: #fdf0f0; }
.pending { color: var(--warning); background: #fff7ed; }
.inline-result.success,
.inline-result.error,
.inline-result.pending { padding: 9px 11px; border-radius: 4px; }

form fieldset {
  margin: 0;
  padding: 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

legend { padding: 0; margin-bottom: 16px; font-size: 15px; font-weight: 700; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid .wide { grid-column: 1 / -1; }

form label,
.wide-label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; }

form input,
form select {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid #b9c3ca;
  border-radius: 4px;
  color: var(--ink);
  background: #fff;
}

form input:focus,
form select:focus,
.date-field input:focus { outline: 2px solid rgba(23, 105, 170, .2); border-color: var(--brand); }

.option-row,
.switch-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.option-row > span { color: var(--muted); font-size: 13px; }

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 190px;
  padding: 3px;
  border-radius: 5px;
  background: #e9edf0;
}

.segmented-control label { display: block; }
.segmented-control input {
  position: absolute;
  width: 1px;
  min-height: 0;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.segmented-control span { display: grid; place-items: center; min-height: 36px; border-radius: 3px; color: var(--muted); }
.segmented-control input:checked + span { color: var(--ink); background: #fff; box-shadow: 0 1px 2px rgba(23, 33, 43, .15); }

.switch-row { margin: 10px 0 14px; grid-template-columns: 1fr auto; }
.switch-row span { display: block; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { color: var(--ink); font-size: 14px; }
.switch-row small { margin-top: 3px; }
.switch-row input { width: 46px; min-height: 26px; accent-color: var(--brand); }

.photo-field { margin-top: 16px; }
.photo-field input { padding: 9px; }

.privacy-note { margin: 18px 20px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.hidden { display: none !important; }

@media (max-width: 560px) {
  .topbar-inner, main { width: min(100% - 24px, 720px); }
  .topbar-inner { min-height: 84px; }
  h1 { font-size: 21px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .wide { grid-column: auto; }
  .auth-summary { grid-template-columns: 1fr; }
  .segmented-control { min-width: 166px; }
  .section-heading, form fieldset, .date-field, .fixed-values, .auth-summary { padding-left: 16px; padding-right: 16px; }
  .primary-action { width: calc(100% - 32px); margin-left: 16px; margin-right: 16px; }
  .result { margin-left: 16px; margin-right: 16px; }
}
