:root {
  color-scheme: light;
  --page: #f6f8fb;
  --page-2: #edf3ff;
  --surface: rgba(255, 255, 255, .82);
  --surface-solid: #ffffff;
  --surface-muted: #f8fafc;
  --ink: #101828;
  --ink-2: #26354d;
  --muted: #667085;
  --muted-2: #8a95a7;
  --line: rgba(16, 24, 40, .11);
  --line-strong: rgba(16, 24, 40, .18);
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #eaf1ff;
  --success: #0f9f8f;
  --success-soft: #e8f8f5;
  --warning: #d88912;
  --warning-soft: #fff6df;
  --danger: #d92d20;
  --danger-soft: #fff1f0;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow: 0 18px 48px rgba(37, 99, 235, .10), 0 8px 18px rgba(16, 24, 40, .07);
  --shadow-lg: 0 32px 90px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 9% 8%, rgba(37, 99, 235, .14), transparent 30%),
    radial-gradient(circle at 84% 6%, rgba(15, 159, 143, .09), transparent 27%),
    linear-gradient(180deg, #fbfcff 0%, var(--page) 54%, #eef3f8 100%);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16, 24, 40, .032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 24, 40, .032) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.62), rgba(0,0,0,.18) 42%, transparent 78%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
  padding: 14px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid rgba(16, 24, 40, .08);
  background: rgba(255, 255, 255, .74);
  backdrop-filter: blur(20px) saturate(150%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #5b8cff);
  color: #fff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
}

.brand-name { white-space: nowrap; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(16, 24, 40, .07);
  border-radius: 999px;
  background: rgba(248, 250, 252, .72);
  color: var(--muted);
  font-size: 14px;
}

.site-nav a,
.site-nav button {
  min-height: 32px;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}

.site-nav a:hover,
.site-nav button:hover {
  color: var(--primary-strong);
  background: #fff;
  transform: translateY(-1px);
}

main { width: min(1160px, calc(100vw - 32px)); margin: 0 auto; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(430px, 1.06fr);
  gap: 54px;
  align-items: center;
  min-height: 620px;
  padding: 52px 0 46px;
}

.hero-copy { position: relative; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
}

h1, h2, h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-size: clamp(44px, 5.6vw, 78px);
  line-height: 1.02;
}

h2 {
  font-size: clamp(24px, 2.8vw, 36px);
  line-height: 1.18;
}

h3 {
  font-size: 18px;
  line-height: 1.3;
}

.lede {
  max-width: 650px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.82;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 18px;
  background: var(--surface-solid);
  color: var(--ink-2);
  font-weight: 900;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, .28);
  box-shadow: 0 12px 24px rgba(16, 24, 40, .10);
}

.button:active { transform: translateY(0); }

.button.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary), #4f7df8);
  color: #fff;
  box-shadow: 0 14px 30px rgba(37, 99, 235, .25);
}

.button.secondary {
  background: rgba(255, 255, 255, .86);
  color: var(--primary-strong);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
  box-shadow: none;
}

.button:focus-visible,
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .18);
  outline-offset: 2px;
}

.version-card {
  display: inline-flex;
  max-width: 620px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, .16);
  border-radius: var(--radius);
  background: rgba(234, 241, 255, .76);
  color: #244a9a;
  font-size: 13px;
  line-height: 1.55;
}

.product-frame {
  position: relative;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.product-frame::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(37,99,235,.25), rgba(15,159,143,.13), rgba(255,255,255,.7));
}

.product-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top left;
  border: 1px solid rgba(16, 24, 40, .10);
  border-radius: 8px;
}

.product-frame figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 0;
  color: var(--muted);
  font-size: 13px;
}

.product-frame figcaption strong { color: var(--primary-strong); }

.workflow-section { padding: 30px 0 18px; }

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-note {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.workflow-grid,
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric,
.quick-action-card,
.download-band,
.form-card,
.table-card,
.contact-card,
.price-panel,
.credit-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.metric {
  display: grid;
  gap: 12px;
  min-height: 168px;
  padding: 22px;
}

.metric strong,
.quick-action-card h3 {
  color: var(--ink);
  font-size: 18px;
}

.metric span,
.quick-action-card p,
.feature-strip span {
  color: var(--muted);
  line-height: 1.72;
}

.step-num {
  color: var(--warning) !important;
  font-weight: 950;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  margin: 20px 0 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.70);
  box-shadow: var(--shadow-sm);
}

.feature-strip div {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.feature-strip div:last-child { border-right: 0; }
.feature-strip strong { color: var(--ink); }

.download-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin: 36px 0 54px;
  padding: 26px;
}

.download-band p {
  color: var(--muted);
  line-height: 1.72;
  margin-bottom: 0;
}

.quick-actions-section {
  margin: 8px 0 62px;
  scroll-margin-top: 92px;
}

.quick-action-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 190px;
  padding: 22px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.quick-action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 99, 235, .20);
  box-shadow: var(--shadow);
}

.quick-action-card p { margin: 0; }
.quick-action-card .button { margin-top: auto; }

.quick-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.site-modal {
  width: min(1000px, calc(100vw - 32px));
  max-height: min(86vh, 900px);
  border: 0;
  padding: 0;
  background: transparent;
}

.site-modal::backdrop {
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(14px);
}

.modal-card {
  position: relative;
  overflow: auto;
  width: min(100%, 760px);
  max-height: min(86vh, 900px);
  margin: 0 auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 16px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px) saturate(150%);
}

.modal-card-wide { width: min(100%, 980px); }
.modal-card-narrow { width: min(100%, 520px); }

