/* ============================================================
   ANTSPRO 图册 — 版式致敬 RIDE，配色独立
   颜色全部由 CSS 变量驱动，支持 data-theme 切换
   ============================================================ */

:root {
  color-scheme: dark;
  --display: "DIN Neuzeit Grotesk", "Avenir Next", "Helvetica Neue", "Arial Black", sans-serif;
  --mono: ui-monospace, Consolas, monospace;
  --sans: "Alibaba PuHuiTi", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;

  /* —— 字体字号规范（参考 Apple HIG typography）——
     display  封面主标题  20px  -1.5%  1.2
     product  产品名      18px  -1%    1.25
     detail   详情标题    15px   0     1.3
     body     正文        14px   0     1.4
     caption  辅助/说明   12px   0     1.3
     footnote 脚注/目录   11px   0     1.3  */
  --fs-display: 20px;
  --fs-display-lh: 1.2;
  --fs-display-ls: -0.015em;
  --fs-product: 18px;
  --fs-product-lh: 1.25;
  --fs-product-ls: -0.01em;
  --fs-detail: 15px;
  --fs-detail-lh: 1.3;
  --fs-detail-ls: 0;
  --fs-body: 14px;
  --fs-body-lh: 1.4;
  --fs-body-ls: 0;
  --fs-caption: 12px;
  --fs-caption-lh: 1.3;
  --fs-caption-ls: 0;
  --fs-footnote: 11px;
  --fs-footnote-lh: 1.3;
  --fs-footnote-ls: 0;

  /* —— 默认主题（暖棕，接近原 RIDE，后续可换）—— */
  --paper: #f4eddf;        /* 主文字 */
  --muted: #bcb6ad;        /* 弱化文字 */
  --muted-2: #c0ad9b;      /* 更弱的辅助 */
  --accent: #edb779;       /* 强调色 */
  --accent-soft: #ffc99e;  /* 强调浅色 */
  --glow: #ffad75;         /* 光带动效应色 */

  --outer: #242326;        /* 页面最外背景 */
  --ground: #121214;       /* 内容/卡片底 */
  --surface: #211d21;      /* 次表面 */
  --surface-2: #2a262b;    /* 画廊渐变浅 */
  --field: #191719;        /* 字段底 */
  --rule: #383035;         /* 分隔线（常规细线） */
  --rule-strong: #4a3d3a;  /* 分隔线（强/深，分大板块） */
  --rule-soft: #2a2527;    /* 分隔线（软/浅，微分割） */
  --hover: #352b28;        /* hover 底 */

  --cover-grad-a: #755842; /* 封面径向渐变 高光 */
  --cover-grad-b: #2e2825; /* 封面渐变 中间 */
  --cover-grad-c: #141417; /* 封面渐变 边缘 */
  --cover-rule: #7b685a;   /* 封面分隔线 */
  --cover-muted: #d5c2ac;  /* 封面脚注 */
  --link: #cabfb4;         /* 翻页链接 */
}

/* —— PANTONE 2765C 蓝紫深底（品牌主色）+ 2562C 强调 —— */
[data-theme="2765c"] {
  --paper: #ece8f7;
  --muted: #a49bcb;
  --muted-2: #9489bf;
  --accent: #b892d9;       /* 2562C 亮紫 */
  --accent-soft: #d1b3ea;
  --glow: #aa7fd0;         /* 光带动威色 */

  --outer: #150e30;
  --ground: #201547;       /* 2765C 本体 */
  --surface: #2a1c5a;
  --surface-2: #33246b;
  --field: #1a1238;
  --rule: #3d2d78;
  --rule-strong: #55409a;
  --rule-soft: #2a1c5a;
  --hover: #31235f;

  --cover-grad-a: #4a3387;
  --cover-grad-b: #2a1c5a;
  --cover-grad-c: #150e30;
  --cover-rule: #4a3a80;
  --cover-muted: #c9c0e8;
  --link: #b3a8d8;
}

/* —— 冷色科技风 —— */
[data-theme="cool"] {
  --paper: #eaf3fb;
  --muted: #9db4c8;
  --muted-2: #8aa2b8;
  --accent: #5fd0ff;
  --accent-soft: #9ee4ff;
  --glow: #4fc3f7;

  --outer: #0c141c;
  --ground: #0e1720;
  --surface: #15222e;
  --surface-2: #1c3142;
  --field: #101c26;
  --rule: #234154;
  --rule-strong: #335972;
  --rule-soft: #162c3a;
  --hover: #1b2c3a;

  --cover-grad-a: #1e5c7a;
  --cover-grad-b: #0f2b3d;
  --cover-grad-c: #081119;
  --cover-rule: #2a5a70;
  --cover-muted: #b8d7e8;
  --link: #a9c4d4;
}

