/* 云绘坊官网：方向 C「次元精致」（docs/DESIGN.md、design/directions/C-otaku/tokens.md）。移动端优先。 */
:root {
  --bg: #F4F1F6;
  --surface: #FFFFFF;
  --surface2: #F7F4F9;
  --surface3: #EFEBF3;
  --line: rgba(74, 58, 102, .10);
  --line2: rgba(74, 58, 102, .16);
  --ink: #27222F;
  --ink2: #5C5568;
  --ink3: #726B7E;
  --ink4: #BDB7C6;
  --violet: #6E5D92;
  --violet2: #8A78AC;
  --violet-soft: #EEE8F5;
  --violet-ink: #5A4A7C;
  --haze-soft: #E8EEF4;
  --haze-ink: #4D6684;
  --lotus-soft: #F7EAEE;
  --lotus-ink: #8E5666;
  --sage-soft: #E8F0EA;
  --sage-ink: #506A59;
  --champ-soft: #F5EEE3;
  --champ-ink: #7D6239;
  --success: #44795E;
  --foil: linear-gradient(125deg, #D7C4EE 0%, #C0D7EF 24%, #F0D3C2 47%, #C6E6D7 68%, #E5C6E2 86%, #D7C4EE 100%);
  --sheen: linear-gradient(115deg, transparent 28%, rgba(216, 198, 242, .30) 40%, rgba(192, 222, 242, .30) 50%, rgba(246, 218, 204, .26) 60%, transparent 72%);
  --cta: linear-gradient(135deg, #67578B 0%, #715F98 55%, #7B67A0 100%);
  --sh1: 0 1px 2px rgba(58, 44, 84, .05), 0 6px 18px -6px rgba(58, 44, 84, .10);
  --sh2: 0 2px 4px rgba(58, 44, 84, .05), 0 14px 32px -12px rgba(58, 44, 84, .20);
  --sh-hero: 0 18px 36px -18px rgba(58, 44, 84, .55), 0 2px 6px rgba(58, 44, 84, .08);
  --sh-cta: 0 10px 22px -10px rgba(98, 80, 140, .7), inset 0 1px 0 rgba(255, 255, 255, .22);
  --num: "Inter", "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans CJK SC", "Source Han Sans SC",
    "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(70% 360px at 0 0, rgba(247, 228, 236, .95), transparent 70%),
    radial-gradient(70% 360px at 100% 0, rgba(226, 219, 243, .9), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* 纸纹颗粒：极轻的分形噪点 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .30 0 0 0 0 .24 0 0 0 0 .42 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 28px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 9px; box-shadow: var(--sh1); }
.brand b { font-size: 17px; letter-spacing: .06em; }
.overline {
  font-family: var(--num);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink3);
}
.topbar .overline { margin-left: 2px; }
.topbar-link { font-size: 13px; color: var(--ink2); }

/* ---------- 首屏 ---------- */
.hero { padding: 18px 0 6px; text-align: center; }
.hero h1 {
  margin: 10px 0 0;
  font-size: 28px;
  line-height: 38px;
  font-weight: 700;
  letter-spacing: .04em;
}
.hero .lead {
  margin: 10px auto 0;
  max-width: 340px;
  color: var(--ink2);
  font-size: 15px;
  line-height: 1.65;
}
.star { color: var(--violet2); display: inline-block; vertical-align: -2px; }

/* 首屏插画：三张错落的收藏小卡（纯 CSS，不放示例作品图） */
.deck { position: relative; height: 210px; margin: 26px auto 8px; max-width: 320px; }
.deck .c {
  position: absolute;
  top: 18px;
  width: 128px;
  height: 172px;
  border-radius: 20px;
  background: var(--surface);
  border: .5px solid var(--line);
  box-shadow: var(--sh2);
  overflow: hidden;
}
.deck .c1::after, .deck .c3::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 15px;
  background: var(--surface2);
}
.deck .c .ic {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 15px;
}
.deck .c .ic svg { width: 22px; height: 22px; }
.deck .c1 { left: 6px; transform: rotate(-9deg); }
.deck .c3 { right: 6px; transform: rotate(9deg); }
.deck .c2 {
  left: 50%;
  top: 0;
  z-index: 2;
  width: 146px;
  height: 196px;
  margin-left: -73px;
  border: 0;
  padding: 1.5px;
  border-radius: 22px;
  background: var(--foil);
  box-shadow: var(--sh-hero);
}
.deck .c2 .face {
  position: relative;
  height: 100%;
  border-radius: 20.5px;
  overflow: hidden;
  background: linear-gradient(165deg, #FFFFFF 0%, #F1ECF6 100%);
}
.deck .c2 .face::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--sheen);
  background-size: 260% 100%;
  background-position: 100% 0;
  animation: sheen 1.4s ease-in-out .3s 1 both;
}
.deck .c2 .face img { position: absolute; left: 50%; top: 42%; width: 104px; height: 104px; margin: -52px 0 0 -52px; }
.deck .c2 .tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 7px 0 6px;
  border-radius: 999px;
  background: rgba(251, 249, 253, .9);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .95), 0 1px 3px rgba(40, 28, 60, .14);
  color: #3A3346;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
}
.deck .c2 .tag svg { width: 8px; height: 8px; color: var(--violet); }
.deck .c2 .no {
  position: absolute;
  right: 12px;
  top: 12px;
  font-family: var(--num);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--ink3);
}
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  margin-top: 14px;
  padding: 18px 16px;
  border-radius: 20px;
  background: var(--surface);
  border: .5px solid var(--line);
  box-shadow: var(--sh1);
}
.card h2 { margin: 0 0 4px; font-size: 16px; line-height: 22px; }
.card .sub { margin: 0; color: var(--ink3); font-size: 13px; line-height: 19px; }

