/* ==========================================================================
   妄想图册 · 主题与布局样式
   移动端优先（Mobile First）。只有一套主题：全黑
   （原 A/B/C 三套配色与前台切换器已按需求移除）
   ========================================================================== */

/* ---------- 主题变量：全黑 ---------- */
:root {
  --gap: 12px;
  --radius: 16px;
  --radius-sm: 10px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue",
    "Microsoft YaHei", sans-serif;
  --title-font: var(--font);
  --maxw: 1400px;

  --bg: #000000;                 /* 页面纯黑 */
  --surface: #0d0d0f;            /* 卡片：中性黑，不带蓝调 */
  --surface-2: #121215;
  --text: #f2f2f4;
  --text-dim: #8a8a93;
  --border: rgba(255, 255, 255, .10);
  --accent: #22d3ee;
  --accent-2: #a855f7;
  --accent-contrast: #06121a;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 10px 30px rgba(0, 0, 0, .6);
  --shadow-hover: 0 0 0 1px rgba(34, 211, 238, .35), 0 14px 40px rgba(34, 211, 238, .18);
  --nav-bg: rgba(8, 8, 10, .9);
  --chip: #16161a;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(126px + env(safe-area-inset-bottom)); /* 底部两行分类导航占位 */
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 12px; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex; align-items: center; gap: 10px;
  height: 54px;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  color: var(--accent-contrast); font-weight: 800; font-size: 14px;
}
.brand-name {
  font-size: 16px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.brand-sub { font-size: 11px; color: var(--text-dim); display: none; }
.topbar-spacer { flex: 1; }

/* ---------- 三个服务入口：打手考核 / 售后客服 / 联系下单 ---------- */
/* 三者共用同一套客服信息（二维码 + 跳转链接），只是入口名称不同 */
.entry-nav { display: flex; gap: 6px; align-items: center; }
.entry-nav button {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 999px;
  padding: 7px 11px; font-size: 12px; font-weight: 700;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
  transition: background .15s, border-color .15s;
}
.entry-nav button .ico { font-size: 13px; line-height: 1; }
.entry-nav button:active { border-color: var(--accent); }
.entry-nav button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast); border-color: transparent;
}
/* 手机端：三个入口换到第二排，等宽三等分，点击区域更大 */
@media (max-width: 899px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 9px; padding-bottom: 10px; row-gap: 9px; }
  .entry-nav { order: 3; width: 100%; gap: 7px; }
  .entry-nav button { flex: 1 1 0; justify-content: center; padding: 10px 4px; font-size: 13px; }
}

/* ---------- 公告条：跑马灯滚动，点一下看全文 ---------- */
.notice {
  display: none;
  align-items: center; gap: 8px;
  margin: 10px 0 0;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--chip); color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  overflow: hidden;
}
.notice.show { display: flex; }
.notice-ico { flex: none; font-size: 14px; line-height: 1; }
.notice-view { flex: 1; min-width: 0; overflow: hidden; position: relative; }
.notice-track { display: inline-block; white-space: nowrap; will-change: transform; }
/* 文字比容器宽才滚动；JS 会加 .rolling 并按字数设好时长 */
.notice.rolling .notice-track { animation: dx-marquee var(--notice-dur, 12s) linear infinite; }
.notice.rolling:hover .notice-track,
.notice.rolling:active .notice-track { animation-play-state: paused; }
@keyframes dx-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--notice-shift, 50%))); }
}
.notice-more {
  flex: none; font-size: 11px; font-weight: 700;
  color: var(--accent); white-space: nowrap;
}

