/* ============================================================
   统一样式表：index.html / qa.html / biaodan.html 共用
   颜色、字号、间距都在 :root 里改，其他地方尽量不要写死数值
   ============================================================ */

/* ---------- 字体 ----------
   不再下载网页字体，直接使用访客设备自带的中文字体：
   苹果设备 = 苹方，Windows = 微软雅黑，安卓 = 系统默认思源黑体。
   目录里的 font/ 文件夹已不再被引用，需要时可以重新启用。 */

/* ---------- 变量 ---------- */
:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #000000;
  --grey: #55565b;
  --hair: #d9d9d9;
  --soft: #f3f3f1;

  /* 三组匹配的颜色，与六角图里的实线、顶点一致 */
  --blue: #1f2bff;   /* 师傅 · 徒弟 */
  --green: #0fc43c;  /* 贵人 · 凡人 */
  --red: #f0262d;    /* 伯乐 · 千里马 */

  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "Source Han Sans SC", "WenQuanYi Micro Hei", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 48px);
  --max: 1120px;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.7 var(--font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--hair);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 15px; font-weight: 700; }
.top-nav { display: flex; gap: clamp(16px, 3vw, 34px); font-size: 15px; font-weight: 500; }
.top-nav a { position: relative; padding: 12px 0; }
.top-nav a::after { content: ""; position: absolute; right: 0; bottom: 7px; left: 0; height: 2px; background: var(--ink); transform: scaleX(0); transition: transform .2s ease; }
.top-nav a:hover::after, .top-nav a[aria-current="page"]::after { transform: scaleX(1); }
.top-nav a[aria-current="page"] { font-weight: 700; }

/* ---------- 底部导航 ---------- */
.site-footer { padding: 26px 0 calc(26px + env(safe-area-inset-bottom)); border-top: 1px solid var(--hair); }
.foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 30px; font-size: 15px; font-weight: 500; }
.foot-nav a { padding: 10px 4px; }
.foot-nav a:hover { text-decoration: underline; text-underline-offset: 6px; }
.foot-nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.copy { margin: 10px 0 0; color: var(--grey); font-size: 13px; text-align: center; }

/* ---------- 按钮（圆形语言，与顶点呼应） ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 32px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: #fff;
  font: 700 16px/1 var(--font);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.btn:hover { background: #fff; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 通用标题 ---------- */
