:root {
  color-scheme: light;
  --canvas: #f8f6f2;
  --paper: #fffdf9;
  --ink: #30302e;
  --muted: #77736d;
  --faint: #a19b92;
  --line: #e3ded6;
  --soft: #f0ebe3;
  --accent: #8b7050;
  --accent-deep: #6f563b;
  --accent-soft: #f3ede4;
  --danger: #a14c45;
  --danger-soft: #fbefee;
  --success: #58735d;
  --success-soft: #eef4ef;
  --shadow: 0 14px 36px rgba(69, 57, 43, 0.07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100svh;
  line-height: 1.65;
  font-size: 15px;
}

a {
  color: var(--accent-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(248, 246, 242, 0.88);
  border-bottom: 1px solid rgba(227, 222, 214, 0.8);
}

.topbar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
}

.topbar-nav {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}

.topbar-nav a {
  color: var(--muted);
}

.topbar-nav a[aria-current="page"] {
  color: var(--accent-deep);
  font-weight: 600;
}

.page-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 18px calc(44px + env(safe-area-inset-bottom));
}

.page-shell.narrow {
  max-width: 640px;
}

.hero-card {
  background: var(--accent-soft);
  border: 1px solid rgba(139, 112, 80, 0.14);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.hero-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent);
  color: #fffdf9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 19px;
}

.hero-card h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.hero-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.panel-center {
  text-align: center;
  padding: 28px 22px;
}

.about-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  margin-bottom: 12px;
}

.about-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.about-sub {
  margin: 6px 0 6px;
  font-size: 14px;
  color: var(--muted);
}

.about-version {
  margin: 0;
  font-size: 12.5px;
  color: var(--faint);
}

.section-label {
  margin: 22px 0 10px 4px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.doc-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.doc-header h1 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 600;
}

.doc-meta {
  margin: 4px 0;
  font-size: 13.5px;
  color: var(--muted);
}

.doc-body h2 {
  margin: 22px 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.doc-body p {
  margin: 8px 0;
  font-size: 14.5px;
  line-height: 1.78;
}

.doc-body ul {
  margin: 8px 0 12px;
  padding-left: 20px;
}

.doc-body li {
  margin: 6px 0;
  font-size: 14.5px;
  line-height: 1.75;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.info-row {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.7;
}

.info-muted {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
  margin: 0;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.step-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}

.step-desc {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--muted);
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 11px 13px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 112, 80, 0.14);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--soft);
  color: var(--muted);
}

.textarea {
  min-height: 88px;
  resize: vertical;
}

.row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.row > .grow {
  flex: 1 1 auto;
  min-width: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 14.5px;
  font-weight: 550;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fffdf9;
  width: 100%;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-deep);
}

.btn-outline {
  background: var(--paper);
  color: var(--accent-deep);
  border-color: var(--line);
}

.btn-outline:hover:not(:disabled) {
  background: var(--soft);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.status-msg {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
}

.status-ok {
  color: var(--success);
}

.status-err {
  color: var(--danger);
}

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

.banner-ok {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(88, 115, 93, 0.2);
}

.banner-err {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(161, 76, 69, 0.22);
}

.consent-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  margin: 12px 0 14px;
  font-size: 13px;
  line-height: 1.6;
  cursor: pointer;
}

.consent-box input[type="checkbox"] {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.counselor-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 13.5px;
  margin-top: 10px;
}

.verified-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 13.5px;
}

.footer-links {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(48, 48, 46, 0.92);
  color: #fffdf9;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  z-index: 50;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 480px) {
  .topbar-inner {
    padding: 10px 14px;
  }
  .page-shell {
    padding: 14px 12px calc(36px + env(safe-area-inset-bottom));
  }
  .panel {
    padding: 16px;
  }
  .hero-card {
    padding: 16px;
  }
}
