/* ============================================================
   简卡 SimpleCard v2.0 前台样式
   配色规范（三色、无彩色、禁渐变）：
     玄武黑 #1F2226 / 风雪灰 #919AA4 / 雪浪白 #E6E8E5
   前台固定深色电影感：全站背景大图 + 半透明卡片浮层
   ============================================================ */

:root {
  --bg: #1F2226;
  --card: rgba(31, 34, 38, 0.72);
  --card-solid: #1F2226;
  --ink: #E6E8E5;
  --muted: #919AA4;
  --line: rgba(145, 154, 164, 0.18);
  --hover: rgba(145, 154, 164, 0.08);
  --shade: rgba(23, 25, 28, 0.82);
  --btn-bg: #E6E8E5;
  --btn-ink: #1F2226;
  --btn-hover: #FFFFFF;
  --ring: rgba(230, 232, 229, 0.16);
  --radius: 10px;
}

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

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

body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  /* 吸底布局：内容不足一屏时，底栏也固定在视口最下方 */
  display: flex;
  flex-direction: column;
}

/* ---------- 背景大图 + 纯色遮罩（禁渐变） ---------- */

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-shade {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--shade);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(31, 34, 38, 0.92);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.brand img { height: 26px; width: auto; }
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; color: var(--ink); }

.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--ink); background: var(--hover); }
.nav a.on { color: var(--ink); background: var(--hover); }

/* ---------- 公告横幅 / 跑马灯 ---------- */

.banner {
  background: var(--hover);
  color: var(--muted);
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--hover);
  white-space: nowrap;
}
.marquee-inner {
  display: inline-flex;
  width: max-content;
  animation: marquee 18s linear infinite;
}
.marquee-inner span {
  color: var(--muted);
  font-size: 13px;
  padding: 7px 32px 7px 0;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- 轮播 ---------- */

.hero-slider {
  position: relative;
  max-width: 1080px;
  margin: 16px auto 0;
  padding: 0 16px;
}
.hero-slider { padding: 0; margin-top: 16px; }
#hero-slider {
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
}
.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.7s ease;
}
.slide.on { opacity: 1; }
.slide-cap {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  background: rgba(23, 25, 28, 0.55);
  padding: 14px 20px;
}
.slide-cap b { color: var(--ink); font-size: 17px; font-weight: 600; letter-spacing: 0.5px; }
.hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.hero-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(230, 232, 229, 0.35);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.hero-dots i.on { background: var(--ink); transform: scale(1.15); }

/* ---------- 促销倒计时 ---------- */

