/* ============================================================
   無比書屋 · 商城设计系统
   方向：暖白纸张 + 墨色衬线标题 + 单一强调色（随商品变化）
   原则：细线分隔、大留白、数字等宽、克制的入场动效
   品牌名由服务端 /api/site 驱动，此处仅作说明
   ============================================================ */

:root {
  --paper: #f6f4ef;
  --paper-2: #efece5;
  --surface: #ffffff;
  --ink: #15141b;
  --ink-2: #4f4d59;
  --ink-3: #8b8894;
  --line: #e5e1d8;
  --line-2: #efece5;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef0ff;
  --danger: #c0392b;
  --ok: #1c7a4a;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --ease: cubic-bezier(.22, .68, .32, 1);
  --wrap: 1140px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-family: var(--serif); font-weight: 600; line-height: 1.32; letter-spacing: .01em; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 28px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* 入场动效 */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .72s var(--ease) both; }
.reveal:nth-child(1) { animation-delay: .02s; }
.reveal:nth-child(2) { animation-delay: .1s; }
.reveal:nth-child(3) { animation-delay: .18s; }
.reveal:nth-child(4) { animation-delay: .26s; }
.reveal:nth-child(5) { animation-delay: .34s; }
.reveal:nth-child(6) { animation-delay: .42s; }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 244, 239, .86);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 28px; height: 66px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .cn { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: .06em; }
.brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); transform: translateY(-2px); }
.brand .en { font-size: 11.5px; color: var(--ink-3); letter-spacing: .16em; text-transform: uppercase; }
.nav { display: flex; align-items: center; gap: 26px; font-size: 14px; }
.nav a { color: var(--ink-2); position: relative; padding: 4px 0; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--ink); transition: right .3s var(--ease);
}
.nav a:hover::after { right: 0; }
.nav a.active { color: var(--ink); }
.nav a.active::after { right: 0; }

/* ---------------- 首页 Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1100px 380px at 82% -12%, rgba(79, 70, 229, .10), transparent 62%),
    linear-gradient(var(--paper) 0%, var(--paper) 100%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(to right, rgba(21,20,27,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(21,20,27,.045) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(to bottom, #000 20%, transparent 88%);
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 88%);
}
.hero-inner { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 92px 28px 84px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.hero h1 {
  font-size: clamp(34px, 5.4vw, 62px); margin: 22px 0 0; letter-spacing: .015em; line-height: 1.18;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .sub { margin-top: 22px; max-width: 620px; font-size: 16.5px; color: var(--ink-2); }
.hero-meta { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px 34px; align-items: center; }
.hero-meta .m { font-size: 13px; color: var(--ink-3); }
.hero-meta .m b { display: block; font-family: var(--serif); font-size: 24px; color: var(--ink); font-weight: 600; }

/* ---------------- 区块 ---------------- */
.section { padding: 84px 0; border-bottom: 1px solid var(--line); }
.section--tint { background: var(--paper-2); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 44px; }
.sec-head .idx { font-family: var(--serif); font-size: 13px; letter-spacing: .22em; color: var(--ink-3); text-transform: uppercase; }
.sec-head h2 { font-size: clamp(24px, 3vw, 34px); margin-top: 8px; }
.sec-head .desc { max-width: 460px; font-size: 14.5px; color: var(--ink-3); text-align: right; }
@media (max-width: 720px) {
  .sec-head { flex-direction: column; align-items: flex-start; }
  .sec-head .desc { text-align: left; }
}

/* ---------------- 商品卡 ---------------- */
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 940px) { .prod-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .prod-grid { grid-template-columns: 1fr; } }

