@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --paper: #f1f2ee;
  --surface: #ffffff;
  --ink: #15181c;
  --ink-2: #565c64;
  --ink-3: #8a8f96;
  --rule: #d9dbd4;
  --rule-strong: #c4c7bf;
  --pro: #0b7a5c;
  --pro-soft: #bfdccf;
  --pro-wash: #e3efe9;
  --ultra: #4b39c9;
  --ultra-soft: #cfc9f2;
  --ultra-wash: #ebe8fa;
  --alipay: #1677ff;
  --alipay-hover: #0b63de;
  --warn: #8a5300;
  --warn-wash: #fbf0d9;
  --danger: #b4321f;
  --danger-wash: #fbe9e5;

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --font-num: "Archivo", var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { font-weight: 650; line-height: 1.3; text-wrap: balance; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums lining-nums; }

:focus-visible { outline: 2px solid var(--pro); outline-offset: 2px; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── 顶栏 ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}
.brand-mark { width: 28px; height: 28px; flex: none; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.brand-mark rect { fill: var(--ink); stroke: none; }
.brand-mark path { stroke: var(--paper); }
.brand-title {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-content { flex: 1; padding-bottom: 72px; }

/* ── 首屏 ── */
.hero { padding: 64px 0 40px; max-width: 760px; }
.hero h1 {
  font-size: clamp(30px, 4.4vw, 50px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.005em;
}
.hero h1 > span { display: block; }
.hero h1 .num { font-weight: 700; font-stretch: 92%; letter-spacing: -0.02em; white-space: nowrap; }
.lede { margin-top: 16px; font-size: 17px; color: var(--ink-2); max-width: 34em; }

/* ── 分步标题 ── */
.step-title { font-size: 21px; display: flex; align-items: baseline; gap: 12px; }
.step-no {
  font-family: var(--font-num);
  font-weight: 700;
  font-stretch: 80%;
  font-size: 1.15em;
  color: var(--pro);
}
.step-desc { color: var(--ink-2); margin: 6px 0 0; max-width: 40em; }

/* ── 时长刻度尺 ── */
.ruler {
  --cols: minmax(12rem, 15rem) minmax(0, 1fr) 7.5rem 5.5rem;
  --col-gap: 24px;
  margin-top: 28px;
  border-top: 1px solid var(--ink);
}
.ruler-loading { padding: 24px 0; color: var(--ink-3); }

.ruler-axis,
.plan {
  display: grid;
  grid-template-columns: var(--cols);
  column-gap: var(--col-gap);
  align-items: center;
}
.ruler-axis { height: 34px; padding: 0 14px; }
.axis-track { position: relative; height: 100%; }
.axis-label {
  position: absolute;
  bottom: 7px;
  font-family: var(--font-num);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  transform: translateX(-50%);
  white-space: nowrap;
}
.axis-label:first-child { transform: none; color: var(--ink); }
.axis-head { font-size: 12px; color: var(--ink-3); }
.axis-head-r { text-align: right; }

.plan {
  position: relative;
  min-height: 68px;
  padding: 0 14px;
  border-top: 1px solid var(--rule);
  cursor: pointer;
  transition: background-color 0.18s var(--ease);
}
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.plan.is-selected { background: var(--surface); }
.plan:has(input:focus-visible) { outline: 2px solid var(--pro); outline-offset: -2px; }

.plan-name { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 0; }
.plan-radio {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--rule-strong);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plan.is-selected .plan-radio { border-color: var(--pro); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 9px var(--pro); }
.plan.is-ultra.is-selected .plan-radio { border-color: var(--ultra); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 9px var(--ultra); }
.plan-title { font-weight: 600; line-height: 1.35; }
.plan-flag { display: block; font-size: 12.5px; color: var(--pro); font-weight: 600; }

/* 每一行的刻度线由 JS 写入 --ticks */
.plan-track {
  position: relative;
  align-self: stretch;
  background-image: var(--ticks, none);
}
.bar {
  position: absolute;
  left: 0;
  top: 50%;
  height: 14px;
  margin-top: -7px;
  border-radius: 3px;
  background: var(--pro-soft);
  transform-origin: left center;
  animation: bar-grow 0.9s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 70ms + 120ms);
  transition: background-color 0.2s var(--ease);
}
.plan:hover .bar { background: color-mix(in srgb, var(--pro-soft) 60%, var(--pro)); }
.plan.is-selected .bar { background: var(--pro); }
.is-ultra .bar { background: var(--ultra-soft); }
.plan.is-ultra:hover .bar { background: color-mix(in srgb, var(--ultra-soft) 60%, var(--ultra)); }
.plan.is-ultra.is-selected .bar { background: var(--ultra); }

@keyframes bar-grow { from { transform: scaleX(0); } }

.plan-days { line-height: 1.25; }
.plan-days-n { font-size: 19px; font-weight: 600; font-stretch: 88%; }
.plan-days-n small { font-family: var(--font-sans); font-size: 12px; font-weight: 400; color: var(--ink-2); margin-left: 3px; }
.plan-until { display: block; font-family: var(--font-num); font-size: 12px; color: var(--ink-3); }
.plan-price { text-align: right; font-size: 20px; font-weight: 600; font-stretch: 92%; }
.plan-price small { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-right: 1px; }

.ruler-group {
  margin-top: 28px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 600;
  color: var(--ultra);
}
.ruler-group + .plan { border-top: 0; }
.ruler > .plan:last-child { border-bottom: 1px solid var(--rule); }


/* ── 下单区 ── */
.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 56px;
  margin-top: 72px;
  align-items: start;
}

.field { margin-top: 20px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.field-hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.field-paste { margin-top: 24px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field-row-3 { grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 10px 0 14px; }

.input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
  font-size: 15px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: #a3a7ad; font-family: var(--font-sans); }
.input:hover { border-color: #a9ada5; }
.input:focus { outline: none; border-color: var(--pro); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pro) 18%, transparent); }
select.input {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: right 17px center, right 12px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.input.is-filled { animation: filled 0.7s var(--ease); }
@keyframes filled { from { background-color: var(--pro-wash); } }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 60px; }
.reveal {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.reveal:hover { background: var(--paper); color: var(--ink); }


/* 付款汇总 */
.summary {
  position: sticky;
  top: 84px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 24px;
}
.summary-plan { margin-top: 20px; }
.summary-name { font-weight: 600; font-size: 16px; }
.summary-tier { font-size: 13px; color: var(--ink-2); }
.summary-days { display: flex; align-items: baseline; gap: 6px; margin-top: 14px; }
.summary-days-n {
  font-size: 68px;
  line-height: 0.95;
  font-weight: 650;
  font-stretch: 72%;
  letter-spacing: -0.02em;
  color: var(--pro);
}
.summary.is-ultra .summary-days-n { color: var(--ultra); }
.summary-days-u { font-size: 16px; font-weight: 600; }
.summary-until { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.summary-features { list-style: none; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.summary-features li { position: relative; padding-left: 20px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.summary-features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 9px;
  height: 5px;
  border-left: 1.5px solid var(--pro);
  border-bottom: 1.5px solid var(--pro);
  transform: rotate(-45deg);
}
.summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 20px 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--ink-2);
}
.summary-price { font-size: 32px; font-weight: 650; font-stretch: 88%; color: var(--ink); }
.summary-note { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-block { width: 100%; height: 50px; font-size: 16px; border-radius: 10px; }
.btn-alipay { background: var(--alipay); color: #fff; }
.btn-alipay:hover:not(:disabled) { background: var(--alipay-hover); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover:not(:disabled) { background: #2a2f36; }
.btn-quiet { background: transparent; border-color: var(--rule-strong); color: var(--ink); }
.btn-quiet:hover:not(:disabled) { background: var(--surface); border-color: #a9ada5; }

/* ── 订单看板 ── */
.workspace { padding-top: 48px; }
.ws-head { padding-bottom: 24px; border-bottom: 1px solid var(--ink); }
.ws-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ws-title { font-size: clamp(22px, 3vw, 30px); margin-top: 14px; max-width: 26em; word-break: keep-all; overflow-wrap: anywhere; }
.ws-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 14px; font-size: 13.5px; }
.ws-meta dt { color: var(--ink-3); font-size: 12px; }
.ws-meta dd { font-weight: 500; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--rule);
  color: var(--ink-2);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status[data-status="waiting_pay"],
.status[data-status="queued"],
.status[data-status="running"] { color: var(--alipay); }
.status[data-status="running"]::before,
.status[data-status="waiting_pay"]::before { animation: pulse 1.4s ease-in-out infinite; }
.status[data-status="ready_to_start"],
.status[data-status="waiting_2fa"] { color: var(--warn); background: var(--warn-wash); border-color: transparent; }
.status[data-status="succeeded"] { color: var(--pro); background: var(--pro-wash); border-color: transparent; }
.status[data-status="failed"] { color: var(--danger); background: var(--danger-wash); border-color: transparent; }

.copy {
  text-align: left;
  border: 0;
  background: none;
  padding: 0;
  cursor: copy;
  text-decoration: underline dotted var(--rule-strong);
  text-underline-offset: 3px;
}
.copy:hover { text-decoration-color: var(--ink); }

/* 付款 */
.pay {
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 40px 0 8px;
}
.qr {
  flex: none;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 14px;
  line-height: 0;
}
.qr img { width: 232px; height: 232px; }
.pay-label { font-size: 15px; color: var(--ink-2); }
.pay-amount { font-size: 56px; font-weight: 650; font-stretch: 80%; line-height: 1.05; letter-spacing: -0.02em; margin: 2px 0 20px; }
.live { display: flex; align-items: center; gap: 10px; margin-top: 20px; font-size: 13.5px; color: var(--ink-2); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--alipay); animation: pulse 1.4s ease-in-out infinite; }
.pay-tip { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); }
  50% { box-shadow: 0 0 0 5px transparent; }
}
.live-dot { color: var(--alipay); }

/* 进度 */
.progress { padding-top: 32px; }
.progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.progress-hint { font-size: 16px; font-weight: 600; }
.progress-pct { font-size: 28px; font-weight: 650; font-stretch: 80%; }
.progress-track { height: 6px; margin-top: 10px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--pro);
  transition: width 0.6s var(--ease);
}

.notice {
  margin-top: 28px;
  padding: 20px 22px;
  border-radius: 12px;
  border-left: 3px solid;
}
.notice h3 { font-size: 16px; margin-bottom: 4px; }
.notice p { font-size: 13.5px; color: var(--ink-2); margin-bottom: 14px; max-width: 46em; }
.notice-warn { background: var(--warn-wash); border-color: var(--warn); }
.notice-warn h3 { color: var(--warn); }
.notice-danger { background: var(--danger-wash); border-color: var(--danger); }
.notice-danger h3 { color: var(--danger); }
.notice-ok { background: var(--pro-wash); border-color: var(--pro); }
.notice-ok h3 { color: var(--pro); margin-bottom: 12px; }
.notice { animation: notice-in 0.35s var(--ease); }
@keyframes notice-in { from { opacity: 0; transform: translateY(-4px); } }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 220px; width: auto; }
.inline-form .btn { height: 44px; }

.result { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 24px; }
.result dt { font-size: 12px; color: var(--ink-3); }
.result dd { font-weight: 600; word-break: break-all; }
.result .copy { font-weight: 600; }

.steps { margin-top: 40px; max-width: 640px; }
.logs-title { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 12px; }

.milestones { list-style: none; }
.milestones li {
  position: relative;
  padding: 0 0 16px 26px;
  font-size: 14px;
  line-height: 1.5;
}
.milestones li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--rule-strong);
  background: var(--paper);
}
.milestones li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 20px;
  bottom: 0;
  width: 2px;
  background: var(--rule);
}
.milestones li:last-child::after { display: none; }
.milestones li.is-done::before { border-color: var(--pro); background: var(--pro); }
.milestones li.is-active::before { border-color: var(--alipay); color: var(--alipay); animation: pulse 1.4s ease-in-out infinite; }
.milestones li.is-warn::before { border-color: var(--warn); background: var(--warn); }
.milestones li.is-error::before { border-color: var(--danger); background: var(--danger); }
.milestones li.is-error { color: var(--danger); }
.milestones .is-empty { color: var(--ink-3); padding-left: 0; }
.milestones .is-empty::before, .milestones .is-empty::after { display: none; }


