.adm { display: grid; grid-template-columns: 214px 1fr; min-height: 100vh; }
.adm-side { background: #12151d; color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px 14px; }
.adm-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; }
.brand-logo.sm { width: 34px; height: 34px; flex-basis: 34px; font-size: 15px; border-radius: 10px; }
.adm-brand strong { display: block; font-size: 14px; }
.adm-brand span { font-size: 10.5px; color: #7c8598; }
.adm-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.adm-nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px; color: #9aa3b5; text-decoration: none; font-size: 13.5px; transition: all .15s; }
.adm-nav a .ico { width: 18px; text-align: center; font-size: 15px; }
.adm-nav a:hover { background: #1a1f2b; color: #e7ebf3; }
.adm-nav a.on { background: linear-gradient(135deg, rgba(109,94,252,.95), rgba(139,123,255,.95)); color: #fff; font-weight: 600; }
.adm-nav a .dot { margin-left: auto; background: #f04438; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 8px; }
/* 待审核数量红点（菜单 + Tab 右上角） */
.count-badge { position: absolute; top: 2px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: #f04438; color: #fff; font-size: 10px; line-height: 16px; font-style: normal; font-weight: 600; text-align: center; box-shadow: 0 2px 4px rgba(240,68,56,.35); }
.tabs button .count-badge { top: -5px; right: -5px; }
.adm-foot { border-top: 1px solid #232937; padding-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px 4px 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #6d5efc, #2e90fa); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: 0 0 32px; color: #fff; }
.user-chip strong { display: block; font-size: 13px; }
.user-chip span { font-size: 10.5px; color: #7c8598; }

.adm-main { display: flex; flex-direction: column; min-width: 0; }
.adm-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid rgba(230,232,238,.7); position: sticky; top: 0; z-index: 20; background: rgba(244,245,248,.9); backdrop-filter: blur(8px); }
.adm-top h2 { margin: 0; font-size: 18px; }
.today { font-size: 12px; color: var(--muted); }
.adm-top-r { display: flex; align-items: center; gap: 10px; }
.theme-dd { position: relative; }
.theme-dd-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; font-size: 12px; font-family: inherit; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.theme-dd-btn:hover { border-color: var(--primary); color: var(--primary); }
.theme-dd-btn .theme-ico { display: none; }
.theme-dd-btn[data-theme="system"] .theme-ico[data-for="system"],
.theme-dd-btn[data-theme="light"] .theme-ico[data-for="light"],
.theme-dd-btn[data-theme="dark"] .theme-ico[data-for="dark"] { display: block; }
.caret { font-size: 9px; color: var(--muted); }
.theme-dd-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 150px; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 40; }
.theme-dd-menu button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 0; background: transparent; border-radius: 7px; font-size: 12.5px; font-family: inherit; color: var(--text); cursor: pointer; text-align: left; }
.theme-dd-menu button:hover { background: #f3f4f8; }
.theme-dd-menu .chk { margin-left: auto; font-size: 12px; color: var(--primary); visibility: hidden; }
.theme-dd-menu button.on .chk { visibility: visible; }
html[data-theme="dark"] .theme-dd-btn { background: #232735; border-color: var(--line); color: var(--text); }
html[data-theme="dark"] .theme-dd-menu { background: #1b1f2a; border-color: var(--line); }
html[data-theme="dark"] .theme-dd-menu button:hover { background: #262b3a; }
.adm-page { padding: 18px 24px 40px; flex: 1; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border: 1px solid rgba(230,232,238,.6); position: relative; overflow: hidden; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 25px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.stat .sub { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.stat.accent::after { content: ''; position: absolute; right: -30px; top: -30px; width: 96px; height: 96px; border-radius: 50%; background: linear-gradient(135deg, rgba(109,94,252,.16), rgba(46,144,250,.06)); }

.grid2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 8px; }
.chart .bw { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.chart .bar { width: 100%; max-width: 40px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--primary-2), var(--primary)); min-height: 4px; }
.chart .bv { font-size: 10.5px; color: var(--muted); }
.chart .bd { font-size: 11px; color: var(--muted); }

.rank-item { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.rank-item:last-child { border: 0; }
.rank-no { width: 22px; height: 22px; border-radius: 7px; background: #f0f1f6; color: var(--muted); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; flex: 0 0 22px; }
.rank-item:nth-child(1) .rank-no { background: #fff4d6; color: #b7791f; }
.rank-item:nth-child(2) .rank-no { background: #eceef3; color: #5b6472; }
.rank-item:nth-child(3) .rank-no { background: #fbe9e3; color: #b45309; }
.rank-name { flex: 1; font-size: 13.5px; }
.rank-name span { display: block; font-size: 11px; color: var(--muted); }
.rank-amt { font-weight: 600; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type=text], .toolbar select { width: auto; min-width: 130px; padding: 8px 11px; }
.tabs { display: flex; gap: 4px; background: #eceef3; padding: 8px 3px 3px; border-radius: 10px; overflow-x: auto; }
.tabs button { position: relative; border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 12.5px; color: var(--muted); cursor: pointer; font-family: inherit; white-space: nowrap; }
.tabs button.has-badge { padding-right: 20px; }
.tabs button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.spacer { flex: 1; }

.kv { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kv b { color: var(--text); }
.order-clickable { cursor: pointer; transition: border-color .15s, background .15s; }
.order-clickable:hover { border-color: var(--primary); background: #fbfcff; }
.order-select { display: flex; align-items: flex-start; padding-top: 4px; cursor: pointer; }
.order-select input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.recycle-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 13px; color: var(--muted); }
.recycle-bar label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.recycle-bar input { accent-color: var(--primary); }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .adm { grid-template-columns: 1fr; }
  .adm-side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid #232937; flex-direction: row; z-index: 50; }
  .adm-brand, .adm-foot { display: none; }
  .adm-nav { flex-direction: row; justify-content: space-around; width: 100%; overflow-x: auto; }
  .adm-nav a { flex-direction: column; gap: 1px; font-size: 10px; padding: 5px 4px; flex: 1; min-width: 48px; justify-content: center; }
  .adm-nav a .ico { font-size: 17px; }
  .adm-main { padding-bottom: 72px; }
  .adm-top { padding: 12px 14px; }
  .adm-top h2 { font-size: 16px; }
  .adm-page { padding: 4px 12px 24px; }
  .item { flex-wrap: wrap; padding: 12px 13px; }
  .item-amount { text-align: left; }
  .item-actions { width: 100%; }
  .item-actions .btn { flex: 1; }
}
/* ===== 价格表图片管理 ===== */
.price-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pa-item { border: 1px solid rgba(230,232,238,.9); border-radius: 12px; padding: 10px 12px; }
.pa-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pa-head b { font-size: 13.5px; }
.pa-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pa-img { position: relative; border-radius: 8px; overflow: hidden; background: #f3f4f8; aspect-ratio: 3 / 4; }
.pa-img img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.pa-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pa-imgs .photo-add { aspect-ratio: 3 / 4; font-size: 10.5px; gap: 2px; }
.pa-imgs .pa-empty { grid-column: 1 / -1; aspect-ratio: auto; flex-direction: row; gap: 6px; padding: 11px 10px; font-size: 12px; }
.pa-none { grid-column: 1 / -1; font-size: 11.5px; color: #98a1b3; padding: 10px 0; }
.pa-head-right { display: flex; align-items: center; gap: 8px; }
.pa-game-del { border: 0; background: none; color: #b42318; font-size: 11.5px; cursor: pointer; padding: 2px 0; font-family: inherit; }
.pa-game-del:hover { text-decoration: underline; }
.pa-move { display: inline-flex; gap: 3px; }
.pa-mv { width: 20px; height: 20px; border: 1px solid rgba(230,232,238,.95); background: #fff; border-radius: 6px; font-size: 11px; line-height: 1; color: #4b5563; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; font-family: inherit; }
.pa-mv:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pa-mv:disabled { opacity: .35; cursor: not-allowed; }
.pa-head { flex-wrap: wrap; row-gap: 4px; }
.pa-head-right { gap: 10px; flex-wrap: wrap; }
.pa-mv { width: 22px; height: 22px; font-size: 12px; }
.price-admin { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.pa-price { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #eceef4; flex-wrap: wrap; }
.pa-price-label { font-size: 12px; color: #5b6472; }
.pa-price-input { flex: 0 0 96px; width: 96px; padding: 6px 8px; border: 1px solid rgba(230,232,238,.95); border-radius: 8px; font-size: 13px; font-family: inherit; }
.pa-price .btn { flex: 0 0 auto; }
.pa-price .hint { flex: 0 0 auto; }
.pa-price b { font-size: 14px; color: var(--primary); }

/* 审核选抽成 */
.cut-pick { display: flex; gap: 10px; }
.cut-opt {
  flex: 1; display: flex; flex-direction: column; gap: 3px; cursor: pointer;
  border: 1px solid #e3e8f0; border-radius: 10px; padding: 10px 12px; background: #fff;
}
.cut-opt b { font-size: 16px; color: #1f2733; }
.cut-opt em { font-style: normal; font-size: 11.5px; color: #8a93a5; }
.cut-opt input { margin: 0 0 2px; }
.cut-opt:has(input:checked) { border-color: #3b6ef5; background: #f3f6ff; box-shadow: 0 0 0 2px rgba(59,110,245,.12); }
#cut-pv { font-size: 13px; }

/* 审核弹窗：订单明细 */
.audit-info { background: #f7f9fc; border: 1px solid #e8edf5; border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; }
.ai-row { display: flex; gap: 10px; padding: 6px 0; font-size: 13px; line-height: 1.5; border-bottom: 1px dashed #e8edf5; }
.ai-row:last-child { border-bottom: 0; }
.ai-row span { flex: 0 0 76px; color: #8a93a5; }
.ai-row b { font-weight: 600; color: #1f2733; word-break: break-word; }

/* ===== 深色模式（管理后台） ===== */
html[data-theme="dark"] .adm-top { background: rgba(18,20,27,.9); border-bottom-color: var(--line); }
html[data-theme="dark"] .stat { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .tabs { background: #232735; }
html[data-theme="dark"] .tabs button.on { background: #2f3547; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
html[data-theme="dark"] .recycle-bar { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .order-clickable:hover { background: #262b3a; }
html[data-theme="dark"] .rank-no { background: #2a2f3f; }
html[data-theme="dark"] .rank-item:nth-child(1) .rank-no { background: #3a2f17; color: #e2b860; }
html[data-theme="dark"] .rank-item:nth-child(2) .rank-no { background: #2f3547; color: #b9c1d1; }
html[data-theme="dark"] .rank-item:nth-child(3) .rank-no { background: #3a2620; color: #e0a583; }
html[data-theme="dark"] .cut-opt { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .cut-opt b { color: var(--text); }
html[data-theme="dark"] .cut-opt em { color: var(--muted); }
html[data-theme="dark"] .cut-opt:has(input:checked) { background: #232a3d; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(109,94,252,.2); }
html[data-theme="dark"] .audit-info { background: #232735; border-color: var(--line); }
html[data-theme="dark"] .ai-row { border-bottom-color: var(--line); }
html[data-theme="dark"] .ai-row span { color: var(--muted); }
html[data-theme="dark"] .ai-row b { color: var(--text); }
html[data-theme="dark"] .pa-item { border-color: var(--line); }
html[data-theme="dark"] .pa-img { background: #232735; }
html[data-theme="dark"] .pa-mv { background: #232735; border-color: var(--line); color: #b9c1d1; }
html[data-theme="dark"] .pa-price { border-top-color: var(--line); }
html[data-theme="dark"] .pa-price-label { color: var(--muted); }
html[data-theme="dark"] .pa-none { color: var(--muted); }
html[data-theme="dark"] .pa-game-del { color: #f97066; }