.prod-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; transition: transform .34s var(--ease), border-color .34s var(--ease), box-shadow .34s var(--ease);
}
.prod-card:hover { transform: translateY(-4px); border-color: var(--card-accent, var(--accent)); box-shadow: 0 18px 40px -26px rgba(21,20,27,.4); }
.prod-card .bar { height: 4px; background: linear-gradient(90deg, var(--card-accent, var(--accent)), var(--card-accent2, var(--accent-2))); }
.prod-card .body { padding: 24px 24px 22px; display: flex; flex-direction: column; flex: 1; }
.prod-card .kicker { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--card-accent, var(--accent)); font-weight: 600; }
.prod-card h3 { font-size: 21px; margin: 12px 0 0; }
.prod-card .lead { font-size: 14px; color: var(--ink-2); margin-top: 12px; flex: 1; }
.prod-card .tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.prod-card .foot { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; }
.prod-card .go { font-size: 13.5px; color: var(--card-accent, var(--accent)); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.prod-card .go .arw { transition: transform .3s var(--ease); }
.prod-card:hover .go .arw { transform: translateX(4px); }

.tagchip {
  font-size: 12px; padding: 3px 10px; border-radius: 100px;
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line);
}
.tagchip--accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------------- 特性块 ---------------- */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 860px) { .feat-grid { grid-template-columns: 1fr; } }
.feat { border-top: 1px solid var(--ink); padding-top: 20px; }
.feat .n { font-family: var(--serif); font-size: 13px; letter-spacing: .18em; color: var(--ink-3); }
.feat h3 { font-size: 18px; margin: 12px 0 10px; }
.feat p { font-size: 14px; color: var(--ink-2); }

