/*
 * 羽境拼图独立产品页候选样式
 * 视觉基线：羽境品牌统一视觉方案（yujing-image/DESIGN.md）与官网既有产品页
 * 画布 #0D0D10 / 主表面 #15151A / 品牌紫 #7C3AED / 高亮紫 #A78BFA。
 * 不引入新设计语言：细边框、适度圆角、留白组织信息，不堆渐变/阴影/胶囊。
 */

:root {
  --c-bg: #0d0d10;
  --c-surface: #15151a;
  --c-panel: #1b1b22;
  --c-hover: #202029;
  --c-line: rgba(255, 255, 255, 0.1);
  --c-line-strong: rgba(255, 255, 255, 0.16);
  --c-text: #f5f5f7;
  --c-muted: #a1a1aa;
  --c-weak: #71717a;
  --c-brand: #7c3aed;
  --c-brand-hover: #8b5cf6;
  --c-brand-light: #a78bfa;
  --c-success: #4ade80;
  --c-warning: #fbbf24;
  --c-danger: #fb7185;
  color-scheme: dark;
  font-family:
    -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC',
    'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

/* HTML hidden 属性必须真正隐藏元素（作者样式 display 会覆盖 UA 的 [hidden]）。 */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

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

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--c-brand-light);
  outline-offset: 3px;
  border-radius: 4px;
}

.notranslate,
img {
  -webkit-user-drag: none;
}

/* ───────────── 站点外壳 ───────────── */

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13, 13, 16, 0.94);
  border-bottom: 1px solid var(--c-line);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-mark {
  flex-shrink: 0;
}

.brand-name {
  display: inline-block;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  overflow-x: auto;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--c-muted);
  font-size: 13px;
  white-space: nowrap;
  transition:
    color 0.18s,
    background 0.18s;
}

.site-nav a:hover {
  color: var(--c-text);
  background: var(--c-panel);
}

.site-nav a[aria-current='page'] {
  color: var(--c-brand-light);
  background: rgba(124, 58, 237, 0.12);
}

.site-nav a.site-login {
  margin-left: 6px;
  padding-inline: 18px;
  border-radius: 8px;
  background: var(--c-brand);
  border: 1px solid var(--c-brand);
  color: #fff;
}

.site-nav a.site-login:hover {
  background: var(--c-brand-hover);
  border-color: var(--c-brand-hover);
  color: #fff;
}

.page-width {
  width: min(1240px, calc(100% - 80px));
  margin-inline: auto;
}

/* ───────────── 通用文字与控件 ───────────── */

.brand-author {
  color: var(--c-weak);
  font-size: 11px;
  letter-spacing: 0.02em;
  padding-top: 18px;
}

