/* =====================================================================
   SolidCAM全版本资源分享站  —  全局样式
   风格：深色工业机械风（默认暗黑），支持一键切换浅色模式
   主色：深蓝 #0F2447 ｜ 辅色：金属灰 #333842 ｜ 高亮：银灰 #C8CDD4
   说明：所有颜色集中在变量；[data-theme="dark"](默认) 与 [data-theme="light"] 切换。
   ===================================================================== */

/* ============================ 暗黑模式（默认） ============================ */
:root,
[data-theme="dark"] {
  --sidebar-w:   240px;
  --header-h:    56px;
  --radius:      12px;
  --radius-sm:   8px;

  /* 主内容区背景层次（深蓝黑基调） */
  --bg:          #0a1322;
  --surface:     #10203a;       /* 卡片 / 区块 */
  --surface-2:   #16294a;       /* 次级表面：filter bar / 输入框 / hover */

  /* 侧边栏：主色深蓝 */
  --sidebar-bg:      #0F2447;
  --sidebar-hover:   #1a3358;
  --sidebar-active:  #21407a;
  --sidebar-text:    #C8CDD4;   /* 高亮银灰：导航默认文字 */
  --sidebar-text-2:  #8ea0bd;
  --sidebar-divider: rgba(200,205,212,.10);
  --sidebar-active-text: #fff;

  /* 文字 */
  --text:   #e6ebf2;
  --text-2: #aeb9cb;
  --text-3: #7c8aa0;

  /* 边框 */
  --border:   #21344f;
  --border-2: #34465f;
  --metal:    #333842;          /* 辅色金属灰 */

  /* 强调色 */
  --accent:        #C8CDD4;     /* 高位银灰：主按钮底 */
  --accent-ink:    #0F2447;     /* 银灰按钮上的深蓝文字 */
  --accent-strong: #dfe4ea;     /* 银灰 hover */
  --accent-2:      #7fa8e0;     /* 辅助蓝：链接 / 标签 / focus / 分组线 */
  --hit-ring:      rgba(127,168,224,.28);

  --poster-arrow-bg:        rgba(10,19,34,.6);
  --poster-arrow-bg-hover:  #21407a;

  /* 海报视觉（随主题配色驱动） */
  --pv-bg1:#0b1f3a; --pv-bg2:#0a3a5c; --pv-bg3:#06283d;
  --pv-deco:#67a8e6; --pv-ink:#eaf2ff; --pv-shadow:0 2px 18px rgba(0,0,0,.45);

  --shadow:      0 14px 40px rgba(0,0,0,.45);
  --card-shadow: 0 8px 24px rgba(0,0,0,.35);
}

/* ============================ 浅亮模式（侧边栏跟随变浅） ============================ */
[data-theme="light"] {
  --bg:          #eef1f6;
  --surface:     #ffffff;
  --surface-2:   #f4f6fa;

  /* 侧边栏跟随浅色主题 */
  --sidebar-bg:        #f7f9fc;
  --sidebar-hover:     #e9eef5;
  --sidebar-active:    #dbe5f2;
  --sidebar-active-text:#0F2447;
  --sidebar-text:      #2a3850;
  --sidebar-text-2:    #6b7a90;
  --sidebar-divider:   rgba(15,36,71,.10);

  --text:   #1b2533;
  --text-2: #4a5566;
  --text-3: #8492a6;

  --border:   #d8dee8;
  --border-2: #c1c9d6;
  --metal:    #333842;

  /* 浅色模式下主按钮：中等蓝底 + 白字（不再用深蓝，避免太重） */
  --accent:        #3b6ec4;
  --accent-ink:    #ffffff;
  --accent-strong: #2f5fae;
  --accent-2:      #2f5fae;
  --hit-ring:      rgba(47,95,174,.22);

  --poster-arrow-bg:        rgba(27,37,51,.55);
  --poster-arrow-bg-hover:  #2f5fae;

  /* 海报视觉（浅亮主题：浅色渐变 + 深色文字） */
  --pv-bg1:#e7eefb; --pv-bg2:#cfe0f6; --pv-bg3:#bcd3ee;
  --pv-deco:#2f5fae; --pv-ink:#14233f; --pv-shadow:0 1px 2px rgba(15,36,71,.18);

  --shadow:      0 14px 40px rgba(15,36,71,.12);
  --card-shadow: 0 8px 24px rgba(15,36,71,.08);
}

