:root {
  --bg: #0b0d13;
  --fg: #eef1f8;
  --fg-dim: #8a93a8;
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .18);
  --card: rgba(255, 255, 255, .045);
  --card-hover: rgba(255, 255, 255, .085);
  --accent: #6b7cff;
  --accent-2: #33d6e0;
  --ease: cubic-bezier(.22, .8, .28, 1);
}

/* 由软件主题驱动的配色（JS 写入 --panel/--card/--accent/--text） */
html[data-theme] {
  --bg: var(--panel);
}
html[data-theme] body { color: var(--text); }
html[data-theme="light"] {
  --bg: #f5f6fa;
  --fg: #12151f;
  --fg-dim: #5c6377;
  --line: rgba(17, 20, 30, .1);
  --line-strong: rgba(17, 20, 30, .2);
  --card: rgba(255, 255, 255, .8);
  --card-hover: #fff;
  --accent: #4d5cf0;
  --accent-2: #12a8bd;
}

/* 浅色主题下的通用覆盖 */
html[data-light="1"] {
  --fg: #12151f;
  --fg-dim: #5c6377;
  --line: rgba(17, 20, 30, .11);
  --line-strong: rgba(17, 20, 30, .22);
  --card-hover: #fff;
}
html[data-light="1"] .dl-row { color: var(--fg); }
html[data-light="1"] .dl-list { background: color-mix(in srgb, var(--panel) 92%, #fff); }
html[data-light="1"] .doc-top { background: color-mix(in srgb, var(--panel) 88%, #fff); }
html[data-light="1"] .note.warn { border-left-color: #d97706; }

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--fg);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .3s var(--ease), color .3s var(--ease);
  overflow-x: hidden;
}

/* 背景光晕 */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
}
body::before {
  width: 460px; height: 460px;
  top: -190px; left: 12%;
  background: radial-gradient(circle, rgba(107, 124, 255, .5), transparent 65%);
}
body::after {
  width: 400px; height: 400px;
  bottom: -180px; right: 10%;
  background: radial-gradient(circle, rgba(51, 214, 224, .34), transparent 65%);
}
html[data-theme="light"] body::before,
html[data-theme="light"] body::after { opacity: .5; }

.stage {
  width: 100%;
  max-width: 640px;
  padding: 48px 24px;
  text-align: center;
}

.home-pick {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}
.home-pick .pill-group { max-width: 100%; flex-wrap: wrap; justify-content: center; }

/* 图标：直接用 exe 自带图标 */
.logo {
  width: 96px;
  height: 96px;
  margin-bottom: 26px;
  border-radius: 22px;
  filter: drop-shadow(0 16px 34px color-mix(in srgb, var(--accent) 45%, transparent));
}

h1 {
  margin: 0;
  font-size: clamp(42px, 8vw, 64px);
  font-weight: 800;
  letter-spacing: -.045em;
}

.tag {
  margin: 14px 0 0;
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--fg-dim);
}

/* 按钮 */
.acts {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 38px 0 0;
}

.gh-ico {
  display: inline-flex;
  width: 15px;
  height: 15px;
  flex: none;
  opacity: .92;
}
.gh-ico svg { width: 100%; height: 100%; }

/* 下载列表 */
.dl-list {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
}

.dl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  color: var(--fg);
  text-decoration: none;
  transition: background .16s;
}
.dl-row + .dl-row { border-top: 1px solid var(--line); }
.dl-row:hover { background: var(--card-hover); }

.dl-row-ico {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 7px;
}

.dl-row-name {
  font-size: 15px;
  font-weight: 600;
}

.dl-row-size {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--fg-dim);
  text-align: right;
}

.dl-row-go {
  width: 16px;
  height: 16px;
  flex: none;
  fill: currentColor;
  opacity: .3;
  transition: opacity .16s, transform .16s var(--ease);
}
.dl-row:hover .dl-row-go {
  opacity: 1;
  transform: translateY(2px);
}

.dl-src {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 15px;
  font-size: 13px;
  color: var(--fg-dim);
  text-decoration: none;
  opacity: .85;
  transition: color .16s, opacity .16s;
}
.dl-src:hover { color: var(--fg); opacity: 1; }

