/* ============================================================
   江苏夕阳电竞 · 价格表展示站
   暗红 + 鎏金，移动优先
   ============================================================ */

:root {
  --gold: #e8c87a;
  --gold-soft: #f5dfa8;
  --gold-dim: rgba(232, 200, 122, .35);
  --maroon: #2a0d0d;
  --maroon-2: #1a0a0a;
  --ink: #120707;
  --text: #f0e6d4;
  --muted: #b7a488;
  --accent: #c0492f;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background: radial-gradient(140% 90% at 50% 0%, #3a1111 0%, #1c0a0a 55%, #080303 100%) fixed;
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;              /* 防止横向滚动条 / 内容被推出视口 */
  padding-bottom: env(safe-area-inset-bottom);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 0 8px;
  position: relative;
  z-index: 1;                      /* 压在背景层之上 */
}

/* ---------- 自定义背景素材 ----------
   后台「站点设置 → 背景素材」上传，两张图分别用于首页和分类页。
   固定铺满视口（长页面滚动时底图不动，避免长图被拉长变形）。
   --veil 压暗程度 0~1，由 bg.js 按后台滑块写入；--bg-blur 是背景模糊。 */
.bg-layer {
  position: fixed;
  inset: -24px;                    /* 比视口大一圈，模糊后边缘不会露白 */
  z-index: 0;
  pointer-events: none;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(var(--bg-blur, 0px));
  opacity: 0;
  transition: opacity .45s ease;
}
.bg-layer.on { opacity: 1; }

/* 压暗遮罩：顶部轻、底部重，金色文字在亮底图上也能读清 */
.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 3, 3, calc(var(--veil, .45) * .5)) 0%,
    rgba(8, 3, 3, var(--veil, .45)) 45%,
    rgba(8, 3, 3, var(--veil, .45)) 100%
  );
}

/* 有底图时：实心面板改成半透明毛玻璃，让素材透出来，同时保证文字可读 */
body.bg-ready { background: #0a0505; }

body.bg-ready .boss-panel,
body.bg-ready .sec-title,
body.bg-ready .footer {
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

body.bg-ready .boss-panel {
  background: linear-gradient(
    180deg,
    rgba(20, 10, 10, calc(.82 - var(--veil, .45) * .5)),
    rgba(14, 6, 6, calc(.88 - var(--veil, .45) * .5))
  );
  border-color: rgba(232, 200, 122, .26);
}

body.bg-ready .sec-title {
  background: linear-gradient(
    90deg,
    rgba(20, 10, 10, calc(.55 - var(--veil, .45) * .35)),
    rgba(28, 14, 14, calc(.7 - var(--veil, .45) * .35)),
    rgba(20, 10, 10, calc(.55 - var(--veil, .45) * .35))
  );
  border-color: rgba(232, 200, 122, .26);
}

body.bg-ready .footer {
  background: linear-gradient(
    180deg,
    transparent,
    rgba(6, 3, 3, calc(.62 - var(--veil, .45) * .35))
  );
}

/* 分类条上的胶囊在底图上容易糊，加一层薄底 */
body.bg-ready .cat-item,
body.bg-ready .sub-item {
  background: rgba(16, 7, 7, calc(.55 - var(--veil, .45) * .3));
  border-color: rgba(232, 200, 122, .3);
}

/* 选中态必须保持原来的金色，不能被上面那条半透明规则盖掉 */
body.bg-ready .cat-item.active {
  background: linear-gradient(180deg, rgba(232, 200, 122, .18), rgba(232, 200, 122, .04));
  border-color: var(--gold);
  box-shadow: 0 6px 18px rgba(232, 200, 122, .18);
}

body.bg-ready .sub-item.active {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border-color: var(--gold);
}

/* ---------- 顶部 banner ---------- */
.hero {
  position: relative;
  padding: 8px 8px 0;
}

.hero img {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .55), 0 0 0 1px var(--gold-dim);
  object-fit: cover;
}

.hero-title {
  text-align: center;
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--gold);
  margin: 10px 0 2px;
  opacity: .9;
}