/* ============================ 高级黑 + 高级橙 ============================ */
[data-theme="orange"] {
  --bg:          #0d0d0f;
  --surface:     #1a1a1d;
  --surface-2:   #232327;

  --sidebar-bg:        #0a0a0c;
  --sidebar-hover:     #2a2a2f;
  --sidebar-active:    #3a2a1a;
  --sidebar-active-text:#fff;
  --sidebar-text:      #e8e3dc;
  --sidebar-text-2:    #a89e92;
  --sidebar-divider:   rgba(255,255,255,.08);

  --text:   #f2ede6;
  --text-2: #b8b0a6;
  --text-3: #7c766d;

  --border:   #2c2c30;
  --border-2: #3a3a40;
  --metal:    #2a2622;

  --accent:        #df5f00;
  --accent-ink:    #1a0f05;
  --accent-strong: #ff7002;
  --accent-2:      #ff7a0b;
  --hit-ring:      rgba(223,95,0,.30);

  --poster-arrow-bg:        rgba(10,10,12,.6);
  --poster-arrow-bg-hover:  #df5f00;

  /* 海报视觉（高级黑 + 橙） */
  --pv-bg1:#15110c; --pv-bg2:#241408; --pv-bg3:#0c0905;
  --pv-deco:#ff8a2a; --pv-ink:#fff4ea; --pv-shadow:0 2px 18px rgba(0,0,0,.5);

  --shadow:      0 14px 40px rgba(0,0,0,.5);
  --card-shadow: 0 8px 24px rgba(0,0,0,.4);
}

/* ============================ 酒红 + 鎏金 ============================ */
[data-theme="wine"] {
  --bg:          #1a0f14;
  --surface:     #251620;
  --surface-2:   #321e29;

  --sidebar-bg:        #160b10;
  --sidebar-hover:     #3a202c;
  --sidebar-active:    #4a2636;
  --sidebar-active-text:#fff;
  --sidebar-text:      #f0e2e6;
  --sidebar-text-2:    #b393a0;
  --sidebar-divider:   rgba(255,255,255,.08);

  --text:   #f3e9ec;
  --text-2: #c2a8b2;
  --text-3: #8a6c77;

  --border:   #3a2330;
  --border-2: #4d3140;
  --metal:    #33232b;

  --accent:        #d4af37;
  --accent-ink:    #2a1a08;
  --accent-strong: #e6c34d;
  --accent-2:      #e8c66a;
  --hit-ring:      rgba(212,175,55,.30);

  --poster-arrow-bg:        rgba(22,11,16,.6);
  --poster-arrow-bg-hover:  #d4af37;

  /* 海报视觉（酒红 + 鎏金） */
  --pv-bg1:#1c0e15; --pv-bg2:#33141f; --pv-bg3:#140a0e;
  --pv-deco:#e8c66a; --pv-ink:#fdeef3; --pv-shadow:0 2px 18px rgba(0,0,0,.5);

  --shadow:      0 14px 40px rgba(0,0,0,.5);
  --card-shadow: 0 8px 24px rgba(0,0,0,.4);
}

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

html { scroll-behavior: smooth; }

/* -------------------- 滚动条：细窄、融入主题 -------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb {
  background: rgba(200,205,212,.25);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(200,205,212,.40);
}
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: rgba(200,205,212,.25) transparent; }

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===================== 左侧深色侧边栏 ===================== */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  z-index: 200;
  display: flex; flex-direction: column;
  transition: transform .25s ease, background-color .25s ease;
}
.sidebar-inner {
  display: flex; flex-direction: column; height: 100%; padding: 20px 0;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 22px 24px; margin-bottom: 8px;
  font-weight: 800; font-size: 18px;
  border-bottom: 1px solid var(--sidebar-divider);
}
.brand-icon {
  width: 72px; height: 72px; display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  overflow: hidden;
}
.brand-icon img { width: 100%; height: 100%; object-fit: cover; }
.brand-text small {
  display: block; font-weight: 500; font-size: 12px; color: var(--sidebar-text-2);
  margin-top: -2px;
}

