/* ========================================================
   星匣 StarBox · 运营管理后台样式
   品牌色：深紫 #4a3b52 / 珍珠白 #f6f3f8 / 细金 #b08d4f
   ======================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: #f6f3f8;
  color: #463a50;
  font-size: 14px;
}
.hidden { display: none !important; }
a { color: #b08d4f; text-decoration: none; }

/* ---------- 登录页 ---------- */
.login-page {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3b2f45 0%, #4a3b52 45%, #6d5480 100%);
}
.login-bg {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(227,184,116,.14) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}
.login-card {
  position: relative; width: 400px; padding: 44px 40px 34px;
  background: rgba(255,255,255,.97); border-radius: 18px;
  border: 1px solid rgba(227,184,116,.5);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  text-align: center;
}
.login-logo {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff;
  background: linear-gradient(135deg, #e3b874, #b08d4f);
  box-shadow: 0 10px 24px rgba(176,141,79,.4);
}
.login-title { font-size: 24px; font-weight: 700; letter-spacing: 2px; color: #4a3b52; }
.login-sub { margin-top: 6px; font-size: 12px; color: #a993b3; letter-spacing: 1px; }
.login-form { margin-top: 28px; text-align: left; }
.lf-row { margin-bottom: 16px; }
.lf-row label { display: block; font-size: 12px; color: #8a7aa8; margin-bottom: 6px; }
.lf-row input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 10px;
  border: 1px solid #ddd2e6; background: #fbf9fd; font-size: 14px; color: #463a50;
  outline: none; transition: border .15s;
}
.lf-row input:focus { border-color: #b08d4f; }
.lf-tip { min-height: 18px; font-size: 12px; color: #c09098; margin-bottom: 8px; }
.lf-btn {
  width: 100%; height: 44px; border: none; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #e3b874, #b08d4f);
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 8px;
  box-shadow: 0 12px 26px rgba(176,141,79,.35);
}
.lf-btn:hover { filter: brightness(1.05); }
.lf-demo { margin-top: 16px; font-size: 11px; color: #b3a4bd; line-height: 1.7; text-align: center; }

/* ---------- 主框架 ---------- */
.frame { display: flex; height: 100vh; overflow: hidden; }

/* 侧栏 */
.sidebar {
  width: 224px; flex-shrink: 0; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #3b2f45, #4a3b52 60%, #453650);
  color: #cfc2da;
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 20px 16px 16px; }
.sb-logo {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e3b874, #b08d4f); color: #fff; font-size: 18px;
}
.sb-name { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .5px; }
.sb-menu { flex: 1; overflow-y: auto; padding: 6px 12px 20px; }
.sb-menu::-webkit-scrollbar { width: 0; }
.sb-group { margin-top: 14px; padding: 0 10px 6px; font-size: 11px; color: #8a7aa8; letter-spacing: 2px; }
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin: 2px 0; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; color: #cfc2da; transition: background .15s;
  border-left: 3px solid transparent;
}
.sb-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-item.on {
  background: rgba(227,184,116,.14); color: #f3dcb2;
  border-left-color: #e3b874; font-weight: 600;
}
.sb-item .ic { width: 20px; text-align: center; font-size: 15px; }
.sb-foot { padding: 14px 22px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: #8a7aa8; line-height: 1.8; }
/* 发版号徽标：四位版本号（每部署自增 1），与 index.html 脚本 ?v= 同源，强刷后核对此处即知当前线上版本 */
.sb-build { display: inline-block; margin-left: 2px; padding: 0 6px; border-radius: 3px; background: rgba(227,184,116,.16); color: #e3b874; font-weight: 700; letter-spacing: 1px; }

/* 系统门户（v0122）：门户页隐藏侧栏（全宽四卡片）；系统内「返回系统总览」入口 + 当前系统标签 */
.frame.portal-mode .sidebar { display: none; }
.sb-back { margin: 6px 0 4px; color: #f3dcb2; background: rgba(227,184,116,.10); border: 1px solid rgba(227,184,116,.30); font-weight: 600; }
.sb-back:hover { background: rgba(227,184,116,.20); color: #fbeed2; }
.sb-cur { margin-top: 16px; padding: 0 10px 4px; font-size: 11px; color: #b9a6d0; letter-spacing: 1px; }

/* 内容区 */
.content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 56px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: #fff; border-bottom: 1px solid #ece5f2;
}
.tb-crumb { font-size: 16px; font-weight: 700; color: #4a3b52; letter-spacing: 1px; }
.tb-right { display: flex; align-items: center; gap: 14px; font-size: 12px; color: #a993b3; }
.tb-env {
  padding: 3px 10px; border-radius: 999px; font-size: 11px;
  background: rgba(227,184,116,.12); color: #b08d4f; border: 1px solid rgba(227,184,116,.4);
}
.tb-user { color: #6d5480; font-weight: 600; }
.tb-out {
  padding: 5px 14px; border-radius: 999px; cursor: pointer; font-size: 12px;
  border: 1px solid #ddd2e6; background: #fff; color: #8a7aa8;
}
.tb-out:hover { border-color: #c09098; color: #c09098; }

.page { flex: 1; overflow-y: auto; padding: 22px 24px 40px; }

/* ---------- 通用卡片 / 区块 ---------- */
.card {
  background: #fff; border-radius: 14px; padding: 20px 22px;
  border: 1px solid #efe8f5; box-shadow: 0 6px 18px rgba(140,110,165,.06);
  margin-bottom: 18px;
}
.card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-tt { font-size: 15px; font-weight: 700; color: #4a3b52; }
.card-tt .star { color: #e3b874; margin-right: 6px; }
.card-tip { font-size: 12px; color: #b3a4bd; line-height: 1.8; margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* 看板统计卡 */
.stat {
  background: #fff; border-radius: 14px; padding: 18px 20px;
  border: 1px solid #efe8f5; box-shadow: 0 6px 18px rgba(140,110,165,.06);
}
.stat .k { font-size: 12px; color: #a993b3; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 6px; color: #4a3b52; font-family: "Noto Serif SC", serif; }
.stat .v.gold { color: #b08d4f; }
.stat .d { font-size: 11px; margin-top: 6px; color: #7fbf8f; }
.stat .d.down { color: #c09098; }

/* ---------- 表单 ---------- */
.f-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.f-row .lb { width: 190px; flex-shrink: 0; font-size: 13px; color: #6d5480; text-align: right; }
.f-row .lb small { display: block; font-size: 11px; color: #b3a4bd; font-weight: 400; margin-top: 2px; }
.f-row .ct { flex: 1; display: flex; align-items: center; gap: 8px; }
.f-row .unit { font-size: 12px; color: #a993b3; }
.ipt {
  height: 36px; padding: 0 12px; border-radius: 8px; font-size: 13px; color: #463a50;
  border: 1px solid #ddd2e6; background: #fbf9fd; outline: none; transition: border .15s;
}
.ipt:focus { border-color: #b08d4f; }
.ipt.w-s { width: 90px; } .ipt.w-m { width: 180px; } .ipt.w-l { width: 320px; } .ipt.w-full { width: 100%; }
textarea.ipt { height: auto; min-height: 88px; padding: 10px 12px; line-height: 1.8; resize: vertical; }
select.ipt { cursor: pointer; }

/* 开关 */
.sw { position: relative; width: 44px; height: 24px; border-radius: 999px; background: #ddd2e6; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 2px 4px rgba(0,0,0,.15); }
.sw.on { background: linear-gradient(135deg, #e3b874, #b08d4f); }
.sw.on::after { left: 23px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 18px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 13px; transition: filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn.pri { background: linear-gradient(135deg, #e3b874, #b08d4f); color: #fff; font-weight: 600; box-shadow: 0 6px 14px rgba(176,141,79,.28); }
.btn.gh { background: #fff; border: 1px solid #ddd2e6; color: #8a7aa8; }
.btn.dgr { background: #fff; border: 1px solid #e6c2c7; color: #c09098; }
.btn.ok { background: #fff; border: 1px solid #bfe0c8; color: #5d9b6f; }
.btn.sm { height: 28px; padding: 0 12px; font-size: 12px; border-radius: 6px; }
.save-bar { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.save-bar .hint { font-size: 12px; color: #b3a4bd; }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; padding: 10px 12px; font-size: 12px; color: #8a7aa8; font-weight: 600;
  background: #faf7fc; border-bottom: 1px solid #ece5f2; white-space: nowrap;
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid #f3edf8; color: #463a50; vertical-align: middle; }
.tbl tr:hover td { background: #fdfbf7; }
.tbl .empty { text-align: center; color: #b3a4bd; padding: 30px 0; }

/* 徽章 */
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; white-space: nowrap; }
.tag.gold { background: rgba(227,184,116,.14); color: #b08d4f; border: 1px solid rgba(227,184,116,.45); }
.tag.blue { background: rgba(168,195,232,.18); color: #5a7fb0; border: 1px solid rgba(168,195,232,.5); }
.tag.green { background: rgba(160,208,170,.18); color: #5d9b6f; border: 1px solid rgba(160,208,170,.5); }
.tag.red { background: rgba(224,150,158,.14); color: #c09098; border: 1px solid rgba(224,150,158,.45); }
.tag.gray { background: #f1edf5; color: #a993b3; border: 1px solid #e5ddee; }
.tag.purple { background: rgba(195,166,232,.16); color: #8a6ab0; border: 1px solid rgba(195,166,232,.5); }

/* 子 tab */
.subtabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.subtab {
  padding: 7px 18px; border-radius: 999px; font-size: 13px; cursor: pointer;
  background: #fff; border: 1px solid #e5ddee; color: #8a7aa8;
}
.subtab.on { background: linear-gradient(135deg, #e3b874, #b08d4f); color: #fff; border-color: transparent; font-weight: 600; box-shadow: 0 6px 14px rgba(176,141,79,.25); }

/* 进度条 */
.pbar { height: 8px; border-radius: 999px; background: #efe8f5; overflow: hidden; }
.pbar .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #e3b874, #b08d4f); }

/* ---------- 弹层 / Toast ---------- */
.m-mask {
  position: fixed; inset: 0; z-index: 200; background: rgba(59,47,69,.5);
  display: flex; align-items: center; justify-content: center;
}
.m-box {
  /* 全站弹窗统一 16:9 大窗（与奖品录入弹窗同尺寸）：内容超出时仅内部滚动 */
  position: relative;
  width: min(1240px, 94vw);
  aspect-ratio: 16 / 9;
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 16px; padding: 20px 28px;
  border: 1px solid rgba(227,184,116,.4); box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
/* 内容含表格/选品列表时横向也尽量铺满 */
.m-box:has(.tbl), .m-box:has(.pk-row) { min-width: 0; }
@media (max-width: 860px) {
  .m-box { min-width: 0; width: auto; aspect-ratio: auto; }
  /* 内容含表格的弹窗横向铺满 */
  .m-box:has(.tbl), .m-box:has(.pk-row) { min-width: 90vw; }
}
.m-head { font-size: 16px; font-weight: 700; color: #4a3b52; margin-bottom: 14px; flex: none; padding-right: 34px; }
.m-body { font-size: 13px; color: #6d5480; line-height: 1.8; flex: 1 1 auto; overflow-y: auto; }
.m-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; flex: none; }
/* 关闭按钮：固定弹窗右上角（远离底部确认键，防误触） */
.m-x {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; padding: 0; border: none; border-radius: 50%;
  background: #f2ecf7; color: #8a7a95; font-size: 13px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 5;
}
.m-x:hover { background: #e5484d; color: #fff; }
/* wide 类名保留向后兼容：全站弹窗已统一 16:9，尺寸与录入弹窗一致 */
.m-box.wide {
  width: min(1240px, 94vw);
  aspect-ratio: 16 / 9;
  max-height: 88vh;
  min-width: 0;
  display: flex; flex-direction: column;
  padding: 20px 28px;
}
.m-box.wide .m-head { margin-bottom: 10px; flex: none; }
.m-box.wide .m-body { flex: 1 1 auto; overflow-y: auto; }
.m-box.wide .m-foot { flex: none; margin-top: 12px; }
/* slim 对话框（新建/编辑等表单弹窗）：大窗自适应高度，字段双列尽量一屏显示完，内容超出时仅内部滚动 */
.m-box.slim {
  width: min(1080px, 96vw);
  aspect-ratio: auto;
  max-height: 94vh;
  min-width: 0;
  display: flex; flex-direction: column;
  padding: 24px 32px;
}
.m-box.slim .m-head { margin-bottom: 10px; flex: none; }
.m-box.slim .m-body { flex: 1 1 auto; overflow-y: auto; }
.m-box.slim .m-foot { flex: none; margin-top: 12px; }
/* slim 内表单行紧凑（配合 f-grid 双列，尽量一屏显示完） */
.m-box.slim .f-row { padding: 7px 0; }
/* 双列表单栅格（wide 弹窗内字段分栏） */
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.f-grid .f-row.span2 { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .m-box.wide { aspect-ratio: auto; width: auto; min-width: 0; }
  .f-grid { grid-template-columns: 1fr; }
}
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 300;
  padding: 10px 22px; border-radius: 999px; font-size: 13px;
  background: #4a3b52; color: #fff; box-shadow: 0 10px 26px rgba(0,0,0,.25);
}

/* ---------- 聊天查询 ---------- */
.chat-wrap { display: flex; gap: 18px; align-items: flex-start; }
.chat-side { width: 300px; flex-shrink: 0; }
.chat-main { flex: 1; }
.sess {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px;
  cursor: pointer; border: 1px solid transparent; margin-bottom: 6px;
}
.sess:hover { background: #faf7fc; }
.sess.on { background: rgba(227,184,116,.1); border-color: rgba(227,184,116,.45); }
.sess .av {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f6cfe0, #cdd9f4); color: #6d4a63; font-size: 16px;
}
.sess .mt { flex: 1; min-width: 0; }
.sess .nm { font-size: 13px; font-weight: 600; color: #4a3b52; }
.sess .ls { font-size: 11px; color: #b3a4bd; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble-row { display: flex; margin-bottom: 12px; }
.bubble-row.me { justify-content: flex-end; }
.bubble {
  max-width: 70%; padding: 9px 14px; border-radius: 12px; font-size: 13px; line-height: 1.7;
  background: #f3eef8; color: #463a50;
}
.bubble-row.me .bubble { background: rgba(227,184,116,.18); }
.bubble .tm { display: block; font-size: 10px; color: #b3a4bd; margin-top: 4px; }
.bubble.img { padding: 6px; }
.bubble.img .fake-img {
  width: 150px; height: 110px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f6cfe0, #cdd9f4); color: #8a7aa8; font-size: 12px;
}

/* 合规警示条 */
.notice {
  display: flex; gap: 10px; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px;
  background: rgba(227,184,116,.08); border: 1px solid rgba(227,184,116,.4);
  font-size: 12px; color: #8a6a3f; line-height: 1.8;
}
.notice.blue { background: rgba(168,195,232,.1); border-color: rgba(168,195,232,.5); color: #5a7fb0; }
.notice.gold { background: rgba(227,184,116,.12); border-color: rgba(227,184,116,.55); color: #9a7434; }
.notice.red { background: rgba(214,106,126,.1); border-color: rgba(214,106,126,.55); color: #b05a5a; }

/* 卡池创建向导浮层 */
.wz-mask {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: rgba(60, 45, 70, 0.45); backdrop-filter: blur(3px); padding: 16px;
}
.wz-box {
  width: min(1240px, 94vw); aspect-ratio: 16 / 9; max-height: 92vh;
  background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 60px rgba(90, 60, 100, .25);
  display: flex; flex-direction: column;
}
.wz-hd {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 24px;
  border-bottom: 1px solid #f1ebf5; background: linear-gradient(135deg, rgba(246,207,224,.2), rgba(205,217,244,.2));
}
.wz-hd b { font-size: 15px; color: #4a3b52; flex: 0 0 auto; }
.wz-step { flex: 0 0 auto; margin-left: 12px; font-size: 12px; color: #9a8fb0; white-space: nowrap; }
.wz-bd { padding: 16px 24px; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.wz-bd .f-row { margin-bottom: 10px; }
.wz-bd textarea.ipt { min-height: 90px; resize: vertical; }
.wz-ft {
  flex: none; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px;
  border-top: 1px solid #f1ebf5; background: #fdfbff;
}
/* 向导步骤条（hd 中部）：数字+短名胶囊，当前金色高亮、已完成金描边 */
.wz-steps { display: flex; gap: 8px; align-items: center; flex: 1; justify-content: center; }
.wz-steps .st {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px;
  font-size: 12px; color: #a993b3; background: #f6f2fa; border: 1px solid #ece4f4; white-space: nowrap;
}
.wz-steps .st.on {
  background: linear-gradient(135deg, #e3b874, #d4a05e); border-color: #d4a05e; color: #fff;
  font-weight: 700; box-shadow: 0 4px 10px rgba(212, 160, 94, .35);
}
.wz-steps .st.done { color: #b08d4f; background: rgba(227, 184, 116, .14); border-color: rgba(227, 184, 116, .4); }
/* 向导小节标题（区块分隔：金色竖条 + 标题 + 灰说明） */
.wz-sec { display: flex; align-items: center; gap: 8px; margin: 16px 0 2px; font-size: 13px; font-weight: 700; color: #4a3b52; }
.wz-sec::before { content: ''; flex: none; width: 4px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, #e3b874, #c9965a); }
.wz-sec small { font-size: 11px; font-weight: 400; color: #b3a4bd; }
.wz-sec:first-child { margin-top: 0; }
/* 选品行两行结构：主行（勾选+图+名称+数量/概率输入）横向，徽章条与编码库存行独立成行 */
.pk-row.multi { flex-direction: column; align-items: stretch; gap: 3px; }
.pk-row.multi .pk-main { display: flex; align-items: center; gap: 8px; row-gap: 6px; width: 100%; flex-wrap: wrap; }
.pk-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0 0 22px; }
.pk-meta { font-size: 11px; color: #b3a4bd; margin: 0 0 0 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 选品实时指标卡（已选/概率总和/总抽数/总商品数） */
.sel-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.sel-stat {
  flex: 1 1 150px; min-width: 130px; border: 1px solid rgba(227, 184, 116, .45);
  background: linear-gradient(180deg, #fffdf6, #fdf9ee); border-radius: 10px; padding: 8px 14px;
}
.sel-stat .k { font-size: 11px; color: #9a8a6f; line-height: 1.4; }
.sel-stat .v { font-size: 18px; font-weight: 700; color: #4a3b52; margin-top: 2px; }
.sel-stat .v.ok { color: #3aa66b; }
.sel-stat .v.bad { color: #c96a6a; }
@media (max-width: 900px) { .wz-box { aspect-ratio: auto; width: min(720px, 94vw); } }

/* 响应式兜底 */
@media (max-width: 1100px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .chat-wrap { flex-direction: column; }
  .chat-side { width: 100%; }
}

/* 只读账号（无该模块操作权限）：锁定操作类按钮与开关，查看不受影响 */
body.no-act .btn.pri, body.no-act .btn.ok, body.no-act .btn.dgr,
body.no-act .save-bar .btn {
  pointer-events: none; opacity: .38; filter: grayscale(.4);
}
body.no-act .sw { pointer-events: none; opacity: .55; }

/* ========================================================
   模块页美化（数字权益 / 优惠券管理 同款样板）
   概览统计条 / 卡片副标题 / 操作按钮组 / 弹窗工具条
   ======================================================== */
/* 概览统计条：列表页顶部 4-6 个指标卡（金白渐变） */
.ov-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ov-stat {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #fffdf8, #fbf5ea);
  border: 1px solid rgba(227,184,116,.38); border-radius: 12px;
  padding: 12px 16px;
}
.ov-stat::after {
  content: ''; position: absolute; right: -16px; top: -16px;
  width: 66px; height: 66px; border-radius: 50%;
  background: radial-gradient(rgba(227,184,116,.2), transparent 70%);
}
.ov-stat .k { font-size: 11px; color: #a08a68; letter-spacing: 1px; }
.ov-stat .v { font-size: 22px; font-weight: 800; color: #4a3b52; margin-top: 3px; font-family: "Noto Serif SC", serif; line-height: 1.2; }
.ov-stat .v.gold { color: #b08d4f; }
.ov-stat .d { font-size: 11px; color: #b3a4bd; margin-top: 2px; }
/* 卡片标题旁副标题说明 */
.card-sub { font-size: 12px; color: #a993b3; font-weight: 400; margin-left: 8px; }
/* 表格操作按钮组（内联排列不换行） */
.op-group { display: inline-flex; gap: 6px; white-space: nowrap; }
.op-group .btn.sm { padding: 0 11px; }
/* 弹窗内工具条（兑换码生成/筛选区）：淡紫底圆角块 */
.cd-toolbar {
  background: linear-gradient(180deg, #fdfbff, #faf6fd);
  border: 1px solid #eee6f8; border-radius: 12px;
  padding: 8px 14px; margin: 12px 0 14px;
}
.cd-toolbar .f-row { padding: 6px 0; }
.cd-toolbar .lb { width: 92px; }
/* 弹窗内统计胶囊（已录/已发/未发） */
.cd-stat {
  display: inline-flex; gap: 16px; font-size: 12px; color: #8a7aa8;
  background: rgba(227,184,116,.1); border: 1px solid rgba(227,184,116,.35);
  border-radius: 999px; padding: 4px 16px;
}
.cd-stat b { color: #b08d4f; font-size: 13px; }
/* 弹窗表单节标题（金色竖条 + 标题） */
.f-sec { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; font-size: 13px; font-weight: 700; color: #4a3b52; }
.f-sec::before { content: ''; flex: none; width: 4px; height: 14px; border-radius: 2px; background: linear-gradient(180deg, #e3b874, #c9965a); }
.f-sec:first-child { margin-top: 0; }
.f-sec small { font-size: 11px; font-weight: 400; color: #b3a4bd; }
/* 双列表单网格（wide 弹窗） */
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; }
.f-grid .f-row.span2 { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .f-grid { grid-template-columns: 1fr; }
}

/* 商品库/卡池选品小表格 */
.tbl.mini { font-size: 12px; }
.tbl.mini th, .tbl.mini td { padding: 6px 8px; }
.pk-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #f4eff7; font-size: 12.5px; }
.pk-row:hover { background: #faf7fd; }
.pk-row .pk-name { flex: 1 1 120px; min-width: 60px; line-height: 1.5; }
.pk-row .ipt { padding: 4px 8px; font-size: 12px; }

/* ---- 快速筛选 chips 条（列表页通用，浅色主题） ---- */
.flt-bar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-bottom: 12px; padding: 10px 14px; background: #faf7ff; border: 1px solid #eee6f8; border-radius: 10px; }
.flt-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.flt-name { font-size: 11px; color: #a993b3; margin-right: 2px; white-space: nowrap; }
.flt-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 11px; font-size: 12px; color: #8a7aa8; background: #fff; border: 1px solid #ddd2e6; border-radius: 999px; cursor: pointer; user-select: none; transition: all .15s; white-space: nowrap; }
.flt-chip:hover { border-color: #b08d4f; color: #b08d4f; }
.flt-chip.on { background: linear-gradient(135deg, #c8954f, #b08d4f); border-color: #b08d4f; color: #fff; font-weight: 600; }
.flt-chip em { font-style: normal; font-size: 10px; opacity: .8; }

/* ========================================================
   官网运维（smilegame.cn 静态站）：左栏区块导航 + 卡片式编辑 / 图片位网格
   ======================================================== */
.site-top .ov-stats { margin-bottom: 12px; }
.site-top .save-bar { flex-wrap: wrap; row-gap: 8px; }
/* 左栏导航 + 右栏内容（左栏超出时区域内滚动） */
.site-wrap { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 16px; align-items: start; }
.site-rail {
  position: sticky; top: 12px; max-height: calc(100vh - 150px); overflow: auto;
  background: linear-gradient(180deg, #fffdf8, #fbf7ff);
  border: 1px solid #eee6f8; border-radius: 12px; padding: 8px 8px 4px;
}
.sn-group { font-size: 11px; letter-spacing: 1px; color: #a993b3; padding: 8px 8px 4px; }
.sn-item {
  display: flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 8px;
  font-size: 13px; color: #5b4a63; cursor: pointer; transition: all .15s;
}
.sn-item:hover { background: #faf7ff; color: #8a6a34; }
.sn-item.on { background: linear-gradient(135deg, #f7ead6, #fbf5ea); color: #8a6a34; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(227,184,116,.5); }
.sn-item .sn-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sn-item em { font-style: normal; font-size: 11px; color: #8a7aa8; background: #f4eff9; border-radius: 999px; padding: 1px 7px; }
.sn-item .sn-dot { font-style: normal; font-size: 10px; color: #fff; background: #d97b7b; border-radius: 999px; padding: 1px 6px; }
.sn-tip { font-size: 11px; color: #b3a4bd; line-height: 1.7; padding: 8px; margin-top: 6px; border-top: 1px dashed #eee6f8; }
.site-main { min-width: 0; }
/* 卡片 = 编辑单元（序号 + 标题 + 换序/删除 + 字段 + 内联图片位） */
.site-card { background: #fff; border: 1px solid #eee6f8; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.site-card:hover { border-color: rgba(227,184,116,.7); }
.sc-hd { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px dashed #f2ecf8; }
.sc-no { flex: none; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #e3b874, #c9965a); }
.sc-hd b { flex: 1; min-width: 0; font-size: 13px; color: #4a3b52; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-tools { display: inline-flex; gap: 6px; }
.sc-body { display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 14px; align-items: start; }
.sc-fields { min-width: 0; }
.sc-fields .f-row .lb { width: 168px; }
/* 内联图片位（缩略图可点击看原图） */
.site-img { display: flex; gap: 10px; align-items: flex-start; background: #fbf9fe; border: 1px solid #f0eaf6; border-radius: 10px; padding: 8px; }
.site-img.empty { border-style: dashed; }
.si-thumb {
  flex: none; width: 76px; height: 76px; border-radius: 8px; overflow: hidden; background: #f1ecf7;
  border: 1px dashed #ded3e8; cursor: zoom-in; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #b3a4bd; text-align: center;
}
.si-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.si-meta { flex: 1; min-width: 0; font-size: 11.5px; line-height: 1.65; }
.si-meta b { display: block; font-size: 12px; color: #4a3b52; word-break: break-all; }
.si-meta em { display: block; font-style: normal; color: #8a7aa8; }
.si-meta small { display: block; color: #a993b3; }
.si-btns { display: inline-flex; gap: 6px; margin-top: 6px; }
/* 图片总览：图片位网格 / 批量上传 / 对照表 / 未挂靠文件 */
.site-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.site-batch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 6px 0 2px; }
.site-batch input[type=file] { font-size: 12px; color: #8a7aa8; }
.site-tbl { max-height: 520px; overflow: auto; }
.site-orphans { display: flex; flex-wrap: wrap; gap: 8px; }
.site-orphan { display: flex; align-items: center; gap: 8px; background: #fbf9fe; border: 1px solid #f0eaf6; border-radius: 8px; padding: 5px 10px; font-size: 12px; }
.site-orphan a { color: #8a6a34; text-decoration: none; }
.site-orphan em { font-style: normal; font-size: 11px; color: #b3a4bd; }
/* 概率公示：概率行（角标 + 名称 + 概率 + 排序） */
.site-rows { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.site-row { display: flex; align-items: center; gap: 6px; }
/* ---------- 官网运维 · 产品管理（产品清单 / 明细简报 / 批量上传目标产品） ---------- */
#siteProdBox:not(:empty) { margin-bottom: 14px; }
.site-prods .card-hd { align-items: flex-start; }
.sp-no {
  flex: none; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #e3b874, #c9965a);
}
.sp-tools { flex: none; display: inline-flex; gap: 6px; white-space: nowrap; }
/* 左栏分组标题：产品级分组追加当前产品名（金色） */
.sn-group b { color: #c9965a; font-weight: 700; }
@media (max-width: 1180px) {
  .site-wrap { grid-template-columns: 1fr; }
  .site-rail { position: static; max-height: none; }
  .sc-body { grid-template-columns: 1fr; }
  .sc-fields .f-row { flex-direction: column; align-items: stretch; }
  .sc-fields .f-row .lb { width: auto; text-align: left; }
}