/* —— 军绿户外风 —— */
[data-theme="olive"] {
  --paper: #ede8d8;
  --muted: #b3ac93;
  --muted-2: #a29b80;
  --accent: #e8a33d;
  --accent-soft: #f5c06a;
  --glow: #d98a2b;

  --outer: #1c1e17;
  --ground: #14160f;
  --surface: #1f2217;
  --surface-2: #2a2f1e;
  --field: #181a12;
  --rule: #3a4028;
  --rule-strong: #57622f;
  --rule-soft: #27291c;
  --hover: #2a2e1b;

  --cover-grad-a: #5a5a2e;
  --cover-grad-b: #2c331c;
  --cover-grad-c: #12140c;
  --cover-rule: #5a6034;
  --cover-muted: #cfc9a8;
  --link: #bcb58e;
}

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

body {
  margin: 0;
  background: var(--outer);
  color: var(--paper);
  font: var(--fs-body)/var(--fs-body-lh) var(--sans);
  letter-spacing: var(--fs-body-ls);
}

a { color: inherit; text-underline-offset: .2em; }
button { color: inherit; font: inherit; cursor: pointer; }

/* 主容器：窄幅居中，像一本图册 */
.catalog {
  max-width: 680px;
  margin-inline: auto;
  background: var(--ground);
  min-height: 100vh;
}

/* ============ 封面 cover ============ */
.cover {
  position: relative;
  isolation: isolate;
  min-height: auto;
  padding: clamp(22px, 6.7vw, 45px) clamp(18px, 6.3vw, 42px) clamp(20px, 5vw, 34px);
  overflow: hidden;
  background: radial-gradient(ellipse at 66% 66%, var(--cover-grad-a), var(--cover-grad-b) 42%, var(--cover-grad-c) 80%);
  display: flex;
  flex-direction: column;
}
.cover-top {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--cover-rule); padding-bottom: 12px;
}
.brandmark { display: flex; align-items: center; gap: 10px; color: var(--paper); }
.brandmark .logosvg { width: clamp(105px, 22vw, 145px); height: auto; }
.edition {
  color: var(--accent);
  font: 700 var(--fs-caption)/1.1 var(--mono);
}
.cover h1 {
  margin: clamp(14px, 5vw, 30px) 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: var(--fs-display-lh);
  letter-spacing: var(--fs-display-ls);
}
.cover-sub {
  margin: 9px 0 0; color: var(--accent);
  font-size: var(--fs-caption); font-weight: 700; letter-spacing: 0.13em;
}
.cover-photo {
  display: block; width: 100%; height: auto; margin-top: auto; margin-bottom: 0;
}
/* ===== 封面下方图册轮播 cover-carousel（封面与目录之间） ===== */
.cover-carousel {
  position: relative;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: var(--surface);
  -webkit-user-select: none; user-select: none;
}
.cover-slides {
  display: flex;
  transition: transform .5s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.cover-slide {
  flex: 0 0 100%;
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  aspect-ratio: 16 / 10;
}
.cover-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--cover-rule);
  background: rgba(21,14,48,.55); color: var(--paper);
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; z-index: 2;
  backdrop-filter: blur(4px);
  transition: background .2s ease, border-color .2s ease;
}
.cover-arrow:hover { background: rgba(170,127,208,.45); border-color: var(--accent); }
.cover-prev { left: 10px; }
.cover-next { right: 10px; }
.cover-dots {
  position: absolute; bottom: 10px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 7px; z-index: 2;
}
.cover-dots button {
  width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0;
  background: rgba(255,255,255,.38); cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.cover-dots button.active { background: var(--accent); transform: scale(1.35); }
.cover-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-top: 14px; padding: 11px 0 0; border-top: 1px solid var(--cover-rule);
}
.cover-foot p { margin: 0; color: var(--cover-muted); font-size: var(--fs-footnote); }
.cover-foot a { white-space: nowrap; font-weight: 700; font-size: var(--fs-caption); color: var(--accent); }