.side-nav {
  flex: 1; display: flex; flex-direction: column; gap: 4px;
  padding: 0 14px; overflow-y: auto;
}
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-size: 14px; transition: .18s;
}
.side-nav a:hover { background: var(--sidebar-hover); color: var(--sidebar-active-text); }
.side-nav a.active { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

/* 左侧二级导航（目前用于“安装包下载”） */
.nav-group { display: flex; flex-direction: column; }
.nav-group-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-size: 14px; transition: .18s;
  cursor: pointer; user-select: none;
}
.nav-group-toggle:hover { background: var(--sidebar-hover); color: var(--sidebar-active-text); }
.nav-group-toggle.active { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.nav-group-toggle .nav-chevron {
  margin-left: auto; font-size: 11px;
  transition: transform .18s; transform: rotate(0deg);
}
.nav-group.open > .nav-group-toggle .nav-chevron { transform: rotate(90deg); }
.nav-sub {
  display: none; flex-direction: column; gap: 2px;
  padding-left: 8px; margin: 2px 0 4px 22px;
  border-left: 2px solid var(--sidebar-divider);
}
.nav-group.open > .nav-sub { display: flex; }
.nav-sub a {
  padding: 7px 12px; font-size: 12px; color: var(--sidebar-text-2);
}
.nav-sub a:hover { color: var(--sidebar-active-text); background: var(--sidebar-hover); }
.nav-sub a.active { color: var(--sidebar-active-text); background: var(--sidebar-active); }

.sidebar-footer {
  padding: 14px; border-top: 1px solid var(--sidebar-divider); margin-top: auto;
}
.sidebar-footer a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-size: 14px;
}
.sidebar-footer a:hover { background: var(--sidebar-hover); color: var(--sidebar-active-text); }

/* 移动端遮罩 */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 150; opacity: 0; visibility: hidden; transition: .2s;
}
.sidebar-overlay.open { opacity: 1; visibility: visible; }

/* ===================== 右侧主区域 ===================== */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ===================== 顶部标题栏 ===================== */
.top-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  transition: background-color .25s ease, border-color .25s ease;
}
.menu-toggle {
  display: none;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  font-size: 18px; color: var(--text); cursor: pointer;
}
.menu-toggle:hover { background: var(--surface-2); }

/* 手机端顶部导航按钮（首页 / 返回）——默认隐藏，仅移动端显示 */
.header-btn {
  display: none;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: transparent;
  font-size: 17px; color: var(--text); cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.header-btn:active { background: var(--surface-2); transform: scale(.92); }
.header-btn-home { text-decoration: none; }
.header-btn-home:hover { border-color: var(--accent-2); color: var(--accent-2); }
.header-btn-back:hover { border-color: var(--accent-2); color: var(--accent-2); }
.header-btn-text { font-size: 13px; font-weight: 600; white-space: nowrap; line-height: 1; }

/* 配色风格切换器（点击按钮循环切换） */
.style-current {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 18px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: .18s;
}
.style-current:hover { border-color: var(--accent-2); color: var(--accent-2); }
.style-dot {
  width: auto; height: auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
}
.style-dot::before { content: "🎨"; }
.style-chevron { font-size: 12px; opacity: .7; }

.header-search { position: relative; margin-left: auto; }
.header-search input {
  width: 280px; max-width: 40vw; height: 36px; padding: 0 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 18px;
  color: var(--text); font-size: 13px; outline: none; transition: .18s;
}
.header-search input::placeholder { color: var(--text-3); }
.header-search input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--hit-ring); }

.search-results {
  position: absolute; top: 44px; right: 0; width: 320px; max-height: 60vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; z-index: 120;
}
.search-results .sr-item {
  padding: 9px 11px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent;
}
.search-results .sr-item:hover { background: var(--surface-2); border-color: var(--border); }
.search-results .sr-title { font-size: 14px; color: var(--text); }
.search-results .sr-sub { font-size: 12px; color: var(--text-3); }
.search-results .sr-empty { padding: 14px; color: var(--text-3); font-size: 13px; text-align: center; }

/* ===================== 主内容区 ===================== */
.content {
  flex: 1;
  padding: 22px;
  max-width: 1280px; margin: 0 auto; width: 100%;
}

