:root {
  --gold: #C19A6B;
  --gold-d: #A67C4E;
  --gold-l: #E3CBAB;
  --ink: #2B2320;
  --sub: #8B7F76;
  --line: #EFE5DB;
  --bg: #FAF6F2;
  --card: #fff;
  --rose: #FBEFEC;
  --red: #C0563F;
  --ok: #4E8A63;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-d); text-decoration: none; }
.muted { color: #b3a79c; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.side {
  width: 216px; flex: 0 0 216px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 12px; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.brand .bn { font-size: 15px; font-weight: 600; letter-spacing: .5px; }
.brand .bs { font-size: 11px; color: var(--sub); }
.menu { padding: 8px 8px 20px; overflow-y: auto; flex: 1; }
.mtitle { font-size: 11px; color: #b9ada2; padding: 12px 10px 6px; letter-spacing: 1px; }
.mi {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px;
  color: #4b4038; font-size: 13.5px; margin-bottom: 2px;
}
.mi .ic { width: 18px; text-align: center; color: var(--gold-d); font-size: 13px; }
.mi:hover { background: var(--bg); }
.mi.on { background: linear-gradient(90deg, #f7ece0, #fdf8f2); color: var(--ink); font-weight: 600; }
.side-foot { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; gap: 14px; font-size: 12.5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  position: sticky; top: 0; z-index: 10;
}
.topbar .tt { font-size: 16px; font-weight: 600; }
.topbar .tr { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--sub); }
.body { padding: 18px 22px 40px; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13.5px; cursor: pointer;
}
.btn:hover { border-color: var(--gold-l); }
.btn.primary { background: linear-gradient(135deg, #c9a578, #a67c4e); border: 0; color: #fff; }
.btn.primary:hover { filter: brightness(1.03); }
.btn.ghost { background: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; height: 42px; margin-top: 6px; }
.lnk { margin-right: 10px; font-size: 13px; }
.lnk.go { color: var(--gold-d); font-weight: 600; }
.lnk.danger { color: var(--red); }

.inp {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 13.5px; color: var(--ink); outline: none; font-family: inherit;
}
textarea.inp { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.inp:focus { border-color: var(--gold-l); box-shadow: 0 0 0 3px rgba(193, 154, 107, .12); }
.inp[readonly] { background: #f8f4f0; color: var(--sub); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.ph { font-size: 14px; font-weight: 600; margin-bottom: 12px; }

.flash { margin: 14px 22px 0; padding: 10px 14px; border-radius: 8px; font-size: 13.5px; }
.flash.ok { background: #eef6f0; color: var(--ok); border: 1px solid #d5e8da; }
.flash.err { background: #fdf0ec; color: var(--red); border: 1px solid #f3d8d0; }

/* ---------- 列表 ---------- */
.listbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; align-items: center; }
.filters .inp { width: 240px; }
.listbar-r { display: flex; gap: 10px; }

.tb { width: 100%; border-collapse: collapse; }
.tb th {
  text-align: left; font-weight: 500; font-size: 12.5px; color: var(--sub);
  padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fcfaf8;
}
.tb td { padding: 10px; border-bottom: 1px solid #f6efe8; font-size: 13px; vertical-align: middle; }
.tb tr:hover td { background: #fdfaf7; }
.tb .op { text-align: right; white-space: nowrap; }
.tb .empty { text-align: center; color: #b3a79c; padding: 36px 0; }
.tb.sm th, .tb.sm td { padding: 8px; font-size: 12.5px; }
.thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; background: var(--bg); display: block; }
.ell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.money { color: var(--gold-d); font-weight: 600; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.badge.ok { background: #eef6f0; color: var(--ok); }
.badge.warn { background: #fdf4e7; color: #b4802f; }
.badge.off { background: #f2f0ee; color: #9b9189; }
.badge.default { background: #f6f2ee; color: #6f6259; }

.pager { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 13px; }
.pager .pinfo { color: var(--sub); margin-right: 8px; }
.pager a { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; }
.pager a.on { background: var(--gold-d); color: #fff; border-color: var(--gold-d); }

/* ---------- 表单 ---------- */
.form .fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.fitem { display: flex; flex-direction: column; gap: 6px; }
.fitem.full { grid-column: 1 / -1; }
.fitem > label { font-size: 13px; color: #5e5249; }
.fitem > label em { color: var(--red); font-style: normal; margin-left: 3px; }
.help { font-size: 12px; color: #b3a79c; }
.formfoot { display: flex; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.sw { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.sw input { display: none; }
.sw .track { width: 42px; height: 24px; border-radius: 999px; background: #e6ded6; position: relative; transition: .2s; }
.sw .track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.sw input:checked + .track { background: var(--gold); }
.sw input:checked + .track::after { left: 20px; }
.sw .txt { font-size: 13px; color: var(--sub); }

.imgfield { display: flex; flex-direction: column; gap: 8px; }
.imgfield .file { font-size: 12px; }
.imgfield .prev img { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.prevs { display: flex; gap: 8px; flex-wrap: wrap; }
.prevs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* ---------- 概览 ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.kpi .kt { font-size: 12.5px; color: var(--sub); }
.kpi .kv { font-size: 26px; font-weight: 600; margin: 6px 0 4px; letter-spacing: .5px; }
.kpi .ks { font-size: 12px; color: #b3a79c; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart .bar { width: 60%; max-width: 42px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, #d9b992, #c19a6b); }
.chart .cl { font-size: 11.5px; color: var(--sub); margin-top: 6px; }

.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #f1e8df; font-size: 13px; }
.rank li:last-child { border: 0; }
.rank .no { width: 20px; height: 20px; border-radius: 50%; background: var(--bg); color: var(--gold-d); font-size: 11.5px; display: flex; align-items: center; justify-content: center; }
.rank .nm { flex: 1; }
.rank .vl { color: var(--sub); }
.tipbox p { margin: 0; color: #6f6259; font-size: 13px; }
.bal { margin-bottom: 14px; font-size: 14px; color: var(--sub); }
.bal b { color: var(--gold-d); font-size: 20px; margin-left: 6px; }

/* ---------- 登录 ---------- */
.login-body { background: linear-gradient(150deg, #f6ece1, #faf6f2); }
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 380px; background: #fff; border-radius: 16px; padding: 30px 28px 24px; box-shadow: 0 20px 60px rgba(120, 88, 55, .12); }
.lg-brand { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; letter-spacing: .5px; }
.lg-brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.lg-sub { color: var(--sub); font-size: 12.5px; margin: 6px 0 20px; }
.lg-tip { margin-top: 16px; font-size: 12px; color: #b3a79c; text-align: center; }
.login-card .fitem { margin-bottom: 14px; }

@media (max-width: 1080px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .cols { grid-template-columns: 1fr; }
  .form .fgrid { grid-template-columns: 1fr; }
  .side { width: 190px; flex-basis: 190px; }
}

/* 文件选择框美化成按钮 */
input[type=file] {
  font-size: 12.5px; color: var(--sub);
}
input[type=file]::file-selector-button {
  height: 30px; padding: 0 12px; margin-right: 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--gold-d); font-size: 12.5px; cursor: pointer;
}
input[type=file]::file-selector-button:hover { border-color: var(--gold-l); }
