@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #1e3a5f;
  --accent-hover: #16304f;
  --accent-soft: #eff6ff;
  --accent-line: #3b82f6;
  --good: #059669;
  --bad: #dc2626;
  --warn-bg: #fffbeb;
  --warn-border: #fcd34d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --header-h: 64px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-line); }
a:hover { color: #2563eb; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-logo {
  flex-shrink: 0;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions,
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.lang-toggle {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  font-family: inherit;
}

.lang-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.page-shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

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

.hero {
  padding: 1.5rem 0 2.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #dbeafe;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h2 {
  margin: 0 auto 0.75rem;
  max-width: 640px;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}

.hero-lead {
  margin: 0 auto 1.75rem;
  max-width: 560px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.feature-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}

.feature-pill strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.feature-pill span {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.content-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

.status-banner {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--bg-elevated);
}

.status-banner.warn {
  border-color: var(--warn-border);
  background: var(--warn-bg);
  color: #92400e;
}

.status-banner.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0 0 1.1rem;
  line-height: 1.5;
}

.purchase-crypto-warn {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.5;
}

.purchase-crypto-warn strong {
  font-weight: 600;
  color: var(--text);
}

.purchase-crypto-label {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.purchase-crypto-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0 0 0.95rem;
}

.crypto-segment-opt {
  position: relative;
  display: grid;
  place-items: center;
  height: 2.25rem;
  margin: 0;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.15s, background 0.15s;
}

.crypto-segment-opt:hover {
  border-color: var(--border-strong);
}

.crypto-segment-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.crypto-segment-opt input {
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.crypto-segment-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  white-space: nowrap;
  line-height: 1;
}

.crypto-segment-name {
  display: inline;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.crypto-segment-net {
  display: inline;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

#purchase-crypto-wrap.hidden {
  display: none;
}

.purchase-sale-banner {
  display: flex;
  align-items: center;
  min-height: 2.25rem;
  margin: 0 0 0.85rem;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}

.purchase-sale-banner.hidden {
  display: none;
}

.plan-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.45rem 0 0.2rem;
}

.plan-price-original {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: line-through;
}

.plan-price-sale {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.trust-steps {
  margin: 0.75rem 0 1rem 1.1rem;
  padding: 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.55;
}

.trust-steps li {
  margin: 0.25rem 0;
}

.trust-hash-label {
  margin: 0.5rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.trust-hash {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  word-break: break-all;
  user-select: all;
}

.trust-links {
  margin-top: 0.85rem;
}

.sim-form, .license-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  align-items: end;
}

.sim-form label {
  min-width: 0;
}

input[type="date"],
input[type="datetime-local"] {
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.sim-form label > span,
.admin-bar label > span,
.field > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input, select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#purchase-email-wrap {
  display: block;
  margin: 0.75rem 0 0.25rem;
  max-width: 420px;
}

#purchase-email-wrap.hidden {
  display: none;
}

input:focus, select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

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

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.85rem;
}

.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.stat .label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat .value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-top: 0.15rem;
}

.pos,
td.pos,
.value.pos,
.stat .value.pos { color: var(--good); }
.neg,
td.neg,
.value.neg,
.stat .value.neg { color: var(--bad); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:last-child td { border-bottom: none; }

.error {
  color: var(--bad);
  margin-top: 0.75rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.hidden { display: none !important; }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-box {
  border: 1px solid var(--border);
  background: #fff;
  padding: 1.75rem 2rem;
  border-radius: var(--radius);
  text-align: center;
  max-width: 320px;
  box-shadow: var(--shadow-md);
}

.loading-box p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  margin-top: 1rem;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1e3a5f, #3b82f6);
  border-radius: 999px;
  transition: width 0.45s ease;
}

.progress-label {
  margin: 0.5rem 0 0 !important;
  font-size: 0.82rem !important;
  font-weight: 500;
  color: var(--accent) !important;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p { margin: 0; }

.legal-links {
  margin-top: 0.65rem !important;
  font-size: 0.88rem;
}

.legal-links a {
  color: var(--muted);
  text-decoration: none;
}

.legal-links a:hover { color: var(--accent-line); }

.card.legal h3 { margin-top: 1.5rem; }
.card.legal h4 { margin-top: 0.85rem; font-size: 1rem; }
.card.legal ul { padding-left: 1.25rem; }
.card.legal ol { padding-left: 1.35rem; }
.card.legal ol ol { margin: 0.4rem 0 0.6rem; }
.card.legal p, .card.legal li { line-height: 1.55; }

.guide-checklist { list-style: none; padding-left: 0 !important; margin-top: 0.5rem; }
.guide-checklist li { margin: 0.25rem 0; }
.guide-checklist li::before { content: "☐ "; color: var(--muted); }

.guide-note {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-line);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.75rem 0;
  font-size: 0.92rem;
}

.guide-toc { columns: 2; column-gap: 2rem; font-size: 0.95rem; }

.site-ver {
  margin-top: 0.5rem !important;
  font-size: 0.75rem;
  color: #94a3b8;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1rem;
  text-align: center;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.plan-card .btn {
  width: 100%;
  margin-top: auto;
}

.plan-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.plan-card-featured {
  border-color: #93c5fd;
  box-shadow: 0 0 0 1px #93c5fd;
}

.plan-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.plan-name { font-weight: 600; font-size: 1rem; }
.plan-price { font-size: 1.65rem; font-weight: 700; margin: 0.45rem 0 0.2rem; letter-spacing: -0.02em; }
.plan-per-day { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.25rem; }
.plan-days { color: var(--muted); font-size: 0.82rem; margin-bottom: 0.85rem; }

.license-key-display {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  word-break: break-all;
}

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}

.admin-bar label { flex: 1; min-width: 200px; }

.admin-bar input, .admin-bar select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 12rem;
}

.admin-actions .btn {
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
}

.admin-mint-bar {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.admin-mint-result {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid #bfdbfe;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.92rem;
  word-break: break-all;
}

.admin-mint-result.hidden {
  display: none;
}

.live-meta {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeframe-toggle {
  display: inline-flex;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid var(--border);
}

.tf-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

.tf-btn.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.tf-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background: #e2e8f0;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.summary-tf {
  margin: -0.25rem 0 0.75rem;
}

.live-stats {
  margin-bottom: 1rem;
}

.live-log-title {
  margin: 0.5rem 0 0.5rem;
  font-size: 1rem;
}

.live-log {
  background: #f8fafc;
  color: var(--text);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  height: 260px;
  overflow-y: auto;
  padding: 0.75rem 0.85rem;
  margin-bottom: 1rem;
}

.live-log-line {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 0.35rem;
}

.live-log-line.order { color: #2563eb; }
.live-log-line.complete { color: var(--good); }
.live-log-line.complete.loss { color: var(--bad); }
.live-log-line.heartbeat { color: var(--muted); }

.live-log-empty {
  color: var(--muted);
}

.live-daily {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.live-daily summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

html[lang="zh-Hant"] .i18n-en { display: none !important; }
html[lang="en"] .i18n-zh { display: none !important; }

@media (max-width: 768px) {
  .feature-row { grid-template-columns: 1fr; }
  .guide-toc { columns: 1; }
  .tagline { display: none; }
  .hero { padding-top: 0.5rem; }
}

@media (max-width: 600px) {
  .page-shell { padding: 1.25rem 1rem 2rem; }
  .header-inner { padding: 0 1rem; }
  .header-actions .btn:not(.primary) { display: none; }
  .sim-form {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 1.15rem 1rem;
  }
}
