:root {
  --bg: #ffffff;
  --text: #2a3550;
  --muted: rgba(42, 53, 80, 0.62);
  --card: rgba(255, 255, 255, 0.75);
  --border: rgba(42, 53, 80, 0.10);
  --shadow: 0 10px 40px rgba(42, 53, 80, 0.08);

  --accent-1: #f6b7d2;
  /* 粉 */
  --accent-2: #9de7e6;
  /* 青 */
  --brand: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --brand-strong: #22c55e;

  /* 按钮：浅粉渐变（统一风格） */
  --btn-bg: rgba(255, 255, 255, 0.92);
  --btn-bg-hover: rgba(255, 255, 255, 0.98);
  --btn-border: rgba(42, 53, 80, 0.14);
  --btn-border-strong: rgba(42, 53, 80, 0.22);
  --btn-shadow: 0 10px 26px rgba(42, 53, 80, 0.12);

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --anim: 520ms cubic-bezier(.2, .8, .2, 1);
  --max: 980px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 背景：固定在视口上，滚动时不会出现“色块断层” */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 560px at 12% 6%, rgba(246, 183, 210, 0.42), transparent 60%),
    radial-gradient(980px 560px at 88% 8%, rgba(157, 231, 230, 0.30), transparent 60%),
    radial-gradient(1100px 720px at 18% 92%, rgba(157, 231, 230, 0.20), transparent 60%),
    radial-gradient(980px 720px at 86% 90%, rgba(246, 183, 210, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(246, 183, 210, 0.10) 0%, rgba(255, 255, 255, 0.0) 38%, rgba(157, 231, 230, 0.10) 100%);
  transform: translateZ(0);
}

/* 隐藏右侧滚动条（仍可滚动） */
html,
body {
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge legacy */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 16px 24px;
  flex: 1 0 auto;
}

.site-footer {
  margin-top: auto;
  padding: 12px 8px 18px;
  text-align: center;
  color: var(--muted);
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.site-footer-row {
  font-size: 12px;
  line-height: 1.6;
}

.site-footer-link {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  text-decoration: none;
}

.site-footer-link:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand>div {
  min-width: 0;
}

.logo {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(246, 183, 210, 0.25);
  position: relative;
  overflow: hidden;
}

.logo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/brand/logo") center/cover no-repeat;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.5px;
  overflow-wrap: anywhere;
}

.brand p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(42, 53, 80, 0.10);
  transition: transform var(--anim), box-shadow var(--anim), filter var(--anim);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.btn:focus {
  outline: none;
}

.btn:focus-visible {
  outline: 3px solid rgba(246, 183, 210, 0.55);
  outline-offset: 3px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}

/* 顶部下拉菜单锚点容器（JS 注入） */
.topbar-menu {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
  position: relative;
}

.topbar-menu .topbar-actions {
  margin-left: 0;
}

/* iOS/安卓：长按/点击高亮去除（避免蓝色方框/高亮块） */
a,
button {
  -webkit-tap-highlight-color: transparent;
}

