/* 剑鸿阁家具 · 电子图册网站样式
 *
 * 视觉沿用已人工验收通过的小程序版本：
 *   配色：商标墨棕 #583524 / 图册封面深红 #892A32 / 纸面暖白 #FAF8F5
 *   层级、圆角、留白、图片比例均按小程序 750rpx 设计稿折算（1rpx = 0.5px）
 *
 * 移动优先：默认按 375px 手机宽度排布，再用 min-width 媒体查询逐级放大。
 * 不使用 CSS 框架，避免为了四个页面引入构建工具。
 */

:root {
  --ink: #583524;
  --accent: #892A32;
  --paper: #FAF8F5;
  --text: #2B2320;
  --text-sub: #6B5F56;
  --muted: #8A7F76;
  --faint: #A79B92;
  --line: #EFE9E3;
  --line-soft: #EDE6E0;
  --img-bg: #F1ECE7;
  --white: #fff;

  --radius-card: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 3px 12px rgba(88, 53, 36, .06);

  --page-pad: 12px;      /* 小程序 24rpx */
  --gap: 12px;           /* 小程序 24rpx */
  --header-h: 48px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;   /* 微信内横屏不放大字体 */
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-size: 14px;                   /* 小程序 28rpx */
  line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
               "Microsoft YaHei", Arial, sans-serif;
  /* 防止长型号/长地址把页面撑出横向滚动 */
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }

/* 可点击元素的最小触控尺寸（手机上按钮难点的问题） */
.tap {
  min-height: 44px;
  display: flex;
  align-items: center;
}

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* 内容宽度：手机上满宽，桌面居中，不做"桌面版缩小" */
.page {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 24px;
}

.boot {
  padding: 80px 20px;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
}
/* 脚本没跑起来时的兜底提示：给出可能原因、重试按钮与诊断信息 */
.boot-error { padding: 48px 24px; color: var(--text-sub); }
.boot-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.boot-hint { font-size: 13px; line-height: 1.7; margin-bottom: 16px; }
.boot-error .btn { margin: 0 auto; }
.boot-diag {
  margin-top: 24px;
  padding: 12px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-all;
}