/* ===================== 白色区块卡片（暗色下为深蓝卡片） ===================== */
.content-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  scroll-margin-top: calc(var(--header-h) + 16px);
  display: none; /* 默认隐藏，仅当前选中板块显示 */
  transition: background-color .25s ease, border-color .25s ease;
}
.content-section.active { display: block; }
.section-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.sec-icon { font-size: 20px; }
.section-desc {
  font-size: 14px; color: var(--text-2); margin-bottom: 20px;
}

/* ===================== 首页欢迎卡 ===================== */
.hero-section { padding: 34px; }
.hero-content { max-width: 820px; }
.hero-content h1 {
  font-size: clamp(26px, 4vw, 38px); line-height: 1.25; font-weight: 800;
  margin-bottom: 0; color: var(--text);
}
/* ===================== 首页海报轮播 ===================== */
.poster-carousel {
  position: relative; margin-top: 26px;
  width: 100%; aspect-ratio: 2.6 / 1;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
}
.poster-track {
  display: flex; height: 100%;
  transition: transform .55s cubic-bezier(.4, 0, .2, 1);
}
.poster-slide {
  position: relative; overflow: hidden;
  flex: 0 0 100%; height: 100%;
  display: flex; align-items: center;
  opacity: 1; transition: opacity .55s ease;
  /* 主题驱动渐变 + 缓慢漂移 */
  background: linear-gradient(125deg, var(--pv-bg1) 0%, var(--pv-bg2) 58%, var(--pv-bg3) 100%);
  background-size: 220% 220%;
}
.poster-slide.is-active {
  opacity: 1;
  animation: pvDrift 18s ease-in-out infinite;
}
@keyframes pvDrift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
/* 左右箭头 */
.poster-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--poster-arrow-bg);
  color: #fff; font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: .2s; backdrop-filter: blur(4px);
}
.poster-carousel:hover .poster-arrow { opacity: 1; }
.poster-arrow:hover { background: var(--poster-arrow-bg-hover); border-color: var(--accent-2); }
.poster-arrow.prev { left: 14px; }
.poster-arrow.next { right: 14px; }
/* 圆点指示 */
.poster-dots {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 2;
}
.poster-dot {
  width: 9px; height: 9px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(200, 205, 212, .4); padding: 0; transition: .2s;
}
.poster-dot.active { background: var(--accent); width: 22px; border-radius: 5px; }

/* ===================== 代码海报（纯 CSS+SVG 视觉卡片，随主题配色） ===================== */
/* 背景渐变与点缀色由主题变量 --pv-* 驱动；各 variant 仅用 --pv-rot 色相旋转彼此区分 */
.pv-hero  { --pv-rot:   0deg; }
.pv-axis5 { --pv-rot:  35deg; }
.pv-imach { --pv-rot: -25deg; }
.pv-hsm   { --pv-rot:  60deg; }
.pv-swiss { --pv-rot:  15deg; }
.pv-sim   { --pv-rot: 110deg; }

/* 网格底纹（右侧径向淡出，随主题文字色自适应） */
.pv-grid {
  position: absolute; inset: 0; opacity: .07; pointer-events: none; color: var(--pv-ink);
  background-image:
    linear-gradient(currentColor 1px, transparent 1px),
    linear-gradient(90deg, currentColor 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(circle at 72% 50%, #000 0%, transparent 78%);
          mask-image: radial-gradient(circle at 72% 50%, #000 0%, transparent 78%);
}
/* 浮游光晕（双球缓慢游动，营造能量场） */
.pv-aura { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.pv-aura::before, .pv-aura::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(10px);
  background: radial-gradient(circle, color-mix(in srgb, var(--pv-deco) 50%, transparent) 0%, transparent 70%);
}
.pv-aura::before { width: 42%; height: 42%; left: 6%; top: 14%; animation: pvFloat1 11s ease-in-out infinite; }
.pv-aura::after  { width: 30%; height: 30%; right: 28%; bottom: 10%; animation: pvFloat2 14s ease-in-out infinite; }
@keyframes pvFloat1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(22px,-18px) scale(1.18); } }
@keyframes pvFloat2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-18px,16px) scale(1.12); } }