.meta {
  margin: 34px 0 0;
  font-size: 13.5px;
  color: var(--fg-dim);
  opacity: .85;
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 28px;
}

.guide-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 26px;
  color: var(--fg-dim);
  font-size: 14.5px;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s, gap .2s var(--ease);
}
.guide-link:hover {
  color: var(--fg);
  border-color: var(--accent-2);
  gap: 10px;
}

@media (max-width: 520px) {
  .acts { width: 100%; }
  .dl-list { width: 100%; }
  .dl-row { padding: 14px 15px; gap: 10px; }
  .dl-row-size { font-size: 12px; }
  .meta { font-size: 13px; }
}

/* ===================== 使用指南页 ===================== */

.doc-body { display: block; }

.doc-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
}
.doc-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  white-space: nowrap;
  color: var(--fg);
  text-decoration: none;
  font-size: 16px;
}
.brand-img {
  width: 26px;
  height: 26px;
  display: block;
  border-radius: 6px;
}
.doc-ver {
  font-size: 12px;
  flex: none;
  white-space: nowrap;
  color: var(--fg-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
}
.doc-spacer { flex: 1; }
.doc-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  white-space: nowrap;
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 14px;
  padding-right: 14px;
  border-right: 1px solid var(--line);
  transition: color .2s;
}
.doc-back:hover { color: var(--accent-2); }

/* 顶部选择器 */
.pill-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

/* 文档页顶栏放不下 40 个色点，收成可横向滚动的一条 */
.doc-top .pill-group {
  flex: 0 1 auto;
  max-width: min(44vw, 400px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.doc-top .pill-group::-webkit-scrollbar { display: none; }
.doc-top .pill-group.scrollable.at-start:not(.at-end) {
  mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent 100%);
}
.doc-top .pill-group.scrollable.at-end:not(.at-start) {
  mask-image: linear-gradient(90deg, transparent 0, #000 18px);
}
.doc-top .pill-group.scrollable:not(.at-start):not(.at-end) {
  mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
}
.doc-top .select-wrap,
.doc-top .pick { flex: none; }
.pill {
  width: 17px;
  height: 17px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: transform .18s var(--ease);
}
.pill:hover { transform: scale(1.22); }
.pill.on { box-shadow: 0 0 0 2px color-mix(in srgb, var(--fg) 70%, transparent); }

.pick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  white-space: nowrap;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 13.5px;
  color: var(--fg-dim);
}
.pick-label { opacity: .8; flex: none; }
.pick select {
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  outline: none;
  max-width: 130px;
}
.pick select option { background: var(--panel); color: var(--fg); }

.doc {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 48px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 90px;
}

.doc-side { position: relative; }
.doc-nav {
  position: sticky;
  top: 90px;
  border-right: 1px solid var(--line);
  padding-right: 22px;
}
.doc-nav h4 {
  margin: 22px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.doc-nav h4:first-child { margin-top: 0; }
.doc-nav a {
  display: block;
  padding: 6px 0;
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 14.5px;
  transition: color .18s;
}
.doc-nav a:hover,
.doc-nav a.active { color: var(--accent-2); }

.doc-main { min-width: 0; }
.doc-main h1 {
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -.035em;
  margin: 0 0 18px;
}
.doc-lede {
  color: var(--fg-dim);
  font-size: 17px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
}
.doc-main h2 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.025em;
  margin: 46px 0 14px;
  padding-top: 6px;
  scroll-margin-top: 80px;
}
.doc-main h3 {
  font-size: 18px;
  font-weight: 650;
  margin: 30px 0 8px;
}
.doc-main p {
  color: var(--fg-dim);
  margin: 0 0 14px;
  font-size: 16px;
}
.doc-main ul,
.doc-main ol {
  margin: 0 0 16px;
  padding-left: 22px;
  color: var(--fg-dim);
  font-size: 16px;
}
.doc-main li { margin-bottom: 7px; }
.doc-main li::marker { color: var(--accent-2); }
.doc-main b { color: var(--fg); font-weight: 650; }
.doc-main a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.doc-main code {
  font-family: "Cascadia Mono", Consolas, Menlo, monospace;
  font-size: .9em;
  padding: .1em .42em;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--fg);
}
.doc-main hr {
  margin: 44px 0 26px;
  border: 0;
  border-top: 1px solid var(--line);
}
.langs { line-height: 2; }

