/* ============================================================
   程的小铺 · 二次元风格样式表 🌸
   ============================================================ */
:root {
  --pink: #ff8fab;
  --pink-deep: #f76b96;
  --pink-light: #ffd6e2;
  --purple: #9d8bff;
  --purple-deep: #7c6cf0;
  --blue: #7cc4f7;
  --text: #4a3f55;
  --text-light: #8d84a0;
  --bg: #fff5f8;
  --card: rgba(255, 255, 255, .82);
  --border: #ffd9e5;
  --shadow: 0 8px 30px rgba(255, 143, 171, .22);
  --shadow-lg: 0 14px 44px rgba(255, 143, 171, .35);
  --radius: 20px;
  --ok: #3ecf8e;
  --warn: #ffb020;
  --muted: #98a2b3;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  background: linear-gradient(155deg, #fff0f5 0%, #f6efff 45%, #eef5ff 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
body.has-custom-bg {
  background-image: linear-gradient(155deg,
    rgba(255, 240, 245, .80) 0%,
    rgba(246, 239, 255, .74) 45%,
    rgba(238, 245, 255, .80) 100%), var(--site-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
body.has-custom-bg .bg-deco { opacity: .32; }

a { color: var(--pink-deep); text-decoration: none; }
a:hover { color: var(--purple-deep); }

::selection { background: var(--pink-light); }

/* ---------- 背景装饰光斑 ---------- */
.bg-deco { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.bg-deco .blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5;
  animation: float-blob 18s ease-in-out infinite;
}
.bg-deco .b1 { width: 420px; height: 420px; background: #ffd1e0; top: -120px; left: -80px; }
.bg-deco .b2 { width: 360px; height: 360px; background: #dccfff; bottom: -100px; right: -60px; animation-delay: -6s; }
.bg-deco .b3 { width: 260px; height: 260px; background: #cfe6ff; top: 40%; left: 55%; animation-delay: -12s; }
@keyframes float-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -24px) scale(1.06); }
}

/* ---------- 樱花飘落 ---------- */
.petal {
  position: fixed; top: -40px; z-index: -1; pointer-events: none;
  font-size: 18px; opacity: .8; user-select: none;
  animation: petal-fall linear infinite;
}
@keyframes petal-fall {
  0% { transform: translateY(-5vh) translateX(0) rotate(0deg); opacity: 0; }
  10% { opacity: .85; }
  90% { opacity: .7; }
  100% { transform: translateY(108vh) translateX(9vw) rotate(340deg); opacity: 0; }
}

/* ---------- 顶部导航 ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(14px);
  border-bottom: 1.5px solid var(--border);
}
.navbar .logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(90deg, var(--pink-deep), var(--purple-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.navbar .logo .mascot-mini { width: 34px; height: 34px; flex: none; }
.navbar .logo .logo-img { width: 34px; height: 34px; flex: none; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.navbar nav { display: flex; gap: 6px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.nav-link {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--text); transition: all .2s;
}
.nav-link:hover { background: var(--pink-light); color: var(--pink-deep); transform: translateY(-1px); }
.nav-link.active { background: linear-gradient(90deg, var(--pink), var(--purple)); color: #fff; box-shadow: 0 4px 14px rgba(247, 107, 150, .4); }
.nav-user { font-size: 14px; color: var(--text-light); display: flex; align-items: center; gap: 8px; }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; margin-left: 4px; border-radius: 999px;
  background: #ff6b81; color: #fff; font-size: 10px; font-weight: 900; vertical-align: 1px;
}
.agree-line {
  display: flex; align-items: flex-start; gap: 8px; font-size: 13px;
  color: var(--text-light); font-weight: 500; line-height: 1.6;
}
.agree-line input { margin-top: 3px; }
.agree-line a { color: var(--pink-deep); }

/* ---------- 公告条 ---------- */
.announcement {
  display: flex; align-items: center; gap: 10px;
  margin: 16px auto 0; max-width: 1080px; padding: 10px 18px;
  background: linear-gradient(90deg, #fff2f6, #f3efff);
  border: 1.5px dashed var(--pink); border-radius: 16px;
  font-size: 14px; color: var(--text);
}
.announcement .text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* 公告轮播 */
.announcement-carousel {
  flex: 1; min-width: 0; position: relative;
  transition: opacity .35s ease, transform .35s ease;
}
.announcement-carousel.ann-fade { opacity: 0; transform: translateY(6px); }
.ann-dots { display: flex; gap: 5px; flex: none; }
.ann-dot {
  width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: rgba(247, 107, 150, .28); transition: background .2s, transform .2s;
}
.ann-dot.active { background: var(--pink); transform: scale(1.25); }

/* ---------- 布局容器 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }

/* ---------- 首页 Hero ---------- */
.hero {
  display: flex; align-items: center; gap: 30px;
  margin: 26px 0 10px; padding: 36px 40px;
  background: linear-gradient(120deg, rgba(255, 214, 226, .8), rgba(220, 207, 255, .8));
  border-radius: 28px; border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero::after {
  content: "✨"; position: absolute; top: 14px; right: 20px; font-size: 22px;
  animation: twinkle 2.2s ease-in-out infinite;
}
.hero .mascot { width: 130px; height: 130px; flex: none; animation: bob 3.5s ease-in-out infinite; }
.hero .hero-text h1 {
  font-size: 30px; font-weight: 900; letter-spacing: 1px;
  background: linear-gradient(92deg, #f76b96, #9d8bff, #7cc4f7);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .hero-text p { margin-top: 10px; color: var(--text-light); font-size: 15px; line-height: 1.7; white-space: pre-line; }
.hero .tag-row { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.hero .tag {
  font-size: 12.5px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .75); border: 1px solid var(--border); color: var(--pink-deep);
  font-weight: 700;
}
@keyframes twinkle { 0%, 100% { opacity: .3; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- 分类筛选 ---------- */
.section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 30px 0 16px; font-size: 20px; font-weight: 800;
}
.section-title::before { content: "🎀"; font-size: 18px; }
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  padding: 8px 18px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 700;
  background: var(--card); border: 1.5px solid var(--border); color: var(--text);
  transition: all .2s; user-select: none;
}
.chip:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.chip.active {
  background: linear-gradient(90deg, var(--pink), var(--purple));
  color: #fff; border-color: transparent; box-shadow: 0 6px 18px rgba(247, 107, 150, .45);
}
.chip-num { font-size: 12px; font-weight: 600; opacity: .65; margin-left: 2px; }
.chip.active .chip-num { opacity: .85; }

/* 筛选栏:分类 + 排序 + 搜索 */
.shop-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
.shop-filters .chip-row { flex: 1 1 auto; margin-bottom: 0; }
.shop-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.shop-tools select.input { width: auto; min-width: 132px; padding: 8px 12px; font-size: 13.5px; }
.shop-tools #search-input { width: 220px; padding: 8px 14px; font-size: 13.5px; }
@media (max-width: 640px) {
  .shop-filters .chip-row { flex: 1 1 100%; }
  .shop-tools { width: 100%; margin-left: 0; }
  .shop-tools select.input { flex: 1; min-width: 0; }
  .shop-tools #search-input { flex: 1.4; width: auto; min-width: 0; }
}

/* ---------- 商品卡片 ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.product-grid > .empty { grid-column: 1 / -1; width: 100%; }
.product-card {
  background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
  backdrop-filter: blur(10px); box-shadow: var(--shadow);
  transition: all .25s ease; position: relative; overflow: hidden; cursor: pointer;
}
.product-card:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.product-card:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: var(--shadow-lg); border-color: var(--pink); }
.product-card .p-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
  font-size: 26px; background: linear-gradient(135deg, #ffe1ea, #eae4ff);
  border: 1px solid #fff; overflow: hidden;
}
.product-card .p-icon img { width: 100%; height: 100%; object-fit: cover; }
.product-card .p-name { font-size: 16.5px; font-weight: 800; line-height: 1.4; }
.product-card .p-desc { font-size: 13px; color: var(--text-light); line-height: 1.6; min-height: 42px; }
.product-card .p-bottom { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.product-card .p-price { font-size: 22px; font-weight: 900; color: var(--pink-deep); }
.product-card .p-price .rmb { font-size: 13px; font-weight: 700; }
.product-card .p-stock { font-size: 12px; color: var(--text-light); margin-left: auto; }
.product-card .p-stock.warn { color: var(--warn); font-weight: 700; }
.product-card .p-sales { font-size: 12px; color: var(--text-light); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 22px; border-radius: 999px; border: none; cursor: pointer;
  font-family: var(--font); font-size: 14.5px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(92deg, var(--pink), var(--purple));
  color: #fff; box-shadow: 0 6px 18px rgba(247, 107, 150, .35);
  transition: all .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(247, 107, 150, .5); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn.ghost {
  background: #fff; color: var(--pink-deep); border: 1.5px solid var(--pink);
  box-shadow: none;
}
.btn.ghost:hover { background: #fff2f6; box-shadow: var(--shadow); }
.btn.sm { padding: 6px 14px; font-size: 13px; }
.btn.danger { background: linear-gradient(92deg, #ff7b7b, #ff9e7d); box-shadow: 0 6px 18px rgba(255, 123, 123, .35); }
.btn.ok { background: linear-gradient(92deg, #3ecf8e, #7cc4f7); box-shadow: 0 6px 18px rgba(62, 207, 142, .3); }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13.5px; font-weight: 700; color: var(--text); }
.field label .req { color: var(--pink-deep); }
.forgot-link { float: right; font-size: 12.5px; font-weight: 700; color: var(--pink-deep); cursor: pointer; }
.forgot-link:hover { color: var(--purple-deep); text-decoration: underline; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 15px; border-radius: 14px;
  border: 1.5px solid var(--border); background: rgba(255, 255, 255, .9);
  font-family: var(--font); font-size: 14.5px; color: var(--text);
  transition: all .2s; outline: none;
}
.input:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 199, 216, .45); }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-tip { font-size: 12.5px; color: var(--text-light); }

/* 图片上传 */
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-preview {
  width: 64px; height: 64px; border-radius: 12px; border: 1.5px dashed var(--border);
  background: #fff; display: grid; place-items: center; overflow: hidden;
  color: var(--text-light); font-size: 11px; flex: none;
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview.sm { width: 40px; height: 40px; border-radius: 10px; }
.product-thumb {
  width: 30px; height: 30px; border-radius: 9px; overflow: hidden; flex: none;
  background: linear-gradient(135deg, #ffe1ea, #eae4ff); display: grid; place-items: center; font-size: 15px;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 登录/注册卡片 ---------- */
.auth-wrap { min-height: calc(100vh - 90px); display: grid; place-items: center; padding: 30px 16px; }
.auth-card {
  width: 400px; max-width: 100%;
  background: var(--card); backdrop-filter: blur(14px);
  border: 1.5px solid var(--border); border-radius: 26px;
  box-shadow: var(--shadow-lg); padding: 36px 34px 30px; text-align: center;
  position: relative;
}
.auth-card .mascot { width: 88px; height: 88px; margin: 0 auto 8px; animation: bob 3.5s ease-in-out infinite; }
.auth-logo-img {
  display: block; width: 120px; height: 120px; max-width: 70%; object-fit: contain;
  margin: 0 auto 8px; border-radius: 22px;
}
.auth-card h2 { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.auth-card .sub { font-size: 13px; color: var(--text-light); margin-bottom: 22px; }
.auth-card .switch-line { margin-top: 18px; font-size: 13.5px; color: var(--text-light); }
.auth-card .text-left { text-align: left; }

/* ---------- 登录/注册切换标签 ---------- */
.auth-tabs {
  display: flex; gap: 5px; padding: 5px; margin-bottom: 18px;
  background: #fff0f5; border-radius: 999px; border: 1px solid var(--border);
}
.auth-tab {
  flex: 1; padding: 9px 0; border: none; border-radius: 999px;
  background: transparent; font-family: var(--font); font-size: 14px; font-weight: 800;
  color: var(--text-light); cursor: pointer; transition: all .2s;
}
.auth-tab:hover { color: var(--pink-deep); }
.auth-tab.active {
  background: linear-gradient(92deg, var(--pink), var(--purple));
  color: #fff; box-shadow: 0 4px 14px rgba(247, 107, 150, .35);
}

/* 验证码行 */
.code-row { display: flex; gap: 10px; }
.code-row .input { flex: 1; min-width: 0; }
.code-btn { flex: none; white-space: nowrap; padding: 10px 16px; }
.code-btn:disabled { opacity: .6; }
.pwd-wrap { position: relative; display: flex; align-items: center; }
.pwd-wrap .input { width: 100%; padding-right: 48px; }
.pwd-toggle {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer; padding: 6px;
  font-size: 16px; line-height: 1; opacity: .6; border-radius: 8px;
}
.pwd-toggle:hover { opacity: 1; background: var(--pink-light); }
.pwd-toggle:focus-visible { outline: 2px solid var(--pink); }
.captcha-row { display: flex; align-items: center; gap: 12px; }
.captcha-question {
  flex: 1; min-width: 120px; padding: 10px 14px; border-radius: 12px;
  background: var(--pink-light); color: var(--pink-deep); font-weight: 900; letter-spacing: .08em;
  text-align: center; user-select: none;
}
.captcha-row .input { width: 110px; flex: none; text-align: center; }
.form-tip.ok { color: #1a9e6b; }
.form-tip.err { color: #e5484d; }

/* ---------- 徽章/状态 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 800;
}
.badge.pending { background: #fff3dd; color: #b97a00; }
.badge.paid { background: #e0f8ee; color: #1a9e6b; }
.badge.cancelled, .badge.expired, .badge.refunded { background: #eef0f4; color: var(--muted); }
.badge.on { background: #e0f8ee; color: #1a9e6b; }
.badge.off { background: #eef0f4; color: var(--muted); }
.badge.admin { background: #ece7ff; color: var(--purple-deep); }
.badge.user { background: #ffe9f0; color: var(--pink-deep); }
.badge.agent { background: #e8f1ff; color: #2f6fb3; }
.badge.unsold { background: #e5f1ff; color: #3178c6; }
.badge.reserved { background: #fff3dd; color: #b97a00; }
.badge.sold { background: #e0f8ee; color: #1a9e6b; }
.badge.disabled { background: #eef0f4; color: var(--muted); }
.badge.approved { background: #e0f8ee; color: #1a9e6b; }
.badge.rejected { background: #ffe6ea; color: #c2374f; }

/* ---------- 面板/卡片(控制台通用) ---------- */
.panel {
  background: var(--card); backdrop-filter: blur(10px);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 20px;
}
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.panel-title .sub { font-size: 12.5px; font-weight: 400; color: var(--text-light); margin-left: auto; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: rgba(255,255,255,.7); }
.table th {
  text-align: left; padding: 11px 14px; white-space: nowrap;
  background: linear-gradient(90deg, #ffeef4, #f1edff); color: var(--text);
  font-weight: 800;
}
.table td { padding: 11px 14px; border-top: 1px solid #ffeef3; vertical-align: middle; }
.table tr:hover td { background: rgba(255, 240, 246, .55); }
.table .mono { font-family: Consolas, monospace; font-size: 12.5px; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border: 1.5px solid var(--border); border-radius: 18px;
  padding: 18px 20px; box-shadow: var(--shadow);
  transition: transform .2s;
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card .icon { font-size: 22px; }
.stat-card .num { font-size: 26px; font-weight: 900; margin-top: 6px; color: var(--pink-deep); }
.stat-card .num.purple { color: var(--purple-deep); }
.stat-card .num.blue { color: #3178c6; }
.stat-card .label { font-size: 12.5px; color: var(--text-light); margin-top: 3px; }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  padding: 9px 20px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 14px;
  background: #fff; border: 1.5px solid var(--border); color: var(--text); transition: all .2s;
}
.tab:hover { border-color: var(--pink); }
.tab.active { background: linear-gradient(92deg, var(--pink), var(--purple)); color: #fff; border-color: transparent; }

/* ---------- 后台布局 ---------- */
.container-admin { max-width: 1400px; padding: 20px 24px 52px; }
.admin-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 20px; align-items: stretch; }
.admin-side {
  position: sticky; top: 84px;
  height: auto; max-height: max(calc(100vh - 104px), 820px); min-height: 0; min-width: 0;
  background: var(--card); backdrop-filter: blur(10px);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 12px;
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.admin-side .side-title { font-size: 11.5px; color: var(--text-light); font-weight: 800; padding: 6px 12px 8px; letter-spacing: 2px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; margin-bottom: 18px; }
.side-nav::-webkit-scrollbar { height: 4px; }
.side-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.side-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 12px;
  font-size: 14px; font-weight: 700; color: var(--text); cursor: pointer; transition: all .18s;
  border: none; background: none; font-family: var(--font); text-align: left; width: 100%;
}
.side-item:hover { background: #fff0f5; }
.side-item.active {
  background: linear-gradient(92deg, var(--pink), var(--purple)); color: #fff;
  box-shadow: 0 5px 16px rgba(247, 107, 150, .4);
}
.side-foot {
  margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 2px;
  border-top: 1px dashed var(--border);
}
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 13px; border-radius: 12px;
  font-size: 13px; font-weight: 700; color: var(--text-light); transition: all .18s;
}
.side-link:hover { background: #fff0f5; color: var(--pink-deep); }

.admin-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.admin-main > .panel { margin-bottom: 0; padding: 20px 22px; }
.admin-main .panel-title { margin-bottom: 14px; font-size: 16px; }
.admin-main .panel-title .sub { margin-left: 8px; }

/* 内容区与侧边栏底部对齐:两列按较高一列等高,最后一个面板撑满 */
@media (min-width: 1041px) {
  .admin-main > .panel:last-child { flex: 1 1 auto; }
}

/* 概览横幅 */
.admin-hero {
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(120deg, #fff0f5, #f0ecff) !important;
}
.admin-hero .hero-row { display: flex; align-items: center; gap: 12px; }
.admin-hero .hero-row .emoji { font-size: 22px; }
.admin-hero .hero-row .title { font-size: 16px; font-weight: 900; }
.admin-hero .hero-row .badge { margin-left: auto; }
.admin-hero .hero-tip {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: rgba(255, 255, 255, .7); border: 1px dashed #ffd6a5; border-radius: 11px;
  font-size: 12.5px; color: #a5681a;
}
.admin-hero .hero-tip .link { margin-left: auto; font-weight: 800; color: var(--pink-deep); cursor: pointer; }

/* 概览统计卡 */
.admin-main .stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 0; }
.admin-main .stat-grid.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-main .stat-card { padding: 15px 16px; border-radius: 16px; }
.admin-main .stat-card .icon { font-size: 19px; }
.admin-main .stat-card .num { font-size: 23px; margin-top: 4px; white-space: nowrap; }
.admin-main .stat-card .label { font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 快捷入口 */
.quick-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.quick-item {
  display: flex; align-items: center; gap: 11px; padding: 13px 15px;
  background: var(--card); border: 1.5px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); cursor: pointer; font-family: var(--font);
  font-size: 13.5px; font-weight: 800; color: var(--text); text-align: left;
  transition: all .2s;
}
.quick-item:hover { transform: translateY(-2px); border-color: var(--pink); box-shadow: var(--shadow-lg); }
.quick-item .qi-icon {
  width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center;
  font-size: 17px; background: linear-gradient(135deg, #ffe1ea, #eae4ff);
}
.quick-item .qi-sub { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-light); margin-top: 2px; }

/* 近 7 天销售趋势 */
.trend-chart { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 10px 6px 0; }
.trend-day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.trend-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.trend-bar {
  width: 70%; max-width: 54px; min-height: 4px; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--pink), var(--purple));
  box-shadow: 0 4px 12px rgba(247, 107, 150, .25); transition: height .3s;
}
.trend-day:hover .trend-bar { filter: brightness(1.05); }
.trend-rev { font-size: 11.5px; font-weight: 800; color: var(--pink-deep); margin-top: 6px; white-space: nowrap; }
.trend-date { font-size: 11.5px; color: var(--text); font-weight: 700; margin-top: 2px; }
.trend-orders { font-size: 11px; color: var(--text-light); }
@media (max-width: 640px) {
  .trend-chart { gap: 4px; }
  .trend-rev { font-size: 10px; }
  .trend-orders { display: none; }
}

/* 库存预警 */
.stock-alert-panel { border-color: #ffd6a5; background: linear-gradient(90deg, #fff8ef, #fff); }
.stock-alert-list { display: flex; flex-direction: column; gap: 8px; }
.stock-alert-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 14px; border: 1px solid #ffd6a5; border-radius: 12px;
  background: rgba(255, 255, 255, .7); cursor: pointer; font-family: var(--font);
  text-align: left; transition: all .18s;
}
.stock-alert-item:hover { border-color: var(--warn); background: #fff8ef; transform: translateX(3px); }
.sa-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: #fff3dd; font-size: 16px; flex: none; }
.sa-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sa-name { font-weight: 800; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-sub { font-size: 11.5px; color: var(--text-light); margin-top: 2px; }
.sa-stock { flex: none; font-size: 12px; font-weight: 800; color: #b97a00; background: #fff3dd; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.sa-stock.out { color: #e5484d; background: #ffe9e9; }
.sa-go { flex: none; font-size: 12.5px; font-weight: 800; color: var(--pink-deep); white-space: nowrap; }
@media (max-width: 640px) {
  .sa-go { display: none; }
  .sa-sub { display: none; }
}

/* 表格紧凑化 */
.admin-main .table-wrap { border-radius: 12px; }
.admin-main .table { font-size: 13px; }
.admin-main .table th { padding: 10px 12px; font-size: 12.5px; white-space: nowrap; }
.admin-main .table td { padding: 10px 12px; }
.admin-main .table .actions { flex-wrap: nowrap; gap: 5px; }
.admin-main .table .badge { white-space: nowrap; }
.admin-main .table .muted { white-space: nowrap; }
.admin-main .table .cell-main { font-weight: 800; line-height: 1.4; }
.admin-main .table .cell-sub { font-size: 12px; color: var(--text-light); line-height: 1.4; margin-top: 2px; }
.admin-main .table .card-content-cell { max-width: 260px; word-break: break-all; }
.admin-main .table td.col-nowrap, .admin-main .table th.col-nowrap { white-space: nowrap; }
.admin-main .table-categories th:nth-child(1) { width: 64px; }
.admin-main .table-categories th:nth-child(3) { width: 110px; }
.admin-main .table-categories th:nth-child(4) { width: 90px; }
.admin-main .table-categories th:nth-child(5) { width: 170px; }
.admin-main .btn.sm { padding: 5px 11px; font-size: 12.5px; }
.admin-main .btn.sm.danger { padding: 5px 11px; }

/* 空状态更紧凑 */
.admin-main .empty { padding: 34px 16px; }
.admin-main .empty .emoji { font-size: 36px; margin-bottom: 8px; }
.admin-main table .empty { padding: 26px 16px; }
.admin-main table .empty .emoji { font-size: 30px; margin-bottom: 6px; }

/* 表单网格 */
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .field { grid-column: span 6; margin-bottom: 14px; }
.form-grid .col-3 { grid-column: span 3; }
.form-grid .col-4 { grid-column: span 4; }
.form-grid .col-8 { grid-column: span 8; }
.form-grid .col-9 { grid-column: span 9; }
.form-grid .col-12 { grid-column: span 12; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.form-actions .btn:first-child { margin-left: auto; }

/* 卡密页筛选栏 */
.filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-main #card-result { scroll-margin-top: 84px; }
.filter-row .input { width: auto; }
.filter-row .grow { flex: 1 1 180px; min-width: 160px; }
.filter-row .spacer { margin-left: auto; }

/* 支付通道子卡片 */
.sub-panel {
  background: rgba(255, 255, 255, .62); border: 1px solid var(--border);
  border-radius: 16px; padding: 17px 18px; margin-bottom: 12px;
}
.sub-panel:last-child { margin-bottom: 0; }
.sub-panel .panel-title { margin-bottom: 12px; font-size: 15px; }
.sub-panel .panel-title .toggle { margin-left: auto; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.sub-panel .panel-title .toggle input { width: 16px; height: 16px; accent-color: var(--pink-deep); }

@media (max-width: 1040px) {
  .container-admin { padding: 16px 18px 40px; }
  .admin-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .admin-side {
    position: static; height: auto; max-height: none; min-height: 0; overflow: visible;
    flex-direction: row; align-items: center; padding: 10px;
  }
  .admin-side .side-title, .admin-side .side-foot { display: none; }
  .side-nav { flex-direction: row; overflow-x: auto; width: 100%; gap: 4px; margin-bottom: 0; }
  .side-item { white-space: nowrap; width: auto; padding: 9px 13px; font-size: 13px; }
}
@media (max-width: 860px) {
  .admin-main .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-main .stat-grid.stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .field, .form-grid .col-3, .form-grid .col-4, .form-grid .col-8 { grid-column: span 12; }
  .hero { flex-direction: column; text-align: center; padding: 26px; }
  .hero .tag-row { justify-content: center; }
  .navbar { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .navbar .logo { font-size: 17px; white-space: nowrap; }
  .navbar .logo .mascot-mini { width: 28px; height: 28px; }
  .nav-link { padding: 6px 12px; font-size: 13px; }
  .nav-user { font-size: 13px; }
}
@media (max-width: 520px) {
  .quick-grid { grid-template-columns: 1fr; }
  .admin-main .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 代理中心 ---------- */
.container-agent { max-width: 1180px; }
.agent-hero { background: linear-gradient(120deg, #fff0f5, #f0ecff) !important; }
.agent-hero-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.agent-name { font-size: 24px; font-weight: 900; margin-top: 2px; }
.agent-hero-balance { margin-left: auto; text-align: right; }
.agent-balance-value { font-size: 32px; font-weight: 900; color: var(--pink-deep); line-height: 1.15; }
.agent-hero-discount { min-width: 104px; text-align: center; }
.agent-hero-discount .badge { font-size: 14px; padding: 6px 14px; }
.agent-price-box { display: flex; flex-direction: column; gap: 1px; }
.price-old { font-size: 12px; color: var(--text-light); text-decoration: line-through; }
.amt-plus { color: #1a9e6b; font-weight: 800; }
.amt-minus { color: #e5484d; font-weight: 800; }
.agent-hero .muted { font-size: 12.5px; }
@media (max-width: 700px) {
  .agent-hero-balance { margin-left: 0; text-align: left; width: 100%; }
  .agent-balance-value { font-size: 28px; }
}

/* ---------- 在线客服(用户 / 代理) ---------- */
.support-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(92deg, var(--pink), var(--purple)); color: #fff;
  font-family: var(--font); font-size: 14px; font-weight: 800;
  box-shadow: 0 10px 30px rgba(247, 107, 150, .45);
  transition: transform .2s, box-shadow .2s;
}
.support-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(247, 107, 150, .55); }
.support-fab .sf-icon { font-size: 18px; }
.support-fab .sf-badge {
  position: absolute; top: -5px; right: -4px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: #e5484d; color: #fff; font-size: 11px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.modal.support-modal { width: 520px; }
.support-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.support-modal-head h3 { margin-bottom: 2px; }
.support-head-actions { display: flex; gap: 6px; flex: none; }
.support-msgs {
  height: 300px; overflow-y: auto; padding: 14px;
  background: #fff8fb; border: 1.5px solid var(--border); border-radius: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.support-welcome { margin: auto; text-align: center; color: var(--text-light); font-size: 13px; line-height: 1.9; }
.support-welcome span { display: block; font-size: 28px; margin-bottom: 6px; }
.support-msg { display: flex; flex-direction: column; max-width: 88%; }
.support-msg.theirs { align-self: flex-start; align-items: flex-start; }
.support-msg.mine { align-self: flex-end; align-items: flex-end; }
.support-bubble {
  padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
  background: #fff; border: 1px solid var(--border);
}
.support-msg.mine .support-bubble {
  background: linear-gradient(92deg, var(--pink), var(--purple));
  color: #fff; border-color: transparent;
}
.support-meta { font-size: 11px; color: var(--text-light); margin-top: 3px; }
.support-compose { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.support-compose textarea { min-height: 64px; max-height: 120px; resize: vertical; flex: 1; min-width: 0; }
.support-compose .btn { flex: none; height: 42px; }
.support-modal .form-tip { margin-top: 6px; }

/* 后台客服收件箱 */
.support-alert { border-color: #9dc3ef; background: linear-gradient(90deg, #eef5ff, #fff); }
.support-alert .flex { font-size: 14px; }
.side-count {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #ff6b81; color: #fff; font-size: 10.5px; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center;
}

/* 站内通知 */
.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice-item {
  display: flex; gap: 14px; padding: 16px 18px; border: 1px solid var(--border);
  border-radius: 14px; background: rgba(255, 255, 255, .68);
}
.notice-item.unread { border-color: #ffc3d5; background: linear-gradient(90deg, #fff5f8, #fff); }
.notice-icon { font-size: 24px; line-height: 1.2; flex: none; }
.notice-main { flex: 1; min-width: 0; }
.notice-title { font-weight: 800; font-size: 14px; }
.notice-content { color: var(--text-light); font-size: 13px; margin-top: 4px; line-height: 1.7; }
.notice-time { color: var(--muted); font-size: 12px; margin-top: 6px; }
.notice-actions { display: flex; flex-direction: column; gap: 6px; flex: none; }
.support-inbox { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; min-height: 540px; }
.support-threads {
  border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, .65);
  display: flex; flex-direction: column; overflow: hidden;
}
.support-thread-search { padding: 10px; border-bottom: 1px solid var(--border); }
.support-thread-search .input { padding: 8px 12px; font-size: 13px; }
.support-thread-list { overflow-y: auto; flex: 1; max-height: 560px; }
.support-thread { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid #ffeef3; cursor: pointer; transition: background .15s; }
.support-thread:hover { background: #fff4f8; }
.support-thread.active { background: #fff0f5; box-shadow: inset 3px 0 0 var(--pink); }
.st-avatar {
  width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, #ffe1ea, #eae4ff); font-size: 17px;
}
.st-main { flex: 1; min-width: 0; }
.st-top { display: flex; align-items: center; gap: 5px; }
.st-name { flex: 1; min-width: 0; font-weight: 800; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.support-thread .badge { flex: none; white-space: nowrap; }
.st-time { flex: none; margin-left: auto; font-size: 11px; color: var(--text-light); white-space: nowrap; }
.st-preview { font-size: 12px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.st-unread {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e5484d; color: #fff;
  font-size: 10.5px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center;
}
.support-chat-pane {
  border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, .65);
  display: flex; flex-direction: column; min-height: 540px; max-height: 640px; overflow: hidden;
}
.support-chat-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.support-chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.support-chat-pane .support-compose { margin: 0; padding: 12px 14px; border-top: 1px solid var(--border); }
.support-chat-pane .support-compose textarea { min-height: 56px; }
.support-chat-pane .empty { margin: auto; }
.support-chat-pane .support-welcome { margin: auto; }
@media (max-width: 860px) {
  .support-fab { right: 14px; bottom: 14px; padding: 11px 15px; }
  .support-fab .sf-text { display: none; }
  .modal.support-modal { width: 100%; }
  .support-inbox { grid-template-columns: 1fr; min-height: 0; }
  .support-thread-list { max-height: 240px; }
  .support-chat-pane { min-height: 460px; max-height: none; }
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(90, 60, 90, .35); backdrop-filter: blur(4px); padding: 18px;
}
.modal {
  width: 460px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  background: #fff; border-radius: 24px; border: 1.5px solid var(--pink-light);
  box-shadow: var(--shadow-lg); padding: 26px 28px;
  animation: pop-in .25s cubic-bezier(.34, 1.56, .64, 1);
}
.modal.wide { width: 680px; }
.modal.xwide { width: 980px; }
.modal h3 { font-size: 17px; font-weight: 900; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal .table .badge { white-space: nowrap; }
.modal .table .card-content-cell { max-width: 240px; word-break: break-all; }
.modal .table .cell-main { font-weight: 800; line-height: 1.4; }
.modal .table .cell-sub { font-size: 12px; color: var(--text-light); line-height: 1.4; margin-top: 2px; }
@keyframes pop-in { from { transform: scale(.85) translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 购买数量步进器 ---------- */
.stepper { display: inline-flex; align-items: center; gap: 0; border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button {
  width: 38px; height: 38px; border: none; background: #fff6f9; cursor: pointer;
  font-size: 18px; font-weight: 900; color: var(--pink-deep); font-family: var(--font);
}
.stepper button:hover { background: var(--pink-light); }
.stepper .val { width: 56px; text-align: center; font-weight: 800; font-size: 15px; }

/* ---------- 支付页 ---------- */
.pay-wrap { max-width: 620px; margin: 0 auto; }
.pay-order-box {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(120deg, #fff0f5, #f0ecff);
  border: 1.5px dashed var(--pink); border-radius: 18px; padding: 16px 20px; margin-bottom: 18px;
}
.pay-order-box .oi { display: grid; gap: 3px; }
.pay-order-box .amount { margin-left: auto; font-size: 26px; font-weight: 900; color: var(--pink-deep); }
.channel-list { display: flex; flex-direction: column; gap: 10px; }
.channel-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: #fff; border: 2px solid var(--border); border-radius: 16px;
  cursor: pointer; transition: all .18s; font-weight: 700; font-size: 14.5px;
}
.channel-item:hover { border-color: var(--pink); transform: translateX(3px); }
.channel-item.selected { border-color: var(--purple); background: #f7f4ff; box-shadow: 0 6px 18px rgba(157, 139, 255, .25); }
.channel-item .ci-icon { font-size: 22px; }
.channel-item .ci-sub { font-size: 12px; color: var(--text-light); font-weight: 400; margin-top: 2px; }

/* 卡密展示 */
.card-keys { display: flex; flex-direction: column; gap: 10px; }
.card-key {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(92deg, #f4fff9, #eef7ff);
  border: 1.5px dashed #9fdcbe; border-radius: 14px; padding: 12px 16px;
}
.card-key .key-text { font-family: Consolas, monospace; font-size: 14px; font-weight: 700; word-break: break-all; }
.card-key .copy-btn { margin-left: auto; flex: none; }

/* 倒计时 */
.countdown { font-family: Consolas, monospace; font-weight: 800; color: var(--warn); }

/* ---------- Toast ---------- */
.toast-wrap { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  padding: 11px 22px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: #fff; border: 1.5px solid var(--border); box-shadow: var(--shadow-lg);
  animation: toast-in .3s cubic-bezier(.34, 1.56, .64, 1);
  display: flex; align-items: center; gap: 8px; max-width: 90vw;
}
.toast.ok { border-color: #9fdcbe; color: #1a9e6b; }
.toast.err { border-color: #ffb3b3; color: #e5484d; }
@keyframes toast-in { from { transform: translateY(-14px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 46px 20px; color: var(--text-light); }
.empty .emoji { font-size: 44px; display: block; margin-bottom: 12px; animation: bob 3.5s ease-in-out infinite; }

/* ---------- 页脚 ---------- */
.site-footer {
  text-align: center; padding: 26px 16px 34px; color: var(--text-light); font-size: 13px;
}
.site-footer .heart { color: var(--pink-deep); }
.site-footer .footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px;
  margin: 8px 0; font-size: 12.5px;
}
.site-footer .footer-links a { color: var(--text-light); }
.site-footer .footer-links a:hover { color: var(--pink-deep); }
.legal-content { max-width: 860px; line-height: 1.95; font-size: 14.5px; color: var(--text); }
.legal-content h2 { font-size: 17px; margin: 26px 0 10px; color: var(--text); }
.legal-content h3 { font-size: 15.5px; margin: 20px 0 8px; }
.legal-content p { margin: 0 0 12px; color: var(--text-light); }
.legal-content p strong { color: var(--text); }
.legal-meta { color: var(--muted); font-size: 12.5px; margin-bottom: 18px; }

/* ---------- 工具类 ---------- */
.flex { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.ml-auto { margin-left: auto; }
.muted { color: var(--text-light); font-size: 12.5px; }
.strong { font-weight: 800; }
.hide { display: none !important; }
.kbd {
  font-family: Consolas, monospace; font-size: 12px; background: #f7f2fb;
  border: 1px solid var(--border); border-bottom-width: 2.5px; border-radius: 7px; padding: 2px 8px;
}
