:root {
  --brand: #ef3b3b; --brand2: #ff8a3d; --ink: #17131d; --ink2: #3a3442; --line: #ece6ea;
  --bg: #f7f4f6; --card: #fff; --ok: #12a150; --warn: #d97706; --danger: #e5484d; --info: #2563eb;
  --grad: linear-gradient(135deg, #ef3b3b, #ff8a3d);
  --shadow: 0 1px 2px rgba(23,19,29,.04), 0 8px 24px rgba(23,19,29,.06);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; color: var(--ink); }

.btn { border: 0; border-radius: 10px; padding: 8px 16px; cursor: pointer; font-weight: 600; background: #f1edf0; color: var(--ink); transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn:hover { background: #e8e2e6; }
.btn:active { transform: scale(.97); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .side__nav button:focus-visible { outline: 2px solid var(--brand2); outline-offset: 2px; }
.btn--primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(239,59,59,.28); }
.btn--primary:hover { background: var(--grad); box-shadow: 0 8px 22px rgba(239,59,59,.38); }
.btn--danger { background: #fdecec; color: #c4262c; }
.btn--danger:hover { background: #fbdcdc; }
.btn--ok { background: #e5f6ec; color: #0b7a3b; }
.btn--ok:hover { background: #d3efdf; }
.btn--ghost { background: #fff; border: 1px solid var(--line); }
.btn--sm { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; padding: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: #fff; }
label { display: grid; gap: 6px; font-weight: 600; color: var(--ink); }
.form-error { color: var(--danger); min-height: 20px; margin: 0; font-weight: 600; }

/* 登录 */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #ffe3d6 0, transparent 40%), radial-gradient(circle at 85% 90%, #ffe0e6 0, transparent 40%), var(--bg); }
.login__card { width: min(380px, 92vw); background: #fff; border-radius: 20px; padding: 32px 28px; box-shadow: 0 20px 60px rgba(23,19,29,.12); display: grid; gap: 14px; animation: rise .5s ease both; }
.login__logo { width: 120px; justify-self: center; }
.login__card h1 { text-align: center; font-size: 22px; }
.login__sub { text-align: center; margin: -6px 0 6px; color: var(--ink2); }
.login__hint { margin: 0; font-size: 12px; color: var(--ink2); text-align: center; }

/* 布局 */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.side__brand img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 12px; padding: 3px; }
.side__brand b { display: block; font-size: 16px; }
.side__brand span { font-size: 11px; letter-spacing: .12em; color: #ffb38a; }
.side__nav { display: grid; gap: 4px; margin-top: 16px; }
.side__nav button { position: relative; text-align: left; border: 0; background: transparent; color: #fff; padding: 11px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; transition: background .15s; }
.side__nav button:hover { background: rgba(255,255,255,.08); }
.side__nav button.is-active { background: var(--grad); box-shadow: 0 6px 18px rgba(239,59,59,.35); }
.dot { position: absolute; right: 12px; top: 50%; margin-top: -4px; width: 8px; height: 8px; border-radius: 50%; background: #ffd23f; box-shadow: 0 0 0 3px rgba(255,210,63,.25); }
.side__logout { margin-top: auto; border: 1px solid rgba(255,255,255,.2); background: transparent; color: #fff; border-radius: 10px; padding: 10px; cursor: pointer; font-weight: 600; }
.side__logout:hover { background: rgba(255,255,255,.08); }
.main { padding: 22px 28px 40px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.topbar h2 { font-size: 22px; }
.view { animation: rise .35s ease both; }

/* 卡片与统计 */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card { background: var(--card); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.card + .card, .grid + .card, .card + .grid { margin-top: 14px; }
.grid > .card { margin-top: 0; }
.grid--4 { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid--4 > div { background: #fff7f2; border-radius: 10px; padding: 10px; }
.dialog table td { padding: 8px 6px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card__head h3 { font-size: 16px; }
.stat { position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(23,19,29,.1); }
.stat__label { font-weight: 600; color: var(--ink2); }
.stat__value { font-size: 26px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat__sub { margin-top: 4px; font-size: 12px; color: var(--ink2); }
.stat--hot { background: var(--grad); color: #fff; }
.stat--hot .stat__label, .stat--hot .stat__sub, .stat--hot .stat__value { color: #fff; }
.money { color: var(--brand); font-weight: 800; font-variant-numeric: tabular-nums; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--ink2); font-weight: 700; background: #faf8f9; white-space: nowrap; }
tr:hover td { background: #fffaf7; }
td .name { font-weight: 700; color: var(--ink); }
td .meta { font-size: 12px; color: var(--ink2); margin-top: 2px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { text-align: center; padding: 30px; color: var(--ink2); }
.thumb { width: 54px; height: 40px; border-radius: 8px; object-fit: cover; }

.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag--ok { background: #e5f6ec; color: #0b7a3b; }
.tag--warn { background: #fff3dc; color: #a35a00; }
.tag--info { background: #e6eeff; color: #1d4ed8; }
.tag--danger { background: #fdecec; color: #c4262c; }
.tag--off { background: #efedf0; color: #4a4450; }
.tag--hot { background: var(--grad); color: #fff; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; }
.tabs button.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs b { margin-left: 4px; color: var(--brand); }
.tabs button.is-active b { color: #ffb38a; }

.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-width: 820px; }
.form-grid .full { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--ink2); font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 18px; height: 18px; }
.preview { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: #fff7f2; border: 1px dashed #ffc7a6; }
.preview img { width: 72px; height: 54px; border-radius: 8px; object-fit: cover; }
.strike { text-decoration: line-through; color: var(--ink2); margin-left: 6px; font-size: 12px; }

/* 弹窗与提示 */
.dialog { border: 0; border-radius: 18px; padding: 0; width: min(440px, 92vw); box-shadow: 0 30px 80px rgba(23,19,29,.25); }
.dialog::backdrop { background: rgba(23,19,29,.45); }
.dialog form { padding: 22px; display: grid; gap: 14px; }
.dialog h3 { font-size: 18px; }
.dialog p { margin: 0; color: var(--ink2); line-height: 1.6; }
.dialog .row { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; opacity: 0; pointer-events: none; transition: .25s; font-weight: 600; z-index: 10; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side__nav { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .side__logout { margin-top: 12px; }
  .main { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* 列表编辑器（公告 / TIPS / 滚动卡片） */
.le { display: grid; gap: 12px; margin-top: 10px; }
.le__row { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; transition: opacity .2s, box-shadow .2s; }
.le__row:hover { box-shadow: 0 6px 18px rgba(23,19,29,.06); }
.le__row--off { opacity: .55; }
.le__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.le__head .actions { margin-left: auto; }
.le__no { width: 26px; height: 26px; border-radius: 8px; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 13px; }
.le__fields { max-width: none; }
.search { width: 200px; }

/* 图片选择 */
.picker { display: flex; gap: 14px; align-items: flex-start; }
.picker__thumb { width: 140px; height: 80px; object-fit: cover; border-radius: 10px; background: #f1edf0; flex: none; }
.picker__ctl { flex: 1; display: grid; gap: 8px; min-width: 0; }

/* 滚动卡片预览（还原小程序首页样式） */
.bn-preview { position: relative; height: 180px; max-width: 420px; border-radius: 18px; overflow: hidden; background: #2a1d24; box-shadow: 0 12px 30px rgba(23,19,29,.18); }
.bn-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bn-preview::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,10,14,.82), rgba(20,10,14,.2)); }
.bn-preview__copy { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 16px; display: grid; gap: 6px; color: #fff; justify-items: start; }
.bn-preview__copy b { font-size: 20px; color: #fff; }
.bn-preview__copy span { font-size: 12px; color: #fff; }
.bn-preview__kicker { background: #ffd9e2; color: #8a1238 !important; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.bn-preview__copy i { font-style: normal; background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; margin-top: 4px; }

/* 商品卡片预览 */
.pc-preview { width: 200px; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--line); margin-top: 6px; }
.pc-preview img { width: 100%; height: 110px; object-fit: cover; display: block; }
.pc-preview__body { padding: 10px 12px 12px; }
.pc-preview__body b { font-size: 15px; color: var(--ink); }
.pc-preview__body p { margin: 4px 0 8px; font-size: 12px; color: var(--ink2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
textarea { resize: vertical; }
/* 私信监管 */
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 520px; margin-top: 14px; overflow: auto; padding: 4px; }
.chat-msg { max-width: 78%; padding: 10px 12px; border-radius: 12px; background: #f6f0eb; }
.chat-msg--booster { align-self: flex-end; background: #fff1e8; }
.chat-msg.is-hidden { opacity: .55; }
.chat-msg__text { margin: 4px 0 6px; color: #111; font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-all; }
.chat-img { display: block; max-width: 180px; max-height: 180px; margin: 4px 0 6px; border-radius: 10px; object-fit: cover; cursor: zoom-in; background: #ece3dc; }
