:root {
  color-scheme: light;
  --page: #f3f6f7;
  --surface: #ffffff;
  --ink: #10253a;
  --muted: #617386;
  --line: #d4dfe5;
  --teal: #00717a;
  --teal-dark: #005860;
  --teal-soft: #e8f5f4;
  --green: #137a45;
  --green-soft: #edf8f2;
  --amber: #9a5b00;
  --amber-soft: #fff5e2;
  --red: #bc3030;
  --red-soft: #fff0f0;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0;
}

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

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header-inner,
main,
.site-footer {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.identity-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.identity strong,
.identity small { display: block; }
.identity strong { font-size: 14px; }
.identity small { color: var(--muted); font-size: 11px; }

.invite-only,
.account-status {
  border: 1px solid #9fcfba;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

main { padding: 52px 0 64px; }

.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 56px;
  align-items: start;
}

.entry-copy { padding-top: 12px; }

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.25;
}

h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

h3 {
  margin: 0;
  font-size: 16px;
}

.lead {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.lead.compact { max-width: 650px; font-size: 15px; }

.entry-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 34px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.entry-facts div { padding: 17px 16px 17px 0; }
.entry-facts div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.entry-facts dt { font-weight: 800; }
.entry-facts dd { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.access-tool {
  min-height: 300px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(16, 37, 58, .07);
}

.access-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.access-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.access-index {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

#access-form { margin-top: 20px; }
#access-form label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }

#access-code {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #aebdc7;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-transform: uppercase;
}

#access-code:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(0, 113, 122, .12);
}

.primary-command,
.outline-command,
.quiet-command {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 800;
}

.primary-command {
  padding: 8px 15px;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fff;
}

.primary-command:hover:not(:disabled),
.primary-command:focus-visible { background: var(--teal-dark); outline: none; }

#access-form .primary-command { width: 100%; margin-top: 12px; }

.outline-command {
  padding: 8px 14px;
  border: 1px solid var(--teal);
  background: #fff;
  color: var(--teal);
}

.outline-command:hover:not(:disabled),
.outline-command:focus-visible { background: var(--teal-soft); outline: none; }

.quiet-command {
  padding: 7px 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.quiet-command:hover,
.quiet-command:focus-visible { border-color: #91a4b1; outline: none; }

.access-message { margin-top: 20px; padding: 14px; background: #f6f8f9; border-left: 3px solid var(--teal); }
.access-message p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.form-error { min-height: 24px; margin: 9px 0 0; color: var(--red); font-size: 13px; }

.flow-section,
.public-rules {
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.public-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.public-flow li { min-height: 118px; padding: 0 22px 0 0; }
.public-flow li + li { padding-left: 22px; border-left: 1px solid var(--line); }
.public-flow span { color: var(--teal); font-size: 12px; font-weight: 800; }
.public-flow strong,
.public-flow small { display: block; }
.public-flow strong { margin-top: 8px; }
.public-flow small { margin-top: 3px; color: var(--muted); }

.public-rules {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 54px;
}

.public-rules ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
  margin: 0;
  padding-left: 20px;
}

.portal-heading {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.portal-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.portal-tabs {
  display: flex;
  gap: 3px;
  margin: 20px 0 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #e9eef1;
  overflow-x: auto;
}

.portal-tabs button {
  min-width: 112px;
  min-height: 40px;
  flex: 1 0 auto;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.portal-tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(16, 37, 58, .11);
}

.tab-panel { min-height: 430px; }

.section-heading { margin-bottom: 22px; }
.inline-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.progress-count { color: var(--teal); font-size: 18px; }

.account-flow {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.account-flow li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  border-bottom: 1px solid var(--line);
}

.account-flow li > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.account-flow strong,
.account-flow small { display: block; }
.account-flow small { margin-top: 2px; color: var(--muted); }
.account-flow b { color: var(--muted); font-size: 13px; }
.account-flow li.done > span { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.account-flow li.done b { color: var(--green); }
.account-flow li.current > span { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.account-flow li.current b { color: var(--teal); }

.rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.rules-grid article {
  min-height: 174px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .48);
}

.rules-grid article > span { color: var(--teal); font-size: 11px; font-weight: 800; }
.rules-grid h3 { margin-top: 8px; }
.rules-grid p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.agreement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  padding: 18px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
}

.agreement label { display: flex; align-items: flex-start; gap: 10px; font-weight: 700; }
.agreement input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--teal); }
.accepted-notice { margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--green); background: var(--green-soft); color: var(--green); font-weight: 700; }

.locked-message {
  padding: 16px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
  color: #69420c;
}

.file-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.file-type {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.file-row strong,
.file-row small { display: block; }
.file-row small { margin-top: 2px; color: var(--muted); }

.config-notes { margin-top: 20px; }
.config-notes p { margin: 8px 0; color: var(--muted); }
.config-notes strong { color: var(--ink); }

.tutorial-jump {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  margin-top: 18px;
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.tutorial-jump:hover,
.tutorial-jump:focus-visible { color: var(--teal-dark); outline: none; text-decoration: underline; }

.online-tutorial {
  margin-top: 38px;
  scroll-margin-top: 20px;
  border-top: 1px solid var(--line);
}

.tutorial-heading {
  padding: 28px 0 8px;
}

.tutorial-heading > p:last-child {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
}

.tutorial-step {
  display: grid;
  grid-template-columns: minmax(300px, .82fr) minmax(0, 1.18fr);
  gap: 36px;
  align-items: center;
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.tutorial-number {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.tutorial-copy h3 { margin-top: 12px; font-size: 19px; }
.tutorial-copy > p { margin: 8px 0 0; color: var(--muted); }
.tutorial-copy > p strong { color: var(--ink); }

.marker-legend {
  display: grid;
  gap: 7px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.marker-legend li { display: flex; align-items: center; gap: 8px; }
.marker-legend span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.marker-legend .warning span { background: var(--amber); }

.annotated-shot {
  position: relative;
  width: 100%;
  margin: 0;
  border: 1px solid #b8c8d1;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(16, 37, 58, .08);
  overflow: hidden;
}

.annotated-shot img { display: block; width: 100%; height: auto; }

.shot-marker {
  position: absolute;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 37, 58, .34);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.marker-warning { background: var(--amber); }
.shot-import .marker-1 { left: 7%; top: 16%; }
.shot-import .marker-2 { left: 26%; top: 84%; }
.shot-import .marker-3 { left: 89%; top: 95%; }
.shot-network .marker-1 { left: 32%; top: 38%; }
.shot-network .marker-2 { left: 68%; top: 38%; }
.shot-network .marker-3 { left: 89%; top: 78%; }
.shot-rule .marker-1 { left: 34%; top: 46%; }
.shot-node .marker-1 { left: 49%; top: 51%; }
.shot-node .marker-2 { left: 49%; top: 68%; }
.shot-node .marker-warning { left: 73%; top: 11%; }
.shot-site .marker-1 { left: 38%; top: 52%; }

.tutorial-warning,
.recovery-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
}

.recovery-note { border-left-color: var(--teal); background: var(--teal-soft); }
.tutorial-warning strong,
.recovery-note strong { font-size: 13px; }
.tutorial-warning p,
.recovery-note p { margin: 3px 0 0; color: #69420c; font-size: 13px; }
.recovery-note p { color: var(--teal-dark); }

.tutorial-boundary {
  margin-top: 12px;
  padding: 18px 20px;
  border-left: 4px solid var(--green);
  background: var(--green-soft);
}

.tutorial-boundary p { margin: 4px 0 0; color: #2d6247; }

.payment-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-height: 170px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.payment-state h3 { margin-top: 8px; font-size: 20px; }
.payment-state p { max-width: 680px; margin: 5px 0 0; color: var(--muted); }
.payment-label { color: var(--amber); font-size: 12px; font-weight: 800; }
.payment-label.paid { color: var(--green); }
.payment-footnote { color: var(--muted); font-size: 13px; }

.modal-open { overflow: hidden; }

.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 37, 58, .58);
}

.payment-dialog {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(16, 37, 58, .3);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover,
.modal-close:focus-visible { border-color: var(--teal); color: var(--teal); outline: none; }
.payment-dialog-copy { margin: 8px 38px 0 0; color: var(--muted); font-size: 14px; }

.payment-amount-row,
.payment-reference {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #f7f9fa;
}

.payment-amount-row span,
.payment-reference span { color: var(--muted); font-size: 13px; }
.payment-amount-row strong { color: var(--red); font-size: 22px; }

.payment-qr-frame {
  display: grid;
  width: min(320px, 100%);
  aspect-ratio: 1;
  place-items: center;
  margin: 18px auto 0;
  border: 1px solid var(--line);
  background: #f7f9fa;
  overflow: hidden;
}

.payment-qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.payment-qr-placeholder { max-width: 220px; padding: 20px; color: var(--muted); text-align: center; }
.payment-reference { margin-top: 14px; }
.payment-reference strong { font-family: Consolas, "Courier New", monospace; }
.payment-dialog-footnote { margin: 14px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100% - 32px));
  padding: 12px 15px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 28px rgba(16, 37, 58, .2);
  font-size: 14px;
}

@media (max-width: 820px) {
  .entry-layout,
  .public-rules,
  .tutorial-step { grid-template-columns: 1fr; }
  .entry-layout { gap: 34px; }
  .entry-facts { grid-template-columns: 1fr; }
  .entry-facts div + div { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .public-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
  .public-flow li:nth-child(3) { padding-left: 0; border-left: 0; }
  .public-rules { gap: 24px; }
  .rules-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .site-header-inner,
  main,
  .site-footer { width: min(100% - 24px, 1080px); }
  main { padding-top: 30px; }
  h1 { font-size: 29px; }
  .lead { font-size: 15px; }
  .entry-layout { display: flex; flex-direction: column; }
  .access-tool { width: 100%; min-height: 0; padding: 18px; }
  .public-flow,
  .public-rules ul,
  .rules-grid { grid-template-columns: 1fr; }
  .public-flow li,
  .public-flow li + li,
  .public-flow li:nth-child(3) { min-height: 92px; padding: 14px 0; border-top: 1px solid var(--line); border-left: 0; }
  .portal-heading,
  .payment-state,
  .agreement { align-items: stretch; flex-direction: column; }
  .portal-actions { align-items: center; }
  .portal-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 26px;
    overflow: visible;
  }
  .portal-tabs button { min-width: 0; }
  .account-flow li { grid-template-columns: 38px minmax(0, 1fr); padding: 12px 0; }
  .account-flow li b { grid-column: 2; }
  .file-row { grid-template-columns: 48px minmax(0, 1fr); }
  .file-row .outline-command { grid-column: 2; justify-self: start; }
  .tutorial-step { gap: 22px; padding: 28px 0; }
  .tutorial-copy h3 { font-size: 18px; }
  .shot-marker { width: 27px; height: 27px; }
  .payment-dialog { padding: 22px 18px; }
  .site-footer { display: block; }
  .site-footer span { display: block; }
}
