:root {
    --brand: #a9743f;
    --brand-dark: #8c5a2b;
    --text: #1f2329;
    --muted: #8a9099;
    --line: #eceff5;
    --bg: #f4f6fa;
    --card: #ffffff;
    --ok: #1a9d5a;
    --bad: #d24545;
    --warn: #d68a1c;
    --radius: 14px;
    --shadow: 0 6px 22px rgba(21, 33, 50, .06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { opacity: .85; }

h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-size: 19px; }
h2 { font-size: 15px; }
h3 { font-size: 13px; color: #4b5158; font-weight: 600; }

code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- 布局 ---------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 216px;
    background: #1d2229;
    color: #c9d0d8;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(135deg, #c08b58, #8c5a2b);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.brand-mark.big { width: 46px; height: 46px; border-radius: 14px; font-size: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { color: #fff; font-size: 14px; }
.brand-text span { font-size: 11px; color: #7d868f; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    color: #b9c1ca; font-size: 13.5px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; opacity: 1; }
.nav-item.active { background: rgba(169,116,63,.22); color: #fff; }
.nav-item svg { opacity: .85; flex: none; }
.nav-badge {
    margin-left: auto; background: #d24545; color: #fff;
    font-size: 11px; padding: 1px 6px; border-radius: 9px;
}
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; font-size: 12px; }
.sidebar-foot .who { color: #7d868f; margin-bottom: 6px; padding-left: 6px; }
.link-btn { background: none; border: 0; color: #b9c1ca; cursor: pointer; padding: 6px; font-size: 12.5px; }
.link-btn:hover { color: #fff; }

.main { margin-left: 216px; min-height: 100vh; }
.topbar {
    height: 58px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 26px; background: rgba(255,255,255,.85);
    border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
    position: sticky; top: 0; z-index: 10;
}
.crumb { font-size: 13px; color: var(--muted); }
.topbar-right { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }

.content { padding: 22px 26px 60px; max-width: 1180px; }

/* ---------- 卡片 ---------- */
.card {
    background: var(--card); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-head h2 { font-size: 15px; }
.desc { margin: 0 0 12px; }

.grid { display: grid; gap: 14px; margin-bottom: 4px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-num { font-size: 26px; font-weight: 650; letter-spacing: -.5px; }
.stat-num.ok { color: var(--ok); }
.stat-num.bad { color: var(--bad); }
.stat-sub { font-size: 12px; color: #a3a9b2; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
    text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
    padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 10px; border-bottom: 1px solid #f5f7fa; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.table .nowrap { white-space: nowrap; }
.table .small-cell { font-size: 12px; }
.table tr.row-active { background: #fbf7f2; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
td small, .field small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 4px; }

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
    font-size: 13px; cursor: pointer; background: #f2f4f8; color: var(--text);
    transition: .15s; text-decoration: none; line-height: 1.4;
}
.btn:hover { opacity: .9; }
.btn-primary { background: linear-gradient(135deg, #b98454, var(--brand-dark)); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: #4b5158; }
.btn-danger { background: #fdeeee; color: var(--bad); border-color: #f7dcdc; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.inline { display: inline; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.reset-row { margin-top: -6px; }

/* ---------- 徽章 ---------- */
.badge {
    display: inline-block; padding: 2px 9px; border-radius: 20px;
    font-size: 11.5px; font-weight: 500; line-height: 1.7;
}
.badge-ok { background: #e9f8ef; color: var(--ok); }
.badge-bad { background: #fdeeee; color: var(--bad); }
.badge-warn { background: #fdf4e4; color: var(--warn); }
.badge-grey { background: #f1f3f7; color: #737a83; }

/* ---------- 表单 ---------- */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: #545a63; }
.field > span { font-weight: 500; }
.field em { color: var(--bad); font-style: normal; }
.field-wide { grid-column: 1 / -1; }
.field input[type=text], .field input[type=password], .field input[type=number],
.field select, .field textarea, .filters select {
    width: 100%; padding: 9px 12px; border: 1px solid #e2e6ee; border-radius: 9px;
    font-size: 13px; background: #fbfcfe; color: var(--text); font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--brand); background: #fff;
    box-shadow: 0 0 0 3px rgba(169,116,63,.10);
}
.field input[readonly] { color: #6b7280; }
.field-inline { flex-direction: row; align-items: center; gap: 10px; }

.field-switch { flex-direction: row; align-items: flex-start; gap: 10px; grid-column: 1 / -1; }
.switch-wrap { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; margin-top: 2px; }
.switch-wrap input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch-wrap i {
    position: absolute; inset: 0; background: #d8dde5; border-radius: 20px; transition: .18s;
}
.switch-wrap i::after {
    content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; top: 2px; left: 2px; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch-wrap input:checked + i { background: var(--brand); }
.switch-wrap input:checked + i::after { transform: translateX(18px); }
.switch-label { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text); }

.switch-btn {
    width: 38px; height: 21px; border-radius: 20px; border: 0; background: #d8dde5;
    position: relative; cursor: pointer; padding: 0;
}
.switch-btn span {
    position: absolute; width: 17px; height: 17px; border-radius: 50%;
    background: #fff; top: 2px; left: 2px; transition: .15s;
}
.switch-btn.on { background: var(--brand); }
.switch-btn.on span { transform: translateX(17px); }

.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] {
    width: 38px; height: 34px; border: 1px solid #e2e6ee; border-radius: 8px;
    background: #fff; padding: 2px; cursor: pointer;
}

.image-row { display: flex; gap: 12px; align-items: flex-start; }
.image-prev {
    width: 84px; height: 84px; border-radius: 10px; border: 1px dashed #dbe0e8;
    background: #fafbfd; display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex: none;
}
.image-prev img { width: 100%; height: 100%; object-fit: cover; }
.image-prev .ph { font-size: 11px; color: #aab0b9; }
.image-ctrl { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.image-btns { display: flex; gap: 6px; }

.divider { height: 1px; background: var(--line); margin: 16px 0; }
.rows { display: flex; flex-direction: column; gap: 10px; }
.row-item { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.row-label { color: var(--muted); width: 70px; flex: none; }

/* ---------- 提示 ---------- */
.flash {
    padding: 11px 16px; border-radius: 11px; font-size: 13px; margin-bottom: 14px;
    border: 1px solid transparent;
}
.flash-ok { background: #eefaef; border-color: #cdf0d6; color: #15794a; }
.flash-bad { background: #fdf0f0; border-color: #f8d9d9; color: #b3261e; }
.flash-warn { background: #fdf6e8; border-color: #f6e6c7; color: #96621a; }

.empty { text-align: center; padding: 34px 10px; color: var(--muted); font-size: 13px; }
.empty p { margin: 0 0 12px; }

.tips { margin: 0; padding-left: 18px; color: #5a6068; font-size: 12.5px; line-height: 1.9; }
.tips li { margin-bottom: 2px; }

.code-box {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px;
    padding: 10px 12px; font-size: 12px; word-break: break-all;
}
.code-box.column { flex-direction: column; align-items: flex-start; }
.code-box code { color: #3d434b; }

/* ---------- 时间线 ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
    display: flex; align-items: center; gap: 10px; padding: 9px 0;
    border-bottom: 1px dashed #f0f3f8; font-size: 12.5px;
}
.timeline li:last-child { border-bottom: 0; }
.tl-text { flex: 1; color: #4b5158; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-time { color: #a3a9b2; font-size: 11.5px; flex: none; }

/* ---------- 图表 ---------- */
.chart-block { margin: 18px 0 6px; }
.chart-block h3 { margin-bottom: 10px; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 92px; padding-top: 6px; }
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.chart-bar { width: 100%; max-width: 26px; border-radius: 4px 4px 2px 2px; min-height: 2px; transition: .2s; }
.chart-bar:hover { opacity: .8; }
.chart-x { font-size: 9.5px; color: #a9afb8; margin-top: 5px; white-space: nowrap; height: 12px; }

.seg { display: inline-flex; background: #f2f4f8; border-radius: 8px; padding: 2px; }
.seg-item { padding: 4px 10px; border-radius: 6px; font-size: 12px; color: #6b7280; }
.seg-item.on { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* ---------- 举报 ---------- */
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filters select { width: auto; min-width: 130px; padding: 7px 10px; font-size: 12.5px; }
.report-list { display: flex; flex-direction: column; gap: 12px; }
.report { border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; background: #fcfdff; }
.report-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 8px; }
.report-detail { margin: 6px 0 10px; font-size: 13px; color: #3d434b; background: #fff; border-radius: 9px; padding: 10px 12px; border: 1px solid #f0f3f8; }
.report-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.report-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.report-form select, .report-form input {
    padding: 6px 10px; border: 1px solid #e2e6ee; border-radius: 8px; font-size: 12.5px; background: #fff;
}
.report-form input { flex: 1; min-width: 180px; }

.pager { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pager-item {
    padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line);
    background: #fff; color: #5a6068; font-size: 12.5px;
}
.pager-item.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 页面头 ---------- */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-head h1 { font-size: 19px; }
.page-head p { margin: 3px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.sticky-actions {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; align-items: center; gap: 14px;
    background: rgba(244,246,250,.92); backdrop-filter: blur(6px);
    padding: 12px 4px; border-top: 1px solid var(--line); margin-top: 4px;
}

/* ---------- 登录 / 安装 ---------- */
.auth-body { background: linear-gradient(160deg, #f6f3ee, #eef2f8); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 26px; box-shadow: 0 14px 44px rgba(21,33,50,.09); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-brand h1 { font-size: 17px; }
.auth-brand p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.auth-card .field { margin-bottom: 14px; }
.auth-tip { text-align: center; color: #a3a9b2; font-size: 11.5px; margin: 14px 0 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .sidebar { position: static; width: 100%; flex-direction: row; align-items: center; padding: 10px 12px; overflow-x: auto; }
    .brand { padding: 0 12px 0 0; }
    .brand-text { display: none; }
    .nav { flex-direction: row; gap: 4px; }
    .nav-item { white-space: nowrap; padding: 8px 10px; }
    .sidebar-foot { display: none; }
    .main { margin-left: 0; }
    .content { padding: 16px 14px 50px; }
    .grid-2, .grid-4, .fields { grid-template-columns: minmax(0, 1fr); }
    .topbar { padding: 0 14px; }
}

/* ---------- 页面配置：左右布局 ---------- */
.cfg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.cfg-main { min-width: 0; }
.cfg-side { position: sticky; top: 74px; }
.preview-card { padding: 16px 16px 14px; }

.inline-switch { display: flex; align-items: center; gap: 10px; padding-top: 4px; }

/* 手机外壳 */
.phone {
    width: 100%;
    max-width: 282px;
    margin: 8px auto 0;
    background: #fff;
    border: 9px solid #23272e;
    border-radius: 30px;
    box-shadow: 0 18px 42px rgba(21, 33, 50, .16);
    overflow: hidden;
}

.phone-screen {
    height: 460px;
    background: #f4f6fa;
    position: relative;
    overflow: hidden;
}

.pv-status {
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #3d434b;
    padding: 7px 14px 1px;
    letter-spacing: .5px;
}

.pv { padding: 6px 12px 0; }
.pv[hidden], .pv-full[hidden], .pv-card[hidden] { display: none; }

.pv-hero {
    border-radius: 11px;
    padding: 13px 12px 16px;
    background: linear-gradient(135deg, #b98454, #8c5a2b);
    color: #fff;
}
.pv-brand { font-size: 8px; opacity: .85; letter-spacing: .3px; }
.pv-title { font-size: 14px; font-weight: 600; margin-top: 6px; line-height: 1.32; }

.pv-quick { display: flex; gap: 6px; margin-top: 9px; }
.pv-quick-i {
    flex: 1; text-align: center; background: #fff; border: 1px solid #eef1f6;
    border-radius: 7px; font-size: 8px; color: #8a9099; padding: 6px 0;
}
.pv-quick-i.on { color: #a9743f; border-color: #a9743f; background: #fdf8f2; }

.pv-form { background: #fff; border-radius: 11px; margin-top: 9px; padding: 1px 10px; }
.pv-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid #f3f5f9; font-size: 8.5px; color: #8a9099;
}
.pv-row:last-child { border-bottom: 0; }
.pv-row b { font-weight: 500; color: #1f2329; font-size: 9.5px; }

.pv-btn {
    margin-top: 9px; height: 28px; border-radius: 7px;
    background: linear-gradient(135deg, #b98454, #8c5a2b);
    color: #fff; font-size: 9px;
    display: flex; align-items: center; justify-content: center;
}
.pv-foot { text-align: center; font-size: 8px; color: #b6bbc3; margin-top: 7px; }

/* 客服页预览 */
.pv-top { font-size: 8.5px; color: #8a9099; text-align: center; padding: 3px 0 7px; }
.pv-card {
    background: #fff; border-radius: 13px; padding: 11px;
    box-shadow: 0 6px 18px rgba(31, 35, 41, .06);
}
.pv-card-head { display: flex; gap: 8px; align-items: center; margin-bottom: 9px; }
.pv-logo {
    width: 26px; height: 26px; border-radius: 7px; flex: none;
    background: #eef1f6 center/cover no-repeat;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.pv-logo-ph { font-size: 10px; color: #9aa0a8; }
.pv-card-text { min-width: 0; }
.pv-card-title { font-size: 11.5px; font-weight: 600; color: #1f2329; }
.pv-card-sub { font-size: 8.5px; color: #8a9099; margin-top: 2px; }

.pv-poster {
    border: 1px dashed #dbe0e8; border-radius: 8px; height: 122px;
    display: flex; align-items: center; justify-content: center;
    background: #fafbfd center/cover no-repeat;
    overflow: hidden;
}
.pv-poster-ph { font-size: 8.5px; color: #b6bbc3; }
.pv-hint { text-align: center; font-size: 8.5px; color: #b6bbc3; margin-top: 7px; }

.pv-full-box {
    height: 208px; border-radius: 9px; border: 1px dashed #dbe0e8;
    display: flex; align-items: center; justify-content: center;
    background: #fff center/cover no-repeat;
}
.pv-bottom { font-size: 8.5px; color: #8a9099; text-align: center; margin-top: 9px; }
.pv-report {
    position: absolute; right: 9px; bottom: 9px;
    font-size: 8.5px; color: #8a9099;
    background: rgba(255, 255, 255, .92);
    border: 1px solid #eef1f6; border-radius: 20px; padding: 3px 9px;
}
.pv-tip { text-align: center; margin: 10px 0 0; }
.pv-dots { letter-spacing: 1px; }

@media (max-width: 1200px) {
    .cfg-layout { grid-template-columns: minmax(0, 1fr); }
    .cfg-side { position: static; }
    .phone { max-width: 260px; }
}