/* ============ 目录 directory ============ */
.directory {
  padding: 16px clamp(16px, 5vw, 34px) 18px;
  background: var(--field);
  border-block: 1px solid var(--rule-strong);
}
.directory summary {
  cursor: pointer; font-weight: 700; font-size: var(--fs-body); list-style: none;
}
.directory summary::-webkit-details-marker { display: none; }
.directory-groups { display: grid; gap: 13px; margin-top: 12px; }
.directory h2 { margin: 0 0 4px; font-size: var(--fs-footnote); color: var(--muted); }
.directory ul {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none; margin: 0; padding: 0; gap: 1px; background: var(--rule);
}
.directory a {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 3px 6px; padding: 7px 8px; background: var(--surface); text-decoration: none;
}
.directory a:hover { background: var(--hover); }
.directory strong { font: 400 var(--fs-caption)/1.15 var(--display); }
.directory small { flex: none; color: var(--muted-2); font-size: var(--fs-footnote); }
@media (min-width: 530px) {
  .directory ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============ 产品条目 ============ */
.entry { border-top: 1px solid var(--rule-strong); }

/* hero 段 */
.hero {
  background: var(--ground);
  padding: clamp(13px, 4.6vw, 29px) clamp(15px, 5.8vw, 37px) 0;
  overflow: hidden;
}
.hero-top {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 9px; border-bottom: 1px solid var(--rule);
}
.hero-top .brandmark .logosvg { width: clamp(80px, 18vw, 118px); }
.hero h2 {
  margin: 11px 0 0;
  font-family: var(--display); font-weight: 400;
  font-size: var(--fs-product);
  letter-spacing: var(--fs-product-ls); line-height: var(--fs-product-lh);
}
.hero-model {
  color: var(--accent); margin: 6px 0 0;
  font-size: var(--fs-caption); line-height: 1.2;
  font-weight: 700; letter-spacing: 0.08em;
}
.hero-stage {
  display: block;
  width: calc(100% + clamp(30px, 11.6vw, 74px));
  margin: 8px calc(-1 * clamp(15px, 5.8vw, 37px)) 0;
}
.hero-stage img {
  display: block; width: 100%; height: auto;
  max-height: 460px; object-fit: cover; object-position: center;
}

/* detail 段 */
.detail {
  color: var(--paper); background: var(--ground);
  padding: clamp(11px, 3.1vw, 22px) clamp(12px, 3.6vw, 25px) clamp(13px, 3.3vw, 24px);
  border-top: 1px solid var(--rule);
}
.detail-subheading {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 7px; margin-top: 3px;
}
.detail h3 {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: var(--fs-detail); line-height: var(--fs-detail-lh); letter-spacing: var(--fs-detail-ls);
}
.detail-model {
  margin: 0; color: var(--accent);
  font-size: var(--fs-footnote); font-weight: 700; line-height: 1.3;
}

/* 事实栏 facts */
.facts {
  display: grid;
  grid-template-columns: minmax(72px,auto) minmax(48px,auto) minmax(0,1fr) minmax(0,1.4fr);
  margin: 8px 0 0;
  border-block: 1px solid var(--rule-strong);
  background: linear-gradient(105deg, var(--surface), transparent 78%);
}
.facts div {
  display: grid; align-content: center; min-width: 0; gap: 2px;
  padding: 4px clamp(5px, 1.7vw, 11px);
}
.facts div + div { border-inline-start: 1px solid var(--rule); }
.facts dt { color: var(--muted); font-size: var(--fs-footnote); line-height: 1.14; }
.facts dd {
  margin: 0; color: var(--paper);
  font-size: var(--fs-body); line-height: 1.16; font-weight: 700;
}
.facts div:first-child dd {
  color: var(--accent);
  font: 700 var(--fs-detail)/1 var(--mono);
  white-space: nowrap;
}

/* 多图左右滑动画廊 */
.pic-gallery {
  position: relative; isolation: isolate;
  margin-top: 6px; overflow: hidden; border-radius: 12px;
  background: radial-gradient(ellipse at 47% 46%, var(--surface-2), var(--surface) 79%);
  -webkit-user-select: none; user-select: none;
}
.pic-track {
  display: flex;
  transition: transform .45s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.pic-slide {
  flex: 0 0 100%; min-width: 0; aspect-ratio: 4 / 3;
  display: flex; align-items: center; justify-content: center;
}
.pic-slide img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
}
.pic-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: rgba(21,14,48,.58); color: var(--paper);
  font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; z-index: 2;
  backdrop-filter: blur(3px);
}
.pic-arrow:hover { background: rgba(170,127,208,.42); border-color: var(--accent); }
.pic-prev { left: 9px; }
.pic-next { right: 9px; }
.pic-dots {
  position: absolute; bottom: 9px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px; z-index: 2;
}
.pic-dots button {
  width: 7px; height: 7px; border-radius: 50%; border: none; padding: 0;
  background: rgba(255,255,255,.38); cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.pic-dots button.active { background: var(--accent); transform: scale(1.35); }

/* 规格说明 spec */
.spec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 12px 0 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--rule-soft);
}
.spec-head h4 { margin: 0; font-size: var(--fs-caption); line-height: 1.2; letter-spacing: 0.05em; font-family: var(--display); font-weight: 400; }
.spec-head a { white-space: nowrap; color: var(--muted); font-size: var(--fs-footnote); text-decoration-color: var(--accent); }

