/* ===== 肛肠后台样式 · 白侧栏商务蓝版 ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eaf1fe;
    --primary-deep: #0f2a5c;
    --sidebar-w: 200px;
    --topbar-h: 56px;
    --bg: #f0f3f8;
    --text: #1e293b;
    --text-sub: #64748b;
    --line: #e6eaf2;
    --shadow-sm: 0 1px 2px rgba(15,42,92,.05), 0 2px 10px rgba(15,42,92,.05);
    --shadow-md: 0 6px 20px rgba(15,42,92,.12);
    --radius: 10px;
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font:14px/1.65 -apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",system-ui,sans-serif;
    background:var(--bg); color:var(--text);
    -webkit-font-smoothing:antialiased;
}
a { color:var(--primary); text-decoration:none; transition:color .15s; }

/* ---------- 白色侧栏 ---------- */
.sidebar {
    position:fixed; left:0; top:0; bottom:0; width:var(--sidebar-w);
    background:#fff; border-right:1px solid var(--line);
    display:flex; flex-direction:column; z-index:10;
}
.sidebar .logo {
    height:var(--topbar-h); display:flex; align-items:center; gap:10px;
    padding:0 20px; border-bottom:1px solid var(--line);
}
.logo-icon {
    width:34px; height:34px; border-radius:9px; flex:none;
    background:linear-gradient(135deg,var(--primary-light),var(--primary));
    display:flex; align-items:center; justify-content:center;
    box-shadow:0 3px 10px rgba(37,99,235,.35);
}
.logo-icon svg { width:18px; height:18px; }
.logo-txt { font-size:16px; font-weight:700; color:var(--primary-deep); letter-spacing:1px; }

.sidebar nav { flex:1; padding:14px 10px; display:flex; flex-direction:column; gap:3px; overflow:auto; }
.sidebar nav a {
    display:flex; align-items:center; gap:11px;
    padding:10px 14px; border-radius:9px; color:#3f4c63; font-size:13.5px;
    border-left:3px solid transparent;
    transition:background .15s, color .15s;
}
.sidebar nav a svg { width:16px; height:16px; flex:none; color:#8fa3c4; transition:color .15s; }
.sidebar nav a:hover { background:#f5f8fd; color:var(--primary); }
.sidebar nav a:hover svg { color:var(--primary); }
.sidebar nav a.on {
    background:var(--primary-bg); color:var(--primary); font-weight:600;
    border-left-color:var(--primary);
}
.sidebar nav a.on svg { color:var(--primary); }

/* ---------- 顶栏 ---------- */
.wrapper { margin-left:var(--sidebar-w); min-height:100vh; display:flex; flex-direction:column; }
.topbar {
    position:sticky; top:0; z-index:9; height:var(--topbar-h);
    background:#fff; border-bottom:1px solid var(--line);
    display:flex; align-items:center; justify-content:space-between;
    padding:0 28px;
}
.topbar-title { font-size:16px; font-weight:700; color:var(--primary-deep); }
.topbar-right { display:flex; align-items:center; gap:14px; }
.admin-name { font-size:13px; color:var(--text-sub); }

/* ---------- 主区（全屏） ---------- */
.main { padding:22px 28px 40px; }
h3.block-title { font-size:14px; font-weight:700; margin:24px 0 12px; display:flex; align-items:center; gap:8px; color:var(--primary-deep); }
h3.block-title::before { content:""; width:3px; height:14px; border-radius:2px; background:var(--primary); }

/* 统计卡片 */
.card-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-bottom:18px; }
.card {
    background:#fff; border-radius:var(--radius); padding:16px 22px; min-width:180px;
    box-shadow:var(--shadow-sm); border:1px solid var(--line);
    position:relative; overflow:hidden; transition:transform .15s, box-shadow .15s;
}
.card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); }
.card::after { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:linear-gradient(180deg,var(--primary),var(--primary-light)); }
.card span { font-size:12px; color:var(--text-sub); }
.card b { display:block; font-size:24px; color:var(--primary-deep); margin-top:4px; font-variant-numeric:tabular-nums; letter-spacing:.5px; }

/* 面板 */
.panel { background:#fff; border-radius:var(--radius); padding:18px 22px; box-shadow:var(--shadow-sm); border:1px solid var(--line); }

/* 搜索条 */
.searchbar { display:flex; gap:9px; margin-bottom:14px; flex-wrap:wrap; align-items:center; }
.searchbar input, .searchbar select {
    padding:8px 12px; border:1px solid var(--line); border-radius:8px; font-size:13px;
    background:#fafbfd; transition:border-color .15s, box-shadow .15s; font-family:inherit;
}
.searchbar input:focus, .searchbar select:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,.12); }