.nav-item,
.pill,
.pay-method,
.pay-method-inner {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* 顶部菜单按钮（小屏下启用） */
.topbar-menu-btn {
  display: none;
}

.topbar-menu-icon {
  width: 18px;
  height: 12px;
  background:
    linear-gradient(currentColor 0 0) 0 0 / 100% 2px,
    linear-gradient(currentColor 0 0) 0 50% / 100% 2px,
    linear-gradient(currentColor 0 0) 0 100% / 100% 2px;
  background-repeat: no-repeat;
  opacity: 0.85;
}

/* 小屏：默认还是保留原来的换行（作为 JS 菜单未初始化时的兜底），初始化后再变成下拉菜单 */
@media (max-width: 560px) {
  /* 小屏 + 下拉菜单：强制同一行，避免菜单按钮掉到下一行 */
  .topbar.has-menu {
    flex-wrap: nowrap;
  }

  .topbar.has-menu .brand {
    flex: 1 1 auto;
  }

  .topbar.has-menu .topbar-menu {
    flex: 0 0 auto;
  }

  /* 后台：顶部按钮保持靠右（即便换行也右对齐） */
  .admin-topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .topbar-actions .btn {
    padding: 9px 12px;
    font-size: 13px;
  }

  /* JS 初始化后：把动作区变成下拉菜单面板 */
  .topbar.has-menu {
    position: relative;
    z-index: 30;
  }

  .topbar.has-menu .topbar-menu-btn {
    display: inline-flex;
    margin-left: auto;
  }

  .topbar.has-menu .topbar-menu-btn {
    margin-left: 0;
  }

  .topbar.has-menu .topbar-menu .topbar-actions {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: auto;
    min-width: 90px;
    max-width: calc(100vw - 32px);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow);
    z-index: 9999;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;

    opacity: 0;
    transform: translateY(-6px) scale(0.985);
    pointer-events: none;
    transform-origin: top right;
    will-change: opacity, transform;
    transition: opacity var(--anim), transform var(--anim);
  }

  .topbar.has-menu .topbar-menu .topbar-actions .btn {
    width: 100%;
    justify-content: center;
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
  }

  .topbar.has-menu .topbar-menu-btn {
    padding: 8px 10px;
    font-size: 13px;
    gap: 6px;
  }

  .topbar.has-menu.is-menu-open {
    z-index: 9998;
  }

  .topbar.has-menu.is-menu-open .topbar-menu .topbar-actions {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
}

.grid.grid-centered {
  grid-template-columns: 1fr;
  max-width: var(--grid-max, 820px);
  margin: 16px auto 0;
}

/* ===== 我的页面悬浮功能区（风格对齐首页） ===== */
.action-float {
  width: 200px;
  position: fixed;
  top: 150px;
  left: max(16px, calc(50% - (var(--max) / 2) - 200px - 16px));
  z-index: 20;
}

@media (max-width: 1200px) {
  .action-float {
    display: none;
  }
}

/* 小屏：顶部横向功能区 */
.me-nav-mobile {
  margin-top: 16px;
}

/* 大屏隐藏，小屏显示 */
@media (min-width: 1201px) {
  .me-nav-mobile {
    display: none;
  }
}

@media (max-width: 1200px) {
  .me-nav-mobile {
    display: block;
  }

  .me-nav-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .me-nav-row::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .me-nav-row .nav-item {
    width: auto;
    flex: 0 0 auto;
  }
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow);
  background: var(--btn-bg-hover);
}

.btn:active {
  transform: translateY(0);
  filter: saturate(1.02) brightness(0.99);
}

.btn.primary {
  border-color: rgba(246, 183, 210, 0.55);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(246, 183, 210, 0.14);
}

.btn.primary:hover {
  background: #fff;
}

.btn.danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(255, 255, 255, 0.96);
  color: #b42318;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 16px;
}

.layout {
  margin-top: 16px;
  position: relative;
}

.sidebar {
  width: 240px;
  position: fixed;
  top: 112px;
  left: max(16px, calc(50% - (var(--max) / 2) - 240px - 16px));
  z-index: 20;
}

@media (max-width: 1280px) {
  .sidebar {
    width: 100%;
    position: static;
    top: auto;
    left: auto;
    margin-bottom: 14px;
  }
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 1280px) {
  .nav {
    flex-direction: row;
    overflow: auto;
    padding-bottom: 4px;
  }
}

.nav-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  cursor: pointer;
  font-weight: 650;
  color: var(--text);
  transition: transform var(--anim), box-shadow var(--anim), filter var(--anim);
}

@media (max-width: 920px) {
  .nav-item {
    width: auto;
    white-space: nowrap;
  }
}

.nav-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--btn-shadow);
  filter: saturate(1.02);
}

.nav-item.active {
  border-color: var(--btn-border-strong);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 -14px 34px rgba(246, 183, 210, 0.12), 0 14px 34px rgba(157, 231, 230, 0.12);
}

.content {
  min-width: 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.card.ggs-host-open {
  position: relative;
  z-index: 120;
}

/* 自定义下拉框：在 .form（grid）内打开时，把所在单元抬高，避免被后续 grid item 覆盖 */
.ggs-item-open {
  position: relative;
  z-index: 300;
}

.section {
  padding: 16px;
}

.title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.text-sm {
  font-size: 13px;
}

.text-xs {
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  color: var(--muted);
}

.wechat-pill {
  border-color: rgba(34, 197, 94, 0.30);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.20), rgba(34, 197, 94, 0.12));
  color: rgba(12, 84, 34, 0.95);
  font-weight: 750;
}

.wechat-pill .wechat-mark {
  width: 16px;
  height: 16px;
  color: rgba(22, 163, 74, 0.98);
  flex: 0 0 auto;
}

.alipay-pill {
  border-color: rgba(22, 119, 255, 0.30);
  background: linear-gradient(135deg, rgba(22, 119, 255, 0.18), rgba(22, 119, 255, 0.10));
  color: rgba(10, 52, 120, 0.95);
  font-weight: 750;
}

