/*
 * 使用说明（/guide/、/en/guide/）的样式，两种语言共用这一份。
 *
 * 纯静态页，不经过 React，也不带任何脚本：CSP 不放行内联脚本，
 * 而这一页也用不着——目录是锚点，常见问题是 <details>。
 * 颜色和圆角照着 src/styles/global.css 的那一套抄的，改那边的时候记得看一眼这里。
 */

:root {
  --bg-0: #06060c;
  --bg-1: #0b0b16;
  --bg-2: #12121f;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --violet: #7c5cff;
  --violet-soft: #a08cff;
  --pink: #ff5c8a;
  --pink-soft: #ff8fb0;
  --mint: #2ee6c5;
  --gold: #cdb887;
  --ink-0: #fff;
  --ink-1: rgba(255, 255, 255, 0.82);
  --ink-2: rgba(255, 255, 255, 0.56);
  --ink-3: rgba(255, 255, 255, 0.34);
  --grad-brand: linear-gradient(120deg, var(--violet) 0%, var(--pink) 100%);
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background:
    radial-gradient(60vw 60vw at -10% -10%, rgba(124, 92, 255, 0.16), transparent 60%),
    radial-gradient(50vw 50vw at 110% 30%, rgba(255, 92, 138, 0.1), transparent 60%),
    var(--bg-0);
  background-attachment: fixed;
  color: var(--ink-1);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--violet-soft);
}

strong {
  color: var(--ink-0);
  font-weight: 600;
}

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

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px 0;
  font-size: 14px;
}

.top a {
  text-decoration: none;
}

.top__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-0);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.top__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.26);
}

.top__mark::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-brand);
  box-shadow: 0 0 12px rgba(255, 92, 138, 0.8);
}

.top__lang {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink-1);
}

/* 给店家那几页：顶栏里的「操作指南 · 视频教程」 */
.top__nav {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
}

.top__sub {
  white-space: pre;
}

.top__nav a:not(.top__lang) {
  color: var(--ink-1);
}

.top__nav a:not(.top__lang):hover,
.top__nav a[aria-current="page"] {
  color: var(--ink-0);
}

.top__nav a[aria-current="page"] {
  font-weight: 650;
}

@media (max-width: 480px) {
  .top__nav {
    gap: 12px;
    font-size: 13px;
  }

  .top__lang {
    padding: 5px 11px;
  }

  /* 窄屏放不下「迷藏 · 给店家」加两个链接：只留「迷藏」 */
  .top__sub {
    display: none;
  }
}

/* ---------- 开头 ---------- */

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 20px 8px;
}

.hero__tag {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--violet-soft);
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid rgba(160, 140, 255, 0.3);
  background: rgba(124, 92, 255, 0.1);
}

.hero h1 {
  margin-top: 16px;
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.25;
  color: var(--ink-0);
}

.hero__lede {
  max-width: 640px;
  margin-top: 14px;
  font-size: 17px;
  color: var(--ink-1);
}

.hero__meta {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--ink-3);
}

.btn {
  display: inline-block;
  margin-top: 24px;
  padding: 13px 26px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: var(--grad-brand);
  box-shadow: 0 10px 30px -10px rgba(124, 92, 255, 0.8);
}

/* ---------- 版式：目录在左，正文在右 ---------- */

.layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 20px 40px;
}

.toc {
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line);
}

.toc__title {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.toc ol {
  list-style: none;
  counter-reset: toc;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 2px 14px;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: block;
  padding: 5px 0;
  font-size: 14.5px;
  color: var(--ink-1);
  text-decoration: none;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  margin-right: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

.toc a:hover {
  color: var(--ink-0);
}

/* 分了组的目录（店家指南）：组名不编号，编号接着往下数 */
.toc .toc__groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc .toc__group {
  counter-increment: none;
}

.toc .toc__group ol {
  counter-reset: none;
}

.toc a.toc__group-title {
  padding: 2px 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--violet-soft, #a08cff);
}

.toc a.toc__group-title::before {
  content: none;
}

/* 正文里每一组前面的大标题 */
.part {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 56px 0 8px;
  padding: 22px 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(255, 92, 138, 0.06) 60%, transparent), var(--glass);
  scroll-margin-top: 24px;
}

.doc > .part:first-child {
  margin-top: 0;
}

.part__no {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(120deg, #7c5cff, #ff5c8a);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.part__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.part__title {
  margin: 2px 0 4px;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-0);
}

.part__desc {
  margin: 0;
  color: var(--ink-2);
}

a.card--link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s;
}

a.card--link:hover {
  border-color: rgba(160, 140, 255, 0.5);
}

@media (min-width: 980px) {
  .layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
  }

  .toc {
    position: sticky;
    top: 24px;
  }

  .toc ol {
    grid-template-columns: 1fr;
  }
}

/* ---------- 正文 ---------- */

.doc {
  min-width: 0;
  counter-reset: section;
}

.doc section {
  counter-increment: section;
  padding-top: 44px;
  /* 从目录跳过来时，标题别顶着屏幕边 */
  scroll-margin-top: 8px;
}

.doc section:first-child {
  padding-top: 8px;
}

.doc h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 26px;
  line-height: 1.35;
  color: var(--ink-0);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.doc h2::before {
  content: counter(section, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--violet-soft);
}

.doc h3 {
  font-size: 18.5px;
  color: var(--ink-0);
  margin: 30px 0 10px;
  scroll-margin-top: 8px;
}

.doc p,
.doc li {
  margin-bottom: 10px;
}

