/* =========================================================
   掘金账房 · 视觉系统
   深墨 + 香槟金 + 米白，贴合品牌 Logo
   ========================================================= */

:root {
  --bg: #f4efe4;
  --bg-2: #efe7d7;
  --panel: #fffdf8;
  --panel-2: #fbf7ed;
  --ink: #211a11;
  --ink-2: #5f5342;
  --ink-3: #94856d;
  --gold: #c3923f;
  --gold-2: #e2b96d;
  --gold-3: #f4e2ba;
  --gold-deep: #8d6422;
  --line: #e8dcc7;
  --line-2: #d9c7a7;
  --input-bg: #fffdf9;
  --th-bg: #fbf6ea;
  --hover-bg: #fdf9f1;
  --soft-bg: #fdfaf3;
  --note-bg: #fdf8ed;
  --topbar-bg: rgba(255, 253, 248, .82);
  --card-a: #fffdf9;
  --card-b: #fdfaf3;
  --green: #2e7d5c;
  --green-soft: #e7f2ec;
  --red: #b34a34;
  --red-soft: #f8e9e3;
  --blue: #4a6d96;
  --blue-soft: #e9eff7;
  --shadow: 0 18px 44px -28px rgba(64, 47, 20, .42), 0 2px 8px rgba(64, 47, 20, .04);
  --shadow-lg: 0 34px 80px -40px rgba(52, 37, 14, .55), 0 4px 16px rgba(52, 37, 14, .06);
  --r: 18px;
  --r-sm: 12px;
  --num: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display", "Segoe UI", sans-serif;
  --sans: "Microsoft YaHei UI", "PingFang SC", "HarmonyOS Sans SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font: 14px/1.6 var(--sans);
  background:
    radial-gradient(1100px 560px at 8% -12%, #fff9eb 0, rgba(255, 249, 235, 0) 62%),
    radial-gradient(900px 520px at 102% -4%, #f0e1c6 0, rgba(240, 225, 198, 0) 58%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: #ecd39e; color: #211a11; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

/* ---------------- 启动 / 登录 ---------------- */

.boot {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: #14100a; color: #f4e3c1;
  transition: opacity .35s ease;
}
.boot.hide { opacity: 0; pointer-events: none; }
.boot-logo { width: 96px; height: 96px; border-radius: 24px; object-fit: cover; border: 1px solid rgba(226, 185, 109, .5); box-shadow: 0 20px 60px -20px rgba(226, 185, 109, .5); }
.boot-name { font-size: 20px; letter-spacing: 6px; font-weight: 600; color: #efd49b; }
.boot-line { width: 126px; height: 2px; background: rgba(226, 185, 109, .18); overflow: hidden; border-radius: 2px; }
.boot-line span { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, #e2b96d, transparent); animation: slide 1.1s infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(320%); } }

.login {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 20px; overflow: auto; overflow-x: hidden;
  background: #13100a;
}
.login-bg {
  position: absolute; inset: 0; overflow: hidden;
  background:
    radial-gradient(760px 540px at 18% 20%, rgba(197, 146, 63, .22), transparent 62%),
    radial-gradient(620px 480px at 86% 82%, rgba(120, 82, 28, .22), transparent 64%),
    linear-gradient(135deg, #17120b, #0e0b07 58%, #1a140c);
}
.login-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(226, 185, 109, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(226, 185, 109, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 78%);
}
.login-bg::after {
  content: ""; position: absolute; width: 620px; height: 620px; right: -180px; top: -220px;
  border: 1px solid rgba(226, 185, 109, .16); border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(226, 185, 109, .035), 0 0 0 140px rgba(226, 185, 109, .025);
}
.login-wrap {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1.06fr .94fr;
  width: min(1040px, 94vw); min-height: 590px;
  border: 1px solid rgba(226, 185, 109, .18);
  border-radius: 30px; overflow: hidden;
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .75);
  background: rgba(23, 18, 11, .55);
  backdrop-filter: blur(10px);
}
.login-brand { padding: 54px 52px; display: flex; flex-direction: column; justify-content: center; color: #f2e5cd; }
.login-logo { width: 206px; height: 206px; border-radius: 28px; overflow: hidden; border: 1px solid rgba(226, 185, 109, .45); box-shadow: 0 26px 70px -24px rgba(226, 185, 109, .45); margin-bottom: 30px; }
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-kicker { font: 600 10.5px/1 var(--num); letter-spacing: 3px; color: #b9965b; text-transform: uppercase; margin-bottom: 12px; }
.login-brand h1 {
  margin: 0 0 14px; font-size: 48px; line-height: 1.15; letter-spacing: 3px;
  background: linear-gradient(100deg, #fff3d8, #e6bf78 45%, #b98536 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-slogan { margin: 0; font-size: 15px; line-height: 1.9; color: #c9b795; letter-spacing: .5px; }
.login-features { display: flex; gap: 18px; margin-top: 34px; flex-wrap: wrap; }
.login-features span { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #b7a684; }
.login-features i { width: 5px; height: 5px; border-radius: 50%; background: #d3a64f; box-shadow: 0 0 10px #d3a64f; }

.login-card { background: #fffdf8; padding: 48px 46px; display: flex; flex-direction: column; justify-content: center; }
.login-card-head { margin-bottom: 26px; }
.eyebrow { display: inline-block; font: 600 10px/1 var(--num); letter-spacing: 2.4px; color: var(--gold-deep); text-transform: uppercase; }
.login-card-head h2 { margin: 10px 0 6px; font-size: 26px; letter-spacing: 1px; }
.login-card-head p { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 7px; }
.input-wrap { position: relative; margin-bottom: 18px; }
.input-wrap .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #a8967a; width: 17px; height: 17px; }
.input-wrap input {
  width: 100%; height: 46px; padding: 0 14px 0 40px;
  border: 1px solid var(--line-2); border-radius: 12px; background: #fffdf9;
  outline: none; transition: .15s;
}
.login .input-wrap input { padding-left: 43px; }
.input-wrap input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(195, 146, 63, .14); }
.login-btn { height: 48px; border-radius: 12px; margin-top: 6px; font-size: 15px; letter-spacing: 3px; }
.login-err { min-height: 20px; color: var(--red); font-size: 12.5px; padding: 2px 0 6px; }
.login-foot { margin-top: 22px; font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; justify-content: center; gap: 6px; }
.login-foot .icon { width: 14px; height: 14px; }
.login-copy { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-size: 11px; color: #6e614c; letter-spacing: 1px; }

/* ---------------- 布局 ---------------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 254px; flex: 0 0 254px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 22px 16px 16px;
  background:
    radial-gradient(320px 220px at 50% 0%, rgba(195, 146, 63, .16), transparent 70%),
    linear-gradient(180deg, #17120b, #12100a 55%, #16120c);
  color: #cbbda7;
  border-right: 1px solid rgba(226, 185, 109, .12);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 20px; }
.brand-mark { width: 46px; height: 46px; border-radius: 13px; overflow: hidden; border: 1px solid rgba(226, 185, 109, .45); flex: 0 0 auto; box-shadow: 0 8px 24px -10px rgba(226, 185, 109, .5); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name {
  font-size: 18px; font-weight: 700; letter-spacing: 2px;
  background: linear-gradient(96deg, #f9e8c4, #dcb066 62%, #b98232);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.brand-sub { font-size: 9.5px; color: #8d7c63; letter-spacing: .8px; margin-top: 2px; white-space: nowrap; }

.nav-label { font-size: 9.5px; letter-spacing: 2px; color: #6f634f; margin: 14px 10px 8px; text-transform: uppercase; }
.nav-label-2 { margin-top: 22px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; border-radius: 10px; color: #b6a88f; font-size: 13.5px;
  transition: background .15s, color .15s, transform .15s;
}
.nav-item .icon { width: 17px; height: 17px; color: #7d7059; transition: color .15s; }
.nav-item:hover { background: rgba(226, 185, 109, .08); color: #f0e2c7; }
.nav-item:hover .icon { color: #d5b476; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(226, 185, 109, .19), rgba(226, 185, 109, .045));
  color: #ffecc8;
  box-shadow: inset 2px 0 0 #e2b96d;
}
.nav-item.active .icon { color: #e8c582; }
.nav-count { margin-left: auto; font: 600 10.5px/1 var(--num); color: #95846a; background: rgba(226, 185, 109, .1); padding: 3px 6px; border-radius: 5px; }
.nav-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: #d8a64f; box-shadow: 0 0 0 4px rgba(216, 166, 79, .12); }

.period-card {
  margin-top: 16px; padding: 12px;
  border: 1px solid rgba(226, 185, 109, .16); border-radius: 13px;
  background: rgba(226, 185, 109, .045);
}
.period-head { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; color: #a99777; letter-spacing: 1px; margin-bottom: 8px; }
.period-head button { border: 0; background: transparent; color: #d8b46e; font-size: 10.5px; padding: 0; }
.period-inputs { display: flex; align-items: center; gap: 5px; }
.period-inputs input {
  width: 100%; height: 28px; padding: 0 6px; font-size: 9.5px;
  border: 1px solid rgba(226, 185, 109, .2); border-radius: 6px;
  background: #1b150e; color: #e8d6b5; color-scheme: dark;
}
.period-inputs span { color: #6f634f; font-size: 9px; }
.period-presets { display: flex; gap: 4px; margin-top: 7px; }
.period-presets button { flex: 1; height: 24px; border: 1px solid rgba(226, 185, 109, .16); border-radius: 6px; background: transparent; color: #a99777; font-size: 9.5px; padding: 0; }
.period-presets button:hover { background: rgba(226, 185, 109, .1); color: #f0d7a7; }
.period-apply { width: 100%; height: 28px; margin-top: 7px; border: 0; border-radius: 7px; background: linear-gradient(135deg, #d8ad63, #b98334); color: #241806; font-size: 10.5px; font-weight: 700; }
.period-top { font-size: 11.5px; color: var(--ink-2); }
.period-top .icon { width: 15px; height: 15px; }

.side-card {
  margin-top: auto; margin-bottom: 14px; padding: 14px;
  border: 1px solid rgba(226, 185, 109, .16); border-radius: 14px;
  background: linear-gradient(160deg, rgba(226, 185, 109, .09), rgba(226, 185, 109, .02));
}
.side-card-top { display: flex; align-items: center; gap: 7px; font-size: 10.5px; color: #9d8b6d; letter-spacing: 1px; }
.pulse { width: 5px; height: 5px; border-radius: 50%; background: #4fbf8c; box-shadow: 0 0 0 4px rgba(79, 191, 140, .12); }
.side-amount { font: 600 24px/1.3 var(--num); color: #f3ddb0; margin-top: 6px; letter-spacing: .5px; }
.side-sub { font-size: 10.5px; color: #8c7b60; }
.side-row { display: flex; justify-content: space-between; font-size: 11px; color: #93836a; margin-top: 8px; }
.side-row b { color: #cfba95; font-weight: 500; font-family: var(--num); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid rgba(226, 185, 109, .1); }
.appearance { display: flex; align-items: center; gap: 8px; padding: 10px 6px 10px; border-top: 1px solid rgba(226, 185, 109, .1); }
.appearance label { font-size: 10px; color: #8f7e63; letter-spacing: .5px; flex: 0 0 auto; }
.appearance select {
  flex: 1; height: 28px; padding: 0 8px; font-size: 10.5px;
  border: 1px solid rgba(226, 185, 109, .2); border-radius: 7px;
  background-color: #1b150e; color: #e8d6b5; color-scheme: dark;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  color: #2a1d09; background: linear-gradient(135deg, #f0d398, #c99645);
  border: 1px solid rgba(255, 240, 210, .5);
}
.side-user-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.side-user-text b { font-size: 12.5px; color: #e8d8bb; font-weight: 600; }
.side-user-text span { font-size: 10px; color: #8b7a60; }
.side-user .icon-btn { margin-left: auto; color: #8b7a60; }
.side-user .icon-btn:hover { color: #e8c582; background: rgba(226, 185, 109, .08); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: 70px; flex: 0 0 70px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 30px;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgba(217, 199, 167, .55);
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.crumb-root { color: var(--gold-deep); font-weight: 600; }
.crumb-arrow { width: 12px; height: 12px; color: #b9a78a; }
#crumbCurrent { color: var(--ink-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none !important; }

.user-menu { position: relative; }
.avatar-btn { cursor: pointer; padding: 0; border: 1px solid rgba(255, 240, 210, .7); }
.user-pop {
  position: absolute; right: 0; top: 44px; width: 180px; padding: 7px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); z-index: 50;
}
.user-pop-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; display: flex; flex-direction: column; }
.user-pop-head b { font-size: 13px; }
.user-pop-head span { font-size: 11px; color: var(--ink-3); }
.user-pop button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 12.5px; text-align: left; }
.user-pop button:hover { background: var(--panel-2); color: var(--ink); }
.user-pop .icon { width: 15px; height: 15px; }

.content { flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; padding: 26px 30px 44px; }
.site-foot { display: flex; justify-content: center; gap: 8px; padding: 0 20px 22px; font-size: 10.5px; color: #a2937a; flex-wrap: wrap; }
.site-foot .dot { color: #c9b99d; }

/* ---------------- 通用控件 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--input-bg); color: var(--ink);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: .15s; box-shadow: 0 1px 1px rgba(64, 47, 20, .03);
}
.btn:hover { border-color: #c8b18a; background: #fffaf0; transform: translateY(-1px); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, #e5bd74, #c08d3a);
  border-color: #b78431; color: #241806;
  box-shadow: 0 8px 20px -10px rgba(170, 115, 28, .8), inset 0 1px 0 rgba(255, 248, 230, .45);
}
.btn-primary:hover { background: linear-gradient(135deg, #edc780, #c8943d); border-color: #aa7827; color: #1e1404; }
.btn-dark { background: #1d1810; border-color: #1d1810; color: #f4e3c2; }
.btn-dark:hover { background: #2b2317; border-color: #2b2317; color: #fff1d5; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(195, 146, 63, .09); border-color: transparent; }
.btn-danger { color: var(--red); border-color: #ecc3b8; background: #fffaf7; }
.btn-danger:hover { background: var(--red-soft); border-color: #dfa999; }
.btn-sm { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 11.5px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.icon-btn {
  width: 34px; height: 34px; border: 0; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--ink-3); transition: .15s;
}
.icon-btn:hover { background: rgba(195, 146, 63, .1); color: var(--gold-deep); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }

input[type=text], input[type=number], input[type=date], input[type=password], input[type=search], select, textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--line-2);
  border-radius: 10px; background: var(--input-bg); outline: none; min-width: 0;
  transition: border .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.65; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(195, 146, 63, .13); }
input::placeholder, textarea::placeholder { color: #b3a48c; }
select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394856d'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
input[type=date] { font-family: var(--num); }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 10.5px; color: var(--ink-3); font-weight: 400; }
.field .req { color: var(--red); margin-left: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field.full { grid-column: 1 / -1; }
.form-section { padding: 18px 0; border-top: 1px dashed var(--line); }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--gold-deep); margin-bottom: 14px; }
.form-section-title .icon { width: 15px; height: 15px; }
.form-note { font-size: 11.5px; color: var(--ink-3); background: var(--note-bg); border: 1px dashed var(--line); border-radius: 9px; padding: 9px 11px; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: #f2ebdd; }
.seg button { height: 32px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 600; }
.seg button.on { background: #fffdf8; color: var(--ink); box-shadow: 0 1px 4px rgba(64, 47, 20, .12); }
.seg button.on.income { color: var(--green); }
.seg button.on.expense { color: var(--red); }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8; color: var(--ink-2); font-size: 11.5px; }
.chip:hover { border-color: var(--gold-2); color: var(--gold-deep); }
.chip.on { background: var(--gold-3); border-color: #d8b987; color: #614312; font-weight: 600; }

.tag { display: inline-flex; align-items: center; gap: 4px; height: 23px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.tag.income { background: var(--green-soft); color: var(--green); }
.tag.expense { background: var(--red-soft); color: var(--red); }
.tag.gold { background: #f8edd5; color: var(--gold-deep); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.gray { background: #f1ece2; color: var(--ink-3); }
.tag.purple { background: #f0eafa; color: #72569a; }
.tag.line { background: transparent; border: 1px solid var(--line-2); color: var(--ink-2); }

.pos { color: var(--green); }
.neg { color: var(--red); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.muted { color: var(--ink-3); }
.small { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--num); font-size: 11.5px; letter-spacing: .2px; }

/* ---------------- 页面头 / 卡片 ---------------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .page-kicker { font: 600 9.5px/1 var(--num); letter-spacing: 2.6px; color: var(--gold-deep); text-transform: uppercase; margin-bottom: 8px; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: 1px; line-height: 1.2; }
.page-head p { margin: 7px 0 0; color: var(--ink-3); font-size: 12.5px; max-width: 720px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.card {
  background: linear-gradient(180deg, var(--card-a), var(--card-b));
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 10px; padding: 17px 20px 0; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .3px; }
.card-head .sub { color: var(--ink-3); font-size: 11px; font-weight: 400; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.card-body { padding: 18px 20px 20px; }
.card-body.tight { padding: 12px 20px 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------------- 总览 ---------------- */

.dash-top { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 18px; }
.hero {
  position: relative; overflow: hidden; border-radius: 24px;
  padding: 28px 30px 24px;
  background:
    radial-gradient(500px 280px at 88% -20%, rgba(226, 185, 109, .24), transparent 70%),
    linear-gradient(135deg, #1a150d, #271d10 52%, #3b2b13);
  color: #f8edd9;
  border: 1px solid rgba(226, 185, 109, .3);
  box-shadow: 0 26px 60px -34px rgba(42, 29, 8, .8);
  min-height: 250px;
}
.hero::before {
  content: ""; position: absolute; width: 360px; height: 360px; right: -80px; top: -140px;
  border: 1px solid rgba(226, 185, 109, .14); border-radius: 50%;
  box-shadow: 0 0 0 44px rgba(226, 185, 109, .035), 0 0 0 88px rgba(226, 185, 109, .022);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(226, 185, 109, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(226, 185, 109, .035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(90deg, transparent, rgba(0,0,0,.9));
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero-label { font-size: 12px; color: #bfa87f; letter-spacing: 1.2px; display: flex; align-items: center; gap: 7px; }
.hero-label .dot { width: 6px; height: 6px; border-radius: 50%; background: #e2b96d; box-shadow: 0 0 12px #e2b96d; }
.hero-amount { font: 600 48px/1.15 var(--num); letter-spacing: 1px; margin: 12px 0 6px; color: #f7e4bd; }
.hero-amount .cur { font-size: 22px; margin-right: 5px; color: #cfa75c; }
.hero-formula { font-size: 11.5px; color: #a99777; display: flex; flex-wrap: wrap; gap: 8px 12px; }
.hero-formula b { color: #e4c78f; font-weight: 600; font-family: var(--num); }
.hero-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(226, 185, 109, .15); }
.hero-split > div { min-width: 0; }
.hero-split label { display: block; font-size: 10.5px; color: #9d8a69; margin-bottom: 4px; }
.hero-split b { font: 600 19px/1.2 var(--num); color: #ead3a7; }
.hero-split b.neg { color: #ff9e88; }
.hero-split b.pos { color: #7fd2a8; }
.hero-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 10.5px; color: #8e7b5e; }

.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 15px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 118px;
  transition: transform .18s, box-shadow .18s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #f8edd7; color: var(--gold-deep); }
.stat-icon .icon { width: 15px; height: 15px; }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.red { background: var(--red-soft); color: var(--red); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-label { font-size: 10.5px; color: var(--ink-3); }
.stat-value { font: 600 22px/1.25 var(--num); margin-top: auto; padding-top: 8px; letter-spacing: .3px; }
.stat-sub { font-size: 10px; color: var(--ink-3); margin-top: 2px; }

.chart-card .chart { padding: 6px 12px 4px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-3); padding: 0 20px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.chart-legend i.line { height: 2px; width: 14px; border-radius: 2px; }

.donut-wrap { display: grid; grid-template-columns: 156px 1fr; gap: 16px; align-items: center; }
.donut-center { font-family: var(--num); }
.donut-list { display: flex; flex-direction: column; gap: 10px; }
.donut-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.donut-row .name { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-row .val { margin-left: auto; font-family: var(--num); color: var(--ink); }
.donut-row .pct { width: 42px; text-align: right; color: var(--ink-3); font-size: 10.5px; font-family: var(--num); }
.donut-row i { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 auto; }

.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 11.5px; }
.bar-row .bar-label { color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.bar-row .bar-val { font-family: var(--num); color: var(--ink); }
.bar-track { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: #f0e7d7; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #e0b76b, #c08d3a); }
.bar-fill.green { background: linear-gradient(90deg, #7fc7a5, #2e7d5c); }
.bar-fill.blue { background: linear-gradient(90deg, #9ab6d6, #4a6d96); }
.bar-fill.red { background: linear-gradient(90deg, #e5a08d, #b34a34); }

.recent-list { display: flex; flex-direction: column; }
.recent-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.recent-row:last-child { border-bottom: 0; padding-bottom: 0; }
.recent-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #f7edda; color: var(--gold-deep); flex: 0 0 auto; }
.recent-ico.red { background: var(--red-soft); color: var(--red); }
.recent-ico.green { background: var(--green-soft); color: var(--green); }
.recent-ico .icon { width: 14px; height: 14px; }
.recent-main { min-width: 0; flex: 1; }
.recent-main b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-main span { display: block; font-size: 10.5px; color: var(--ink-3); }
.recent-amt { font: 600 13px/1.2 var(--num); white-space: nowrap; }

.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item { display: flex; gap: 9px; padding: 10px 12px; border-radius: 10px; background: #fdf8ec; border: 1px solid #f0e1c4; }
.alert-item.warn { background: #fdf0eb; border-color: #f0cfc4; }
.alert-item .icon { width: 15px; height: 15px; color: var(--gold-deep); margin-top: 2px; }
.alert-item.warn .icon { color: var(--red); }
.alert-item b { display: block; font-size: 11.5px; margin-bottom: 2px; }
.alert-item p { margin: 0; font-size: 10.5px; color: var(--ink-3); line-height: 1.6; }

/* ---------------- 筛选栏 ---------------- */

.filter-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar .spacer { flex: 1; }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: #a99a82; }
.search-box input { height: 38px; padding-left: 34px; width: 230px; background: #fffdf8; }
.select-compact { height: 38px; background: #fffdf8; font-size: 12px; }

.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.summary-cell { padding: 13px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); box-shadow: var(--shadow); }
.summary-cell label { display: block; font-size: 10.5px; color: var(--ink-3); margin-bottom: 4px; }
.summary-cell b { font: 600 18px/1.2 var(--num); }
.summary-cell b small { font-size: 10px; color: var(--ink-3); font-family: var(--sans); margin-left: 3px; }
.summary-cell > span { display: block; font-size: 10px; margin-top: 3px; }
.store-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (max-width: 1200px) { .store-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .store-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------- 表格 ---------------- */

.table-card { padding: 0; overflow: hidden; }
.table-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.table-head h3 { margin: 0; font-size: 13.5px; }
.table-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 880px; }
table.data th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; font-size: 10px; font-weight: 600; letter-spacing: .7px;
  color: var(--ink-3); background: var(--th-bg);
  padding: 11px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data th.right, table.data td.right { text-align: right; }
table.data th.center, table.data td.center { text-align: center; }
table.data td { padding: 11px 12px; border-bottom: 1px solid #f2ebdd; font-size: 12px; vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover td { background: var(--hover-bg); }
table.data tr.clickable { cursor: pointer; }
.cell-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cell-main b { font-weight: 600; font-size: 12px; color: var(--ink); display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-main span { font-size: 10.5px; color: var(--ink-3); display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-date { font-family: var(--num); font-size: 11.5px; white-space: nowrap; }
.cell-date span { display: block; font-size: 10px; color: var(--ink-3); }
.cell-amt { font: 600 13px/1.2 var(--num); white-space: nowrap; }
.thumbs { display: flex; gap: 4px; }
.thumbs img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); cursor: zoom-in; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.row-actions .icon-btn { width: 28px; height: 28px; }
.row-actions .icon { width: 14px; height: 14px; }

.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.table-foot .info { font-size: 11px; color: var(--ink-3); }
.pager { display: flex; gap: 4px; align-items: center; }
.pager button { min-width: 30px; height: 30px; border: 1px solid var(--line); background: #fffdf8; border-radius: 7px; font-size: 11.5px; color: var(--ink-2); }
.pager button:hover { border-color: var(--gold-2); }
.pager button.on { background: var(--gold-3); border-color: #d8b987; color: #5c3f10; font-weight: 700; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

.empty { padding: 54px 20px; text-align: center; color: var(--ink-3); }
.empty .icon { width: 34px; height: 34px; color: #cbb998; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 3px; }
.empty span { font-size: 11.5px; }

/* ---------------- 结余 ---------------- */

.balance-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 18px; }
.balance-card {
  position: relative; overflow: hidden; border-radius: 24px; padding: 28px 30px;
  background: radial-gradient(500px 300px at 90% -30%, rgba(226, 185, 109, .3), transparent 70%), linear-gradient(135deg, #1b150d, #2d2111 60%, #483414);
  border: 1px solid rgba(226, 185, 109, .32); color: #f7e9cd;
  box-shadow: 0 28px 64px -36px rgba(42, 29, 8, .8);
}
.balance-card::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(226, 185, 109, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(226, 185, 109, .04) 1px, transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(90deg, transparent, #000); pointer-events: none; }
.balance-card > * { position: relative; z-index: 1; }
.balance-big { font: 600 52px/1.1 var(--num); color: #f7e4bd; margin: 8px 0 8px; letter-spacing: .5px; }
.balance-big .cur { font-size: 22px; color: #cfa75c; margin-right: 4px; }
.balance-formula-line { font-size: 11.5px; color: #a99777; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.balance-formula-line b { color: #e4c78f; font-family: var(--num); }
.balance-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(226, 185, 109, .16); }
.balance-part label { display: block; font-size: 10.5px; color: #9d8a69; }
.balance-part b { font: 600 17px/1.2 var(--num); color: #ecd4a6; }

.calc-panel { display: flex; flex-direction: column; gap: 12px; }
.calc-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.calc-sign { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font: 700 13px/1 var(--num); background: #f7ecd6; color: var(--gold-deep); }
.calc-sign.minus { background: var(--red-soft); color: var(--red); }
.calc-sign.equals { background: #1f1a12; color: #e2b96d; }
.calc-row .name { font-size: 12px; color: var(--ink-2); }
.calc-row .val { margin-left: auto; font: 600 15px/1.2 var(--num); }
.calc-row.total { border-color: #d8b987; background: #fff8e8; }
.calc-row.total .val { color: var(--gold-deep); font-size: 18px; }

.waterfall { padding: 8px 4px 0; }
.waterfall svg { width: 100%; height: auto; }

.month-table td, .month-table th { font-size: 11px; }
.month-table .bar-mini { height: 5px; border-radius: 3px; background: #f1e8d7; overflow: hidden; min-width: 60px; }
.month-table .bar-mini i { display: block; height: 100%; background: linear-gradient(90deg, #e0b76b, #c08d3a); }
.month-table .bar-mini.out i { background: linear-gradient(90deg, #e5a08d, #b34a34); }

.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.method-item { padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: #fdfaf3; }
.method-item b { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 5px; }
.method-item p { margin: 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }

/* ---------------- 报表 ---------------- */

.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { padding: 16px 18px; border-radius: 15px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.kpi label { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--ink-3); }
.kpi label .icon { width: 13px; height: 13px; }
.kpi b { display: block; font: 600 23px/1.25 var(--num); margin-top: 8px; }
.kpi small { font-size: 10.5px; color: var(--ink-3); }

.insight { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, #fdf7e8, #fbf1dc); border: 1px solid #eddcbb; margin-bottom: 10px; }
.insight .icon { width: 16px; height: 16px; color: var(--gold-deep); margin-top: 2px; }
.insight p { margin: 0; font-size: 11.5px; color: var(--ink-2); line-height: 1.7; }
.insight b { color: var(--gold-deep); }

.type-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.type-box { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fdfaf3; }
.type-box label { font-size: 10.5px; color: var(--ink-3); display: block; }
.type-box b { font: 600 18px/1.2 var(--num); display: block; margin-top: 4px; }
.type-box.in { background: #f3faf6; border-color: #d7e9df; }
.type-box.out { background: #fdf5f1; border-color: #f0d9d0; }

/* ---------------- 设置 ---------------- */

.tabs { display: flex; gap: 4px; padding: 4px; background: #f1e9da; border-radius: 12px; width: fit-content; margin-bottom: 18px; overflow-x: auto; max-width: 100%; }
.tabs button { height: 34px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tabs button.on { background: #fffdf8; color: var(--ink); box-shadow: 0 1px 4px rgba(64, 47, 20, .12); }
.settings-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; }
.setting-list { display: flex; flex-direction: column; gap: 12px; }
.setting-row { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fdfaf3; }
.setting-row .info { min-width: 0; }
.setting-row .info b { display: block; font-size: 12px; }
.setting-row .info span { display: block; font-size: 10.5px; color: var(--ink-3); }
.setting-row .right { margin-left: auto; }
.switch { position: relative; width: 40px; height: 23px; border-radius: 999px; border: 0; background: #ddd0b9; transition: .18s; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .18s; }
.switch.on { background: linear-gradient(135deg, #d8ad63, #b98334); }
.switch.on::after { transform: translateX(17px); }

.cat-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-item { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fffdf8; }
.cat-item .tag { flex: 0 0 auto; }
.cat-item .name { font-size: 12px; font-weight: 600; }
.cat-item .parent { font-size: 10.5px; color: var(--ink-3); }
.cat-item .right { margin-left: auto; display: flex; gap: 2px; }
.cat-add { display: flex; gap: 7px; margin-top: 10px; }
.cat-add input { height: 34px; font-size: 12px; flex: 1; }

.member-table td { font-size: 12px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.data-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.data-card { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fdfaf3; }
.data-card .icon { width: 22px; height: 22px; color: var(--gold-deep); margin-bottom: 8px; }
.data-card b { display: block; font-size: 12.5px; margin-bottom: 3px; }
.data-card p { margin: 0 0 12px; font-size: 11px; color: var(--ink-3); line-height: 1.6; }
.audit-list { display: flex; flex-direction: column; }
.audit-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 11.5px; }
.audit-row:last-child { border-bottom: 0; }
.audit-row time { width: 130px; color: var(--ink-3); font-family: var(--num); flex: 0 0 auto; }
.audit-row b { width: 74px; flex: 0 0 auto; }
.audit-row span { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 弹窗 / 提示 ---------------- */

.modal-mask {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px 6vh; overflow: auto;
  background: rgba(24, 18, 9, .58);
  backdrop-filter: blur(5px);
  animation: fade .18s ease;
}
.modal {
  width: min(720px, 100%); border-radius: 20px; background: var(--panel);
  border: 1px solid rgba(226, 185, 109, .35);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .7);
  animation: pop .22s cubic-bezier(.2, .8, .2, 1);
  display: flex; flex-direction: column; max-height: 92vh;
}
.modal.wide { width: min(960px, 100%); }
.modal.narrow { width: min(460px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 24px 0; flex: 0 0 auto; }
.modal-head .title { min-width: 0; }
.modal-head h3 { margin: 0; font-size: 17px; letter-spacing: .5px; }
.modal-head p { margin: 4px 0 0; font-size: 11.5px; color: var(--ink-3); }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 24px 8px; overflow-y: auto; min-height: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 24px 20px; border-top: 1px solid var(--line); margin-top: 10px; flex-wrap: wrap; flex: 0 0 auto; }
.modal-foot .left { margin-right: auto; color: var(--ink-3); font-size: 11px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 8px;
  padding: 11px 15px; border-radius: 11px; background: #1e1911; color: #f2e4c8;
  font-size: 12px; box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .6);
  border-left: 3px solid var(--gold-2);
  animation: toastIn .22s ease;
}
.toast.err { border-left-color: #e07b61; }
.toast.ok { border-left-color: #5cc394; }
.toast .icon { width: 15px; height: 15px; color: var(--gold-2); }
.toast.err .icon { color: #ff9c84; }
.toast.ok .icon { color: #7ee0b4; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(10, 8, 5, .9); display: flex; align-items: center; justify-content: center; padding: 30px; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.lightbox-close { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); color: #fff; display: grid; place-items: center; }
.lightbox-close:hover { background: rgba(255, 255, 255, .16); }

/* ---------------- 上传 ---------------- */

.uploader { border: 1.5px dashed var(--line-2); border-radius: 13px; background: #fdfaf3; padding: 14px; transition: .15s; }
.uploader.drag { border-color: var(--gold); background: #fff7e3; }
.uploader-head { display: flex; align-items: center; gap: 10px; }
.uploader-head .icon { width: 22px; height: 22px; color: var(--gold-deep); }
.uploader-head b { display: block; font-size: 12px; }
.uploader-head span { display: block; font-size: 10.5px; color: var(--ink-3); }
.uploader-head .btn { margin-left: auto; }
.upload-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.upload-thumb { position: relative; width: 74px; height: 74px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); background: #eee; }
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-thumb button { position: absolute; top: 3px; right: 3px; width: 19px; height: 19px; border-radius: 50%; border: 0; background: rgba(20, 15, 8, .72); color: #fff; display: grid; place-items: center; }
.upload-thumb button .icon { width: 11px; height: 11px; }
.upload-empty { font-size: 11px; color: var(--ink-3); margin-top: 8px; }
.uploader.compact { padding: 10px; }
.uploader.compact .upload-thumb { width: 56px; height: 56px; }
.upload-progress { font-size: 10.5px; color: var(--gold-deep); margin-top: 6px; }

.account-picker { display: flex; flex-direction: column; gap: 10px; }
.account-choice {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px; border: 1px solid var(--line); border-radius: 13px;
  background: #fdfaf3; text-align: left; transition: .15s;
}
.account-choice:hover { border-color: var(--gold-2); background: #fff8e8; transform: translateY(-1px); }
.account-choice .avatar { width: 42px; height: 42px; font-size: 15px; }
.account-choice .avatar.chen { background: linear-gradient(135deg, #bcd8ea, #6f9fbe); color: #0e2a3a; }
.account-choice .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-choice .info b { font-size: 13.5px; }
.account-choice .info span { font-size: 11px; color: var(--ink-3); }
.account-choice .arrow { margin-left: auto; color: var(--ink-3); font-size: 20px; }

/* ---------------- 导入 ---------------- */

.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.import-drop {
  min-height: 190px; border: 1.5px dashed var(--line-2); border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  background: #fdfaf3; color: var(--ink-2); cursor: pointer; transition: .15s; text-align: center; padding: 20px;
}
.import-drop:hover, .import-drop.drag { border-color: var(--gold); background: #fff7e3; }
.import-drop .icon { width: 32px; height: 32px; color: var(--gold-deep); }
.import-drop b { font-size: 14px; }
.import-drop span { font-size: 11px; color: var(--ink-3); }
@media (max-width: 720px) { .import-grid { grid-template-columns: 1fr; } }

/* ---------------- 手机底部导航 ---------------- */

.mobile-nav { display: none; }

@media (max-width: 980px) {
  .mobile-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 248, .96);
    border-top: 1px solid var(--line);
    box-shadow: 0 -10px 30px -20px rgba(64, 47, 20, .45);
    backdrop-filter: blur(14px);
  }
  .mobile-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: 52px; border-radius: 10px; color: var(--ink-3); font-size: 10px;
  }
  .mobile-nav a .icon { width: 20px; height: 20px; }
  .mobile-nav a.active { color: var(--gold-deep); background: rgba(195, 146, 63, .09); }
  .mobile-add {
    justify-self: center; align-self: start;
    width: 58px; height: 58px; margin-top: -22px;
    border: 4px solid var(--bg); border-radius: 50%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
    background: linear-gradient(135deg, #e5bd74, #bd8a3b); color: #241806;
    box-shadow: 0 12px 24px -10px rgba(160, 110, 30, .8);
    font-size: 9px; font-weight: 700;
  }
  .mobile-add .icon { width: 24px; height: 24px; stroke-width: 2.2; }
  .content { padding-bottom: 96px; }
  .site-foot { padding-bottom: 86px; }
}

@media (max-width: 980px) {
  .sidebar { padding-bottom: 82px; }
}

/* ---------------- 空状态 / 加载 ---------------- */

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 70px 20px; color: var(--ink-3); font-size: 12px; }
.spinner { width: 17px; height: 17px; border: 2px solid #e7d9c1; border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #f2eadb, #faf5ea, #f2eadb); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- 外观主题 ---------------- */

[data-theme="light"] {
  --bg: #eef6fd;
  --bg-2: #e2eef9;
  --panel: #ffffff;
  --panel-2: #f7fbff;
  --ink: #182838;
  --ink-2: #526b82;
  --ink-3: #8298ad;
  --gold: #2f74c0;
  --gold-2: #63a0dc;
  --gold-3: #e4f0fb;
  --gold-deep: #1d5896;
  --green: #2b7d62;
  --green-soft: #e8f5ef;
  --red: #b2473a;
  --red-soft: #fbeae6;
  --line: #dce8f3;
  --line-2: #c5d7e7;
  --input-bg: #ffffff;
  --th-bg: #f3f9ff;
  --hover-bg: #f7fbff;
  --soft-bg: #f8fbff;
  --note-bg: #f1f8ff;
  --topbar-bg: rgba(255, 255, 255, .92);
  --card-a: #ffffff;
  --card-b: #fbfdff;
}
[data-theme="light"] body {
  background:
    radial-gradient(1000px 560px at 8% -10%, #ffffff, transparent 62%),
    radial-gradient(900px 500px at 100% 0, #dcecfb, transparent 58%),
    #eef6fd;
}
[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #ffffff, #f1f8ff 60%, #eaf4fd);
  color: #5d7488;
  border-right: 1px solid #dce8f3;
  box-shadow: 8px 0 30px -24px rgba(21, 64, 104, .3);
}
[data-theme="light"] .brand-mark { border-color: #c5d7e7; box-shadow: 0 8px 24px -12px rgba(47, 116, 192, .35); }
[data-theme="light"] .brand-name { background: linear-gradient(96deg, #2f74c0, #1b4f8a); -webkit-background-clip: text; background-clip: text; }
[data-theme="light"] .brand-sub { color: #8298ad; }
[data-theme="light"] .nav-label { color: #9ab0c4; }
[data-theme="light"] .nav-item { color: #5d7488; }
[data-theme="light"] .nav-item .icon { color: #7e9ab3; }
[data-theme="light"] .nav-item:hover { background: #edf5fd; color: #1d5896; }
[data-theme="light"] .nav-item.active { background: linear-gradient(90deg, #e3f0fd, #f3f9ff); color: #1d5896; box-shadow: inset 2px 0 0 #2f74c0; }
[data-theme="light"] .nav-item.active .icon { color: #2f74c0; }
[data-theme="light"] .nav-count { background: #e8f2fc; color: #5d7a96; }
[data-theme="light"] .nav-dot { background: #2f74c0; box-shadow: 0 0 0 4px rgba(47, 116, 192, .12); }
[data-theme="light"] .side-card { background: #f7fbff; border-color: #dce8f3; }
[data-theme="light"] .side-card-top { color: #7e96aa; }
[data-theme="light"] .side-amount { color: #1d5896; }
[data-theme="light"] .side-sub,
[data-theme="light"] .side-row { color: #8298ad; }
[data-theme="light"] .side-row b { color: #526b82; }
[data-theme="light"] .side-user { border-color: #dce8f3; }
[data-theme="light"] .side-user-text b { color: #182838; }
[data-theme="light"] .side-user-text span { color: #8298ad; }
[data-theme="light"] .appearance { border-color: #dce8f3; }
[data-theme="light"] .appearance label { color: #8298ad; }
[data-theme="light"] .appearance select { background-color: #fff; color: #182838; border-color: #c5d7e7; color-scheme: light; }
[data-theme="light"] .side-user .icon-btn { color: #8298ad; }
[data-theme="light"] .hero,
[data-theme="light"] .balance-card {
  background:
    radial-gradient(500px 300px at 90% -30%, rgba(99, 160, 220, .3), transparent 70%),
    linear-gradient(135deg, #102a44, #173f63 60%, #1d5896);
  border-color: rgba(120, 180, 235, .35);
}
[data-theme="light"] .hero-label,
[data-theme="light"] .balance-formula-line { color: #b9d4ee; }
[data-theme="light"] .hero-amount,
[data-theme="light"] .balance-big { color: #f3f9ff; }
[data-theme="light"] .hero-amount .cur,
[data-theme="light"] .balance-big .cur { color: #8fc0f0; }
[data-theme="light"] .hero-formula { color: #aac6df; }
[data-theme="light"] .hero-formula b,
[data-theme="light"] .balance-formula-line b { color: #b9dcff; }
[data-theme="light"] .hero-split label,
[data-theme="light"] .balance-part label { color: #9fbcd6; }
[data-theme="light"] .hero-split b,
[data-theme="light"] .balance-part b { color: #dceeff; }
[data-theme="light"] .hero-foot { color: #9fbcd6; }
[data-theme="light"] .btn-primary,
[data-theme="light"] .mobile-add,
[data-theme="light"] .period-apply { background: linear-gradient(135deg, #4b8fd4, #2f74c0); border-color: #2f74c0; color: #fff; box-shadow: 0 8px 20px -10px rgba(47, 116, 192, .7); }
[data-theme="light"] .btn-primary:hover { background: linear-gradient(135deg, #5b9ee0, #2f74c0); }
[data-theme="light"] .tag.gold { background: #e4f0fb; color: #1d5896; }
[data-theme="light"] .stat-icon { background: #e9f3fd; color: #2f74c0; }
[data-theme="light"] .avatar { background: linear-gradient(135deg, #d8ecff, #6fa8dc); color: #0f2a42; border-color: #fff; }
[data-theme="light"] .brand-mark { background: #fff; }

[data-theme="dark"] {
  --bg: #080d0d;
  --bg-2: #0d1414;
  --panel: #101919;
  --panel-2: #0d1515;
  --ink: #e9f5f2;
  --ink-2: #a9c1bd;
  --ink-3: #6f8a86;
  --line: #1f2e2d;
  --line-2: #2b4040;
  --input-bg: #0f1818;
  --th-bg: #121d1d;
  --hover-bg: #152222;
  --soft-bg: #0f1818;
  --note-bg: #11201e;
  --topbar-bg: rgba(8, 13, 13, .94);
  --card-a: #101919;
  --card-b: #0b1212;
  --gold: #38d6a4;
  --gold-2: #65e7bf;
  --gold-3: #123a2e;
  --gold-deep: #8df0d0;
  --green: #38d6a4;
  --green-soft: #123a2e;
  --red: #ff7a6b;
  --red-soft: #3a1c18;
  --shadow: 0 18px 44px -28px rgba(0, 0, 0, .9);
}
[data-theme="dark"] body {
  background:
    radial-gradient(900px 500px at 8% -10%, rgba(56, 214, 164, .07), transparent 60%),
    radial-gradient(800px 480px at 100% 0, rgba(56, 214, 164, .04), transparent 58%),
    #080d0d;
}
[data-theme="dark"] .topbar { background: rgba(8, 13, 13, .94); border-color: #1f2e2d; }
[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #060b0b, #0a1111 55%, #070c0c);
  border-right-color: #1c2a29;
}
[data-theme="dark"] .brand-mark { border-color: #2b4040; box-shadow: none; }
[data-theme="dark"] .brand-name { background: none; -webkit-text-fill-color: #f2fffb; color: #f2fffb; }
[data-theme="dark"] .brand-sub { color: #6f8a86; }
[data-theme="dark"] .nav-label { color: #56716c; }
[data-theme="dark"] .nav-item { color: #9fb8b3; }
[data-theme="dark"] .nav-item .icon { color: #6f8a86; }
[data-theme="dark"] .nav-item:hover { background: #10201d; color: #d8fff5; }
[data-theme="dark"] .nav-item:hover .icon { color: #38d6a4; }
[data-theme="dark"] .nav-item.active { background: linear-gradient(90deg, rgba(56, 214, 164, .16), rgba(56, 214, 164, .03)); color: #8df0d0; box-shadow: inset 2px 0 0 #38d6a4; }
[data-theme="dark"] .nav-item.active .icon { color: #38d6a4; }
[data-theme="dark"] .nav-count { background: #173a30; color: #9fe8d3; }
[data-theme="dark"] .nav-dot { background: #38d6a4; box-shadow: 0 0 0 4px rgba(56, 214, 164, .12); }
[data-theme="dark"] .side-card { background: #0d1817; border-color: #1f2e2d; }
[data-theme="dark"] .side-card-top { color: #7fa39b; }
[data-theme="dark"] .side-amount { color: #f2fffb; }
[data-theme="dark"] .side-sub,
[data-theme="dark"] .side-row { color: #6f8a86; }
[data-theme="dark"] .side-row b { color: #cfe8e2; }
[data-theme="dark"] .side-user { border-color: #1f2e2d; }
[data-theme="dark"] .side-user-text b { color: #e9f5f2; }
[data-theme="dark"] .side-user-text span { color: #6f8a86; }
[data-theme="dark"] .appearance { border-color: #1f2e2d; }
[data-theme="dark"] .appearance label { color: #7fa39b; }
[data-theme="dark"] .appearance select { background-color: #0f1818; border-color: #2b4040; color: #e9f5f2; color-scheme: dark; }
[data-theme="dark"] .avatar { background: linear-gradient(135deg, #8df0d0, #1f9a76); color: #06231a; border-color: #d7fff4; }
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .mobile-add { background: linear-gradient(135deg, #4be0b0, #26b98b); border-color: #38d6a4; color: #04241a; box-shadow: 0 10px 26px -12px rgba(56, 214, 164, .65); }
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .mobile-add:hover { background: linear-gradient(135deg, #62eec2, #2fc99a); }
[data-theme="dark"] .hero,
[data-theme="dark"] .balance-card {
  background:
    radial-gradient(520px 320px at 88% -30%, rgba(56, 214, 164, .16), transparent 70%),
    linear-gradient(135deg, #071010, #0d1a18 58%, #102522);
  border-color: rgba(56, 214, 164, .24);
}
[data-theme="dark"] .hero-label,
[data-theme="dark"] .balance-formula-line,
[data-theme="dark"] .hero-formula { color: #86a8a1; }
[data-theme="dark"] .hero-amount,
[data-theme="dark"] .balance-big { color: #f4fffb; }
[data-theme="dark"] .hero-amount .cur,
[data-theme="dark"] .balance-big .cur { color: #38d6a4; }
[data-theme="dark"] .hero-formula b,
[data-theme="dark"] .balance-formula-line b { color: #8df0d0; }
[data-theme="dark"] .hero-split label,
[data-theme="dark"] .balance-part label { color: #7fa39b; }
[data-theme="dark"] .hero-split b,
[data-theme="dark"] .balance-part b { color: #e9fff9; }
[data-theme="dark"] .hero-foot { color: #7fa39b; }
[data-theme="dark"] .tag.gold { background: #123a2e !important; color: #8df0d0 !important; }
[data-theme="dark"] .hero .tag,
[data-theme="dark"] .balance-card .tag { background: #123a2e !important; color: #8df0d0 !important; }
[data-theme="dark"] .stat-icon { background: #123a2e; color: #38d6a4; }
[data-theme="dark"] .mobile-nav { background: rgba(8, 13, 13, .96); border-top-color: #1f2e2d; }
[data-theme="dark"] .mobile-nav a.active { color: #8df0d0; background: #10201d; }
[data-theme="dark"] .mobile-add { border-color: #080d0d; }
[data-theme="dark"] .bar-fill,
[data-theme="dark"] .bar-fill.green,
[data-theme="dark"] .bar-fill.blue,
[data-theme="dark"] .bar-fill.red { background: linear-gradient(90deg, #62eec2, #1f9a76); }
[data-theme="dark"] .summary-cell b,
[data-theme="dark"] .stat-value { color: var(--ink); }
[data-theme="dark"] .pos { color: #8df0d0; }
[data-theme="dark"] .neg { color: #ff9384; }
[data-theme="dark"] .seg,
[data-theme="dark"] .tabs,
[data-theme="dark"] .role-switch { background: #101d1b; }
[data-theme="dark"] .seg button,
[data-theme="dark"] .tabs button { color: var(--ink-3); }
[data-theme="dark"] .seg button.on,
[data-theme="dark"] .tabs button.on { background: #173a30; color: #d9fff5; }
[data-theme="dark"] .setting-row,
[data-theme="dark"] .cat-item,
[data-theme="dark"] .data-card,
[data-theme="dark"] .account-choice,
[data-theme="dark"] .import-drop,
[data-theme="dark"] .uploader,
[data-theme="dark"] .type-box,
[data-theme="dark"] .calc-row,
[data-theme="dark"] .summary-cell,
[data-theme="dark"] .month-table .bar-mini,
[data-theme="dark"] .bar-track { background: var(--soft-bg); border-color: var(--line); }
[data-theme="dark"] .page-head p,
[data-theme="dark"] .card-head .sub,
[data-theme="dark"] .small.muted,
[data-theme="dark"] .method-item p { color: var(--ink-3); }
[data-theme="dark"] .chart-legend { color: var(--ink-3); }
[data-theme="dark"] .empty b { color: var(--ink-2); }
[data-theme="dark"] .table-head { border-color: var(--line); }
[data-theme="dark"] .select-compact,
[data-theme="dark"] .search-box input,
[data-theme="dark"] .chip,
[data-theme="dark"] .pager button { background: var(--input-bg); color: var(--ink); border-color: var(--line-2); }
[data-theme="dark"] .table-foot,
[data-theme="dark"] .table-head,
[data-theme="dark"] .modal-foot { border-color: var(--line); }
[data-theme="dark"] .modal,
[data-theme="dark"] .user-pop { background: var(--panel); }
[data-theme="dark"] .chart-legend span:nth-child(1) i { background: #38d6a4 !important; }
[data-theme="dark"] .chart-legend span:nth-child(2) i { background: #3a4b48 !important; }
[data-theme="dark"] .chart-legend span:nth-child(3) i { background: #8df0d0 !important; }
[data-theme="dark"] .toast { background: #0f1a18; border-left-color: #38d6a4; color: #e9f5f2; }
[data-theme="dark"] .toast .icon { color: #38d6a4; }

[data-theme="pink"] {
  --bg: #fdf1f5;
  --bg-2: #f8e4ec;
  --panel: #fffafc;
  --panel-2: #fdf1f6;
  --ink: #3a2530;
  --ink-2: #6f4b5c;
  --ink-3: #a27688;
  --line: #efd4df;
  --line-2: #e2b9c9;
  --gold: #d47a9d;
  --gold-2: #eba9c1;
  --gold-3: #fbe1ea;
  --gold-deep: #a3486d;
  --green: #2e7d64;
  --green-soft: #e8f5ef;
  --red: #b34a63;
  --red-soft: #fbe9ee;
  --input-bg: #fffafc;
  --th-bg: #fceef3;
  --hover-bg: #fff5f8;
  --soft-bg: #fdf3f7;
  --note-bg: #fdf0f5;
  --topbar-bg: rgba(255, 250, 252, .9);
  --card-a: #fffafc;
  --card-b: #fdf4f8;
}
[data-theme="pink"] body {
  background:
    radial-gradient(900px 500px at 8% -10%, #fff7fa, transparent 60%),
    radial-gradient(800px 480px at 100% 0, #f9dce8, transparent 58%),
    #fdf1f5;
}
[data-theme="pink"] .sidebar {
  background: radial-gradient(320px 220px at 50% 0%, rgba(212, 122, 157, .22), transparent 70%), linear-gradient(180deg, #2a1821, #1d1017 60%, #24141c);
}
[data-theme="pink"] .brand-name { background: linear-gradient(96deg, #ffe0eb, #e9a0ba 62%, #c76f91); -webkit-background-clip: text; background-clip: text; }
[data-theme="pink"] .nav-item.active { background: linear-gradient(90deg, rgba(212, 122, 157, .24), rgba(212, 122, 157, .05)); box-shadow: inset 2px 0 0 #e9a0ba; }
[data-theme="pink"] .btn-primary,
[data-theme="pink"] .mobile-add { background: linear-gradient(135deg, #e9a0ba, #c76f91); border-color: #c76f91; color: #32101f; }
[data-theme="pink"] .hero,
[data-theme="pink"] .balance-card { background: radial-gradient(500px 300px at 90% -30%, rgba(233, 160, 186, .3), transparent 70%), linear-gradient(135deg, #2a1721, #3a1c2b 60%, #55283c); }

[data-theme="gold"] {
  --bg: #f4efe4;
  --bg-2: #efe7d7;
  --panel: #fffdf8;
  --panel-2: #fbf7ed;
  --ink: #211a11;
  --ink-2: #5f5342;
  --ink-3: #94856d;
  --line: #e8dcc7;
  --line-2: #d9c7a7;
  --gold: #c3923f;
  --gold-2: #e2b96d;
  --gold-3: #f4e2ba;
  --gold-deep: #8d6422;
  --input-bg: #fffdf9;
  --th-bg: #fbf6ea;
  --hover-bg: #fdf9f1;
  --soft-bg: #fdfaf3;
  --note-bg: #fdf8ed;
  --topbar-bg: rgba(255, 253, 248, .82);
  --card-a: #fffdf9;
  --card-b: #fdfaf3;
}
[data-theme="gold"] body {
  background:
    radial-gradient(1100px 560px at 8% -12%, #fff9eb 0, rgba(255, 249, 235, 0) 62%),
    radial-gradient(900px 520px at 102% -4%, #f0e1c6 0, rgba(240, 225, 198, 0) 58%),
    #f4efe4;
}
[data-theme="gold"] .sidebar {
  background:
    radial-gradient(320px 220px at 50% 0%, rgba(195, 146, 63, .16), transparent 70%),
    linear-gradient(180deg, #17120b, #12100a 55%, #16120c);
}
[data-theme="gold"] .btn-primary,
[data-theme="gold"] .mobile-add { background: linear-gradient(135deg, #e5bd74, #c08d3a); border-color: #b78431; color: #241806; box-shadow: 0 8px 20px -10px rgba(170, 115, 28, .8); }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1280px) {
  .dash-top { grid-template-columns: 1.45fr 1fr; }
  .content { padding: 24px 24px 40px; }
  .topbar { padding: 0 24px; }
}

@media (max-width: 1120px) {
  .dash-top { grid-template-columns: 1fr; }
  .mini-grid { grid-template-columns: repeat(4, 1fr); }
  .balance-hero { grid-template-columns: 1fr; }
  .report-kpis { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh;
    transform: translateX(-100%); transition: transform .24s ease;
    box-shadow: 30px 0 80px rgba(0, 0, 0, .35);
  }
  .app.menu-open .sidebar { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; z-index: 35; background: rgba(20, 15, 8, .5); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .app.menu-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex !important; }
  .crumb-root, .crumb-arrow { display: none; }
  .main { width: 100%; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .login-wrap { grid-template-columns: 1fr; width: min(560px, 94vw); }
  .login-brand { display: none; }
  .login-card { padding: 40px 34px; }
}

@media (max-width: 720px) {
  .content { padding: 18px 15px 34px; }
  .topbar { height: 62px; flex-basis: 62px; padding: 0 14px; gap: 8px; }
  .top-actions { gap: 6px; }
  .top-actions .btn-ghost .hide-sm { display: none; }
  .btn { height: 36px; padding: 0 11px; }
  .page-head h1 { font-size: 23px; }
  .page-head { gap: 12px; margin-bottom: 16px; }
  .hero { padding: 22px 20px; border-radius: 20px; }
  .hero-amount { font-size: 38px; }
  .hero-split { grid-template-columns: 1fr 1fr; }
  .hero-split > div:last-child { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid rgba(226, 185, 109, .14); }
  .mini-grid { grid-template-columns: 1fr 1fr; }
  .stat-card { min-height: 108px; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal, .modal.wide, .modal.narrow { width: 100%; border-radius: 20px 20px 0 0; max-height: 94vh; overflow: auto; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
  .donut-list { width: 100%; }
  .method-grid, .cat-columns, .data-cards, .type-split { grid-template-columns: 1fr; }
  .balance-big { font-size: 40px; }
  .balance-parts { grid-template-columns: 1fr 1fr; }
  .report-kpis { grid-template-columns: 1fr 1fr; }
  .filter-bar { gap: 7px; }
  .search-box input { width: 100%; }
  .search-box { flex: 1; min-width: 150px; }
  .table-head { padding: 13px 14px; }
  .table-foot { padding: 12px 14px; }
  .login-card { padding: 32px 22px; }
  .login-card-head h2 { font-size: 22px; }
  .login-logo { width: 150px; height: 150px; }
  .site-foot { font-size: 9.5px; }
}

@media (max-width: 420px) {
  .mini-grid { grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr; }
  .hero-split b { font-size: 16px; }
  .report-kpis { grid-template-columns: 1fr; }
}

/* 打印：结余表 */
@media print {
  .sidebar, .topbar, .site-foot, .page-actions, .btn, .tabs { display: none !important; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .card, .balance-card { box-shadow: none; break-inside: avoid; }
}