.alipay-pill .alipay-mark {
  width: 16px;
  height: 16px;
  color: rgba(22, 119, 255, 0.98);
  flex: 0 0 auto;
}

.products {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.product-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 35, 40, 0.08);
  background: rgba(255, 255, 255, 0.72);
  transition: transform var(--anim), box-shadow var(--anim);
}

.product-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(31, 35, 40, 0.10);
}

/* 后台：商品管理操作区（移动端竖排） */
.product-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-product-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: start;
}

.admin-product-meta {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.admin-product-meta .pm {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}

.admin-product-meta .pm-k {
  font-weight: 800;
}

.admin-product-meta .pm-v {
  min-width: 0;
  word-break: break-word;
}

/* 卡密管理：固定高度滚动区，避免状态筛选时卡片高度抖动 */
.codes-scroll {
  min-height: 360px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge legacy */
}

.codes-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* 风控监控：近期事件内置滚动（默认显示约 6 条） */
.risk-scroll {
  max-height: 440px;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.risk-ev-lines {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  display: grid;
  gap: 3px;
}

.risk-ev-line {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.risk-ev-k {
  flex: 0 0 auto;
  min-width: 42px;
  color: var(--muted);
  font-weight: 750;
}

.risk-ev-v {
  min-width: 0;
  color: var(--muted);
  word-break: break-all;
}

.risk-scroll::-webkit-scrollbar {
  width: 10px;
}

.risk-scroll::-webkit-scrollbar-thumb {
  background: rgba(42, 53, 80, 0.18);
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.60);
}

.risk-scroll::-webkit-scrollbar-track {
  background: rgba(42, 53, 80, 0.05);
  border-radius: 999px;
}

@media (max-width: 920px) {
  .risk-scroll {
    max-height: 360px;
  }
}

@media (max-width: 560px) {
  .product-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .product-actions .btn {
    width: 100%;
  }

  .admin-product-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
  }

  .admin-product-meta .pm {
    justify-content: space-between;
  }
}

.product-name {
  font-weight: 950;
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.product-desc {
  margin: 7px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

/* 公告/提示强调 */
.callout {
  border-radius: 18px;
  padding: 14px 14px;
  background:
    linear-gradient(
      90deg,
      rgba(255,240,245,0.7) 0%,
      rgba(240,255,255,0.7) 25%,
      rgba(245,240,255,0.7) 50%,
      rgba(255,245,240,0.7) 75%,
      rgba(255,240,245,0.7) 100%
    ),
    linear-gradient(
      135deg,
      #f0ffff 0%,
      #fff0f5 33%,
      #fff5f0 66%,
      #f0ffff 100%
    );
  background-size: 200% 100%, 300% 300%;
  border: 1px solid rgba(255, 200, 220, 0.4);
  box-shadow: 0 18px 50px rgba(42, 53, 80, 0.08);
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  font-weight: 650;
  animation: callout-flow-a 11s ease-in-out infinite, callout-flow-b 17s ease-in-out infinite;
}

@keyframes callout-flow-a {
  0%, 100% { background-position: 0% 50%, 0% 0%; }
  50% { background-position: 100% 50%, 0% 0%; }
}

@keyframes callout-flow-b {
  0%, 100% { background-position: 0% 50%, 0% 0%; }
  50% { background-position: 0% 50%, 100% 100%; }
}

.callout .muted {
  color: rgba(42, 53, 80, 0.72);
}

.code-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(42, 53, 80, 0.10);
  background: rgba(255, 255, 255, 0.72);
}

.code-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.code-main {
  min-width: 0;
}

.code-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  font-weight: 800;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.code-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.price .v {
  font-size: 16px;
  font-weight: 900;
}

.price .unit {
  font-size: 12px;
  color: var(--muted);
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 720px) {
  .form {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(31, 35, 40, 0.12);
  background: rgba(255, 255, 255, 0.9);
  outline: none;
  font-size: 14px;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 5px rgba(157, 231, 230, 0.25);
}

/* 后台：品牌上传（自定义 file picker） */
.brand-uploader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(31, 35, 40, 0.16);
  background: rgba(255, 255, 255, 0.65);
}

.brand-uploader-main {
  display: grid;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.brand-uploader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.brand-uploader-name {
  flex: 1;
  min-width: 160px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid rgba(31, 35, 40, 0.10);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 8px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-uploader-preview {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(31, 35, 40, 0.10);
  background: rgba(255, 255, 255, 0.75);
  object-fit: cover;
  flex: 0 0 auto;
}

/* Turnstile iframe（避免 window.turnstile 被插件污染） */
.ts-frame {
  width: 100%;
  height: 78px;
  border: 0;
  display: block;
  background: transparent;
}

/* 支付方式选择（商品页） */
.pay-methods {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pay-method {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.pay-method input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pay-method-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 35, 40, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: transform var(--anim), box-shadow var(--anim), filter var(--anim);
}

.pay-method-inner:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(42, 53, 80, 0.10);
}

.pay-method-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.pay-method.wechat .pay-method-inner {
  border-color: rgba(34, 197, 94, 0.26);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.10));
  color: rgba(12, 84, 34, 0.95);
  font-weight: 800;
}

.pay-method.wechat .pay-method-icon {
  color: rgba(22, 163, 74, 0.98);
}

.pay-method.alipay .pay-method-inner {
  border-color: rgba(22, 119, 255, 0.26);
  background: linear-gradient(135deg, rgba(22, 119, 255, 0.16), rgba(22, 119, 255, 0.08));
  color: rgba(10, 52, 120, 0.95);
  font-weight: 800;
}

.pay-method.alipay .pay-method-icon {
  color: rgba(22, 119, 255, 0.98);
}

.pay-method.wechat input:checked + .pay-method-inner {
  border-color: rgba(34, 197, 94, 0.42);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.16);
  filter: saturate(1.03);
}

.pay-method.alipay input:checked + .pay-method-inner {
  border-color: rgba(22, 119, 255, 0.42);
  box-shadow: 0 0 0 5px rgba(22, 119, 255, 0.16);
  filter: saturate(1.03);
}

/* 自定义下拉框（替代原生 select） */
select.ggs-native {
  position: absolute;
  left: -99999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ggs {
  position: relative;
  width: 100%;
}

.ggs.open {
  z-index: 10000;
}

.ggs.ggs-inline {
  width: auto;
  display: inline-block;
  min-width: 120px;
}

.ggs.ggs-inline .ggs-btn {
  width: auto;
  padding: 10px 12px;
}

.ggs.ggs-inline .ggs-text {
  white-space: nowrap;
}

.ggs-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(42, 53, 80, 0.12);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: transform var(--anim), box-shadow var(--anim);
  color: var(--text);
  text-align: left;
}

.ggs-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(42, 53, 80, 0.12);
}