/* 收藏卡：箔边（每屏只有这一张） */
.foil {
  margin-top: 18px;
  padding: 1.5px;
  border-radius: 24px;
  background: var(--foil);
  box-shadow: var(--sh-hero);
}
.foil > .inner {
  padding: 20px 18px 18px;
  border-radius: 22.5px;
  background: var(--surface);
}

.app-row { display: flex; align-items: center; gap: 12px; }
.app-row img { width: 54px; height: 54px; border-radius: 15px; box-shadow: var(--sh1); flex: none; }
.app-row b { display: block; font-size: 16px; line-height: 22px; }
.app-row span { display: block; color: var(--ink3); font-size: 12px; line-height: 17px; }

/* ---------- 按钮 ---------- */
.btns { display: grid; gap: 10px; margin-top: 16px; }
.card > .btns:first-child { margin-top: 0; }
.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s ease-out, filter .1s ease-out;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); filter: brightness(.94); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary {
  color: #fff;
  background: var(--cta);
  box-shadow: var(--sh-cta);
  overflow: hidden;
}
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .16) 45%, transparent 60%);
  pointer-events: none;
}
.btn-ghost {
  color: var(--violet-ink);
  background: var(--surface2);
  box-shadow: inset 0 0 0 .5px var(--line2);
}
.btn[aria-disabled="true"] {
  color: var(--ink3);
  background: var(--surface3);
  box-shadow: none;
  cursor: default;
  font-weight: 600;
  font-size: 15px;
}
.btn[aria-disabled="true"]:active { transform: none; filter: none; }

.note { margin: 12px 0 0; color: var(--ink3); font-size: 12px; line-height: 18px; }
.note b { color: var(--ink2); font-weight: 600; }

/* ---------- 功能 ---------- */
.section-title { margin: 26px 2px 0; font-size: 15px; line-height: 22px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.feature {
  padding: 14px;
  border-radius: 20px;
  background: var(--surface);
  border: .5px solid var(--line);
  box-shadow: var(--sh1);
}
.feature .ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
}
.feature .ic svg { width: 22px; height: 22px; }
.feature b { display: block; margin-top: 10px; font-size: 15px; line-height: 21px; }
.feature p { margin: 4px 0 0; color: var(--ink3); font-size: 12px; line-height: 18px; }
.tone-violet { background: var(--violet-soft); color: var(--violet-ink); }
.tone-haze { background: var(--haze-soft); color: var(--haze-ink); }
.tone-lotus { background: var(--lotus-soft); color: var(--lotus-ink); }
.tone-sage { background: var(--sage-soft); color: var(--sage-ink); }
.tone-champ { background: var(--champ-soft); color: var(--champ-ink); }