/* ---------- 一级分类 ---------- */
.catbar {
  margin-top: 14px;
  padding: 0 8px;
}

.catbar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
  padding: 0 4px 8px;
}

.catbar-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-dim), transparent);
}

.cat-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-scroll::-webkit-scrollbar { display: none; }

.cat-item {
  flex: 0 0 auto;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 7px 4px 8px;
  border-radius: 12px;
  border: 1px solid rgba(232, 200, 122, .16);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .01));
  transition: .22s;
}

.cat-item .ico {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  background: #2a1414;
  border: 1px solid rgba(232, 200, 122, .28);
  display: grid;
  place-items: center;
  font-size: 20px;
}

.cat-item .ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-item .name {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-item.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(232, 200, 122, .18), rgba(232, 200, 122, .04));
  box-shadow: 0 6px 18px rgba(232, 200, 122, .18);
  transform: translateY(-2px);
}

.cat-item.active .name { color: var(--gold-soft); font-weight: 600; }
.cat-item.active .ico { border-color: var(--gold); box-shadow: 0 0 12px rgba(232, 200, 122, .45); }

/* ---------- 当前分类主题 ---------- */
.theme {
  text-align: center;
  padding: 14px 16px 6px;
}

.theme .big-ico {
  width: 74px;
  height: 74px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 0 0 5px rgba(232, 200, 122, .09), 0 10px 24px rgba(0, 0, 0, .5);
  background: #2a1414;
  display: grid;
  place-items: center;
  font-size: 30px;
}

.theme .big-ico img { width: 100%; height: 100%; object-fit: cover; }

.theme .title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(180deg, #fff4d6, var(--gold) 55%, #a9803a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.theme .sub {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-top: 2px;
}

.theme .rule {
  width: 120px;
  height: 1px;
  margin: 12px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  position: relative;
}
.theme .rule::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -2px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 8px var(--gold);
}

/* ---------- 二级分类 ---------- */
.subbar {
  padding: 12px 8px 4px;
}

.sub-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}
.sub-scroll::-webkit-scrollbar { display: none; }

.sub-item {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid rgba(232, 200, 122, .22);
  background: rgba(255, 255, 255, .03);
  transition: .2s;
  white-space: nowrap;
}

.sub-item.active {
  color: #2a0d0d;
  font-weight: 700;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border-color: var(--gold);
  box-shadow: 0 4px 14px rgba(232, 200, 122, .3);
}

/* ---------- 价格表长图 ---------- */
.poster {
  position: relative;
  margin: 6px 10px 0;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(232, 200, 122, .18);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
  min-height: 120px;
}

.poster img {
  width: 100%;
  cursor: zoom-in;
  background: #150a0a;
}

/* 价格图包一层，让「点击放大」标签贴在图右下角，而不是内容区底部 */
.poster-figure {
  position: relative;
  overflow: hidden;
}

.poster-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 11px;
  color: #2a0d0d;
  background: rgba(232, 200, 122, .92);
  padding: 4px 10px;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.poster-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 1px;
  background: rgba(20, 8, 8, .6);
}

.poster-loading .spin {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(232, 200, 122, .25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* 空状态 */
.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--muted);
  font-size: 13px;
}
.empty .ico { font-size: 34px; opacity: .5; margin-bottom: 8px; }
.empty .tip { font-size: 11.5px; opacity: .7; margin-top: 4px; }

/* ---------- 二级分类 / 老板专区 · 图文内容 ---------- */
/* 后台编辑器写进来的内联样式（颜色 / 字号 / 对齐 / 行距）优先于这里的基础排版 */
.rich {
  padding: 4px 14px 14px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }

.rich p { margin: 8px 0; }

.rich h2 {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
  color: var(--gold);
  margin: 16px 0 8px;
}

.rich h3 {
  font-size: 15.5px;
  line-height: 1.55;
  font-weight: 600;
  color: var(--gold-soft);
  margin: 14px 0 6px;
  padding-left: 10px;
  border-left: 3px solid var(--gold);
}

