/* ============================================================
   WEVI — 公共样式
   从 website/ 各页内联 <style> 抽取合并。
   设计令牌与静态站保持一致（见 docs/开发指导文档.md §1.4）
   ============================================================ */

@import url('../fonts/fonts.css');

/* ---------- 设计令牌 ----------
   ⚠️ 下面这个 @theme 是**无效的**：Tailwind 浏览器构建版只解析文档内联的
   <style type="text/tailwindcss">，不会去读外部 CSS。真身在 templates/base.html。
   这里保留一份是为了让颜色有个集中的说明书；改色时**两处都要改**。
   :root 里那份是给 site.css 自己的 var(--color-*) 用的，那个是真生效的。 */
@theme {
  --color-primary: #000000;
  --color-accent:          #16537f;
  --color-accent-on-dark:  #7FB2D9;
  --color-danger:  #c51c2c;
  --color-surface: #f6f6f6;
  --color-muted:   #666666;
  --color-subtle:  #333333;
  --font-display:  'Poppins', sans-serif;
  --font-body:     'DM Sans', sans-serif;
}

:root {
  --color-primary: #000000;
  --color-accent:          #16537f;
  --color-accent-on-dark:  #7FB2D9;
  --color-danger:  #c51c2c;
  --color-surface: #f6f6f6;
  --color-muted:   #666666;
  --color-subtle:  #333333;
}

/* ---------- 字体 ---------- */
.font-display { font-family: 'Poppins', sans-serif; }
.font-body    { font-family: 'DM Sans', sans-serif; }