/* ---------- 步骤 ---------- */
.steps { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li {
  position: relative;
  padding: 0 0 12px 34px;
  counter-increment: s;
  color: var(--ink2);
  font-size: 14px;
  line-height: 22px;
}
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--violet-soft);
  color: var(--violet-ink);
  font-family: var(--num);
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.steps li b { color: var(--ink); font-weight: 600; }

/* ---------- 邀请码 ---------- */
.invite-head { text-align: center; }
.invite-head .avatar {
  width: 64px;
  height: 64px;
  margin: 2px auto 0;
  border-radius: 20px;
  box-shadow: var(--sh2);
}
.invite-head h1 { margin: 14px 0 0; font-size: 22px; line-height: 30px; letter-spacing: .02em; }
.invite-head p { margin: 6px 0 0; color: var(--ink2); font-size: 14px; }
.code-box {
  margin-top: 18px;
  padding: 14px 12px 12px;
  border-radius: 18px;
  background: var(--surface2);
  box-shadow: inset 0 0 0 .5px var(--line);
  text-align: center;
}
.code-box .overline { display: block; }
.code {
  display: block;
  margin-top: 4px;
  font-family: var(--num);
  font-size: 34px;
  line-height: 44px;
  font-weight: 700;
  letter-spacing: .22em;
  padding-left: .22em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  user-select: all;
  -webkit-user-select: all;
  word-break: break-all;
}
.code.empty { font-size: 18px; letter-spacing: .04em; color: var(--ink3); font-weight: 600; }

/* ---------- 分享落地 ---------- */
.share-head { text-align: center; padding-top: 6px; }
.share-head .glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 20px;
}
.share-head .glyph svg { width: 30px; height: 30px; }
.share-head h1 { margin: 14px 0 0; font-size: 22px; line-height: 30px; letter-spacing: .02em; }
.share-head p { margin: 6px auto 0; max-width: 320px; color: var(--ink2); font-size: 14px; }

/* ---------- 404 ---------- */
.lost { padding: 40px 0 6px; text-align: center; }
.lost .big {
  font-family: var(--num);
  font-size: 64px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--violet);
}
.lost h1 { margin: 14px 0 0; font-size: 20px; line-height: 28px; }
.lost p { margin: 6px 0 0; color: var(--ink2); }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 30px;
  padding: 16px 2px 8px;
  border-top: .5px solid var(--line2);
  color: var(--ink3);
  font-size: 12px;
  line-height: 20px;
  text-align: center;
}
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.footer nav a { color: var(--ink2); }
.footer p { margin: 8px 0 0; }
.footer .beian { color: var(--ink3); }

/* ---------- 浮层：微信内下载引导、复制提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 20;
  max-width: 80vw;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(39, 34, 47, .88);
  color: #fff;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.guide {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  background: rgba(21, 18, 27, .78);
  color: #fff;
}
.guide.show { display: block; }
.guide .arrow { position: absolute; right: 22px; top: 8px; width: 74px; height: 74px; color: #fff; }
.guide .tip { position: absolute; right: 24px; left: 24px; top: 96px; text-align: right; font-size: 17px; line-height: 28px; font-weight: 700; }
.guide .tip small { display: block; margin-top: 6px; font-size: 14px; line-height: 22px; font-weight: 400; opacity: .86; }
.guide .dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  margin: 0 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  vertical-align: 1px;
  font-size: 14px;
  font-style: normal;
  letter-spacing: .1em;
}

.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 桌面 ---------- */
@media (min-width: 900px) {
  body {
    background:
      radial-gradient(50% 480px at 0 0, rgba(247, 228, 236, .95), transparent 70%),
      radial-gradient(50% 480px at 100% 0, rgba(226, 219, 243, .9), transparent 70%),
      var(--bg);
    background-repeat: no-repeat;
  }
  .page { max-width: 1040px; padding: 0 32px 32px; }
  .topbar { height: 76px; }
  .home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 56px;
    align-items: center;
    padding-top: 36px;
  }
  .home-grid .hero { text-align: left; padding: 0; }
  .home-grid .hero h1 { font-size: 40px; line-height: 52px; }
  .home-grid .hero .lead { margin-left: 0; max-width: 460px; font-size: 16px; }
  .home-grid .deck { margin: 34px 0 0; }
  .features { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .narrow { max-width: 440px; margin: 0 auto; }
  .steps-card { max-width: 640px; margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .deck .c2 .face::before { animation: none; background-position: 0 0; }
  .btn, .toast { transition: none; }
}