.cd-card { margin-top: 16px; }
.cd-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cd-box { display: flex; gap: 12px; flex-wrap: wrap; }
.cd-cell {
  min-width: 76px;
  padding: 12px 10px;
  text-align: center;
  background: var(--hover);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cd-cell b {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.cd-cell span { font-size: 12px; color: var(--muted); }

/* ---------- 布局 / 卡片 ---------- */

.container { max-width: 1080px; margin: 0 auto; padding: 20px 16px 48px; width: 100%; box-sizing: border-box; flex: 1 0 auto; }

.page-head { margin: 8px 0 18px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: 0.5px; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 14px; }

.block { margin-top: 28px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.more { color: var(--muted); font-size: 13px; }
.more:hover { color: var(--ink); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card + .card { margin-top: 14px; }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; letter-spacing: 0.3px; }
.card.empty { color: var(--muted); text-align: center; padding: 28px 16px; }

.intro-text { color: var(--ink); font-size: 14px; }

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  border-radius: 8px;
  background: var(--hover);
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 14px;
}
.callout strong { display: block; color: var(--ink); margin-bottom: 4px; }
.callout.plain { border-left-color: var(--line); }

.flash {
  max-width: 1080px;
  margin: 0 auto 14px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid var(--line);
}
.flash.ok { background: rgba(230, 232, 229, 0.10); color: var(--ink); }
.flash.err { background: rgba(207, 34, 46, 0.12); color: #E6A6AC; border-color: rgba(207, 34, 46, 0.35); }
.flash.warn { background: rgba(230, 232, 229, 0.08); color: var(--ink); }

/* ---------- 分类入口（首页） ---------- */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.cat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.15s, background 0.15s;
}
.cat-card:hover { border-color: rgba(145, 154, 164, 0.4); background: rgba(31, 34, 38, 0.85); }
.cat-name { font-size: 15px; font-weight: 600; }
.cat-go { font-size: 12.5px; color: var(--muted); }
.goods-cta { margin-top: 14px; }

/* ---------- 商品网格 ---------- */

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pills a {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  background: var(--hover);
  transition: color 0.15s, border-color 0.15s;
}
.pills a:hover { color: var(--ink); border-color: rgba(145, 154, 164, 0.4); }
.pills a.on { color: var(--btn-ink); background: var(--btn-bg); border-color: var(--btn-bg); }

.goods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.goods-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.15s, transform 0.15s;
}
.goods-card:hover { border-color: rgba(145, 154, 164, 0.4); transform: translateY(-2px); }
.g-head { display: flex; align-items: center; gap: 10px; }
.g-name { font-size: 15px; font-weight: 600; line-height: 1.35; }
.g-name-lg { font-size: 19px; }
.g-ico {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.g-ico-txt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hover);
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
}
.g-desc { color: var(--muted); font-size: 13px; min-height: 0; }
.g-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.price { font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--hover);
}
.badge.file { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.badge.soldout { color: var(--muted); border-style: dashed; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  border: 1px solid var(--btn-bg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn-block { display: block; width: 100%; }
.btn-ghost {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover { background: var(--hover); border-color: rgba(145, 154, 164, 0.4); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-disabled {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--hover);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 14px;
  text-align: center;
  cursor: not-allowed;
}
.link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--btn-hover); }

/* ---------- 表单 ---------- */

.form-card { max-width: 520px; margin: 0 auto; }
.f-label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="datetime-local"], textarea, select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(145, 154, 164, 0.10);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus { border-color: rgba(230, 232, 229, 0.45); box-shadow: 0 0 0 3px var(--ring); }
textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

.qty-stepper { display: flex; align-items: stretch; gap: 8px; }
.qty-stepper input { text-align: center; }
.qty-btn {
  flex: none;
  width: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--hover);
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
  transition: background 0.15s;
}
.qty-btn:hover { background: rgba(145, 154, 164, 0.16); }

.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-of-type { border-bottom: none; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; }

.crumbs { color: var(--muted); font-size: 13px; margin: 4px 0 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }

/* ---------- 详情 ---------- */

.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 14px; align-items: start; }
.detail-price { font-size: 26px; font-weight: 700; margin: 12px 0; font-variant-numeric: tabular-nums; }
.soldout-tip {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 16px;
  font-size: 14px;
}

/* ---------- 收银台 ---------- */

.cashier, .pay-state { max-width: 560px; margin: 0 auto; }
.cashier-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0 4px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.total-num { font-size: 24px; font-weight: 700; }
.cd-hint { color: var(--muted); font-size: 13px; margin: 8px 0; }
.cd-hint .mono { color: var(--ink); font-weight: 700; }
.pay-tips { color: var(--muted); font-size: 13px; margin: 14px 0 8px; }
.pay-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.pay-tabs a {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--hover);
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.pay-tabs a:hover { border-color: rgba(145, 154, 164, 0.45); background: rgba(145, 154, 164, 0.14); }
.pay-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.pay-state { text-align: center; padding: 30px 20px; }
.pay-state .st { margin-bottom: 10px; }
.pay-state h2 { margin-bottom: 8px; }
.pay-state .btn { margin-top: 14px; }

.mono { font-family: ui-monospace, Consolas, "Courier New", monospace; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- 订单状态徽章 ---------- */

.st {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--hover);
  color: var(--muted);
  white-space: nowrap;
}
.st-delivered { background: rgba(230, 232, 229, 0.14); color: var(--ink); border-color: rgba(230, 232, 229, 0.3); }
.st-paid { background: rgba(145, 154, 164, 0.16); color: var(--ink); }
.st-pending { color: var(--muted); }
.st-expired, .st-refunded { color: var(--muted); border-style: dashed; }

