:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e6e8ec;
  --text: #1d2129;
  --text-2: #5a6172;
  --text-3: #8b93a5;
  --brand: #1f5eff;
  --brand-soft: #eef3ff;
  --green: #0d9f6e;
  --green-soft: #e8f8f1;
  --amber: #b8791a;
  --amber-soft: #fdf4e3;
  --red: #d43a3a;
  --red-soft: #fdeceb;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 32px;
}
.login-card h1 { font-size: 20px; font-weight: 500; margin-bottom: 4px; }
.login-card .sub { color: var(--text-3); font-size: 13px; margin-bottom: 26px; }
.login-card label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.login-card input {
  width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 8px;
  padding: 0 12px; margin-bottom: 16px; background: #fff;
}
.login-card input:focus { outline: none; border-color: var(--brand); }
.login-card button {
  width: 100%; height: 40px; background: var(--brand); color: #fff; border: none;
  border-radius: 8px; font-weight: 500;
}

/* 密码框 + 显示/隐藏 */
.pwd-box { position: relative; }
.pwd-box input { padding-right: 56px; }
.login-card .pwd-box .pwd-eye {
  position: absolute; right: 7px; top: 7px;
  width: auto; height: 26px; padding: 0 9px;
  background: transparent; color: var(--text-3);
  border: none; border-radius: 6px; font-size: 12.5px; font-weight: 400;
}
.login-card .pwd-box .pwd-eye:hover { background: var(--bg); color: var(--brand); }
/* pwd-box 里的 input 自身有 margin-bottom，眼睛按钮跟着对齐 */
.login-card .pwd-box { margin-bottom: 16px; }
.login-card .pwd-box input { margin-bottom: 0; }
.login-hint {
  margin-top: 20px; padding: 12px; background: var(--bg); border-radius: 8px;
  font-size: 12px; color: var(--text-3); line-height: 1.9;
}
.login-hint code { color: var(--text-2); }

/* 表格行内多个操作按钮 */
.row-act { white-space: nowrap; }
.row-act .btn + .btn { margin-left: 6px; }