.modal-head {
  display: grid;
  gap: 8px;
  margin: 0 42px 18px 0;
}

.modal-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}

.modal-close:hover {
  color: var(--primary-strong);
  border-color: rgba(37, 99, 235, .26);
}

.has-modal-open { overflow: hidden; }

.pricing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, .92fr);
  gap: 16px;
}

.price-panel,
.credit-panel {
  padding: 18px;
  background: rgba(255,255,255,.74);
  box-shadow: none;
}

.price-rate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.price-rate span { font-weight: 900; }
.price-rate strong { font-size: 16px; }

.package-table,
.credit-list {
  display: grid;
  gap: 8px;
}

.package-row,
.credit-list div {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.package-row { grid-template-columns: 1fr .8fr 1fr 1fr; }
.package-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: var(--surface-muted);
}

.credit-panel h3 { margin-bottom: 12px; }
.credit-list div { grid-template-columns: 1fr auto; }
.credit-list strong { color: var(--primary-strong); }

.contact-card {
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(255,255,255,.74);
  box-shadow: none;
}

.contact-card img {
  display: block;
  width: min(100%, 320px);
  height: auto;
  border-radius: var(--radius);
}

.form-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.inline-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.grant-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.grant-user-row .button {
  min-width: 132px;
  white-space: nowrap;
}

.grant-user-row .status {
  flex: 1 1 240px;
  line-height: 1.5;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  padding: 0 12px;
  color: var(--ink);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea {
  height: auto;
  padding: 10px 12px;
  line-height: 1.55;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, .55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .10);
}

.status {
  color: var(--muted);
  font-size: 13px;
}

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

.admin-shell {
  width: min(1220px, calc(100vw - 32px));
  padding: 34px 0 64px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .80);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.admin-hero h1 { font-size: clamp(30px, 4vw, 46px); }

.admin-hero p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.admin-token-card {
  background: rgba(248, 250, 252, .86);
  box-shadow: none;
}

.admin-workbench {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .80);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
}

.admin-nav-item {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  padding: 12px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.admin-nav-item:hover {
  transform: translateY(-1px);
  background: rgba(248, 250, 252, .92);
}

.admin-nav-item strong {
  color: var(--ink);
  font-size: 15px;
}

.admin-nav-item span {
  line-height: 1.45;
  font-size: 12px;
}

.admin-nav-item.is-active {
  border-color: rgba(37, 99, 235, .18);
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: inset 3px 0 0 var(--primary);
}

.admin-panel {
  min-height: 520px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.admin-panel[hidden] { display: none; }

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}

.panel-head > .status {
  max-width: 420px;
  text-align: right;
  line-height: 1.6;
}

.table-card {
  margin-top: 0;
  padding: 18px;
}

.admin-panel > .table-card {
  background: rgba(255, 255, 255, .62);
  box-shadow: none;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-filter-row input { width: min(320px, 100%); }

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

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 900;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--primary);
}

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

.model-channel-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.model-channel-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.model-channel-item.is-active {
  border-color: rgba(37, 99, 235, .30);
  background: var(--primary-soft);
}

.model-channel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink);
  font-weight: 950;
}

.model-channel-url {
  margin-top: 5px;
  color: var(--primary-strong);
  font-size: 13px;
  word-break: break-all;
}

.model-channel-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.model-channel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pill.ok {
  color: var(--success);
  border-color: rgba(15, 159, 143, .28);
  background: var(--success-soft);
}

.pill.off {
  color: var(--danger);
  border-color: rgba(217, 45, 32, .24);
  background: var(--danger-soft);
}

.model-channel-form {
  background: rgba(255, 255, 255, .78);
  box-shadow: none;
}

.table-wrap { overflow: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--ink-2);
  background: #f8fafc;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button,
  .quick-action-card,
  .admin-nav-item,
  .site-nav a,
  .site-nav button { transition: none; }
  .button:hover,
  .quick-action-card:hover,
  .admin-nav-item:hover,
  .site-nav a:hover,
  .site-nav button:hover { transform: none; }
}

@media (max-width: 900px) {
  .site-header { display: grid; gap: 12px; }
  .site-nav { flex-wrap: wrap; border-radius: var(--radius-lg); }
  .hero,
  .admin-hero,
  .admin-workbench,
  .pricing-layout { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 38px; }
  .product-frame { order: -1; }
  .workflow-grid,
  .feature-strip,
  .quick-action-grid { grid-template-columns: 1fr; }
  .feature-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .feature-strip div:last-child { border-bottom: 0; }
  .download-band { align-items: stretch; flex-direction: column; }
  .download-band .button { width: 100%; }
  .admin-sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-head { display: grid; }
  .panel-head > .status { max-width: none; text-align: left; }
  .model-channel-item { grid-template-columns: 1fr; }
  .model-channel-actions { justify-content: flex-start; }
}

@media (max-width: 560px) {
  main { width: min(100% - 24px, 1160px); }
  h1 { font-size: 40px; }
  .lede { font-size: 16px; }
  .hero-actions,
  .inline-form-row,
  .quick-action-row,
  .form-row.two { display: grid; grid-template-columns: 1fr; }
  .button { width: 100%; }
  .product-frame figcaption { display: grid; }
  .package-row { grid-template-columns: 1fr 1fr; }
  .site-modal { width: min(100vw - 18px, 760px); }
  .modal-card { padding: 18px; }
  .admin-sidebar { grid-template-columns: 1fr; }
  .admin-panel { padding: 14px; }
}