.doc ul,
.doc ol {
  padding-left: 22px;
}

.lede {
  font-size: 17px;
  color: var(--ink-1);
}

/* App 里的路：收集 › 我藏过的 › 生成口令 */
.path {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(160, 140, 255, 0.26);
  color: var(--ink-1);
}

.path i {
  font-style: normal;
  color: var(--ink-3);
}

.where {
  margin: 4px 0 14px;
}

/* 界面上的字：按钮、开关、标签的名字 */
.ui {
  display: inline-block;
  padding: 1px 9px;
  margin: 0 1px;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink-0);
  background: var(--glass-strong);
  border: 1px solid var(--line-strong);
  white-space: nowrap;
}

/* ---------- 一步一步 ---------- */

.steps {
  list-style: none;
  padding: 0 !important;
  counter-reset: step;
  display: grid;
  gap: 10px;
  margin: 14px 0 18px;
}

.steps > li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 16px 18px 16px 58px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line);
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--grad-brand);
}

.steps > li > strong:first-child {
  display: block;
  font-size: 16.5px;
  margin-bottom: 2px;
}

.steps p:last-child,
.steps ul:last-child {
  margin-bottom: 0;
}

.steps ul {
  margin-top: 6px;
}

/* ---------- 提示 ---------- */

.note {
  margin: 16px 0;
  padding: 14px 18px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line);
  border-left: 3px solid var(--violet-soft);
}

.note > :last-child {
  margin-bottom: 0;
}

.note__label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--violet-soft);
  margin-bottom: 2px;
}

.note--tip {
  border-left-color: var(--mint);
  background: rgba(46, 230, 197, 0.06);
}

.note--tip .note__label {
  color: var(--mint);
}

.note--warn {
  border-left-color: var(--pink);
  background: rgba(255, 92, 138, 0.07);
}

.note--warn .note__label {
  color: var(--pink-soft);
}

/* ---------- 表格 ---------- */

.table {
  margin: 14px 0 18px;
  overflow-x: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--glass);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.65;
}

th,
td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

td:first-child {
  color: var(--ink-0);
  font-weight: 600;
}

/* ---------- 一排卡片 ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

.card {
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line);
}

.card h4 {
  font-size: 16px;
  color: var(--ink-0);
  margin-bottom: 4px;
}

.card p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0;
}

.card__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--violet-soft);
  margin-bottom: 6px;
}

/* ---------- 小样：一张打了码的卡 ---------- */

.sample {
  max-width: 380px;
  margin: 16px 0 18px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.9);
}

.sample__label {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.sample__text {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-0);
  margin: 0 !important;
}

.sample__mask {
  color: var(--ink-3);
  letter-spacing: -0.04em;
}

.sample__code {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-0);
}

/* ---------- 小样：雷达盘 ---------- */

.radar {
  position: relative;
  width: 210px;
  aspect-ratio: 1;
  margin: 18px 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle, rgba(124, 92, 255, 0.18), transparent 68%),
    rgba(0, 0, 0, 0.35);
}

.radar::before,
.radar::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(160, 140, 255, 0.3);
}

.radar::before {
  inset: 4%;
}

.radar::after {
  inset: 27%;
}

.radar__beam {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 290deg,
    rgba(46, 230, 197, 0.05) 300deg,
    rgba(46, 230, 197, 0.34) 360deg
  );
  opacity: 0.5;
}

.radar__me,
.radar__dot {
  position: absolute;
  border-radius: 50%;
}

.radar__me {
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  background: #3d8bff;
  border: 2px solid #fff;
}

.radar__dot {
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--violet-soft);
  box-shadow: 0 0 12px 2px rgba(160, 140, 255, 0.7);
}

.radar__dot--gold {
  background: var(--gold);
  box-shadow: 0 0 12px 2px rgba(205, 184, 135, 0.7);
}

.figure {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
}

.figure > ul {
  flex: 1;
  min-width: 240px;
}

/* ---------- 常见问题 ---------- */

details {
  margin-bottom: 10px;
  border-radius: var(--r-md);
  background: var(--glass);
  border: 1px solid var(--line);
}

summary {
  padding: 15px 44px 15px 18px;
  position: relative;
  font-weight: 600;
  color: var(--ink-0);
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 12px;
  font-size: 22px;
  font-weight: 400;
  color: var(--ink-3);
}

details[open] summary::after {
  content: "−";
}

details > div {
  padding: 0 18px 16px;
}

details > div > :last-child {
  margin-bottom: 0;
}

summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--violet-soft);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 收尾 ---------- */

.end {
  margin-top: 56px;
  padding: 36px 24px;
  text-align: center;
  border-radius: var(--r-lg);
  background:
    radial-gradient(80% 140% at 50% 0%, rgba(124, 92, 255, 0.22), transparent 70%),
    var(--glass);
  border: 1px solid var(--line-strong);
}

.end h2 {
  display: block;
  border: 0;
  margin: 0;
  padding: 0;
}

.end h2::before {
  content: none;
}

.end p {
  margin: 8px 0 0;
  color: var(--ink-2);
}

.foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 20px 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: 13.5px;
  color: var(--ink-3);
}

.foot a {
  color: var(--ink-2);
}

@media (max-width: 560px) {
  body {
    font-size: 15.5px;
  }

  .hero {
    padding-top: 40px;
  }

  .doc h2 {
    font-size: 23px;
  }

  th,
  td {
    padding: 11px 13px;
  }

  /* 英文表头长，不换行的话会把旁边那一列挤成一个词一行 */
  th {
    white-space: normal;
  }
}

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