.eyebrow {
  color: var(--c-brand-light);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.product-page h2 {
  font-size: clamp(25px, 2.5vw, 34px);
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.product-page h3 {
  font-size: 17px;
  font-weight: 600;
}

.lead {
  color: var(--c-muted);
  font-size: 16px;
  line-height: 1.9;
  max-width: 760px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 19px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  transition:
    background 0.18s,
    color 0.18s,
    border-color 0.18s;
}

.btn-primary {
  background: var(--c-brand);
  border: 1px solid var(--c-brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--c-brand-hover);
  border-color: var(--c-brand-hover);
}

.btn-secondary {
  background: var(--c-panel);
  border: 1px solid var(--c-line-strong);
  color: var(--c-text);
}

.btn-secondary:hover {
  background: var(--c-hover);
  border-color: var(--c-brand-light);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.numbered {
  counter-reset: step;
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.numbered li {
  counter-increment: step;
  display: flex;
  gap: 12px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.85;
}

.numbered li::before {
  content: counter(step, decimal-leading-zero);
  color: var(--c-brand-light);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 2;
  flex-shrink: 0;
}

/* ───────────── 发布状态说明 ───────────── */

.planning-band {
  padding-top: 4px;
}

.planning-notice {
  border: 1px solid rgba(251, 191, 36, 0.36);
  border-radius: 10px;
  padding: 14px 16px;
  margin-block: 0 8px;
  background: rgba(251, 191, 36, 0.06);
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.8;
}

.planning-notice strong {
  color: var(--c-text);
  font-weight: 550;
}

.applicability-note {
  margin-top: 14px;
  color: var(--c-weak);
  font-size: 12px;
  line-height: 1.8;
}

.sha-line {
  margin-top: 6px;
  color: var(--c-weak);
  font-size: 11px;
  line-height: 1.7;
  word-break: break-all;
}

/* ───────────── 首屏 ───────────── */

.hero {
  display: grid;
  grid-template-columns: 0.83fr 1.17fr;
  gap: 54px;
  align-items: center;
  padding-block: 64px 54px;
}

.hero-copy h1 {
  font-size: clamp(34px, 3.5vw, 52px);
  line-height: 1.24;
  letter-spacing: -0.04em;
  font-weight: 650;
}

.hero-copy h1 span {
  color: var(--c-brand-light);
}

.hero .lead {
  margin: 24px 0 30px;
  max-width: 490px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
  color: var(--c-muted);
  font-size: 12px;
}

.hero-meta span + span::before {
  content: '·';
  margin-right: 9px;
  color: var(--c-weak);
}

.image-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: var(--c-surface);
}

.image-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.image-signature {
  position: absolute;
  top: 5px;
  left: 8px;
  z-index: 2;
  color: #fff;
  font-size: clamp(7px, 0.62vw, 10px);
  line-height: 1.4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  opacity: 0.94;
}

figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 1px;
  color: var(--c-muted);
  font-size: 11px;
}

/* ───────────── 页内导航 ───────────── */

.section-nav {
  position: sticky;
  top: 64px;
  z-index: 30;
  background: rgba(13, 13, 16, 0.96);
  border-block: 1px solid var(--c-line);
  backdrop-filter: blur(10px);
}

.section-nav .page-width {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  scrollbar-width: none;
}

.section-nav a {
  padding: 16px 0;
  color: var(--c-muted);
  font-size: 13px;
  white-space: nowrap;
}

.section-nav a:hover {
  color: var(--c-text);
}

/* ───────────── 功能区 ───────────── */

.section {
  padding-block: 72px;
}

.section[id] {
  scroll-margin-top: 140px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 38px;
  border-block: 1px solid var(--c-line);
}

.feature {
  padding: 30px 24px 28px 0;
}

.feature:not(:first-child) {
  border-left: 1px solid var(--c-line);
  padding-left: 24px;
}

.feature h3 {
  color: var(--c-text);
}

.feature p {
  margin-top: 12px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.85;
}

.feature-note {
  margin-top: 20px;
  color: var(--c-weak);
  font-size: 12px;
}

/* ───────────── 会员与价格 ───────────── */

.membership-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-top: 32px;
}

.membership-card {
  border: 1px solid var(--c-line);
  border-radius: 12px;
  padding: 22px;
  background: var(--c-surface);
}

.membership-card h3 {
  margin-bottom: 12px;
}

.membership-card li {
  position: relative;
  padding-left: 15px;
  margin: 7px 0;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.7;
}

.membership-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-brand-light);
}

.membership-card .membership-note {
  margin-top: 14px;
  color: var(--c-weak);
  font-size: 12px;
  line-height: 1.8;
}

.plan-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 8px 0;
  border-bottom: 1px solid var(--c-line);
}

.plan-list li::before {
  display: none;
}

.plan-list strong {
  color: var(--c-text);
  font-weight: 550;
}

.plan-list span {
  color: var(--c-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.notice-block {
  margin-top: 28px;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  padding: 22px 24px;
  background: var(--c-panel);
}

.notice-block h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.notice-block li {
  position: relative;
  padding-left: 15px;
  margin: 8px 0;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.85;
}

.notice-block li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-brand-light);
}

.membership-footnote {
  margin-top: 18px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.85;
}

/* ───────────── 下载区 ───────────── */