.rich blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--gold-dim);
  border-radius: 0 8px 8px 0;
  background: rgba(232, 200, 122, .06);
  color: var(--muted);
}

/* 颜色交给编辑器写入的内联样式，这里不再强制改色 */
.rich b, .rich strong { font-weight: 700; color: inherit; }
.rich u { text-underline-offset: 3px; }
.rich s, .rich strike { opacity: .75; }

.rich ul, .rich ol { padding-left: 22px; margin: 8px 0; }
.rich li { margin: 3px 0; }

.rich img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 8px auto;
  border: 1px solid rgba(232, 200, 122, .2);
  cursor: zoom-in;
}
.rich a { color: var(--gold-soft); text-decoration: underline; }
.rich hr {
  border: 0;
  border-top: 1px dashed rgba(232, 200, 122, .3);
  margin: 14px 0;
}

/* ---------- 首页老板专区 ---------- */
.boss-panel {
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012));
  border: 1px solid rgba(232, 200, 122, .18);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .32);
  overflow: hidden;
}
.boss-panel .rich { padding: 14px 14px 16px; }


/* ---------- 底部 ---------- */
.footer {
  margin-top: 26px;
  padding: 22px 20px 30px;
  text-align: center;
  border-top: 1px solid rgba(232, 200, 122, .14);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .25));
}

.footer .brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--gold);
}

.footer .wx {
  font-size: 12.5px;
  color: var(--text);
  margin-top: 8px;
  opacity: .85;
}
.footer .wx b { color: var(--gold-soft); font-weight: 600; }

.footer .line {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.footer .copyright {
  font-size: 11px;
  color: var(--muted);
  opacity: .6;
  margin-top: 14px;
}

/* ---------- 大图查看器 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(6, 3, 3, .97);
  display: flex;
  flex-direction: column;
  animation: fade .18s ease;
}

.lightbox[hidden] { display: none; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.lb-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(0, 0, 0, .55);
  border-bottom: 1px solid rgba(232, 200, 122, .18);
  color: var(--gold-soft);
  font-size: 13px;
}

.lb-bar .zoom-val {
  min-width: 46px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
}

.lb-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(232, 200, 122, .3);
  display: grid;
  place-items: center;
  font-size: 17px;
  line-height: 1;
  color: var(--gold);
  background: rgba(255, 255, 255, .04);
}
.lb-btn:active { background: rgba(232, 200, 122, .2); }

.lb-title {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: .9;
}

.lb-scroll {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  touch-action: pan-x pan-y;
}

.lb-img {
  margin: 0 auto;
  display: block;
  /* 关键：全局 img{max-width:100%} 会把放大后的宽度压回容器宽，
     这里必须解除限制，否则缩放按钮只是数字在变、图片不动 */
  max-width: none;
  border-radius: 8px;
  transition: width .12s linear;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- 骨架屏 ---------- */
.skeleton {
  padding: 12px;
}
.skeleton .sk {
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04));
  background-size: 200% 100%;
  animation: sk 1.3s infinite linear;
}
.skeleton .sk-hero { height: 150px; }
.skeleton .sk-row { height: 76px; margin-top: 14px; }
.skeleton .sk-box { height: 320px; margin-top: 14px; }

@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- 桌面端微调 ---------- */
@media (min-width: 640px) {
  .cat-item { width: 80px; }
  .cat-item .ico { width: 52px; height: 52px; }
  .theme .title { font-size: 23px; }
}

/* ---------- 平板 / PC：分类条改为换行，全部可见 ----------
   大屏上横向滚动条被隐藏，用户会以为只有前面几个分类，
   换行展示更直观。 */
@media (min-width: 768px) {
  .cat-scroll,
  .sub-scroll {
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
  }
  .cat-item { width: 68px; }
}

@media (min-width: 900px) {
  .app { max-width: 860px; }
  .cat-item { width: 80px; }
  .cat-item .ico { width: 54px; height: 54px; }
  .hero { padding: 14px 14px 0; }
}