.ggs-btn:focus {
  outline: none;
  box-shadow: 0 0 0 5px rgba(246, 183, 210, 0.22);
}

.ggs.placeholder .ggs-text {
  color: var(--muted);
}

.ggs-caret {
  font-size: 12px;
  color: rgba(42, 53, 80, 0.55);
  transition: transform var(--anim);
}

.ggs.open .ggs-caret {
  transform: rotate(180deg);
}

.ggs-panel {
  position: fixed;
  left: 10px;
  top: 10px;
  border-radius: 16px;
  border: 1px solid rgba(42, 53, 80, 0.10);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(42, 53, 80, 0.18);
  z-index: 10050;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  transition: opacity var(--anim), transform var(--anim), max-height var(--anim);
}

.ggs-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  max-height: 340px;
}

.ggs-options {
  max-height: 340px;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
  position: relative;
  z-index: 10002;
}

.ggs-option {
  width: 100%;
  border: 1px solid rgba(42, 53, 80, 0.10);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: transform var(--anim), box-shadow var(--anim), filter var(--anim);
}

.ggs-option:hover,
.ggs-option.hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(42, 53, 80, 0.12);
}

.ggs-option.active {
  border: 1px solid rgba(247, 182, 211, 0.55);
  background: linear-gradient(135deg, rgba(247, 182, 211, 0.35), rgba(253, 231, 242, 0.55));
}

.ggs-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.divider {
  height: 1px;
  background: rgba(31, 35, 40, 0.08);
  margin: 14px 0;
}

/* 动效（统一渐显渐隐） */
[hidden] {
  display: none !important;
}

.fx-fade {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--anim), transform var(--anim);
  will-change: opacity, transform;
}

.fx-fade.fx-in {
  opacity: 1;
  transform: translateY(0);
}

/* Toast */
.toast-host {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(31, 35, 40, 0.10);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 50px rgba(31, 35, 40, 0.16);
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--anim), transform var(--anim);
}