/* ── 查询弹窗 ── */
.dialog {
  margin: auto;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 24px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 64px -12px rgba(21, 24, 28, 0.35);
}
.dialog::backdrop { background: rgba(21, 24, 28, 0.32); backdrop-filter: blur(2px); }
.dialog[open] { animation: dialog-in 0.24s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { font-size: 19px; }
.dialog-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.dialog-close:hover { background: var(--paper); }
.dialog-close svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.dialog-desc { font-size: 13.5px; color: var(--ink-2); margin: 6px 0 16px; }
.query-results { margin-top: 16px; }
.query-results:empty { display: none; }
.query-msg { font-size: 13.5px; color: var(--ink-3); }
.query-msg.is-error { color: var(--danger); }
.query-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.query-item-main { min-width: 0; font-size: 14px; }
.query-item-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }

/* ── 提示条 ── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  box-shadow: 0 12px 32px -8px rgba(21, 24, 28, 0.4);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.footer { padding: 24px 0; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-3); }

/* ── 响应式 ── */
@media (max-width: 960px) {
  .checkout { grid-template-columns: 1fr; gap: 48px; }
  .summary { position: static; }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .hero { padding: 36px 0 28px; }
  .lede { font-size: 15.5px; }
  .checkout { margin-top: 56px; }

  .ruler { margin: 24px -16px 0; }
  .ruler-axis { display: none; }
  .plan {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name price" "track track" "days days";
    padding: 12px 16px 14px;
    min-height: 0;
  }
  .plan-name { grid-area: name; padding: 0; }
  .plan-price { grid-area: price; }
  .plan-track { grid-area: track; height: 30px; margin: 4px 0 2px 30px; background-image: none; }
  .plan-days { grid-area: days; padding-left: 30px; display: flex; align-items: baseline; gap: 10px; }
  .plan-days-n { font-size: 16px; }
  .plan-until { display: inline; }
  .ruler-group { padding: 0 16px 8px; }

  .input, .input.mono { font-size: 16px; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
  .pay { flex-direction: column; align-items: stretch; gap: 24px; padding-top: 28px; }
  .qr { align-self: center; order: 1; }
  .qr img { width: 200px; height: 200px; }
  .pay-side .btn { width: 100%; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