/* ============================================================
   价格页 · 返回首页
   ============================================================ */
.back-home {
  position: absolute;
  left: 14px;
  top: 18px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px 11px 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--gold-soft);
  background: rgba(10, 4, 4, .55);
  border: 1px solid rgba(232, 200, 122, .35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.back-home:active { background: rgba(232, 200, 122, .22); }

/* ============================================================
   首页
   ============================================================ */
.home-sec {
  margin-top: 18px;
  padding: 0 8px;
}

/* 居中区块标题：文字两侧渐隐细线 + 淡金底 */
.sec-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin-bottom: 12px;
  border-radius: 9px;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 2px;
  color: var(--gold);
  background: linear-gradient(90deg, rgba(232, 200, 122, .03), rgba(232, 200, 122, .1), rgba(232, 200, 122, .03));
  border: 1px solid rgba(232, 200, 122, .18);
}
.sec-title::before,
.sec-title::after {
  content: "";
  flex: 1;
  height: 1px;
}
.sec-title::before { background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.sec-title::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }

/* 品类入口网格
   小屏用 flex：列数由 JS 按分类数量算出（--cols），保证最后一行不孤零零
   大屏（≥900）切换成 grid auto-fit，一行撑满 */
.home-cats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 0;
}

.home-cat {
  flex: 0 0 calc(100% / var(--cols, 5));
  max-width: 130px;
}

/* 列数少时把图标放大，避免格子里空荡荡 */
.home-cats[data-cols="1"] .home-cat .ico,
.home-cats[data-cols="2"] .home-cat .ico,
.home-cats[data-cols="3"] .home-cat .ico {
  width: 64px;
  height: 64px;
  font-size: 28px;
}

.home-cat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 6px 2px 5px;
  border-radius: 12px;
  transition: .2s;
}
.home-cat:active { background: rgba(232, 200, 122, .09); transform: scale(.97); }

.home-cat .ico {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 22px;
  background: radial-gradient(circle at 50% 30%, rgba(232, 200, 122, .16), #2a1414 72%);
  border: 1px solid rgba(232, 200, 122, .3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4), inset 0 0 10px rgba(232, 200, 122, .06);
}
.home-cat .ico img { width: 100%; height: 100%; object-fit: cover; }

.home-cat .name {
  font-size: 12px;
  color: var(--text);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-cat .badge {
  position: absolute;
  right: 2px;
  bottom: 26px;
  padding: 0 4px;
  border-radius: 5px;
  font-size: 9px;
  line-height: 14px;
  letter-spacing: .5px;
  color: #fff;
  background: linear-gradient(180deg, #d9613f, var(--accent));
  box-shadow: 0 2px 6px rgba(192, 73, 47, .5);
}

/* emoji / 文字图标 */
.emoji { line-height: 1; }
.home-cat .ico .emoji { font-size: 26px; }

/* 轻提示 */
.home-tip {
  position: fixed;
  left: 50%;
  bottom: calc(40px + env(safe-area-inset-bottom));
  z-index: 60;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--gold-soft);
  background: rgba(20, 10, 10, .95);
  border: 1px solid var(--gold-dim);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: .22s;
  white-space: nowrap;
}
.home-tip.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 首页响应式 ----------
   列数交给 auto-fit 自动算，这里只调整图标尺寸与老板专区 */
@media (min-width: 560px) {
  .home-cat .ico { width: 56px; height: 56px; }
  .boss-panel .rich { padding: 16px 18px 18px; }
}

@media (min-width: 900px) {
  /* 桌面端改成 grid 撑满一行，与截图一致 */
  .home-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 12px 4px;
    justify-content: stretch;
  }
  .home-cat { flex: none; max-width: none; }
  .home-cat .ico { width: 58px; height: 58px; }
  .home-sec { padding: 0 14px; }
  .boss-panel .rich { padding: 18px 20px 20px; }
  .back-home { left: 20px; top: 24px; }
}