.download-band {
  background: var(--c-surface);
  border-block: 1px solid var(--c-line);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.release-version {
  color: var(--c-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.release-version[data-release-state='ok'] {
  color: var(--c-success);
}

.release-version[data-release-state='unavailable'] {
  color: var(--c-warning);
}

.release-notice {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid var(--c-line-strong);
  border-radius: 10px;
  background: var(--c-bg);
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.8;
}

.release-notice[data-tone='warning'] {
  border-color: rgba(251, 191, 36, 0.4);
}

.release-fallback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--c-muted);
  font-size: 13px;
}

.release-fallback button {
  color: var(--c-brand-light);
  text-decoration: underline;
}

.release-fallback a {
  color: var(--c-brand-light);
}

.mobile-notice {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: var(--c-bg);
  color: var(--c-muted);
  font-size: 13px;
}

.mobile-notice button {
  margin-left: 10px;
  color: var(--c-brand-light);
  text-decoration: underline;
}

.mobile-notice [role='status'] {
  margin-left: 8px;
  color: var(--c-success);
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.download-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  padding: 30px;
  background: var(--c-bg);
}

.platform {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--c-brand-light);
}

.platform h3 {
  color: var(--c-text);
  font-size: 20px;
}

.recommended {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid rgba(167, 139, 250, 0.42);
  border-radius: 999px;
  color: var(--c-brand-light);
  font-size: 11px;
}

.system {
  margin-top: 10px;
  color: var(--c-muted);
  font-size: 12px;
}

.price {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.price span {
  color: var(--c-muted);
  font-size: 12px;
  font-weight: 400;
}

.license {
  margin: 8px 0 22px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.85;
}

.download-link,
.download-card > button {
  align-self: flex-start;
}

.file-meta {
  min-height: 18px;
  margin-top: 10px;
  color: var(--c-weak);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.install-steps {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--c-line);
}

.install-steps li {
  counter-increment: none;
  display: flex;
  gap: 10px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.9;
}

.install-steps li::before {
  content: '·';
  color: var(--c-brand-light);
}

.release-notes {
  margin-top: 28px;
  border: 1px solid rgba(167, 139, 250, 0.34);
  border-radius: 12px;
  padding: 22px 24px;
  background: var(--c-bg);
}

.release-notes h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.release-notes h3 span {
  margin-left: 8px;
  color: var(--c-brand-light);
  font-size: 11px;
  font-weight: 500;
}

.release-notes li {
  position: relative;
  padding-left: 15px;
  margin: 8px 0;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.85;
}

.release-notes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-brand-light);
}

.download-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
  color: var(--c-muted);
  font-size: 12px;
}

.download-footer a {
  color: var(--c-brand-light);
}

/* ───────────── 恢复码换机 ───────────── */

.migration-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

.migration-grid > div {
  border: 1px solid var(--c-line);
  border-radius: 12px;
  padding: 24px;
  background: var(--c-surface);
}

.migration-grid h3 {
  margin-bottom: 4px;
}

/* ───────────── 使用教程 ───────────── */

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

.guide-grid article {
  border: 1px solid var(--c-line);
  border-radius: 12px;
  padding: 24px;
}

.requirement-block {
  margin-top: 28px;
  border-top: 1px solid var(--c-line);
  padding-top: 26px;
}

.requirement-block dl {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.requirement-block dl > div {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-line);
}

.requirement-block dt {
  color: var(--c-text);
  font-size: 13px;
  font-weight: 550;
}

.requirement-block dd {
  color: var(--c-muted);
  font-size: 13px;
}

/* ───────────── 界面示例 ───────────── */

.screenshots-intro {
  margin-top: 16px;
  max-width: 820px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.85;
}

.screenshots-intro strong {
  color: var(--c-text);
  font-weight: 550;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 28px;
}