/* ---------------- 步骤 ---------------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
.step { padding: 26px 24px; border-right: 1px solid var(--line-2); }
.step:last-child { border-right: none; }
@media (max-width: 860px) { .step:nth-child(2) { border-right: none; } .step:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); } }
.step .idx { font-family: var(--serif); font-size: 26px; color: var(--accent); }
.step h4 { font-size: 16px; margin: 10px 0 8px; }
.step p { font-size: 13.5px; color: var(--ink-2); }

/* ---------------- FAQ ---------------- */
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq summary {
  cursor: pointer; list-style: none; font-family: var(--serif); font-size: 17px; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); font-size: 20px; color: var(--ink-3); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { font-size: 14px; color: var(--ink-2); margin-top: 12px; max-width: 720px; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-size: 14.5px; font-weight: 500; cursor: pointer;
  padding: 13px 24px; border-radius: 100px; border: 1px solid transparent;
  background: var(--ink); color: #fff; transition: opacity .2s, transform .2s, background .2s;
}
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-accent { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); border-radius: 100px; }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------------- 商品介绍页 Hero ---------------- */
.phero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
}
.phero::before {
  content: ""; position: absolute; inset: 0; opacity: .22; pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 30%, rgba(255,255,255,.5) 0 2px, transparent 3px),
    radial-gradient(circle at 62% 70%, rgba(255,255,255,.4) 0 2px, transparent 3px),
    linear-gradient(to right, rgba(255,255,255,.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 220px 220px, 260px 260px, 56px 56px, 56px 56px;
}
.phero-inner { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 62px 28px 58px; display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .phero-inner { grid-template-columns: 1fr; padding-top: 46px; } }
.phero .crumb { font-size: 13px; color: rgba(255,255,255,.78); }
.phero .crumb a:hover { text-decoration: underline; }
.phero h1 { color: #fff; font-size: clamp(30px, 4.4vw, 50px); margin: 16px 0 0; letter-spacing: .01em; }
.phero .sub { color: rgba(255,255,255,.92); font-size: 17px; margin-top: 18px; max-width: 560px; }
.phero .tags { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.phero .tags span { font-size: 12.5px; padding: 4px 12px; border-radius: 100px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff; }

/* 兑换卡 */
.redeem {
  background: #fff; border-radius: var(--r-lg); padding: 26px 26px 24px; color: var(--ink);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.45);
}
.redeem h3 { font-size: 18px; }
.redeem .hint { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.redeem .field { margin-top: 16px; }
.redeem label { display: block; font-size: 13px; font-weight: 500; color: var(--ink); margin-bottom: 7px; }
.redeem input {
  width: 100%; padding: 14px 16px; font-size: 16px; font-family: var(--mono); letter-spacing: 3px;
  text-transform: uppercase; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-sm); outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.redeem input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: #fff; }
.redeem .btn { margin-top: 14px; }
.redeem .dev { margin-top: 12px; font-size: 12px; color: var(--ink-3); font-family: var(--mono); word-break: break-all; }
.redeem .note { margin-top: 14px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line-2); padding-top: 12px; }

/* 提示条 */
.msg { border-radius: var(--r-sm); padding: 11px 14px; font-size: 13.5px; margin-top: 14px; display: none; }
.msg.show { display: block; }
.msg-error { background: #fdeceb; color: var(--danger); border: 1px solid #f4cfcb; }
.msg-ok { background: #e9f6ef; color: var(--ok); border: 1px solid #c8e6d5; }
.msg-info { background: var(--accent-soft); color: var(--accent); border: 1px solid transparent; }

/* ---------------- 商品介绍页正文 ---------------- */
.pbody { padding: 68px 0 40px; }
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
@media (max-width: 720px) { .stat-band { grid-template-columns: 1fr 1fr; } }
.stat-band .s { padding: 24px 22px; border-right: 1px solid var(--line-2); }
.stat-band .s:last-child { border-right: none; }
@media (max-width: 720px) { .stat-band .s:nth-child(2) { border-right: none; } .stat-band .s:nth-child(-n+2) { border-bottom: 1px solid var(--line-2); } }
.stat-band .s .n { font-family: var(--serif); font-size: 34px; color: var(--ink); font-weight: 600; }
.stat-band .s .l { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

.block { margin-top: 56px; }
.block > h2 { font-size: 24px; margin-bottom: 8px; }
.block > .bl { font-size: 14px; color: var(--ink-3); margin-bottom: 24px; }
.block .prose { font-size: 15.5px; color: var(--ink-2); max-width: 780px; }

.hl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .hl-grid { grid-template-columns: 1fr; } }
.hl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 22px 20px; position: relative; }
.hl::before { content: ""; position: absolute; left: 22px; top: 24px; width: 22px; height: 2px; background: var(--accent); }
.hl h3 { font-size: 17px; margin-top: 20px; }
.hl p { font-size: 14px; color: var(--ink-2); margin-top: 9px; }

.outline-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 720px) { .outline-grid { grid-template-columns: 1fr; } }
.oc { border-top: 1px solid var(--ink); padding-top: 18px; }
.oc h4 { font-size: 16px; margin-bottom: 14px; }
.oc ul { list-style: none; padding: 0; margin: 0; }
.oc li { font-size: 14px; color: var(--ink-2); padding: 7px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; }
.oc li:last-child { border-bottom: none; }
.oc li::before { content: "—"; color: var(--accent); flex: none; }

/* ---------------- 页脚 ---------------- */
.footer { padding: 46px 0 56px; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
.footer .cn { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.footer .meta { font-size: 12.5px; color: var(--ink-3); }

/* 空状态 */
.empty { text-align: center; padding: 70px 20px; color: var(--ink-3); }

/* ---------------- 我的资料（本机已领） ---------------- */
.mine { background: var(--surface); border-bottom: 1px solid var(--line); }
.mine-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 22px 28px;
  display: flex; align-items: center; gap: 18px 22px; flex-wrap: wrap;
}
.mine .lbl {
  flex: none; font-family: var(--serif); font-size: 13px;
  letter-spacing: .18em; color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 9px;
}
.mine .lbl::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.mine-list { display: flex; flex-wrap: wrap; gap: 10px; flex: 1; min-width: 0; }
.mine-item {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 15px 9px 17px; border: 1px solid var(--line); border-radius: 100px;
  background: var(--paper); font-size: 13.5px; color: var(--ink);
  transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.mine-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 24px -18px rgba(21,20,27,.5); }
.mine-item .t { font-weight: 600; }
.mine-item .arw { color: var(--accent); transition: transform .25s var(--ease); }
.mine-item:hover .arw { transform: translateX(3px); }
.mine-item .rm {
  border: none; background: none; cursor: pointer; padding: 0 0 0 4px;
  color: var(--ink-3); font-size: 15px; line-height: 1;
}
.mine-item .rm:hover { color: var(--danger); }
.mine .clear { flex: none; font-size: 12.5px; color: var(--ink-3); cursor: pointer; border: none; background: none; }
.mine .clear:hover { color: var(--danger); text-decoration: underline; }

/* 页脚的管理入口（低调） */
.footer .links { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-3); }
.footer .links a:hover { color: var(--ink); text-decoration: underline; }
.footer .icp { font-size: 12.5px; color: var(--ink-3); }