.page-title { margin: 0 0 14px; font-size: clamp(44px, 9vw, 80px); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
.page-intro { max-width: 26em; margin: 0; color: var(--grey); font-size: clamp(16px, 2vw, 18px); }

/* ---------- 首页：首屏 ---------- */
.hero { padding-block: clamp(24px, 5vw, 64px) clamp(36px, 7vw, 88px); }
.hero-grid {
  display: grid;
  gap: 20px;
  grid-template-areas: "title" "figure" "cta";
}
.hero-title { grid-area: title; }
.hero-title h1 { margin: 0 0 14px; font-size: clamp(46px, 15vw, 64px); font-weight: 800; line-height: 1.05; letter-spacing: -.02em; }
.hero-title p { max-width: 20em; margin: 0; color: var(--grey); font-size: clamp(16px, 2.2vw, 19px); }
.hero-figure { grid-area: figure; justify-self: center; width: 100%; max-width: 540px; margin: 0; }
.hero-cta { grid-area: cta; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-cta .btn { flex: 1 1 160px; }

/* ---------- 六角匹配图 ---------- */
.hex { display: block; width: 100%; height: auto; overflow: visible; }
.hex .ring { fill: none; stroke: var(--ink); stroke-width: 10; }
.hex .dash { fill: none; stroke-width: 7; stroke-dasharray: 20 13; }
.hex .solid { fill: none; stroke-width: 8; stroke-dasharray: 800; stroke-dashoffset: 0; } /* 每条实线长 800 */
.hex .node circle { stroke: var(--ink); stroke-width: 5; }
.hex .label { fill: var(--ink); font-family: var(--font); font-size: 72px; font-weight: 800; }
.hex .taiji-spin { transform-box: fill-box; transform-origin: 50% 50%; }
.hex .logo-spin { transform-box: view-box; transform-origin: 0 0; }
.c-blue { --c: var(--blue); }
.c-green { --c: var(--green); }
.c-red { --c: var(--red); }
.hex .dash, .hex .solid { stroke: var(--c); }
.hex .node circle { fill: var(--c); }

/* 出场顺序：顶点和实线 → 外圆、虚线、太极 → 太极开始转动。
   只有 JS 可用时才先隐藏，没有 JS 就直接显示完整图。 */
.js .hex .solid { stroke-dashoffset: 800; }
.js .hex .node, .js .hex .ring, .js .hex .dash, .js .hex .taiji { opacity: 0; }
.js .hex.play .solid { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s cubic-bezier(.6, 0, .2, 1) .5s; }
.js .hex.play .node { opacity: 1; transition: opacity 1.2s ease .3s; }
.js .hex.play .ring, .js .hex.play .dash, .js .hex.play .taiji { opacity: 1; transition: opacity 1.6s ease 2.3s; }
.js .hex.play .taiji-spin, .js .hex.play .logo-spin { animation: spin 16s linear 4.2s infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 快速问答页 ---------- */
.page-head { padding-block: clamp(32px, 7vw, 80px) clamp(24px, 4vw, 48px); }
.qa-section { padding-bottom: clamp(48px, 8vw, 104px); }
.qa-list { border-top: 2px solid var(--ink); }
/* 规则与隐私、联系我们页没有大标题了，不再画标题下面的粗黑线（弹窗里的列表不受影响） */
.qa-section .qa-list { border-top: 0; }
.qa-item { display: grid; gap: 8px; padding: 24px 0; border-bottom: 1px solid var(--hair); }
.qa-q { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.55; }
.qa-a { margin: 0; color: var(--grey); font-size: 16px; }
.contact-link { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.contact-link:hover { text-decoration-thickness: 2px; }

/* ---------- 表单页（样式统一，提交逻辑在 biaodan.html 的脚本里，别动） ---------- */
.form-page { display: grid; gap: clamp(24px, 5vw, 64px); padding-block: clamp(32px, 7vw, 80px) clamp(48px, 8vw, 104px); }
.form { display: grid; gap: 22px; }
.form label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 700; }
.form .required { margin-left: 3px; color: var(--red); }
.form input, .form select, .form textarea {
  width: 100%; padding: 14px 16px;
  border: 2px solid var(--ink); border-radius: 14px;
  background: #fff; color: var(--ink);
  font: 400 16px/1.5 var(--font); /* 16px 可避免 iPhone 聚焦时自动放大 */
  transition: border-color .2s ease;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--blue); outline: 3px solid color-mix(in srgb, var(--blue) 25%, transparent); outline-offset: 2px; }
.form select {
  padding-right: 44px; appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 16px center;
}
.form textarea { min-height: 130px; resize: vertical; }
.form .upload-box { display: block; margin: 0; padding: 22px; border: 2px dashed var(--ink); border-radius: 14px; background: var(--soft); text-align: center; font-weight: 400; cursor: pointer; transition: border-color .2s ease; }
.form .upload-box:hover { border-color: var(--blue); }
.upload-box input { display: none; }
.upload-text { font-weight: 700; }
.upload-hint { margin-top: 6px; color: var(--grey); font-size: 13px; }
.preview-container { display: none; margin-top: 14px; }
.preview-container img { max-width: 100%; max-height: 220px; border: 1px solid var(--hair); border-radius: 12px; object-fit: contain; }
.file-name { margin-top: 6px; color: var(--grey); font-size: 13px; word-break: break-all; }
.remove-image { margin-top: 10px; padding: 8px 16px; border: 2px solid var(--red); border-radius: 999px; background: #fff; color: var(--red); font: 700 13px/1 var(--font); cursor: pointer; }
.status-msg { display: none; margin-top: 14px; font-size: 15px; font-weight: 500; text-align: center; }
.status-msg.success { color: #0a7a28; }
.status-msg.error { color: #c4161c; }

/* ---------- 回到顶部（右下角；离开页面顶部后出现，回到顶部时隐藏） ---------- */
.to-top {
  position: fixed; z-index: 30;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: grid; place-items: center;
  width: 52px; height: 52px; padding: 0;
  border: 2px solid var(--ink); border-radius: 50%;
  background: var(--ink); color: #fff;
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, background .2s ease, color .2s ease;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: #fff; color: var(--ink); }
.to-top svg { display: block; }

/* ---------- 平板 / 电脑 ---------- */
@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    grid-template-areas: "title figure" "cta figure";
    column-gap: 48px;
    align-content: center;
  }
  .hero-title { align-self: end; padding-bottom: 28px; }
  .hero-title h1 { font-size: clamp(56px, 7.4vw, 96px); }
  .hero-cta { align-self: start; }
  .hero-cta .btn { flex: 0 0 auto; }
  /* 问答：左列问题、右列回答，各自固定宽度，所有行统一在这个宽度内换行 */
  .qa-item { grid-template-columns: 280px minmax(0, 1fr); gap: 48px; padding: 30px 0; }
  .qa-q { max-width: 14em; text-wrap: balance; } /* balance：多行时各行长度尽量均匀，避免末行只剩一两个字 */
  .qa-a { max-width: none; text-wrap: pretty; } /* 回答随屏幕宽度自动换行 */
  .form-page { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
}

/* ---------- 手机 / 平板竖屏：各页标题和一句话居中（首页、快速问答、注册匹配、联系我们） ---------- */
@media (max-width: 879px) {
  .hero-title, .page-head, .form-intro { text-align: center; }
  /* 说明文字：整段居中，但换行后每一行左对齐（一行就能放下时看起来仍是居中） */
  .hero-title p, .page-intro { width: fit-content; margin-inline: auto; text-align: left; }
}

/* ---------- 手机 ---------- */
@media (max-width: 520px) {
  .brand-text { display: none; }
  .top-nav { gap: 22px; }
  .foot-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; text-align: center; }
}

/* ---------- 减少动态效果 ---------- */
/* 手机开了「减弱动态效果」时：出场的淡入和画线仍然播放，只停掉持续旋转和平滑滚动 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .hex.play .taiji-spin, .js .hex.play .logo-spin { animation: none; }
  .top-nav a::after, .to-top { transition: none; }
}

/* ============================================================
   语言切换（中文 / English）与英文版排版
   英文放在网站根目录，中文放在 zh/ 文件夹；右上角的 .lang 按钮互相跳转
   ============================================================ */
.bar-right { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 28px); }
.lang {
  padding: 7px 13px;
  border: 2px solid var(--ink); border-radius: 999px;
  font-size: 13px; font-weight: 700; line-height: 1; white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.lang:hover { background: var(--ink); color: #fff; }

/* 英文字体用各系统自带的拉丁字体；英文词更长，标题字号略小 */
html[lang="en"] { --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif; }
html[lang="en"] body { line-height: 1.65; }
html[lang="en"] .hero-title h1 { font-size: clamp(30px, 9.2vw, 52px); letter-spacing: -.03em; }
html[lang="en"] .hero-title p, html[lang="en"] .page-intro { max-width: 30em; }
html[lang="en"] .page-title { font-size: clamp(38px, 8.5vw, 64px); letter-spacing: -.03em; }
html[lang="en"] .hex .label { font-size: 62px; }
@media (min-width: 880px) {
  html[lang="en"] .hero-title h1 { font-size: clamp(44px, 4.3vw, 64px); }
  html[lang="en"] .qa-item { grid-template-columns: 340px minmax(0, 1fr); }
  html[lang="en"] .qa-q { max-width: none; }
  html[lang="en"] .qa-a { max-width: none; }
}
@media (max-width: 520px) {
  .bar-right { gap: 12px; }
  .top-nav { gap: 14px; font-size: 14px; }
  .lang { padding: 6px 11px; }
}
@media (max-width: 520px) {
  html[lang="en"] .btn { padding: 0 20px; font-size: 15px; white-space: nowrap; }
}

/* ---------- 合规提示：页脚免责声明、表单说明 ---------- */
.disclaimer { max-width: 46em; margin: 12px auto 0; color: var(--grey); font-size: 12px; line-height: 1.6; text-align: center; }
.form-note { margin: 0; color: var(--grey); font-size: 13px; line-height: 1.6; }

.mark-img { display: block; width: 42px; height: 42px; flex: none; }

/* Session ID：长串自动换行，等宽字体，点选即可复制 */
.session-id{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.92rem;word-break:break-all;overflow-wrap:anywhere;user-select:all;-webkit-user-select:all}
.session-dl{margin-top:.5rem}

/* 注册匹配：今日收款地址 */
.pay-row { display: flex; gap: 10px; align-items: stretch; }
.pay-address { flex: 1; min-width: 0; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 12px; background: var(--soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.5; word-break: break-all; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.copy-btn { flex: none; padding: 0 18px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.copy-btn:hover { border-color: var(--blue); }
#pay-box .form-note { margin-top: 10px; }

/* 联系我们：每项后的复制按钮 */
.contact-row { display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
.contact-row > :last-child { min-width: 0; }
.qa-item-session .contact-row { align-items: flex-start; }
.qa-q-sub { font-size: 15px; font-weight: 400; color: var(--grey); }
.qa-q-sub .contact-link { font-weight: 500; }
.copy-sm { padding: 6px 14px; min-height: 36px; border-radius: 10px; font-size: 14px; line-height: 1.4; }

/* 桌面双栏时，Session 的说明行跟 ID 一起放在右栏 */
@media (min-width: 880px) {
  .qa-item-session { row-gap: 6px; }
  .qa-item-session .session-dl { grid-column: 2; margin-top: 0; }
}
.qa-item-session .session-id { padding-top: 7px; }

/* 防刷蜜罐：人看不见，机器人会填 */
.hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* 注册匹配：不退不换提示与勾选同意 */
.pay-warn { margin-top: 10px; }
.pay-warn strong { color: var(--red); }
.form .consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 14px; line-height: 1.6; cursor: pointer; }
.form .consent input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; padding: 0; flex: none; accent-color: var(--ink); }
.consent a { text-decoration: underline; text-underline-offset: 3px; }

/* 规则与隐私弹窗（注册页） */
.rules-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .45); }
.rules-modal[hidden] { display: none; }
.rules-card { display: flex; flex-direction: column; width: min(560px, 100%); max-height: min(86vh, 720px); background: #fff; border-radius: 16px; overflow: hidden; }
.rules-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--hair); }
.rules-head h2 { margin: 0; font-size: 18px; }
.rules-close { width: 40px; height: 40px; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--ink); }
.rules-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 20px 20px; }
.rules-body .qa-item { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 16px 0; }
/* 英文页的两栏规则优先级更高，弹窗里要单独压回一栏，否则正文被挤成窄窄一条 */
html[lang] .rules-body .qa-item { grid-template-columns: 1fr; gap: 6px; padding: 16px 0; }
html[lang] .rules-body .qa-q, html[lang] .rules-body .qa-a { max-width: none; }
.rules-body .qa-q { max-width: none; font-size: 16px; }
.rules-body .qa-a { font-size: 15px; }
.rules-agree { margin-top: 18px; }
.rules-agree:disabled { background: #bdbdbd; border-color: #bdbdbd; color: #fff; opacity: 1; }

/* 首页标题“注册、验证、匹配”：按词换行，不在词中间断开 */
.hero-title h1 span { display: inline-block; }

/* 只给读屏软件和搜索引擎看的标题 */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 推荐：注册页灰色推荐人栏 + 推荐查询页 ---------- */
.form input[readonly] { background: var(--soft); color: var(--grey); border-color: #cfcfcf; cursor: default; }
.form input[readonly]:focus { border-color: #cfcfcf; outline: 0; }
.refs-page { gap: 28px; }
.refs-msg { margin: 0; color: var(--grey); font-size: 16px; line-height: 1.7; }
.refs-h { margin: 0 0 12px; font-size: 18px; font-weight: 700; }
.refs-ul { list-style: none; margin: 0 0 14px; padding: 0; border-top: 1px solid #e5e5e5; }
.refs-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 128px; align-items: baseline; gap: 4px 14px; padding: 14px 0; border-bottom: 1px solid #e5e5e5; }
.refs-name { font-size: 16px; font-weight: 600; word-break: break-all; }
.refs-level { color: var(--ink); font-weight: 700; font-size: 15px; }
.refs-level.is-pending { color: var(--grey); font-weight: 400; }
.refs-time { color: var(--grey); font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.refs-head { padding: 10px 0; color: var(--grey); font-size: 13px; font-weight: 600; }
.refs-head span:last-child { text-align: right; }
html[lang="en"] .refs-row { grid-template-columns: minmax(0, 1fr) 104px 150px; }
@media (max-width: 520px) { /* 英文手机窄屏：名字+级别一行，时间放下一行 */
  html[lang="en"] .refs-row { grid-template-columns: minmax(0, 1fr) auto; }
  html[lang="en"] .refs-time { grid-column: 1 / -1; text-align: left; }
  html[lang="en"] .refs-head span:nth-child(3) { display: none; }
  html[lang="en"] .refs-head span:nth-child(2) { text-align: right; }
}

/* ---------- 联系我们页底部反馈表单 ---------- */
/* 留言表单：和上面的联系方式同属一个列表，标题在左列、表单在右列（手机上自然上下排） */
.qa-item-form { align-items: start; }
.cf-body { display: grid; gap: 16px; min-width: 0; max-width: 640px; }