.screenshot-grid figure {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.screenshot-grid img {
  background: var(--c-surface);
}

.screenshot-grid figcaption {
  display: block;
  padding-top: 12px;
  color: var(--c-muted);
  font-size: 12px;
  line-height: 1.8;
}

.screenshot-grid figcaption strong {
  display: block;
  margin-bottom: 4px;
  color: var(--c-text);
  font-size: 13px;
}

/* ───────────── FAQ ───────────── */

.faq {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 70px;
  border-top: 1px solid var(--c-line);
}

.faq > div > p:last-child {
  margin-top: 22px;
  color: var(--c-muted);
  font-size: 13px;
}

.faq details {
  border-bottom: 1px solid var(--c-line);
  padding: 17px 0;
}

.faq details:first-child {
  padding-top: 0;
}

.faq summary {
  cursor: pointer;
  font-size: 14px;
  line-height: 1.8;
  list-style-position: outside;
}

.faq summary::marker {
  color: var(--c-brand-light);
}

.faq details p {
  margin: 12px 0 3px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.9;
}

/* ───────────── 更新记录 ───────────── */

.changelog-list {
  margin-top: 28px;
  display: grid;
  gap: 26px;
}

.changelog-list > li {
  border-left: 1px solid var(--c-line-strong);
  padding-left: 22px;
}

.changelog-list h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.changelog-list .tag {
  padding: 2px 8px;
  border: 1px solid var(--c-line-strong);
  border-radius: 999px;
  color: var(--c-muted);
  font-size: 11px;
  font-weight: 400;
}

.changelog-list li li {
  position: relative;
  padding-left: 15px;
  margin-top: 8px;
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.85;
}

.changelog-list li li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-brand-light);
}

/* ───────────── 页脚 ───────────── */

.site-footer {
  margin-top: 24px;
  border-top: 1px solid var(--c-line);
  background: var(--c-surface);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 28px;
  padding-block: 30px 40px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 550;
}

.footer-author {
  color: var(--c-muted);
  font-size: 12px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-left: auto;
}

.footer-nav a {
  color: var(--c-muted);
  font-size: 12px;
}

.footer-nav a:hover {
  color: var(--c-brand-light);
}

.footer-meta {
  flex-basis: 100%;
  color: var(--c-weak);
  font-size: 11px;
  letter-spacing: 0.01em;
}

/* ───────────── 响应式 ───────────── */

@media (max-width: 1050px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-block: 45px 40px;
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero .lead {
    max-width: 620px;
  }

  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }

  .feature:nth-child(3) {
    border-left: 0;
    padding-left: 0;
  }

  .feature:nth-child(n + 3) {
    border-top: 1px solid var(--c-line);
  }

  .faq {
    gap: 35px;
  }

  .screenshot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-signature {
    font-size: 10px;
  }
}

@media (max-width: 760px) {
  .site-header-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding-block: 10px;
  }

  .site-nav {
    margin-left: 0;
    flex-basis: 100%;
    gap: 2px;
  }

  .site-nav a {
    padding: 7px 10px;
    font-size: 12px;
  }

  .brand-name {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .section-nav {
    top: 0;
  }

  .download-grid,
  .migration-grid,
  .guide-grid,
  .faq {
    grid-template-columns: 1fr;
  }

  .faq {
    gap: 28px;
  }

  .section-heading {
    display: block;
  }

  .release-version {
    margin-top: 10px;
    white-space: normal;
  }

  .requirement-block dl > div {
    grid-template-columns: 76px 1fr;
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .page-width {
    width: calc(100% - 32px);
  }

  .brand-author {
    padding-top: 12px;
  }

  .hero {
    padding-block: 32px;
  }

  .hero-copy h1 {
    font-size: 35px;
  }

  .lead {
    font-size: 14px;
  }

  .section {
    padding-block: 44px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature,
  .feature:not(:first-child),
  .feature:nth-child(3) {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--c-line);
    padding-block: 22px;
  }

  .feature:first-child {
    border-top: 0;
  }

  .download-card,
  .membership-card,
  .migration-grid > div,
  .guide-grid article,
  .notice-block,
  .release-notes {
    padding: 20px;
  }

  .price {
    font-size: 26px;
  }

  .image-signature {
    font-size: 8px;
  }

  .footer-nav {
    margin-left: 0;
  }

  .screenshot-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