/* ---------- 订单结果 ---------- */

.order-result { max-width: 720px; margin: 0 auto; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.order-no { font-size: 16px; font-weight: 700; }

.timeline { list-style: none; display: flex; gap: 0; margin: 18px 0; }
.timeline li { flex: 1; text-align: center; position: relative; color: var(--muted); font-size: 12.5px; }
.timeline li .dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  margin: 0 auto 6px;
  position: relative;
  z-index: 1;
}
.timeline li.on { color: var(--ink); }
.timeline li.on .dot { background: var(--ink); }
.timeline li::before {
  content: "";
  position: absolute;
  top: 4px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--line);
}
.timeline li:first-child::before { display: none; }
.tl-label { display: block; }
.timeline time { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }

.cards-box { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 14px; }
.cards-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  background: var(--hover);
  border-bottom: 1px solid var(--line);
}
.cards-head h3 { font-size: 13.5px; font-weight: 600; }
.card-line {
  padding: 9px 14px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13.5px;
  border-bottom: 1px dashed var(--line);
  word-break: break-all;
}
.card-line:last-child { border-bottom: none; }

.dl-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  flex-wrap: wrap;
}
.dl-info b { display: block; font-size: 14.5px; }
.dl-info span { color: var(--muted); font-size: 12.5px; }

.act-row { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ticket-link { margin-top: 16px; text-align: right; }

/* ---------- 公告 / 工单 / 客服 ---------- */

.notice-list { list-style: none; }
.notice-list li { border-bottom: 1px solid var(--line); }
.notice-list li:last-child { border-bottom: none; }
.notice-list a {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 4px;
  transition: background 0.15s;
}
.notice-list a:hover { background: var(--hover); }
.n-title { font-size: 14px; }
.n-date { color: var(--muted); font-size: 12.5px; flex: none; }

.narrow { max-width: 720px; margin: 0 auto; }
.notice-detail { max-width: 720px; margin: 0 auto; }
.nd-title { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.nd-date { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.n-main { font-size: 14.5px; }
.n-excerpt { color: var(--muted); }

.thread { margin-top: 14px; }
.rtitle { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.row-list { display: flex; flex-direction: column; gap: 12px; }
.row-side { color: var(--muted); font-size: 12.5px; }
.tno { font-family: ui-monospace, Consolas, monospace; }
.ticket-title { font-size: 15px; font-weight: 600; }
.ticket-link a { font-size: 13px; }

.sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.sv-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sv-info { color: var(--muted); font-size: 13px; }
.sv-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.sv-val { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }

.form-card form, .narrow form, .thread form { margin-top: 4px; }

/* ---------- 悬浮客服 / 弹窗 ---------- */

.float-btn {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 60;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--btn-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: background 0.15s, transform 0.15s;
}
.float-btn:hover { background: var(--btn-hover); transform: translateY(-2px); }

.popup-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 17, 19, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.popup-mask.open { display: flex; }
.popup {
  width: 100%;
  max-width: 420px;
  background: rgba(31, 34, 38, 0.97);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.popup h3 { font-size: 17px; margin-bottom: 10px; }
.popup-body { color: var(--muted); font-size: 14px; max-height: 50vh; overflow: auto; }
.popup .btn { margin-top: 18px; }

/* ---------- 页脚 ---------- */

.footer {
  border-top: 1px solid var(--line);
  background: rgba(31, 34, 38, 0.92);
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  padding: 22px 16px;
  margin-top: auto;
}
.footer p { margin: 3px 0; }

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  .topbar-inner { height: auto; padding: 10px 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .nav { gap: 0; }
  #hero-slider { height: 210px; }
  .detail-grid { grid-template-columns: 1fr; }
  .timeline time { display: none; }
}

@media (max-width: 640px) {
  .goods-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .goods-card { padding: 12px; }
  .g-desc { display: none; }
  .cd-cell { min-width: 0; flex: 1; }
  .cd-cell b { font-size: 22px; }
  .page-head h1 { font-size: 22px; }
  .float-btn { right: 14px; bottom: 16px; width: 46px; height: 46px; }
  .dl-box .btn { width: 100%; }
}