/* 专属 SVG 装饰：右侧旋转光环（正向）+ 反向外环 + 发光 */
.pv-deco {
  position: absolute; right: 2%; top: 50%; transform: translateY(-50%);
  width: min(46%, 320px); aspect-ratio: 1 / 1; opacity: .62;
  color: var(--pv-deco); pointer-events: none;
  filter: drop-shadow(0 0 14px var(--pv-deco)) hue-rotate(var(--pv-rot));
}
.pv-deco::before {
  content: ""; position: absolute; inset: -7%; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 68%, color-mix(in srgb, var(--pv-deco) 65%, transparent) 84%, transparent 100%);
  -webkit-mask: radial-gradient(circle, transparent 57%, #000 60%, #000 73%, transparent 76%);
          mask: radial-gradient(circle, transparent 57%, #000 60%, #000 73%, transparent 76%);
  animation: pvSpinRev 22s linear infinite; opacity: .8;
}
.pv-svg { width: 100%; height: 100%; animation: pvSpin 18s linear infinite; transform-origin: center; }
@keyframes pvSpin { to { transform: rotate(360deg); } }
@keyframes pvSpinRev { to { transform: rotate(-360deg); } }

/* 激活时斜向流光扫过 */
.pv-shine { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.pv-shine::before {
  content: ""; position: absolute; top: -50%; left: -60%; width: 50%; height: 200%;
  background: linear-gradient(115deg, transparent 0%, color-mix(in srgb, var(--pv-ink) 38%, transparent) 50%, transparent 100%);
  transform: translateX(-150%) rotate(8deg); opacity: 0;
}
.poster-slide.is-active .pv-shine::before { animation: pvShine 3.4s ease-in-out .35s infinite; }
@keyframes pvShine {
  0%   { transform: translateX(-150%) rotate(8deg); opacity: 0; }
  18%  { opacity: 1; }
  60%  { transform: translateX(360%) rotate(8deg); opacity: 1; }
  100% { transform: translateX(360%) rotate(8deg); opacity: 0; }
}

/* 文案内容（左对齐，居中于卡片） */
.pv-content {
  position: relative; z-index: 2;
  padding: 0 clamp(18px, 3vw, 40px) 0 clamp(52px, 7vw, 72px);
  max-width: 58%; color: var(--pv-ink);
}
.pv-eyebrow {
  display: inline-block; font-size: clamp(10px, 1.1vw, 12px); letter-spacing: .18em;
  font-weight: 700; color: var(--pv-deco); margin-bottom: 10px;
  text-transform: none; filter: hue-rotate(var(--pv-rot));
}
.pv-title {
  margin: 0; font-weight: 800; line-height: 1.12;
  font-size: clamp(20px, 3.4vw, 40px);
  text-shadow: var(--pv-shadow);
}
.pv-sub {
  margin: 12px 0 0; max-width: 30em; line-height: 1.5;
  font-size: clamp(12px, 1.5vw, 16px);
  color: var(--pv-ink); opacity: .82;
}
.pv-cta {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 18px;
  padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--pv-ink); text-decoration: none; border: 1px solid var(--pv-deco);
  background: rgba(255,255,255,.05);
  transition: background .25s, transform .2s, box-shadow .25s;
  filter: hue-rotate(var(--pv-rot));
}
.pv-cta:hover {
  background: var(--pv-deco); color: #fff; transform: translateY(-1px);
  box-shadow: 0 6px 22px color-mix(in srgb, var(--pv-deco) 55%, transparent);
}

/* 进入动画：仅当前 slide 播放（缩放 + 上浮） */
.poster-slide.is-active .pv-content { animation: pvIn .65s cubic-bezier(.2,.7,.2,1) both; }
@keyframes pvIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
/* 移动端：拉高卡片、文案占满、装饰缩到背景 */
@media (max-width: 960px) {
  .poster-carousel { aspect-ratio: 2 / 1; }
  .poster-arrow { display: none !important; } /* 手机端隐藏箭头，改用滑动 */
  .pv-content { max-width: 82%; }
  .pv-aura { display: none; }            /* 小屏去掉浮游光晕，减负 */
  .pv-deco { width: min(60%, 260px); opacity: .4; }
}
@media (max-width: 640px) {
  .poster-carousel { aspect-ratio: 1.5 / 1; }
  .pv-content { max-width: 100%; padding: 0 18px; }
  .pv-sub { display: none; }            /* 小屏只留标题+CTA，避免拥挤 */
  .pv-eyebrow { margin-bottom: 6px; }
  .pv-cta { margin-top: 12px; padding: 6px 14px; font-size: 13px; }
  .pv-deco { opacity: .25; }
}

/* ===================== 按钮 ===================== */
.btn-primary, .btn-ghost, .btn-download {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 20px; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: .18s; font-size: 14px; font-family: inherit;
}
.btn-primary {
  padding: 10px 24px; color: var(--accent-ink);
  background: var(--accent);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost {
  padding: 10px 24px; color: var(--text-2); background: transparent;
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); }
.btn-download {
  margin-top: 14px; padding: 9px 16px; color: var(--accent-ink); width: 100%;
  background: var(--accent); border-radius: var(--radius-sm);
}
.btn-download:hover { background: var(--accent-strong); }

/* ===================== 子分组标题 ===================== */
.cat { margin-bottom: 24px; }
.cat:last-child { margin-bottom: 0; }
.subgroup { margin-bottom: 22px; }
.subgroup-label {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 14px; padding-left: 10px; border-left: 3px solid var(--accent-2);
}
.subgroup-title {
  font-size: 14px; font-weight: 700; color: var(--accent-2);
  margin: 14px 0 12px; padding-left: 10px; border-left: 3px solid var(--accent-2);
}
.empty-tip {
  color: var(--text-3); font-size: 13px; padding: 14px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* ===================== 资源卡片网格 ===================== */
.card-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* 后处理库：所有后处理卡片固定一排 3 个横向排列 */
.post-card-grid {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1024px) {
  .post-card-grid { grid-template-columns: repeat(2, 1fr); }
}
.card {
  position: relative; padding: 18px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform .18s, border-color .18s, box-shadow .18s, background-color .25s ease;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-3px); border-color: var(--border-2);
  box-shadow: var(--card-shadow);
}
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tag {
  font-size: 12px; font-weight: 700; color: #fff; padding: 3px 10px; border-radius: 20px;
  background: var(--accent-2);
}
.badge {
  font-size: 11px; color: var(--accent-2); border: 1px solid var(--accent-2);
  padding: 2px 8px; border-radius: 20px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.card-desc { font-size: 13px; color: var(--text-2); flex: 1; line-height: 1.6; }
.card-meta { font-size: 12px; color: var(--text-3); margin-top: 10px; }

/* 预留空白卡 */
.card.placeholder {
  border-style: dashed; border-color: var(--border);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, transparent 10px 20px);
  align-items: center; justify-content: center; text-align: center; color: var(--text-3);
  min-height: 140px;
}
.ph-inner { font-size: 14px; font-weight: 600; }
.ph-inner small { display: block; font-weight: 400; font-size: 12px; margin-top: 6px; }

/* 高亮（搜索命中） */
.card.hit { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--hit-ring); }