.toast .i {
  font-weight: 900;
}

.toast.success .i {
  color: #16a34a;
}

.toast.error .i {
  color: #dc2626;
}

.toast.info .i {
  color: #0ea5e9;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.hide {
  opacity: 0;
  transform: translateY(-6px);
}

/* Alert / Modal */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--anim), visibility var(--anim);
}

.overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  width: 100%;
  max-width: 520px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(31, 35, 40, 0.12);
  box-shadow: 0 30px 80px rgba(31, 35, 40, 0.25);
  overflow: hidden;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity var(--anim), transform var(--anim);
}

.overlay.show .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal .hd {
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(246, 183, 210, 0.14), rgba(157, 231, 230, 0.12));
  border-bottom: 1px solid rgba(31, 35, 40, 0.06);
  font-weight: 850;
  font-size: 16px;
}

.modal .bd {
  padding: 14px 16px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.8;
  /* 限制弹窗内容高度，超出后可滚动但不显示滚动条 */
  max-height: 65vh;
  overflow-y: auto;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge legacy */
}

.modal .bd::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.modal .bd .text-sm {
  font-size: 14px;
}

.modal .ft {
  padding: 8px 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid rgba(31, 35, 40, 0.05);
}

.modal .ft.split {
  justify-content: space-between;
  align-items: center;
}

.modal .ft .ft-left,
.modal .ft .ft-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.m-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.m-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: rgba(246, 183, 210, 0.95);
}

.modal .ft .btn {
  padding: 8px 12px;
  font-weight: 650;
  font-size: 13px;
  box-shadow: none;
}

.kline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  background: rgba(31, 35, 40, 0.04);
  border: 1px solid rgba(31, 35, 40, 0.08);
  border-radius: 14px;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
}

/* 后台概览 Dashboard */
.dash-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 920px) {
  .dash-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

.metric {
  border: 1px solid rgba(42, 53, 80, 0.10);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 16px;
  padding: 12px 12px;
}

.metric .k {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.metric .v {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.metric .v.small {
  font-size: 18px;
}

.dash-panels {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 920px) {
  .dash-panels {
    grid-template-columns: 1fr;
  }
}

.dash-panel {
  border: 1px solid rgba(42, 53, 80, 0.10);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  padding: 12px 12px;
  min-width: 0;
  overflow: hidden;
}

.panel-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-wrap {
  position: relative;
  min-height: 140px;
  max-height: 220px;
  overflow: hidden;
}

.chart-svg {
  width: 100%;
  height: 180px;
  display: block;
}

.chart-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-9999px, -9999px);
  pointer-events: none;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(42, 53, 80, 0.12);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 44px rgba(42, 53, 80, 0.18);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  opacity: 0;
  /* tooltip 跟随鼠标：不做 transform 动画，否则会有明显“拖影/延迟” */
  transition: opacity 0.12s linear;
  z-index: 5;
  backdrop-filter: blur(10px);
}

.chart-tooltip.show {
  opacity: 1;
}

.chart-dot .chart-dot-glow {
  opacity: 0;
  transition: opacity 0.12s linear;
}

.chart-dot.hover .chart-dot-glow {
  opacity: 1;
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 10px;
  align-items: center;
}

.bar-name {
  font-weight: 800;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(42, 53, 80, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(246, 183, 210, 0.85), rgba(157, 231, 230, 0.65));
  width: 0%;
  transition: width var(--anim);
}

.bar-val {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ===== 前端悬浮分类 ===== */
.category-float {
  width: 200px;
  position: fixed;
  top: 280px;
  left: max(16px, calc(50% - (var(--max) / 2) - 200px - 16px));
  z-index: 20;
}

@media (max-width: 1200px) {
  .category-float {
    display: none;
  }
}

/* ===== 分类导航样式 ===== */
.category-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 220ms ease;
}

.category-item:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(42, 53, 80, 0.12);
  transform: translateX(2px);
}

.category-item.active {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(246, 183, 210, 0.35);
}

.category-item.active:hover {
  transform: translateX(2px);
}

/* 响应式：小屏幕隐藏侧边栏，改为横向滚动 */
@media (max-width: 768px) {
  .category-nav {
    position: static;
    min-width: 0 !important;
    width: 100%;
    margin-bottom: 12px;
  }

  #category-list {
    display: flex !important;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #category-list::-webkit-scrollbar {
    display: none;
  }

  .category-item {
    flex-shrink: 0;
    min-width: max-content;
    padding: 8px 16px;
  }
}