/* ---------- 布局 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 12px; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.brand { font-size: 15px; font-weight: 500; padding: 0 10px 4px; }
.brand span { display: block; font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.nav { margin-top: 22px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; margin-bottom: 2px; font-size: 13.5px;
}
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.nav .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; }
.user-box { border-top: 1px solid var(--border); padding-top: 12px; font-size: 12.5px; }
.user-box .nm { font-weight: 500; }
.user-box .rl { color: var(--text-3); font-size: 11.5px; }
.user-box button {
  margin-top: 8px; width: 100%; height: 30px; background: transparent;
  border: 1px solid var(--border); border-radius: 6px; color: var(--text-2); font-size: 12.5px;
}
.user-box button:hover { background: var(--bg); }

.main { flex: 1; padding: 22px 26px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.page-head h2 { font-size: 18px; font-weight: 500; }
.page-head .desc { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- 组件 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

input.field, select.field, textarea.field {
  height: 34px; border: 1px solid var(--border); border-radius: 7px; padding: 0 10px;
  background: var(--surface); min-width: 0;
}
textarea.field { height: auto; padding: 8px 10px; width: 100%; resize: vertical; }
input.field:focus, select.field:focus, textarea.field:focus { outline: none; border-color: var(--brand); }
input.field::placeholder { color: var(--text-3); }

.btn {
  height: 34px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13px; white-space: nowrap;
}
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { opacity: .92; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.ghost { border-color: transparent; color: var(--brand); background: transparent; padding: 0 6px; }
.btn.ghost:hover { background: var(--brand-soft); }

table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-weight: 500; color: var(--text-2); font-size: 12px;
  padding: 9px 10px; border-bottom: 1px solid var(--border); background: #fbfcfd; white-space: nowrap;
}
table.data td { padding: 9px 10px; border-bottom: 1px solid #f1f3f6; vertical-align: middle; }
table.data tbody tr:hover { background: #fafbfd; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td:last-child { white-space: nowrap; }
table.data .muted { color: var(--text-3); }
.table-scroll { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border); }
.table-scroll table.data th:first-child, .table-scroll table.data td:first-child { padding-left: 14px; }
.table-scroll table.data th:last-child, .table-scroll table.data td:last-child { padding-right: 14px; }

.tag { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 20px; font-size: 11.5px; white-space: nowrap; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.blue { background: var(--brand-soft); color: var(--brand); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.gray { background: #f0f2f5; color: var(--text-2); }
.tag.red { background: var(--red-soft); color: var(--red); }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .lb { font-size: 12px; color: var(--text-3); }
.kpi .vl { font-size: 22px; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .vl small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 3px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .sidebar { display: none; } }

.sec-title { font-size: 13px; font-weight: 500; margin-bottom: 10px; color: var(--text); }
.sec-title span { font-weight: 400; color: var(--text-3); font-size: 12px; margin-left: 6px; }

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(20, 24, 32, .35); display: flex;
  justify-content: flex-end; z-index: 50;
}
.drawer {
  width: 760px; max-width: 96vw; background: var(--surface); height: 100%;
  display: flex; flex-direction: column; animation: slide .18s ease;
}
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.drawer-head h3 { font-size: 15px; font-weight: 500; }
.drawer-body { padding: 18px 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

.form-sec { margin-bottom: 20px; }
.form-sec > .st { font-size: 12.5px; font-weight: 500; color: var(--brand); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.form-sec > .st::before { content: ""; width: 3px; height: 12px; background: var(--brand); border-radius: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.fld label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; }
.fld label .req { color: var(--red); }
.fld input, .fld select, .fld textarea { width: 100%; }
.hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

.calc-box {
  background: #fafbfd; border: 1px dashed var(--border); border-radius: 8px;
  padding: 12px 14px; font-size: 12.5px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.calc-box .it .k { color: var(--text-3); font-size: 11.5px; }
.calc-box .it .v { font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 2px; }
.calc-box .it .v.big { color: var(--green); font-size: 15px; }

.addon-row { display: grid; grid-template-columns: 1.6fr .7fr .9fr .8fr 56px; gap: 8px; align-items: center; margin-bottom: 8px; }
.addon-row .gift {
  height: 30px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.addon-row .gift.on { background: var(--amber-soft); border-color: #f0dcb5; color: var(--amber); }

.banner {
  padding: 10px 14px; border-radius: 8px; font-size: 12.5px; margin-bottom: 14px;
  background: var(--amber-soft); color: var(--amber); display: flex; gap: 8px; align-items: flex-start;
}
.banner.info { background: var(--brand-soft); color: var(--brand); }

.empty { text-align: center; padding: 48px 0; color: var(--text-3); font-size: 13px; }
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #1d2129; color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 13px; z-index: 99;
}
.toast.err { background: var(--red); }

/* ---------- 收费标准 ---------- */
.charge-grid { display: grid; grid-template-columns: 320px 1fr; gap: 14px; margin-bottom: 16px; }
@media (max-width: 900px) { .charge-grid { grid-template-columns: 1fr; } }
.charge-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.cc-head { font-size: 12px; color: var(--text-3); font-weight: 500; margin-bottom: 12px; letter-spacing: .3px; }
.pay-channel { display: inline-block; font-size: 12px; color: #1677ff; background: #eaf2ff; border-radius: 6px; padding: 2px 8px; margin-bottom: 8px; }
.pay-phone { font-size: 24px; font-weight: 600; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.pay-name { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.pay-notes { list-style: none; counter-reset: pn; }
.pay-notes li { position: relative; padding-left: 22px; margin-bottom: 8px; font-size: 13px; color: var(--text-2); }
.pay-notes li::before { counter-increment: pn; content: counter(pn); position: absolute; left: 0; top: 1px; width: 16px; height: 16px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 11px; display: flex; align-items: center; justify-content: center; }
.cost-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.cost-card .cc-name { font-size: 12.5px; color: var(--text-3); }
.cost-card .cc-val { font-size: 22px; font-weight: 600; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.cost-card.blue .cc-val { color: var(--brand); }
.cost-card.rose .cc-val { color: #d4387a; }
.cost-card .cc-desc { font-size: 12px; color: var(--text-3); line-height: 1.65; }
.price-stage { font-weight: 500; }
.price-stage small { display: block; font-weight: 400; color: var(--text-3); font-size: 11.5px; }
table.data tr.row-total td { background: #fafbfc; font-weight: 500; }

/* ---------- 公告 ---------- */
.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.notice-item.pinned { border-color: #ffd9a0; background: #fffdf8; }
.notice-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.notice-title { font-size: 14.5px; font-weight: 500; }
.notice-meta { font-size: 11.5px; color: var(--text-3); }
.notice-body { font-size: 13px; color: var(--text-2); white-space: pre-wrap; line-height: 1.75; margin-top: 6px; }
.notice-actions { margin-top: 10px; display: flex; gap: 6px; }
.banner.notice { display: flex; align-items: flex-start; gap: 10px; border-color: #cfe0ff; background: #f5f9ff; }
.banner.notice .nt { font-weight: 500; color: var(--brand); }

/* ---------- 编辑表单 ---------- */
.sec-title { font-size: 12px; color: var(--text-3); font-weight: 500; margin: 0 0 8px; letter-spacing: .3px; }
.cost-edit-row { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 8px; margin-bottom: 8px; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
table.data input.field { width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; min-width: 70px; }
table.data input.field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }

/* ---------- 团队分组 ---------- */
.team-block { margin-bottom: 22px; }
.team-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.team-head h3 { font-size: 14px; font-weight: 500; }
.team-head .cnt { font-size: 12px; color: var(--text-3); }
.team-head .sp { flex: 1; }
.team-empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--text-3); font-size: 12.5px; }

/* ---------- 顶栏（返回 / 切换账号） ---------- */
.col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 48px; flex-shrink: 0;
  display: flex; align-items: center; gap: 10px; padding: 0 26px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.tb-back {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px 0 8px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
  color: var(--text-2); font-size: 12.5px; cursor: pointer;
}
.tb-back:hover { background: var(--bg); color: var(--text); }
.tb-back[disabled] { opacity: .38; cursor: default; }
.tb-back[disabled]:hover { background: var(--surface); color: var(--text-2); }
.tb-crumb { font-size: 12.5px; color: var(--text-3); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-crumb b { font-weight: 400; color: var(--text-2); }
.tb-sp { flex: 1; }
.tb-who { font-size: 12.5px; color: var(--text-2); }
.tb-who span { color: var(--text-3); }
.tb-switch {
  height: 28px; padding: 0 11px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--text-2); font-size: 12.5px; cursor: pointer;
}
.tb-switch:hover { background: var(--bg); border-color: var(--border-2, #d4d9e0); }

/* ---------- 收款账户卡片（按交付团队） ---------- */
.head-actions { display: flex; gap: 8px; flex: none; }

.pay-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(372px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
@media (max-width: 880px) { .pay-cards { grid-template-columns: 1fr; } }

.pay-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; display: flex; flex-direction: column;
}
.pc-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 13px 16px 11px; border-bottom: 1px dashed var(--border);
  background: linear-gradient(180deg, #fbfcff, #fff);
}
.pc-title { font-size: 14px; font-weight: 600; }
.pc-sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.pc-body { display: flex; gap: 16px; padding: 16px; }
.pc-qr-wrap { width: 150px; flex: none; text-align: center; }
.pc-qr {
  width: 150px; height: 150px; object-fit: contain; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 6px;
  cursor: zoom-in; transition: box-shadow .15s, border-color .15s;
}
.pc-qr:hover { box-shadow: 0 4px 16px rgba(31, 94, 255, .16); border-color: #c9d8ff; }
.pc-qr-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px; line-height: 1.4; cursor: default; border-style: dashed;
}
.pc-qr-tip { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.pc-info { flex: 1; min-width: 0; }
.pc-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 13px; padding: 3px 0; border-bottom: 1px dotted #eef0f4;
}
.pc-row span { color: var(--text-3); flex: none; }
.pc-row b { font-weight: 600; text-align: right; word-break: break-all; font-variant-numeric: tabular-nums; }
.pc-tips { list-style: none; margin-top: 10px; }
.pc-tips li { position: relative; padding-left: 14px; font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; line-height: 1.55; }
.pc-tips li::before {
  content: ""; position: absolute; left: 2px; top: 8px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--brand);
}
.pc-note {
  margin-top: 10px; font-size: 12px; color: var(--amber);
  background: var(--amber-soft); border-radius: 6px; padding: 6px 9px; line-height: 1.5;
}

/* 收款码放大预览 */
.qr-mask {
  position: fixed; inset: 0; z-index: 70; padding: 24px;
  background: rgba(20, 24, 32, .62);
  display: flex; align-items: center; justify-content: center;
}
.qr-box {
  background: #fff; border-radius: 16px; padding: 14px;
  width: min(430px, 92vw); box-shadow: 0 24px 64px rgba(0, 0, 0, .32);
}
.qr-box-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 500; margin-bottom: 10px;
}
.qr-box img { width: 100%; display: block; border-radius: 10px; }
.qr-box-foot { text-align: center; font-size: 12px; color: var(--text-3); margin-top: 10px; }

/* 抽屉里的小预览图 */
#pa-preview { flex: none; }

/* ---------- 登录页脚（忘记密码） ---------- */
.login-card { position: relative; }
.login-card h1 { line-height: 1.35; margin-bottom: 22px; }
.login-foot {
  margin-top: 14px; text-align: center;
  font-size: 12.5px; color: var(--text-3);
}
.login-foot a {
  font-size: 12.5px; color: var(--brand); text-decoration: none;
}
.login-foot a:hover { text-decoration: underline; }

/* ---------- 顶栏：账号设置 ---------- */
.tb-account {
  height: 28px; padding: 0 11px; margin-right: 8px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface); color: var(--text-2); font-size: 12.5px; cursor: pointer;
}
.tb-account:hover { background: var(--bg); border-color: #d4d9e0; }

/* ---------- 账号设置抽屉 ---------- */
.acct-who {
  background: var(--bg); border-radius: 10px; padding: 12px 14px;
}
.acct-who .nm { font-size: 15px; font-weight: 600; }
.acct-who .rl { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.rec-state { font-size: 13px; color: var(--text-2); }
.rec-code {
  margin-top: 14px; background: var(--brand-soft); border: 1px dashed #b9cdff;
  border-radius: 10px; padding: 14px; text-align: center;
}
.rec-code .rc-label { font-size: 12px; color: var(--brand); margin-bottom: 8px; }
.rec-code .rc-value {
  font-size: 21px; font-weight: 600; letter-spacing: 2.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all; margin-bottom: 10px;
}