/* ===================== 联系作者 ===================== */
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px;
}
.contact-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 24px; text-align: center;
}
.contact-card h3 { font-size: 17px; margin-bottom: 12px; color: var(--text); }
.contact-desc { color: var(--text-2); font-size: 14px; margin-bottom: 16px; }
.contact-desc strong { color: var(--text); }
.qr-wrap {
  max-width: 150px; margin: 0 auto 12px;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); background: #fff;
}
.qr-wrap img { width: 100%; display: block; }
.qr-tip { font-size: 13px; color: var(--text-3); margin-top: 10px; }
#qq-link { margin-top: 8px; padding: 10px 26px; border-radius: 20px; display: inline-flex; }

/* ===================== 页脚 ===================== */
.footer {
  border-top: 1px solid var(--border); background: var(--surface);
  margin-top: auto;
  transition: background-color .25s ease, border-color .25s ease;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto; padding: 22px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 13px; color: var(--text-3);
}

/* ===================== 手机端首页快捷入口（六宫格） ===================== */
.home-quick-links {
  display: none;
  margin-top: 24px;
  gap: 12px;
}
.home-quick-links .hql-item {
  flex: 1 1 calc(50% - 6px);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 16px 10px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600;
  color: var(--text-2); text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all .2s ease;
  white-space: nowrap;
}
.home-quick-links .hql-item:hover,
.home-quick-links .hql-item:active {
  color: var(--accent);
  border-color: var(--accent);
  background: transparent;
}

