/* ============================================================================
 * 品流工坊 · 官网样式
 *
 * 为什么是一张样式表、一套变量：
 * 官网只有 5 个页面，拆成多文件除了多几次请求没有任何好处；颜色/圆角/间距全部
 * 走 CSS 变量，是为了"以后换主题只改 :root"。
 *
 * 为什么不用任何 CDN 字体/框架：
 * 部署环境与访客网络都不可控（服务器可能在内网、访客可能在公司代理后面），
 * 一个字体请求失败就会让整页首屏闪一次，所以只用系统字体栈。
 *
 * 为什么先写移动端：
 * 投手在手机上打开官网（微信里点开链接）的比例不低，窄屏是最容易被忽略、
 * 也最容易溢出的形态，先按窄屏定版再往上加列，比反过来稳。
 * ========================================================================== */

:root {
  /* 品牌主色取客户端侧栏的靛蓝，保证"官网 = 客户端"是同一个产品 */
  --brand: #2f5bd7;
  --brand-strong: #234ab8;
  --brand-soft: #eef2fd;

  --bg: #ffffff;
  --bg-muted: #f6f7fb;
  --surface: #ffffff;
  --border: #e4e6ef;
  --text: #1c2030;
  --text-muted: #5f6579;
  --success: #137a4b;
  --warn-bg: #fff8e8;
  --warn-border: #f0d9a6;

  --radius: 12px;
  --radius-sm: 8px;
  --max: 1080px;
  --gap: 20px;

  /* 中文字体栈：优先系统 UI 字体，Windows 落到微软雅黑，macOS 落到苹方 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC",
    Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  /* 数字等宽：价格/版本号在列表里对齐更整齐 */
  font-variant-numeric: tabular-nums;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

/* 长链接/长英文单词（比如 %APPDATA% 路径）不许把窄屏撑破 */
code,
.path {
  font-family: Consolas, "Courier New", monospace;
  overflow-wrap: anywhere;
  background: var(--bg-muted);
  border-radius: 4px;
  padding: 0 4px;
  font-size: 0.92em;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

/* ---------------------------------------------------------------- 顶栏 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
  /* 不加 backdrop-filter：老版 Windows 的 Chromium 内核支持不稳，宁可朴素 */
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  /* 窄屏放不下时允许换行，而不是把导航挤成"…" */
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
  font-size: 15px;
}

.site-nav a {
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.site-nav a:hover {
  color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
}

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px; /* 触屏可点区域不小于 44px */
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.btn:hover {
  text-decoration: none;
}

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

.btn--primary:hover {
  background: var(--brand-strong);
}

.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn--block {
  width: 100%;
}

/* ---------------------------------------------------------------- 首屏 */

.hero {
  background: linear-gradient(180deg, var(--brand-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 44px 0 36px;
}

.hero__title {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.hero__subtitle {
  margin: 0 0 14px;
  color: var(--brand-strong);
  font-size: 16px;
  font-weight: 600;
}

.hero__lead {
  margin: 0 0 8px;
  max-width: 46em;
  font-size: 17px;
}

.hero__note {
  margin: 0 0 22px;
  max-width: 46em;
  color: var(--text-muted);
  font-size: 14.5px;
}

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

.hero__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.hero__facts li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-muted);
}

.hero__facts strong {
  display: block;
  color: var(--text);
  font-size: 15px;
}

/* ---------------------------------------------------------------- 区块 */

.section {
  padding: 44px 0;
  border-bottom: 1px solid var(--border);
}

.section--muted {
  background: var(--bg-muted);
}

.section__head {
  margin-bottom: 22px;
}

.section__title {
  margin: 0 0 6px;
  font-size: 23px;
  line-height: 1.35;
}

.section__desc {
  margin: 0;
  color: var(--text-muted);
  max-width: 46em;
}

.stage {
  margin-top: 26px;
}

.stage:first-of-type {
  margin-top: 18px;
}

.stage__title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 4px;
  font-size: 18px;
}

.stage__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex: none;
}

.stage__desc {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14.5px;
  /* 和序号对齐：序号 26px + gap 10px */
  padding-left: 36px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.card__title {
  margin: 0 0 4px;
  font-size: 16.5px;
}

.card__hint {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.card__desc {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------- 价格 */

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.plan--featured {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand) inset;
}

.plan__badge {
  align-self: flex-start;
  margin-bottom: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 600;
}

.plan__name {
  margin: 0;
  font-size: 18px;
}

.plan__price {
  margin: 8px 0 2px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.plan__period {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.plan__list {
  margin: 0 0 18px;
  padding-left: 20px;
  font-size: 14.5px;
  color: var(--text-muted);
}

.plan__list li {
  margin-bottom: 6px;
}

.plan__cta {
  margin-top: auto;
}

.note {
  margin: 18px 0 0;
  padding: 12px 14px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
}

/*
 * 退款规则块（价格区里那块静态合规说明）。
 *
 * 为什么单独一个修饰类而不是复用 .callout：`.callout` 走的是 --warn-* 那套黄色，
 * 读起来像"出问题了"；退款规则是**规则说明**，用户什么都没做错。
 * 所以这里用品牌浅底 + 左侧主色边 —— 醒目，但和"警告/报错"区分得开。
 * 深色模式不用额外写：--brand / --brand-soft / --text 在暗色下都有对应值。
 */
.note--rule {
  border-color: var(--brand-soft);
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  color: var(--text);
}

.note--rule p {
  margin: 0;
}

/* 第二段（怎么退 / 多久到账）压小一档：主规则一句话说完，细节退到后面 */
.note--rule p + p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.note--rule .note__title {
  font-weight: 700;
}

.callout {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  font-size: 14.5px;
}

.callout__title {
  margin: 0 0 6px;
  font-size: 15.5px;
}

.callout ol,
.callout ul {
  margin: 6px 0 0;
  padding-left: 22px;
}

/* 价格/正文都靠 JS 填充的区域：未填充时给一个"正在读价格"的提示，
   它和兜底文案是两回事 —— 兜底值在 HTML 里已经写好了，不依赖它 */
[data-hydrated='pending'] {
  /* 故意留空：占位态靠 HTML 里的兜底内容表达，不需要额外样式 */
}

/* ---------------------------------------------------------------- 下载 */

.download__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  align-items: start;
}

.download__meta {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14.5px;
  color: var(--text-muted);
}

.download__meta li {
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}

.download__meta li::before {
  content: '·';
  position: absolute;
  left: 6px;
  color: var(--brand);
  font-weight: 700;
}

.file-name {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 10px 0 0;
}

/* ---------------------------------------------------------------- FAQ */

.faq {
  margin: 0;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px 16px;
  margin-bottom: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15.5px;
}

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

.faq details[open] summary {
  margin-bottom: 6px;
}

.faq p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
}

.faq p + p {
  margin-top: 8px;
}

/* ---------------------------------------------------------------- 客服 */

.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  align-items: center;
}

.contact__box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.contact__label {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.contact__value {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.placeholder {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14.5px;
}

.contact__note {
  margin: 10px 0 0;
}

/* ---------------------------------------------------------------- 页脚 */

.site-footer {
  background: var(--bg-muted);
  padding: 30px 0 34px;
  font-size: 14px;
  color: var(--text-muted);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
}

.footer__title {
  margin: 0 0 8px;
  color: var(--text);
  font-weight: 600;
}

.footer__note {
  margin: 8px 0 0;
}

.footer__links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links li {
  margin-bottom: 6px;
}

.footer__bottom {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
}

.footer__bottom p {
  margin: 0;
}

/* ---------------------------------------------------------------- 协议页 */

.legal {
  padding: 32px 0 48px;
}

.legal__head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.legal__title {
  margin: 0 0 6px;
  font-size: 25px;
}

.legal__meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* "返回首页"放在内容最上方：协议页多半是从客户端或微信直接进来的，得留一条回主站的路 */
.legal__back {
  margin: 0 0 16px;
  font-size: 14px;
}

.legal__body {
  max-width: 46em;
}

.legal__loading {
  color: var(--text-muted);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.legal__retry {
  margin-top: 10px;
}

/*
 * 服务端下发的协议正文是"富文本"，标签不可控（后台编辑时可能用 h2/h3/p/ul/li/table）。
 * 全部用 :where() 降低特异性，方便以后单点覆盖，不用 !important 打架。
 */
.legal__body :where(h2) {
  margin: 28px 0 10px;
  font-size: 19px;
  line-height: 1.4;
}

.legal__body :where(h3) {
  margin: 22px 0 8px;
  font-size: 16.5px;
}

.legal__body :where(h4) {
  margin: 18px 0 8px;
  font-size: 15.5px;
}

.legal__body :where(p) {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
}

.legal__body :where(ul, ol) {
  margin: 0 0 12px;
  padding-left: 24px;
  font-size: 15px;
}

.legal__body :where(li) {
  margin-bottom: 6px;
}

.legal__body :where(table) {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 14px;
  font-size: 14.5px;
}

.legal__body :where(th, td) {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.legal__body :where(th) {
  background: var(--bg-muted);
}

.legal__body :where(blockquote) {
  margin: 0 0 14px;
  padding: 8px 14px;
  border-left: 3px solid var(--brand);
  background: var(--bg-muted);
  color: var(--text-muted);
}

.legal__body :where(a) {
  overflow-wrap: anywhere;
}

.legal__body :where(hr) {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* 协议表在窄屏会撑破：给它自己的横向滚动容器，而不是让整页左右晃 */
.legal__body :where(table) {
  display: block;
  overflow-x: auto;
}

/* ---------------------------------------------------------------- 窄屏微调 */

@media (max-width: 640px) {
  .hero {
    padding: 32px 0 28px;
  }

  .hero__title {
    font-size: 25px;
  }

  .hero__lead {
    font-size: 16px;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .section {
    padding: 34px 0;
  }

  .section__title {
    font-size: 20px;
  }

  .stage__desc {
    padding-left: 0;
  }

  .plan__price {
    font-size: 23px;
  }

  .site-nav {
    font-size: 14px;
  }
}

/* 尊重"减少动效"偏好（本站没有动画，这条只是兜住以后加的过渡） */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/*
 * 深色模式：只做"不刺眼"这一档，不追求品牌色在暗色下的重新设计。
 * 用 media query 而不是 JS 切换，是为了不引入首屏闪烁和一段额外的脚本。
 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181f;
    --bg-muted: #1d2029;
    --surface: #1d2029;
    --border: #2e3340;
    --text: #e8eaf1;
    --text-muted: #a2a9bd;
    --brand: #6f92ff;
    --brand-strong: #93adff;
    --brand-soft: #222737;
    --warn-bg: #2b2417;
    --warn-border: #5a4a24;
  }

  .site-header {
    background: rgba(22, 24, 31, 0.96);
  }

  .hero {
    background: linear-gradient(180deg, #1e2333 0%, var(--bg) 100%);
  }

  .btn--primary {
    color: #12141b;
  }
}