/* 特性列表 */
.annotation-key {
  list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 9px; margin: 0; padding: 0; border-top: 1px solid var(--rule);
}
.annotation-key li {
  display: grid; grid-template-columns: 13px minmax(0, 1fr); align-items: start;
  gap: 5px; padding: 4px 0;
}
.annotation-key p { margin: 0; color: var(--paper); font-size: var(--fs-caption); line-height: 1.3; overflow-wrap: anywhere; }
.annotation-key p strong { display: block; color: var(--accent); margin: 0 0 1px; font-weight: 700; }
.annotation-number {
  display: grid; place-items: center; width: 13px; height: 13px;
  border: 1px solid var(--accent); border-radius: 50%;
  color: var(--paper); font: 700 9px/1 var(--mono);
}

/* 键值规格列表 */
.spec-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 8px; margin: 0; border-top: 1px solid var(--rule);
}
.spec-list div {
  display: grid; align-content: start; gap: 1px; min-width: 0; padding: 4px 1px;
  border-bottom: 1px solid var(--rule);
}
.spec-list dt { color: var(--muted); font-size: var(--fs-caption); }
.spec-list dd { margin: 0; color: var(--paper); font-size: var(--fs-caption); line-height: 1.3; overflow-wrap: anywhere; }
.spec-list div:nth-last-child(1):nth-child(odd) { grid-column: 1 / -1; }

/* 适用人群 */
.uses { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-footnote); }
.uses b { color: var(--accent); margin-right: 4px; }
.us-sizes { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-footnote); line-height: 1.32; }

/* 翻页导航 */
.chapter-links {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 7px clamp(13px,4.4vw,30px);
  background: var(--ground); border-top: 1px solid var(--rule);
}
.chapter-links a { padding-block: 4px; color: var(--link); font-size: var(--fs-footnote); }
.chapter-links a:last-child { text-align: right; }

/* 尺寸表 */
.size-table {
  width: 100%; border-collapse: collapse; margin-top: 6px;
  border: 1px solid var(--rule); font-size: var(--fs-footnote); line-height: 1.3;
  text-align: center;
}
.size-table th, .size-table td { padding: 4px 3px; border: 1px solid var(--rule); }
.size-table th { color: var(--accent); background: var(--surface); font-weight: 700; }
.size-table td { background: var(--field); }

/* 封面标题渐入 */
.cover h1, .cover-sub {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.22,.61,.36,1);
}
.cover h1.in-view, .cover-sub.in-view { opacity: 1; transform: translateY(0); }

/* 产品板块滚动 reveal */
.entry { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.22,.61,.36,1); }
.entry.in-view { opacity: 1; transform: translateY(0); }

/* 主图流动光带 overlay */
.hero-stage { position: relative; isolation: isolate; overflow: hidden; }
.hero-stage img { display: block; width: 100%; height: auto; max-height: 460px; object-fit: cover; object-position: center; }
.hero-stage .light-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  mix-blend-mode: screen; opacity: .85;
  color: var(--glow);
}

@media (prefers-reduced-motion: reduce) {
  .cover h1, .cover-sub { opacity: 1; transform: none; transition: none; }
  .entry { opacity: 1; transform: none; transition: none; }
  .hero-stage .light-overlay { display: none; }
}

footer {
  text-align: center; padding: 40px 20px; color: var(--muted); font-size: var(--fs-footnote);
  border-top: 1px solid var(--rule);
}

/* ============ 移动端适配（手机阅读） ============ */
@media (max-width: 640px) {
  /* 封面：收短高度，减少空白；标题相对更醒目 */
  .cover { min-height: auto; padding-bottom: 28px; }
  .cover h1 { font-size: clamp(26px, 9vw, 32px); line-height: 1.15; }
  .cover-sub { font-size: var(--fs-caption); }
  .cover-foot { flex-direction: column; align-items: flex-start; gap: 6px; }

  /* 目录：保持两列，但项文字更紧凑、价格不换行 */
  .directory ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory a { padding: 9px 10px; }
  .directory small { white-space: nowrap; }

  /* hero 大图：去掉两侧负 margin 溢出，改为全宽安全 */
  .hero-stage, .hero-top { width: auto; margin-inline: 0; }

  /* 事实栏：手机上价格独占一行，其余两两并排 */
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:first-child { grid-column: 1 / -1; border-inline-start: 0; border-bottom: 1px solid var(--rule); }
  .facts div { padding: 6px 10px; }

  /* 多图滑动画廊：移动端保持通栏滑动 */
  .pic-gallery { aspect-ratio: auto; }

  /* 特性列表：两列变单列，更易扫读 */
  .annotation-key { grid-template-columns: 1fr; }
  .spec-list { grid-template-columns: 1fr; }
  .spec-list div:nth-last-child(1):nth-child(odd) { grid-column: auto; }

  /* 翻页：保留左右，但缩短 padding */
  .chapter-links { padding: 10px 16px; }
}

@media print {
  body { background: var(--outer); }
  .catalog { max-width: none; margin: 0; }
  .directory, .chapter-links { display: none; }
  .cover, .hero, .detail { break-after: page; }
}
