:root {
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  --bg: #f6f7fb;
  --surface: #fff;
  --ink: #202738;
  --muted: #667085;
  --line: #e7eaf1;
  --brand: #5262d5;
  --brand-dark: #404fb9;
  --tint: #eef0ff;
  --radius: 16px;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.6;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--brand);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #8e9afa;
  outline-offset: 4px;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  line-height: 1.4;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 18px;
}
.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.site-header {
  height: 80px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  width: min(1200px, calc(100% - 80px));
  height: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--brand);
  color: #fff;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 750;
}
.brand-name {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0.5px;
}
.brand-divider {
  height: 20px;
  width: 1px;
  background: var(--line);
  margin: 0 4px;
}
.brand-product {
  color: var(--muted);
  font-size: 14px;
}
.header-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.header-link:hover {
  color: var(--brand);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
/* .header-link 是 inline-flex，会盖掉 [hidden] 的浏览器默认样式，这里显式关掉 */
.header-right .header-link[hidden] {
  display: none;
}
.page-wrap {
  width: min(1120px, calc(100% - 80px));
  margin: 0 auto;
  padding: 48px 0 32px;
}
.page-heading {
  margin-bottom: 30px;
}
.page-heading p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 15px;
}
.eyebrow {
  color: var(--brand);
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 10px;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}
.section-heading,
.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-description {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}
.field {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: #3d4658;
  font-size: 14px;
  font-weight: 550;
  margin-bottom: 20px;
}
.field input,
.field textarea,
.field select,
.search-field input,
.filter-select {
  width: 100%;
  min-width: 0;
  border: 1px solid #dce0e9;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
  font-weight: 400;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.field input,
.field select,
.search-field input,
.filter-select {
  height: 46px;
  padding: 0 13px;
}
.field input::placeholder,
.search-field input::placeholder {
  color: #8a93a4;
}
.field input:focus,
.field textarea:focus,
.field select:focus,
.search-field input:focus,
.filter-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px #5262d516;
}
.field small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}
.field textarea {
  padding: 12px;
  min-height: 110px;
  resize: vertical;
  overflow-wrap: anywhere;
}
button {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button.primary,
.button-link {
  background: var(--brand);
  color: #fff;
}
button.primary:hover:not(:disabled),
.button-link:hover {
  background: var(--brand-dark);
}
button.secondary {
  background: #fff;
  border-color: #dce0e9;
  color: #465166;
}
button.secondary:hover:not(:disabled) {
  background: #f6f7fc;
  border-color: #b5bed9;
}
button.text-button {
  background: none;
  color: var(--brand);
  padding: 8px;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.small {
  min-height: 38px;
  padding: 7px 12px;
  font-size: 13px;
}
.button-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 9px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.wide {
  width: 100%;
}
.message {
  color: #9a6225;
  margin-top: 12px;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.message:empty {
  display: none;
}
.message.ok {
  color: #217554;
}
.message.error {
  color: #bc414b;
}
.secure-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}
.secure-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #35a77c;
}
.footnote,
.page-footer {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.page-footer {
  text-align: center;
  margin-top: 40px;
}
.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}
.soft-note {
  background: #f5f6fe;
  border-radius: 10px;
  padding: 14px 16px;
  color: #5d6785;
  font-size: 13px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
.badge-ok {
  background: #ecf8f1;
  color: #287c59;
}
.badge-off {
  background: #fff0ee;
  color: #b54f49;
}
.badge-neutral {
  background: var(--tint);
  color: var(--brand);
}
dialog {
  width: min(500px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  box-shadow: 0 24px 80px #20273830;
  overflow-y: auto;
}
dialog::backdrop {
  background: #20273866;
  backdrop-filter: blur(3px);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.dialog-actions button {
  min-width: 96px;
}
.dialog-close {
  font-size: 22px;
  background: transparent;
  color: var(--muted);
  padding: 4px 10px;
}
@media (max-width: 760px) {
  .site-header {
    height: 68px;
  }
  .header-inner {
    width: calc(100% - 36px);
  }
  .brand {
    gap: 9px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 15px;
  }
  .brand-name {
    font-size: 17px;
  }
  .brand-product {
    font-size: 13px;
  }
  .brand-divider {
    margin: 0;
  }
  .header-link {
    font-size: 13px;
  }
  .page-wrap {
    width: calc(100% - 36px);
    padding: 30px 0 24px;
  }
  h1 {
    font-size: 26px;
  }
  h2 {
    font-size: 21px;
  }
  .panel {
    padding: 22px;
    border-radius: 14px;
  }
  .section-heading {
    gap: 12px;
  }
  .grid-two {
    grid-template-columns: minmax(0, 1fr);
  }
  .field input,
  .field textarea,
  .field select,
  .search-field input,
  .filter-select {
    font-size: 16px;
  }
  .page-footer {
    margin-top: 28px;
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ===================== 脚本市场 ===================== */

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.script-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}

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

.script-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  overflow-wrap: anywhere;
}

.script-cat {
  background: var(--tint);
  color: var(--brand);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.script-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 10px;
}

/* 脚本 ID：设备端/开发者核对用，等宽小字，点击可复制 */
.script-id {
  align-self: flex-start;
  margin-bottom: 8px;
  padding: 2px 8px;
  border: 1px dashed var(--line);
  border-radius: 5px;
  background: #f8fafc;
  color: #6b7789;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.2px;
  cursor: pointer;
  overflow-wrap: anywhere;
  text-align: left;
}

.script-id:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.script-id.copied {
  border-style: solid;
  border-color: #287c59;
  color: #287c59;
  background: #eefaf3;
}

.script-desc {
  color: #4a5468;
  font-size: 13.5px;
  line-height: 1.65;
  margin-bottom: 12px;
  flex: 1;
  overflow-wrap: anywhere;
}

.script-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag {
  background: #f1f3f9;
  color: #5d6785;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11.5px;
}

.script-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.price-tag {
  font-size: 17px;
  font-weight: 750;
  color: var(--ink);
}

.price-tag.free {
  color: #287c59;
}

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.list-toolbar .search-field {
  flex: 1 1 260px;
  min-width: 0;
}

.list-toolbar .search-field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid #dce0e9;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.list-toolbar .search-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px #5262d516;
}

.list-toolbar .filter-select {
  height: 46px;
  padding: 0 13px;
  border: 1px solid #dce0e9;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #465166;
  font-size: 14px;
  font-weight: 550;
}

.filter-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}

/* ===================== 开发者中心 ===================== */

.dev-panel {
  margin-bottom: 22px;
}

.token-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.token-row > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
}

.token-row code {
  flex: 1;
  min-width: 160px;
  background: #f5f6fe;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 13px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  overflow-wrap: anywhere;
  color: #344060;
}

.code-preview {
  margin: 8px 0 0;
  max-height: 220px;
  overflow: auto;
  background: #0f1729;
  color: #d6e0f5;
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .market-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------------------------------------------------------------- 基座下载（/zion/） */

.auth-download {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.auth-download-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.auth-download-main b { font-size: 14px; }
.auth-download-main span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.auth-download a[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

.download-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
}
.download-card { display: flex; flex-direction: column; gap: 10px; }
.download-card .kv-list { margin-top: 6px; }
.download-card .kv-list b {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.download-updated { color: var(--muted); font-size: 12px; margin: 0; }
.download-cta {
  justify-content: center;
  background: linear-gradient(160deg, #172554, #26356b);
  border-color: transparent;
  color: #fff;
}
.download-cta h2 { color: #fff; margin: 0 0 6px; font-size: 20px; }
.download-cta p { color: #cbd5e1; font-size: 13px; line-height: 1.7; margin: 0; }
.download-cta .primary {
  margin-top: 16px;
  background: #fff;
  color: #172554;
  text-align: center;
}
.download-cta .primary[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.download-cta small { color: #94a3b8; font-size: 12px; margin-top: 10px; }

.release-list { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.9; }
.release-list code {
  background: #f5f6fe;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12px;
}
.release-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff8e8;
  color: #805f1a;
  font-size: 13px;
  line-height: 1.7;
}
.dev-panel .code-preview { max-height: 320px; }
.dev-panel .section-heading { align-items: center; }

/* ---------------------------------------------------------------- 多开发者密钥 */

.sk-create {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.sk-create input {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.sk-create input:focus { outline: 2px solid var(--tint); border-color: var(--brand); }

.sk-list { margin-top: 14px; display: grid; gap: 10px; }
.sk-item {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fbfbfe;
}
.sk-main { min-width: 0; flex: 1; display: grid; gap: 4px; }
.sk-title { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sk-key {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  color: #344060;
  background: #f0f2fb;
  border-radius: 6px;
  padding: 3px 7px;
  overflow-wrap: anywhere;
}
.sk-meta { color: var(--muted); font-size: 12px; }
.sk-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .download-hero { grid-template-columns: minmax(0, 1fr); }
  .sk-item { align-items: flex-start; }
}