/* ---------- 弹层：公告全文 / 联系方式 ---------- */
.notice-modal, .contact-modal {
  margin: auto; width: calc(100% - 24px); max-width: 460px;
  max-height: calc(100% - 80px);
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden;
}
.cm-body { padding: 0 16px 20px; overflow: auto; -webkit-overflow-scrolling: touch; }
.cm-tip { margin: 0 0 10px; font-size: 12px; color: var(--text-dim); }
.nm-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px 10px 16px;
}
.nm-head h3 { margin: 0; flex: 1; font-size: 16px; font-weight: 700; }
.nm-head .lb-close { width: 38px; height: 38px; font-size: 18px; background: var(--chip); color: var(--text); }
.nm-body {
  padding: 0 16px 20px; overflow: auto; -webkit-overflow-scrolling: touch;
  white-space: pre-wrap; word-break: break-word; line-height: 1.7;
}
.cm-list { display: flex; flex-direction: column; gap: 10px; }
.cm-empty { padding: 18px 2px; font-size: 13px; color: var(--text-dim); }

/* 联系方式一行：二维码 + 信息 + 操作 */
.cm-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--chip); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px;
}
/* 二维码：给足尺寸，扫起来更省事；点一下还能放大到 500×500 再扫 */
.cm-qr {
  flex: none; width: 120px; height: 120px;
  border-radius: 10px; overflow: hidden; background: #fff;
  cursor: zoom-in; position: relative;
}
.cm-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cm-qr::after {
  content: '点击放大'; position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 10px; text-align: center; padding: 2px 0;
}
.cm-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cm-label { font-size: 12px; color: var(--text-dim); }
.cm-value { font-size: 15px; font-weight: 700; word-break: break-all; }
.cm-acts { flex: none; display: flex; flex-direction: column; gap: 6px; }
.cm-acts button, .cm-acts a {
  border: none; border-radius: 8px; cursor: pointer;
  background: var(--accent); color: var(--accent-contrast);
  font-size: 12px; font-weight: 700; padding: 6px 11px;
  white-space: nowrap; text-decoration: none; text-align: center;
  display: block;
}
.cm-acts a { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* 窄屏：二维码缩到 92px，给文字和按钮留出空间 */
@media (max-width: 380px) {
  .cm-qr { width: 92px; height: 92px; }
  .cm-row { gap: 9px; padding: 9px; }
}

/* ---------- 分类标题 ---------- */
.section-head { padding: 16px 2px 12px; }
.section-title {
  margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .3px;
  font-family: var(--title-font);
}
.section-desc { margin: 4px 0 0; font-size: 13px; color: var(--text-dim); }

/* ---------- 瀑布流 ---------- */
.masonry { display: flex; gap: var(--gap); align-items: flex-start; }
.masonry-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  position: relative;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card-media { position: relative; background: var(--surface-2); }
.card-media img { width: 100%; height: auto; display: block; -webkit-touch-callout: default; }
.card-media { -webkit-user-select: auto; user-select: auto; }
.card-badge {
  position: absolute; left: 8px; top: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-contrast);
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.card-body { padding: 9px 10px 11px; }
.card-title {
  margin: 0; font-size: 14px; font-weight: 650; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-desc {
  margin: 4px 0 0; font-size: 12px; color: var(--text-dim);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.price { color: var(--accent); font-weight: 800; font-size: 15px; }
.price small { font-size: 11px; font-weight: 600; opacity: .85; }
.card-cta {
  margin-left: auto; border: none; border-radius: 999px;
  background: var(--chip); color: var(--text);
  font-size: 12px; font-weight: 700; padding: 5px 11px;
}
.card-cta.strong { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-contrast); }
.hide-price .price, .hide-price .card-cta { display: none; }
.hide-desc .card-desc { display: none; }

.empty {
  padding: 60px 12px; text-align: center; color: var(--text-dim); font-size: 14px;
}

/* ---------- 浮动目录：手机=底部两行网格，电脑=左侧一列悬浮 ---------- */
.float-nav {
  position: fixed; z-index: 60;
  left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px;
  padding: 6px;
  background: var(--nav-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .14);
}
.float-nav button {
  min-width: 0; min-height: 46px;
  border: none; background: transparent; color: var(--text-dim);
  border-radius: 11px; padding: 5px 2px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; font-weight: 600; line-height: 1.2;
  transition: background .15s, color .15s;
}
.float-nav button span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.float-nav button .ico { font-size: 17px; line-height: 1; }
.float-nav button.active {
  color: var(--accent-contrast);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.float-nav button.active .ico { filter: none; }

/* 小屏（8 个分类）收紧字号，保证两行放得下 */
@media (max-width: 360px) {
  .float-nav { left: 6px; right: 6px; gap: 4px; padding: 5px; }
  .float-nav button { font-size: 11px; min-height: 42px; padding: 4px 1px 3px; }
  .float-nav button .ico { font-size: 15px; }
}

@media (min-width: 900px) {
  body { padding-bottom: 0; padding-left: 132px; }
  .float-nav {
    left: 16px; right: auto; top: 50%; bottom: auto; transform: translateY(-50%);
    display: flex; flex-direction: column; grid-template-columns: none;
    width: 112px; padding: 9px 8px; gap: 5px;
    border-radius: 18px;
  }
  .float-nav button { min-height: 0; padding: 9px 6px; font-size: 13px; border-radius: 12px; }
  .float-nav button .ico { font-size: 19px; }
  .brand-sub { display: block; }
  .section-title { font-size: 26px; }
  :root { --gap: 16px; }
}

/* ---------- 页脚 ---------- */
.foot { padding: 28px 0 40px; text-align: center; color: var(--text-dim); font-size: 12px; }

/* ---------- 灯箱 ---------- */
/* 灯箱：强制原始分辨率展示，可拖动/双指缩放（不提供缩略模式） */
.lightbox {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(0, 0, 0, .93);
  flex-direction: column;
}
.lightbox.show { display: flex; }
.lb-scroll {
  flex: 1 1 auto; overflow: auto; -webkit-overflow-scrolling: touch;
  display: flex; padding: 64px 8px 142px;
  touch-action: pan-y;   /* 兜底：JS 手势失效时仍可原生上下滚 */
}
/* 灯箱：默认自适应屏幕（手机按手机屏、电脑按电脑屏），可双指/滚轮缩放、拖动查看 */
.lb-scroll img {
  display: block; margin: auto; border-radius: 4px; background: #fff;
  width: auto; height: auto; max-width: 100%; max-height: 100%;
  touch-action: none;    /* 单指滑动/双指缩放全部由 JS 接管，保证长图能滑、能缩放 */
}
/* 顶部：标题/尺寸信息 + 放大的关闭按钮 */
.lb-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; pointer-events: none;
}
.lb-top .lb-cap {
  flex: 1; min-width: 0; text-align: left; color: #e8e8e8;
  font-size: 12px; line-height: 1.5; padding-top: 8px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .85);
}
.lb-top .lb-cap .lb-tip { display: block; margin-top: 2px; font-size: 11px; color: #b6b6b6; }
.lb-close {
  pointer-events: auto; flex: none;
  width: 48px; height: 48px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, .35); color: #111;
  font-size: 24px; line-height: 1;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
/* 底部：咨询下单 + 上一张 / 下一张 / 返回（三个圆形按钮） */
.lb-bottom {
  position: absolute; left: 0; right: 0;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  pointer-events: none;
}
.lb-bottom > * { pointer-events: auto; }
.lb-order {
  border: none; border-radius: 999px; padding: 10px 22px;
  background: rgba(255, 255, 255, .85); color: #111;
  font-size: 13px; font-weight: 700;
}
.lb-nav { display: flex; gap: 22px; }
.lb-nav button {
  width: 54px; height: 54px; border-radius: 50%; border: none; padding: 0;
  background: rgba(255, 255, 255, .35); color: #111;
  font-size: 26px; line-height: 1;
  display: grid; place-items: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.lb-nav button:active { background: rgba(255, 255, 255, .62); }
/* 单独看图（如二维码）：没有上一张/下一张，只留关闭 */
.lightbox.lb-single .lb-nav { display: none; }
.lightbox.lb-single .lb-order { display: none; }

/* ---------- 入口说明（联系弹层里的一段提示） ---------- */
.cm-entry-tip {
  margin: 0 0 10px; padding: 9px 11px;
  background: var(--chip); border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; line-height: 1.6; color: var(--text);
  white-space: pre-wrap;
}