/* 可展开的网格项（软件安装包 / 后处理） */
.hql-expand {
  flex: 1 1 calc(50% - 6px);
  display: flex;
  flex-direction: column;
}
.hql-expand .hql-trigger {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 16px 10px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 600; font-family: inherit;
  color: var(--text-2); text-decoration: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.hql-expand .hql-trigger::after {
  content: "▾"; font-size: 11px; opacity: .6; margin-left: 2px; transition: transform .2s ease;
}
.hql-expand[aria-expanded="true"] .hql-trigger::after {
  transform: rotate(180deg);
}
.hql-expand .hql-trigger:hover,
.hql-expand[aria-expanded="true"] .hql-trigger {
  color: var(--accent);
  border-color: var(--accent);
  background: transparent;
}
.hql-sub {
  display: none;
  margin-top: 6px;
  gap: 8px;
}
.hql-expand[aria-expanded="true"] .hql-sub {
  display: flex;
  flex-wrap: wrap;
}
.hql-sub-item {
  flex: 1 1 calc(50% - 4px);
  display: flex; align-items: center; justify-content: center;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600;
  color: var(--text-2); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border);
  transition: all .15s ease;
  white-space: nowrap;
}
.hql-sub-item:hover,
.hql-sub-item:active {
  color: var(--accent);
  border-color: var(--accent);
  background: transparent;
}

@media (max-width: 960px) {
  .home-quick-links { display: flex; flex-wrap: wrap; }
}

/* ===================== 响应式：手机/平板 ===================== */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }

  /* 手机端顶部栏：左右按钮 + 中间内容居中 */
  .top-header {
    justify-content: space-between;
    padding: 0 10px; gap: 8px;
  }
  .header-btn {
    display: flex;              /* 显示首页/返回按钮 */
    width: auto;                /* 含文字后不再固定方块 */
    height: 34px; padding: 0 10px; gap: 4px;
    border-radius: 17px;        /* 药丸形 */
    font-size: 15px;
  }
  .header-btn-text { font-size: 13px; }
  .header-search { flex: 1 1 auto; min-width: 0; max-width: 32vw; margin-left: 0; } /* 搜索框再收窄 */
  .header-search input { width: 100%; max-width: none; }
  .style-current { padding: 0 10px; gap: 5px; }
  .style-label { display: inline; font-size: 12px; font-weight: 600; } /* 手机端也显示主题名称 */
  .style-chevron { font-size: 11px; }

  .content { padding: 16px; }
  .content-section { padding: 20px; }
}

@media (max-width: 640px) {
  .top-header { padding: 0 8px; gap: 6px; }
  .header-btn { height: 32px; padding: 0 8px; font-size: 14px; gap: 3px; } /* 保持药丸形，仅缩小 */
  .header-btn-text { font-size: 12px; }
  .header-search { max-width: 28vw; }
  .style-current { padding: 0 8px; gap: 3px; }
  .style-label { font-size: 11px; }
  .search-results { width: 92vw; right: -8px; }
  .hero-section { padding: 22px; }
  .content { padding: 12px; }
  .content-section { padding: 16px; margin-bottom: 14px; }
  .card-grid { grid-template-columns: 1fr; }
  .post-card-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ===================== 手机端悬浮返回首页按钮 ===================== */
.mobile-fab-back {
  display: none; /* 默认隐藏，仅手机端显示 */
  position: fixed; z-index: 200;
  right: 18px; bottom: 24px;
  display: none; /* JS 控制显隐：滚动超过首屏才出现 */
  opacity: 0; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.mobile-fab-back.visible {
  display: flex; align-items: center; gap: 6px;
  opacity: 1; transform: translateY(0);
  pointer-events: auto;
}
.mobile-fab-back {
  height: 42px; padding: 0 16px;
  border-radius: 22px;
  background: var(--accent); color: var(--accent-ink, #fff);
  border: none; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.3), 0 2px 4px rgba(0,0,0,.15);
  text-decoration: none; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.mobile-fab-back:active { transform: scale(.95); }
.fab-icon { font-size: 16px; line-height: 1; }
.fab-text { font-size: 13px; }

@media (max-width: 960px) {
  .mobile-fab-back { display: none; } /* 基础状态：由 JS 控制 visible 类 */
}