/* 搜索行内统计 */
.stat-inline { display:inline-flex; align-items:baseline; gap:8px; margin-left:auto; flex-wrap:wrap; }
.stat-inline i { font-style:normal; font-size:12px; color:var(--text-sub); margin-left:10px; }
.stat-inline b { font-size:15px; color:var(--primary-dark); font-variant-numeric:tabular-nums; }

/* 按钮 */
.btn {
    display:inline-flex; align-items:center; justify-content:center; gap:5px;
    padding:8px 18px; border:1px solid var(--primary); border-radius:8px; font-size:13px; font-weight:500;
    background:var(--primary); color:#fff; cursor:pointer; white-space:nowrap;
    transition:background .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background:var(--primary-dark); border-color:var(--primary-dark); box-shadow:0 3px 12px rgba(37,99,235,.3); }
.btn:active { transform:scale(.97); }
.btn.gray  { background:#fff; border-color:var(--line); color:#475569; }
.btn.gray:hover { background:#f5f8fd; border-color:#c9d5e8; color:var(--primary); box-shadow:none; }
.btn.red   { background:#ef5350; border-color:#ef5350; }
.btn.red:hover { background:#e04845; border-color:#e04845; box-shadow:0 3px 12px rgba(239,83,80,.3); }
.btn.green { background:#16a34a; border-color:#16a34a; }
.btn.green:hover { background:#15803d; border-color:#15803d; box-shadow:0 3px 12px rgba(22,163,74,.3); }
.btn.warn  { background:#d97706; border-color:#d97706; }
.btn.warn:hover { background:#b45309; border-color:#b45309; box-shadow:0 3px 12px rgba(217,119,6,.3); }
.btn.sm    { padding:4px 11px; font-size:12px; border-radius:7px; }

/* 富文本编辑器 */
.editor-bar { border:1px solid var(--line); border-bottom:0; border-radius:10px 10px 0 0; background:#f6f9fc; padding:8px; }
.editor-bar button { border:1px solid var(--line); background:#fff; border-radius:6px; padding:5px 11px; margin-right:5px; cursor:pointer; font-size:13px; transition:all .12s; }
.editor-bar button:hover { background:var(--primary-bg); border-color:var(--primary); }
.editor-box { border:1px solid var(--line); border-radius:0 0 10px 10px; min-height:280px; max-height:520px; overflow:auto; padding:14px; background:#fff; font-size:14px; line-height:1.8; outline:none; }
.editor-box:focus { box-shadow:0 0 0 3px rgba(37,99,235,.08); }
.editor-box img { max-width:100%; border-radius:6px; }

/* 表格 */
table.grid { width:100%; border-collapse:separate; border-spacing:0; background:#fff; }
table.grid th, table.grid td { padding:10px 14px; border-bottom:1px solid var(--line); text-align:left; font-size:13px; word-break:break-all; }
table.grid th { background:#f7f9fc; color:#55627a; font-weight:600; white-space:nowrap; font-size:12.5px; }
table.grid th:first-child { border-radius:8px 0 0 8px; }
table.grid th:last-child  { border-radius:0 8px 0 0; }
table.grid tbody tr, table.grid tr { transition:background .12s; }
table.grid tr:hover td { background:#f5f9ff; }
.tag { display:inline-block; padding:2px 10px; border-radius:4px; font-size:12px; font-weight:500; }
.tag.ok    { background:#e0f4ec; color:#0c7a58; }
.tag.refund{ background:#fdeaea; color:#d04840; }
.tag.warn  { background:#fdf3df; color:#b07a14; }
.tag.info  { background:var(--primary-bg); color:var(--primary-dark); }
.tag.off   { background:#eef1f4; color:#8a95a3; }

/* 分页（右对齐，含总数） */
.pager { margin:16px 0 2px; display:flex; justify-content:flex-end; align-items:center; gap:4px; flex-wrap:wrap; }
.pager .sum { color:var(--text-sub); font-size:12.5px; margin-right:8px; }
.pager a { display:inline-flex; align-items:center; justify-content:center; min-width:30px; height:30px; padding:0 9px; border:1px solid var(--line); border-radius:7px; background:#fff; color:#475569; font-size:13px; transition:all .15s; }
.pager a:hover { border-color:var(--primary); color:var(--primary); }
.pager a.cur { background:var(--primary); border-color:var(--primary); color:#fff; font-weight:600; }
.pager .dots { color:#94a3b8; margin:0 3px; }

/* 表单 */
.form-table { width:100%; }
.form-table th { width:140px; text-align:right; padding:10px 14px 10px 0; vertical-align:top; color:#55627a; font-weight:600; font-size:13px; }
.form-table td { padding:10px 0; }
.form-table input[type=text], .form-table input[type=number], .form-table select, .form-table textarea {
    width:100%; max-width:560px; padding:9px 12px; border:1px solid var(--line); border-radius:8px;
    font-size:13px; font-family:inherit; background:#fafbfd; transition:border-color .15s, box-shadow .15s;
}
.form-table input:focus, .form-table select:focus, .form-table textarea:focus {
    outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.form-table textarea { min-height:90px; }
.form-table textarea.tall { min-height:260px; font-family:Consolas,monospace; }
.thumb { max-width:90px; max-height:60px; border-radius:8px; vertical-align:middle; border:1px solid var(--line); object-fit:cover; }

/* 提示 */
.alert { padding:10px 16px; border-radius:9px; margin-bottom:14px; font-size:13px; border:1px solid transparent; }
.alert.ok   { background:#e6f6ef; color:#0c7a58; border-color:#c3e8d8; }
.alert.err  { background:#fdeaea; color:#d04840; border-color:#f6c8c5; }
.alert.warn { background:#fdf4e0; color:#a9770f; border-color:#f3e0b3; }
.alert.info { background:var(--primary-bg); color:var(--primary-dark); border-color:#c7d9fa; }

/* 登录页 */
.login-body {
    display:flex; align-items:center; justify-content:center; min-height:100vh;
    background:radial-gradient(1100px 600px at 20% 10%, #1d4ed8 0%, #0d2b52 45%, #071426 100%);
}
.login-box {
    background:#fff; width:340px; padding:38px 34px; border-radius:16px;
    display:flex; flex-direction:column; gap:13px; box-shadow:0 20px 60px rgba(0,0,0,.4);
}
.login-box h2 { text-align:center; color:var(--primary-deep); margin-bottom:6px; font-size:20px; letter-spacing:2px; }
.login-box input { padding:11px 14px; border:1px solid var(--line); border-radius:9px; font-size:14px; transition:border-color .15s, box-shadow .15s; }
.login-box input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,.12); }
.login-box button { padding:12px; border:0; border-radius:9px; background:var(--primary); color:#fff; font-size:15px; cursor:pointer; font-weight:600; transition:background .15s; }
.login-box button:hover { background:var(--primary-dark); }
.login-box .tip { text-align:center; font-size:12px; color:var(--text-sub); }

/* 选项卡 */
.tabs { display:flex; gap:9px; margin-bottom:14px; }
.tabs a { padding:8px 20px; border-radius:9px; background:#fff; border:1px solid var(--line); color:#55627a; font-size:13px; transition:all .15s; }
.tabs a:hover { border-color:var(--primary); color:var(--primary); }
.tabs a.on { background:var(--primary-bg); border-color:var(--primary); color:var(--primary); font-weight:600; }

/* 接口状态 */
.mono { font-family:Consolas,monospace; background:#f6f9fc; padding:12px 14px; border-radius:9px; font-size:12px; white-space:pre-wrap; word-break:break-all; max-height:340px; overflow:auto; border:1px solid var(--line); }
.state-ok  { color:#0c7a58; font-weight:700; }
.state-bad { color:#d04840; font-weight:700; }
.state-warn { color:#b07a14; font-weight:700; }
.mono-inline { font-family:Consolas,monospace; font-size:12px; background:#f6f9fc; border:1px solid var(--line); border-radius:5px; padding:1px 6px; }
.hint { font-size:12px; color:#8a95a8; line-height:1.7; margin-top:6px; }

/* 微信接口配置 */
.mch-head {
    display:flex; align-items:center; gap:12px; flex-wrap:wrap;
    padding-bottom:10px; margin-bottom:4px; border-bottom:1px dashed var(--line); font-size:14px;
}
.cert-line { display:flex; gap:18px; flex-wrap:wrap; font-size:13px; color:#55627a; align-items:center; }
.upload-row { display:flex; gap:26px; flex-wrap:wrap; }
.upload-row label { font-size:12.5px; color:#55627a; line-height:2; }
.upload-row input[type=file] { font-size:12.5px; max-width:250px; }
.save-bar {
    display:flex; align-items:center; gap:12px; flex-wrap:wrap;
    background:#fff; border:1px solid var(--line); border-radius:12px;
    padding:14px 18px; box-shadow:var(--shadow-sm);
}

/* 弹窗（订单修改） */
#editBox { box-shadow:0 20px 50px rgba(15,42,92,.35); border:1px solid var(--line); }
#editBox h3 { color:var(--primary-deep); }
#editBox p { margin-bottom:10px; }
#editBox label { font-size:12.5px; color:#55627a; }
#editBox input, #editBox textarea {
    margin-top:4px; padding:8px 12px; border:1px solid var(--line); border-radius:8px;
    font-size:13px; font-family:inherit; background:#fafbfd;
}
#editBox input:focus, #editBox textarea:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,.12); }

/* ===== 统计报表 ===== */
.report-filter { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.range-tabs { display:inline-flex; background:#f1f5fb; border-radius:9px; padding:3px; gap:2px; }
.range-tabs a { padding:6px 16px; border-radius:7px; font-size:13px; color:#475569; }
.range-tabs a:hover { color:var(--primary); }
.range-tabs a.on { background:#fff; color:var(--primary); font-weight:600; box-shadow:0 1px 4px rgba(15,42,92,.1); }
.range-form { display:flex; align-items:center; gap:8px; }
.range-form input[type=date] {
    padding:7px 11px; border:1px solid var(--line); border-radius:8px;
    font-size:13px; background:#fafbfd; font-family:inherit; color:#334155;
}
.range-form input[type=date]:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(37,99,235,.12); }
.range-form .to { color:#94a3b8; font-size:13px; }
.range-label { margin-left:auto; font-size:12.5px; color:var(--text-sub); }
.range-label b { color:var(--primary-dark); }

.card em { display:block; font-style:normal; font-size:11.5px; color:#94a3b8; margin-top:5px; }
.card b.red { color:#d9534f; }

.report-split { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.block-title {
    font-size:14px; font-weight:700; color:var(--primary-deep); margin-bottom:12px;
    padding-left:10px; border-left:3px solid var(--primary); line-height:1.2;
}
.block-sub { font-weight:400; font-size:12px; color:#94a3b8; margin-left:8px; }
.money { font-variant-numeric:tabular-nums; font-weight:600; color:var(--primary-dark); }

.mini-bar {
    display:inline-block; vertical-align:middle; width:64px; height:6px;
    background:#eef2f8; border-radius:4px; overflow:hidden; margin-right:7px;
}
.mini-bar i { display:block; height:100%; background:linear-gradient(90deg,var(--primary-light),var(--primary)); border-radius:4px; }
.mini-bar.thin { display:block; width:100%; height:4px; margin:5px 0 0; }
.rate { font-size:12px; color:var(--text-sub); font-variant-numeric:tabular-nums; }

.rank { font-weight:700; color:#94a3b8; text-align:center; }
.rank-1 { color:#e0a800; }
.rank-2 { color:#8a95a3; }
.rank-3 { color:#c07a45; }

.chart-scroll { overflow-x:auto; padding-bottom:4px; }
.chart { display:flex; align-items:flex-end; gap:4px; min-height:190px; padding-top:18px; min-width:100%; }
.chart-col {
    flex:1 0 14px; min-width:14px; height:180px; position:relative;
    display:flex; flex-direction:column; justify-content:flex-end; align-items:center;
}
.chart-bar {
    width:70%; max-width:26px; min-height:0;
    background:linear-gradient(180deg,var(--primary-light),var(--primary));
    border-radius:4px 4px 2px 2px; transition:filter .15s;
}
.chart-col:hover .chart-bar { filter:brightness(1.12); }
.chart-val { font-size:10.5px; color:#94a3b8; margin-bottom:3px; height:13px; }
.chart-x { font-size:10.5px; color:#94a3b8; margin-top:6px; white-space:nowrap; }
.chart-note { margin-top:12px; font-size:11.5px; color:#94a3b8; line-height:1.7; }

@media (max-width:1100px){
    .report-split { grid-template-columns:1fr; }
}

@media (max-width:760px){
    .sidebar { width:60px }
    .logo-txt { display:none }
    .sidebar nav a span.txt { display:none }
    .sidebar nav a { justify-content:center; padding:12px 0; border-left-width:0 }
    .wrapper { margin-left:60px }
    .main { padding:14px 16px 30px }
    .range-label { margin-left:0; width:100% }
    .report-filter { gap:10px }
}

/* ===== 操作成功提示：浮层弹出、自动消失，不占页面位置 ===== */
.flash-toast {
    position:fixed; top:26px; left:50%; z-index:9999;
    transform:translate(-50%,-14px); opacity:0;
    min-width:200px; max-width:calc(100vw - 40px);
    padding:12px 24px; border-radius:10px;
    font-size:14px; line-height:1.5; text-align:center;
    box-shadow:0 12px 32px rgba(15,23,42,.18);
    pointer-events:none;
    animation:flashToastIn .26s ease forwards;
}
.flash-toast.ok  { background:#e6f6ef; color:#0c7a58; border:1px solid #c3e8d8; }
.flash-toast.err { background:#fdeaea; color:#d04840; border:1px solid #f6c8c5; }
.flash-toast.ok::before { content:'✓'; margin-right:8px; font-weight:700; }
.flash-toast.hide { animation:flashToastOut .3s ease forwards; }
@keyframes flashToastIn  { to { opacity:1; transform:translate(-50%,0); } }
@keyframes flashToastOut { from { opacity:1; transform:translate(-50%,0); } to { opacity:0; transform:translate(-50%,-14px); } }