/* 免费托管实例休眠后首次访问要等它启动，用这个提示告诉客户"正在打开" */
.slow-note {
  position: fixed;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(43, 35, 32, .86);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.slow-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.noscript {
  margin: 40px 20px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius-card);
  color: var(--text-sub);
}

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--header-h);
  padding: 0 8px;
  background: rgba(250, 248, 245, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-back {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; color: var(--ink);
  border-radius: 50%;
}
.topbar-back:active { background: rgba(88, 53, 36, .07); }
.topbar-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- 通用 */
.card {
  background: var(--white);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.muted { color: var(--muted); font-size: 12px; }
.model {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .5px;
}
.divider { height: 1px; background: var(--line); margin: 12px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-pill);
  font-size: 14px; cursor: pointer; background: none;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:active { background: #47291c; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-soft); }
.btn-danger { background: var(--accent); color: #fff; }
.btn:disabled { opacity: .5; }

/* ---------------------------------------------------------------- 首页 */
.brand {
  padding: 28px var(--page-pad) 20px;   /* 小程序 56/40rpx */
  text-align: center;
}
.brand-logo { width: 100px; height: 100px; margin: 0 auto; }
.brand-name {
  margin-top: 10px;
  font-size: 23px; font-weight: 600; letter-spacing: 3px; color: var(--ink);
}
.brand-en {
  margin-top: 4px;
  font-size: 11px; letter-spacing: 1.5px; color: var(--faint);
  word-break: break-word;
}
.brand-slogan { margin-top: 10px; font-size: 13px; color: var(--text-sub); }
.brand-rule { width: 60px; height: 1px; background: #D8CEC6; margin: 14px auto 0; }

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 4px 16px 10px;
}
.section-title-text { font-size: 15px; font-weight: 600; }
.section-title-sub { font-size: 11px; color: var(--faint); }

.series-card {
  position: relative;
  display: flex; align-items: center;
  margin: 0 var(--page-pad) var(--gap);
}
.series-card:active { transform: scale(.995); }
.series-cover {
  width: 100px; height: 100px; flex: 0 0 100px;
  background: var(--img-bg); object-fit: cover;
}
.series-cover-empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--line); padding: 6px;
}
.series-cover-text { font-size: 12px; color: #A08D80; text-align: center; line-height: 1.5; }
.series-meta { flex: 1; min-width: 0; padding: 0 10px; }
.series-name { font-size: 17px; font-weight: 600; }
.series-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.series-count {
  display: inline-block; margin-top: 7px;
  font-size: 11px; color: var(--accent);
  background: rgba(137, 42, 50, .08);
  border-radius: var(--radius-pill); padding: 2px 8px;
}
.chevron {
  flex: 0 0 20px; width: 20px; height: 20px; margin-right: 6px;
  color: #C3B5AB; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

.contact {
  display: flex; align-items: center;
  margin: 4px var(--page-pad) 16px; padding: 16px 12px;
}
.contact-main { flex: 1; min-width: 0; }
.contact-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.contact-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }

.footer {
  text-align: center; padding: 8px 16px 20px;
  font-size: 12px; color: var(--faint); line-height: 1.7;
}

/* ---------------------------------------------------------------- 系列页 */
.head { padding: 22px 16px 20px; color: #fff; }
.head-name { font-size: 22px; font-weight: 600; letter-spacing: 1px; }
.head-sub { margin-top: 5px; font-size: 12px; opacity: .85; }
.head-count { margin-top: 9px; font-size: 11px; opacity: .75; }

.chips {
  display: flex; gap: 8px;
  padding: 12px var(--page-pad) 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* 横向滚动条本身要能被裁切：否则子项会撑出整页宽度，手机上一划就整页左右晃 */
  max-width: 100%;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  /* 触控目标不小于 32px，手指点得准 */
  min-height: 34px;
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: #fff; color: var(--text-sub); font-size: 13px;
  border: 1px solid var(--line-soft); cursor: pointer; white-space: nowrap;
}
.chip-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-count { margin-left: 4px; font-size: 10px; opacity: .7; }

.search {
  display: flex; align-items: center;
  margin: 6px var(--page-pad) 2px; padding: 0 12px;
  height: 38px; background: #fff;
  border-radius: var(--radius-pill); border: 1px solid var(--line-soft);
}
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  font-size: 13px; color: var(--text);
}
.search-clear {
  min-height: 32px; padding: 0 4px 0 8px;
  display: inline-flex; align-items: center;
  font-size: 12px; color: var(--accent);
  background: none; border: 0; cursor: pointer;
}

.notice {
  margin: 8px var(--page-pad) 0; padding: 10px 12px;
  background: rgba(137, 42, 50, .06); border-radius: 6px;
  color: #8A6A63; font-size: 11px; line-height: 1.7;
}

.list { padding: 10px var(--page-pad) 0; }
.item { display: flex; margin-bottom: var(--gap); }
.item-img {
  width: 150px; height: 150px; flex: 0 0 150px;
  background: var(--img-bg); object-fit: cover;
}
.item-img-empty {
  display: flex; align-items: center; justify-content: center;
}
.item-img-text {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 17px; color: #C3B5AB;
}
.item-body { flex: 1; min-width: 0; padding: 12px 12px 12px 10px; }
.item-model { font-size: 18px; }
.item-meta { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px; color: var(--ink);
  background: rgba(88, 53, 36, .08);
  border-radius: 3px; padding: 2px 6px;
}
.item-material { margin-top: 6px; font-size: 12px; color: var(--muted); }
.item-spec { margin-top: 4px; font-size: 12px; color: var(--muted); }
.item-more { margin-top: 8px; font-size: 11px; color: var(--accent); }

.load-more, .list-sentinel {
  padding: 16px 0; text-align: center;
  color: var(--faint); font-size: 12px;
}
/* "看更多"按钮在 .list-sentinel 里（不是 .load-more），两个都要覆盖到，
   否则手机上按钮只有 25px 高，手指很难点中 */
.load-more button, .list-sentinel button {
  min-height: 40px; padding: 8px 22px;
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: var(--radius-pill);
  font-size: 13px; color: var(--ink); cursor: pointer;
}
.load-more button:disabled, .list-sentinel button:disabled { opacity: .6; }

/* ---------------------------------------------------------------- 产品详情 */
.gallery { position: relative; background: var(--bg-soft, #F1ECE7); }
/* 详情图多为 3:4 竖图：竖向排列完整显示，不裁切、不缩小 */
.gallery-stack { display: block; }
.gallery-img {
  display: block;
  width: 100%;
  height: auto;              /* 保持原图比例 */
  background: var(--img-bg);
  cursor: zoom-in;
}
.gallery-empty {
  width: 100%; aspect-ratio: 3 / 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.gallery-empty-model {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 30px; color: #C3B5AB;
}
.gallery-empty-text { font-size: 12px; color: var(--faint); }
.counter {
  position: absolute; right: 12px; top: 12px;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: rgba(43, 35, 32, .5); color: #fff; font-size: 11px;
}
.zoom-hint {
  display: block;
  padding: 8px 12px;
  text-align: center;
  background: rgba(43, 35, 32, .04);
  color: var(--muted); font-size: 12px;
}
.dots {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 5px;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(43, 35, 32, .25);
}
.dot-on { background: var(--ink); }

.info { margin: var(--gap); padding: 16px 14px; }
.model-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.info-model { font-size: 23px; }
.row { display: flex; align-items: flex-start; padding: 7px 0; }
.row-label { width: 90px; flex: 0 0 90px; color: var(--muted); font-size: 13px; }
.row-value { flex: 1; min-width: 0; font-size: 14px; word-break: break-word; }
.variant-note {
  margin-top: 10px; padding: 8px 10px;
  background: var(--paper); border-radius: 6px;
  color: var(--text-sub); font-size: 12px;
}
.info-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------------------------------------------------------------- 关于页 */
.about-hero { padding: 24px 16px 8px; text-align: center; }
.about-logo { width: 84px; height: 84px; margin: 0 auto; }
.about-card { margin: 0 var(--page-pad) var(--gap); padding: 16px 14px; }
.about-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.about-row { display: flex; align-items: flex-start; padding: 7px 0; }
.about-label { width: 76px; flex: 0 0 76px; color: var(--muted); font-size: 13px; }
.about-value { flex: 1; font-size: 14px; word-break: break-word; }
.phone-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 600; font-size: 16px;
}

/* ---------------------------------------------------------------- 状态页 */
.state { padding: 60px 24px; text-align: center; color: var(--muted); }
.state-emoji { font-size: 40px; margin-bottom: 8px; }
.state-title { font-size: 15px; font-weight: 600; color: var(--text-sub); margin: 0 0 6px; }
.state-text { font-size: 13px; margin: 0 0 16px; }
.state-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.skeleton { padding: var(--page-pad); }
.skeleton-row {
  height: 150px; margin-bottom: var(--gap);
  border-radius: var(--radius-card);
  background: linear-gradient(90deg, #F1ECE7 25%, #F7F3EF 37%, #F1ECE7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ---------------------------------------------------------------- 图片查看器 */
.viewer {
  position: fixed; inset: 0; z-index: 100;
  background: #16110E;
  display: flex; flex-direction: column;
  touch-action: none;
}
.viewer-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; color: #fff; font-size: 13px;
  padding-top: calc(8px + env(safe-area-inset-top));
}
.viewer-close {
  width: 40px; height: 40px; border: 0; background: none; color: #fff;
  font-size: 24px; line-height: 1; cursor: pointer;
}
.viewer-stage {
  flex: 1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.viewer-img {
  max-width: 100%; max-height: 100%;
  transform-origin: center center;
  transition: transform .12s ease-out;
  will-change: transform;
  user-select: none; -webkit-user-drag: none;
}
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.viewer-nav[disabled] { opacity: .25; }
.viewer-prev { left: 8px; }
.viewer-next { right: 8px; }
.viewer-tip {
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  text-align: center; color: rgba(255, 255, 255, .6); font-size: 11px;
}

/* ---------------------------------------------------------------- 窄屏保护 */
@media (max-width: 359px) {
  :root { --page-pad: 10px; --gap: 10px; }
  .item-img { width: 120px; height: 120px; flex-basis: 120px; }
  .series-cover { width: 84px; height: 84px; flex-basis: 84px; }
  .brand-name { font-size: 20px; letter-spacing: 2px; }
}

/* ---------------------------------------------------------------- 宽屏 */
@media (min-width: 700px) {
  :root { --page-pad: 16px; --gap: 16px; }
  body { font-size: 15px; }
  .page { max-width: 720px; }
  .series-card { padding: 4px; }
  .series-cover { width: 132px; height: 132px; flex-basis: 132px; border-radius: 8px; }
  .item-img { width: 180px; height: 180px; flex-basis: 180px; border-radius: 8px 0 0 8px; }
  .item-model { font-size: 19px; }
  .brand-logo { width: 120px; height: 120px; }
  .brand-name { font-size: 26px; }
}