.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-2);
  border-radius: 10px;
  background: var(--card);
  padding: 13px 16px;
  margin: 0 0 16px;
  color: var(--fg-dim);
  font-size: 15px;
}
.note.warn { border-left-color: #f0a94c; }
.note b { display: block; margin-bottom: 4px; }

.doc-end { color: var(--fg-dim); }

/* ---- 在线演示 ---- */
.demo {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 16px;
  align-items: start;
  margin: 22px 0;
}
.demo-stage,
.demo-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 18px;
}
.pad {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input, rgba(255, 255, 255, .04));
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  padding: 14px;
  outline: none;
  transition: border-color .2s;
}
.pad:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }

.demo-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  min-height: 34px;
}
.dcap {
  min-width: 34px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  background: var(--card-hover);
  color: var(--fg-dim);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  animation: dcap .2s var(--ease);
}
@keyframes dcap {
  from { transform: translateY(3px); opacity: .4; }
  to { transform: none; opacity: 1; }
}

.demo-readout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  text-align: center;
}
.demo-readout b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.demo-readout span { color: var(--fg-dim); font-size: 12.5px; }

.drow {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
  font-size: 14px;
  color: var(--fg-dim);
}
.drow span { display: flex; justify-content: space-between; }
.drow em { font-style: normal; color: var(--fg); }
.drow select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--input, rgba(255, 255, 255, .04));
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  outline: none;
}
.drow-sw { grid-template-columns: 1fr auto; align-items: center; }
.drow-sw input { width: 18px; height: 18px; accent-color: var(--accent); }
.drow input[type="range"] { accent-color: var(--accent); width: 100%; }

.pad-mouse {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 17px;
  text-align: center;
  color: var(--fg-dim);
  font-size: 13.5px;
  cursor: pointer;
  user-select: none;
  transition: background .2s, color .2s;
}
.pad-mouse:hover { background: var(--card-hover); color: var(--fg); }
.pad-mouse.hit { background: color-mix(in srgb, var(--accent) 22%, transparent); }

@media (max-width: 860px) {
  .doc { grid-template-columns: 1fr; gap: 0; padding-top: 24px; }
  .doc-nav {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 20px;
    margin-bottom: 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: baseline;
  }
  .doc-nav h4 {
    width: 100%;
    margin: 12px 0 2px;
  }
  .doc-nav h4:first-child { margin-top: 0; }
  .demo { grid-template-columns: 1fr; }
  .pick-label { display: none; }
  .pill-group { flex: 1; overflow-x: auto; }
}

/* ===================== 留言板 ===================== */

.comment-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 44px 22px 90px;
}
.comment-page h1 { margin: 0 0 14px; }

.comment-box {
  margin-top: 32px;
}

.comment-box iframe {
  width: 100%;
  border: 0;
}

/* 内嵌的留言板应用：高度由 iframe 内部通过 postMessage 上报 */
.gb-frame {
  display: block;
  width: 100%;
  min-height: 420px;
  height: 520px;
  border: 0;
  overflow: hidden;
  background: transparent;
  color-scheme: normal;
}

.comment-warn {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 3px solid #d97706;
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--fg-dim);
}
.comment-warn a { color: var(--accent); }

/* ===================== 开发者登录 ===================== */

.admin-page {
  max-width: 420px;
  margin: 0 auto;
  padding: 56px 22px 90px;
}
.admin-page h1 { margin: 0 0 12px; font-size: 26px; }

.admin-card {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.adm-row { display: block; margin-bottom: 12px; }
.adm-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--fg-dim);
}
.adm-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--input, rgba(255, 255, 255, .04));
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color .2s;
}
.adm-row input:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

.admin-msg {
  min-height: 18px;
  margin: 0 0 10px;
  font-size: 13px;
  color: #f0605d;
}

.admin-go {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 11px;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.admin-go:hover { filter: brightness(1.08); }

.admin-ok { margin: 0 0 12px; font-size: 14.5px; }

.admin-out {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--fg-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.admin-out:hover { color: var(--accent); }