body {
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- 滚动条 ---------- */
* {
  scrollbar-width: none;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- 入场动画（原静态站的 .reveal）---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- 产品卡 ---------- */
.product-card { transition: box-shadow .3s ease, transform .3s ease; }
.product-card:hover { box-shadow: 0 20px 40px rgba(0, 0, 0, .12); transform: translateY(-4px); }
.product-card:hover .product-img { transform: scale(1.06); }

/* ---------- 产品卡：上下白雾 ---------- */
/* 列表卡图片上下边缘各 10px 白雾，让图边融入卡片白底（需求定：纯白、固定 10px、
   紧挨图片上下边）。用 ::after 叠加渐变而非 filter:blur：不碰图片文件、
   不模糊产品像素、无每卡 GPU 开销。层放在 .product-img 内，hover 缩放时
   雾跟图一起走，始终贴图边；New/W 徽标是画框的兄弟节点、DOM 在后，不会被盖。 */
.product-img::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, #ffffff 0, rgba(255, 255, 255, 0) 10px),
    linear-gradient(to top, #ffffff 0, rgba(255, 255, 255, 0) 10px);
}

/* ---------- 分类 tab ---------- */
.category-tab { transition: all .2s ease; }
.category-tab.active { color: #000; border-color: #16537f; }
.category-tab:hover { color: #000; }

/* ---------- 详情页：缩略图选中态 ---------- */
/* JS 只切 .is-active，配色集中在这里，改设计只动一处。
   照静态站 product-vt-g100.html 的 .thumb-active：常态不画边框，选中时用
   outline 画在**框外**（offset 2px），不占位、也不把选中那张的图挤小。
   原来写成 border-color 系：四张全挂一圈灰边，且选中那张内侧少一圈像素，
   比其它三张小一号 —— 静态站没有这圈边，所以换成 outline。
   常态保留 2px 透明 outline，避免 hover/选中时出现宽度突变。 */
.thumb { outline: 2px solid transparent; outline-offset: 2px;
         transition: outline-color .2s ease, opacity .2s ease; }
.thumb:hover { opacity: .8; }
.thumb.is-active { outline-color: #16537f; }

/* ---------- 详情页：主图悬停放大 ---------- */
/* 照静态站 .product-img-wrap:hover .product-main-img。画框已有 overflow-hidden，
   放大部分会被圆角裁掉，不会溢出；配合模板里的 cursor-crosshair 与右下角
   「Hover to zoom」提示一起用（见 products/detail.html 的 .main-img-wrap）。 */
.main-img { transition: transform .4s cubic-bezier(.25, .46, .45, .94); }
.main-img-wrap:hover .main-img { transform: scale(1.06); }

/* ---------- 详情页：颜色色块选中态 ---------- */
/* 和 .thumb 一样，JS 只切 .is-active。
   选中态用外圈描边（offset 让描边和色块之间留一道白），而不是改色块本身 ——
   色块的颜色是数据，不能被选中态篡改。
   .is-light 由模板按色值加：白/米/透明这类亮色在白底上没有边界，必须补内描边。 */
.color-swatch { transition: outline-color .18s ease, transform .18s ease; }
.color-swatch.is-light { box-shadow: inset 0 0 0 1px #d0d0d0; }
.color-swatch:hover { transform: scale(1.08); }
.color-swatch.is-active { outline: 2px solid #000; outline-offset: 3px; }

/* .variant-btn（首屏接口变体按钮）连同 site.js 的 selectVariant 一起删掉了：
   那块按《详情页面说明》首屏的信息清单属于多余，已从详情页移除。
   列表页的产品卡仍会显示 ProductVariant 的名字，但用的是它自己那套 span 样式。 */

/* ---------- FAQ 手风琴 ---------- */
/* 显隐由 JS 切 Tailwind 的 .hidden 控制；
   这里不要再写 display:none，否则元素永远显示不出来 */
.faq-item .faq-answer { transition: none; }
.faq-item svg { transition: transform .3s ease; }

/* ---------- 表单错误 ---------- */
.form-error { color: #c51c2c; font-size: 12px; margin-top: 4px; }
.form-errorlist { list-style: none; padding: 0; margin: 4px 0 0; }

/* ---------- 富文本正文（CKEditor 输出）---------- */
.rich-text { line-height: 1.75; color: #333; }
.rich-text h2 { font-size: 24px; font-weight: 700; margin: 1.4em 0 .6em; color: #000; }
.rich-text h3 { font-size: 19px; font-weight: 600; margin: 1.2em 0 .5em; color: #000; }
.rich-text p  { margin: 0 0 1em; }
.rich-text ul { list-style: disc; padding-left: 1.4em; margin: 0 0 1em; }
.rich-text ol { list-style: decimal; padding-left: 1.4em; margin: 0 0 1em; }
.rich-text li { margin: .3em 0; }
.rich-text img { max-width: 100%; height: auto; border-radius: 12px; margin: 1em 0; }
.rich-text table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.rich-text th, .rich-text td { border: 1px solid #e8e8e8; padding: 10px 14px; text-align: left; }
.rich-text th { background: #f6f6f6; font-weight: 600; }
.rich-text a { color: #c51c2c; text-decoration: underline; }

/* ---------- 详情页锚点导航 ---------- */
/* 站内固定导航高 72px，锚点条本身约 60px：不加 scroll-margin 的话，
   跳过去的板块标题会被这两条压在下面，落点看不见标题。 */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.anchor-target { scroll-margin-top: 148px; }

.anchor-link {
  color: #666; white-space: nowrap;
  padding-bottom: 2px; border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.anchor-link:hover { color: #000; }
.anchor-link.is-active { color: #000; border-bottom-color: var(--color-accent); }

/* Inquiry 是这一条里的动作项，不是章节索引：常态就带色，
   选中态保持同色（不能落回上面那条的 #000，否则唯一一个彩色入口
   恰好在读者滚到它时才褪成灰黑）。 */
.anchor-link-cta { color: var(--color-accent); }
.anchor-link-cta:hover,
.anchor-link-cta.is-active { color: var(--color-accent); }
.anchor-link-cta.is-active { border-bottom-color: var(--color-accent); }

/* 详情页底部的询盘表单铺在深色区上，字段换成深色版。
   选择器写成 form.form-dark … 是为了压过 Field 上的 Tailwind 工具类
   （.focus:border-accent 的优先级是 0,2,0，单写 .form-dark input:focus 不够）。 */
form.form-dark input, form.form-dark textarea, form.form-dark select {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .16);
  color: #fff;
}
form.form-dark input::placeholder, form.form-dark textarea::placeholder {
  color: rgba(255, 255, 255, .38);
}
form.form-dark input:focus, form.form-dark textarea:focus {
  border-color: var(--color-accent-on-dark);
  box-shadow: 0 0 0 3px rgba(127, 178, 217, .22);
}
form.form-dark .form-error { color: #ff9a9a; }
/* 必填星号用的是 .text-danger(#c51c2c)，压黑底只有 3.6:1，
   和同一块里的 .form-error 一样提亮到 #ff9a9a。 */
form.form-dark .text-danger { color: #ff9a9a; }

/* ---------- 详情设计图落位（detail_design/ 的生图）----------
   这些图是自带标题与标注的整幅信息图，不是普通配图：图里最小的标注字在
   1376px 原图里约 30px，铺到 280px 宽就只剩 6px，读不出来。
   所以一律整幅满宽，不做并排、不再额外收窄。 */
.rich-text .detail-figure { margin: 2rem 0; }
.rich-text .detail-figure img { width: 100%; margin: 0; display: block; }

/* ---------- 打印 ---------- */
@media print {
  nav, footer, .no-print { display: none !important; }
}
