/* ========== 设计变量 ========== */
:root {
  color-scheme: light;
  --font: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --surface-3: #eef1f6;
  --border: #e5e8ef;
  --border-strong: #d4d9e3;
  --text-1: #101828;
  --text-2: #475467;
  --text-3: #8a93a6;
  --brand: #3358d4;
  --brand-soft: #eef2ff;
  --brand-ink: #2946aa;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px -6px rgba(16, 24, 40, .08);
  --radius: 14px;

  /* 图表与金额 */
  --income: #1baf7a;
  --expense: #eb6834;
  --transfer: #6250d6;
  --balance: #2a78d6;
  --income-text: #067a50;
  --expense-text: #c2410c;
  --transfer-text: #5240c4;
  --grid: #eceef3;
  --axis: #c9ced8;
  --good-text: #067a50;
  --bad-text: #c4320a;

  /* Element Plus 主色 */
  --el-color-primary: #3358d4;
  --el-color-primary-light-3: #708ae1;
  --el-color-primary-light-5: #99acea;
  --el-color-primary-light-7: #c2cdf2;
  --el-color-primary-light-8: #d6def6;
  --el-color-primary-light-9: #ebeefb;
  --el-color-primary-dark-2: #2946aa;
  --el-border-radius-base: 8px;
  --el-font-family: var(--font);
}

html.dark {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #171a20;
  --surface-2: #1c2027;
  --surface-3: #232831;
  --border: #2a2f39;
  --border-strong: #363c48;
  --text-1: #eef0f4;
  --text-2: #b7bdca;
  --text-3: #7f8797;
  --brand: #5a7cf0;
  --brand-soft: #1d2440;
  --brand-ink: #a9bbff;
  --shadow-sm: none;
  --shadow: 0 1px 0 rgba(255, 255, 255, .02);

  --income: #199e70;
  --expense: #d95926;
  --transfer: #9085e9;
  --balance: #3987e5;
  --income-text: #3ccf98;
  --expense-text: #ff8a5c;
  --transfer-text: #aaa1f2;
  --grid: #262a33;
  --axis: #3a404c;
  --good-text: #3ccf98;
  --bad-text: #ff7a6b;

  --el-color-primary: #5a7cf0;
  --el-color-primary-light-3: #455dae;
  --el-color-primary-light-5: #374882;
  --el-color-primary-light-7: #293356;
  --el-color-primary-light-8: #222940;
  --el-color-primary-light-9: #1b1e2a;
  --el-color-primary-dark-2: #7b96f3;
  --el-bg-color: #171a20;
  --el-bg-color-overlay: #1c2027;
  --el-fill-color-blank: #171a20;
  --el-border-color: #2f3540;
  --el-border-color-light: #2a2f39;
  --el-border-color-lighter: #262a33;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100%; }
a { color: var(--brand); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.sub { color: var(--text-2); }
.income-text { color: var(--income-text); }
.expense-text { color: var(--expense-text); }
.transfer-text { color: var(--transfer-text); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-16 { margin-top: 16px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ========== 启动画面 ========== */
.boot {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); gap: 10px; font-size: 15px;
}

/* ========== 布局 ========== */
.layout {
  display: flex; min-height: 100vh;
  background: linear-gradient(to right, var(--surface) 227px, var(--border) 227px, var(--border) 228px, transparent 228px);
}
.sidebar {
  width: 228px; flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 20px 20px 18px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: linear-gradient(140deg, #4b6ff0, #2846b8);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px;
  box-shadow: 0 4px 12px -4px rgba(51, 88, 212, .6);
}
.brand-name { font-weight: 650; font-size: 15px; line-height: 1.25; }
.brand-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.nav { padding: 6px 12px; flex: 1; overflow-y: auto; }
.nav-group { font-size: 12px; color: var(--text-3); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 9px;
  color: var(--text-2); font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s;
}
.nav a .el-icon { font-size: 17px; }
.nav a:hover { background: var(--surface-2); color: var(--text-1); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
html:not(.dark) .nav a.active { color: var(--brand); }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--el-color-danger); color: #fff; font-size: 12px; line-height: 20px; text-align: center;
}
.pending-link {
  font-size: 13px; color: var(--el-color-danger); background: var(--el-color-danger-light-9);
  padding: 4px 10px; border-radius: 999px; margin-right: 4px; white-space: nowrap;
}
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer;
}
.user-chip:hover { background: var(--surface-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink);
  display: grid; place-items: center; font-weight: 600; flex: none;
}
html:not(.dark) .avatar { color: var(--brand); }
.user-chip .name { font-weight: 550; font-size: 13px; line-height: 1.35; }
.user-chip .role { font-size: 12px; color: var(--text-3); line-height: 1.35; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
}
.topbar h1 { font-size: 19px; font-weight: 650; margin: 0; letter-spacing: .01em; }
.topbar .crumb { color: var(--text-3); font-size: 13px; }
.menu-btn { display: none !important; }
.content { padding: 4px 28px 40px; max-width: 1480px; width: 100%; }

/* ========== 卡片 ========== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; min-height: 40px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-desc { font-size: 12px; color: var(--text-3); }
.card-body { padding: 14px 20px 18px; }
.card-body.flush { padding: 8px 0 0; }
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-hero { grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px;
}
.filter-bar .el-input, .filter-bar .el-select { width: 168px; }
.filter-bar .el-date-editor.el-input__wrapper { width: 260px; flex: none; }

/* ========== 概览：资金总额 & 统计卡 ========== */
.hero {
  position: relative; overflow: hidden; color: #fff; border: none;
  background: radial-gradient(120% 140% at 100% 0%, #4f74f5 0%, #2f4fc4 45%, #22388f 100%);
  box-shadow: 0 12px 30px -14px rgba(41, 70, 170, .65);
}
html.dark .hero { background: radial-gradient(120% 140% at 100% 0%, #3b5bd6 0%, #263f9e 50%, #1a2b6b 100%); }
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 240px; height: 240px; border-radius: 50%;
  border: 36px solid rgba(255, 255, 255, .06);
}
.hero .card-body { padding: 22px 24px; position: relative; z-index: 1; }
.hero .label { font-size: 13px; opacity: .82; display: flex; align-items: center; gap: 6px; }
.hero .value { font-size: 40px; font-weight: 650; margin: 10px 0 6px; letter-spacing: -.01em; line-height: 1.1; }
.hero .value small { font-size: 22px; font-weight: 500; opacity: .85; margin-right: 4px; }
.hero .foot { font-size: 12.5px; opacity: .78; }
.hero .chips { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero .chip { background: rgba(255, 255, 255, .13); border-radius: 999px; padding: 4px 10px; font-size: 12px; }

.stat .card-body { padding: 18px 20px; height: 100%; display: flex; flex-direction: column; }
.stat .foot-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; }
.spark { flex: none; display: block; }
.spark path { stroke: var(--text-3); opacity: .5; }
.stat .label { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.stat .dot { width: 8px; height: 8px; border-radius: 50%; }
.stat .value { font-size: 26px; font-weight: 650; margin: 10px 0 8px; letter-spacing: -.01em; }
.stat .value small { font-size: 15px; font-weight: 500; color: var(--text-3); margin-right: 2px; }
.delta { font-size: 12.5px; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.delta.good { color: var(--good-text); }
.delta.bad { color: var(--bad-text); }
.delta.flat { color: var(--text-3); }

/* 图表 */
.chart-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-tip { font-family: var(--font); font-size: 12.5px; min-width: 150px; }
.chart-tip .t { color: var(--text-3); margin-bottom: 6px; }
.chart-tip .r { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.chart-tip .k { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.chart-tip .v { font-weight: 650; color: var(--text-1); font-variant-numeric: tabular-nums; }
.chart-tip .n { color: var(--text-2); }

/* 排名条 */
.rank { display: flex; flex-direction: column; gap: 13px; }
.rank-row { display: grid; grid-template-columns: minmax(64px, 7.5em) minmax(0, 1fr) 168px; gap: 12px; align-items: center; cursor: default; }
.rank-row.clickable { cursor: pointer; }
.rank-row .nm { font-size: 13px; color: var(--text-1); }
.rank-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.rank-fill { display: block; height: 100%; border-radius: 99px; min-width: 2px; transition: width .4s; }
.rank-row .amt { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-row .pct { color: var(--text-3); display: inline-block; width: 54px; text-align: right; }
.rank-row:hover .rank-fill { filter: brightness(1.08); }

/* 账户 */
.acct-badge {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  font-weight: 650; font-size: 15px; color: #fff;
}
.acct-badge.sm { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.acct-bank { background: linear-gradient(140deg, #3d7be0, #2459b8); }
.acct-cash { background: linear-gradient(140deg, #f2a03c, #d97b0f); }
.acct-alipay { background: linear-gradient(140deg, #2f8cff, #1366d6); }
.acct-wechat { background: linear-gradient(140deg, #23c26b, #0d9a4f); }
.acct-credit { background: linear-gradient(140deg, #8a72f0, #5d45cf); }
.acct-other { background: linear-gradient(140deg, #8794a8, #5d6a7e); }
.acct-list { display: flex; flex-direction: column; }
.acct-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.acct-item:first-child { border-top: none; }
.acct-item .nm { font-weight: 550; font-size: 13.5px; }
.acct-item .meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.acct-item .bal { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.acct-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; transition: border-color .15s, transform .15s; }
.acct-card:hover { border-color: var(--border-strong); }
.acct-card .top { display: flex; gap: 12px; align-items: center; }
.acct-card .nm { font-weight: 600; font-size: 15px; }
.acct-card .meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.acct-card .bal { font-size: 26px; font-weight: 650; letter-spacing: -.01em; }
.acct-card .bal small { font-size: 15px; color: var(--text-3); font-weight: 500; margin-right: 2px; }
.acct-card .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); border-top: 1px dashed var(--border); padding-top: 12px; }
.acct-card.archived { opacity: .62; }

/* 类型标签 */
.kind-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 550;
  white-space: nowrap;
}
.kind-income { background: color-mix(in srgb, var(--income) 14%, transparent); color: var(--income-text); }
.kind-expense { background: color-mix(in srgb, var(--expense) 14%, transparent); color: var(--expense-text); }
.kind-transfer { background: color-mix(in srgb, var(--transfer) 14%, transparent); color: var(--transfer-text); }

/* 表格 */
.el-table { --el-table-header-bg-color: var(--surface-2); --el-table-row-hover-bg-color: var(--surface-2); font-size: 13.5px; }
.el-table th.el-table__cell { font-weight: 600; color: var(--text-2); font-size: 12.5px; }
.el-table .cell { font-variant-numeric: tabular-nums; }
.el-table__row { cursor: default; }
.table-click .el-table__row { cursor: pointer; }
.amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-main { color: var(--text-1); line-height: 1.4; }
.cell-sub { color: var(--text-3); font-size: 12px; line-height: 1.4; margin-top: 1px; }
.el-table .total-row td { background: var(--surface-2) !important; font-weight: 650; }

.summary-strip {
  display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: center; padding: 14px 20px;
  border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2);
}
.summary-strip b { font-weight: 650; color: var(--text-1); font-variant-numeric: tabular-nums; margin-left: 6px; }
.pager { display: flex; justify-content: flex-end; padding: 14px 20px; }

/* 记账弹窗 */
.kind-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; background: var(--surface-3); border-radius: 11px; }
.kind-switch button {
  border: none; background: transparent; height: 36px; border-radius: 8px; font: inherit; font-weight: 550; color: var(--text-2);
  cursor: pointer; transition: all .15s;
}
.kind-switch button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.kind-switch button.on.income { color: var(--income-text); }
.kind-switch button.on.expense { color: var(--expense-text); }
.kind-switch button.on.transfer { color: var(--transfer-text); }
.amount-box { margin: 16px 0 6px; }
.amount-box .el-input__wrapper { padding: 6px 14px; }
.amount-box input { font-size: 26px !important; font-weight: 650; height: 44px !important; font-variant-numeric: tabular-nums; }
.amount-box .el-input__prefix { font-size: 20px; color: var(--text-3); }
.upper { font-size: 12.5px; color: var(--text-3); min-height: 18px; margin-bottom: 8px; }
.tx-dialog .el-dialog__body { padding-top: 6px; max-height: calc(100vh - 150px); overflow-y: auto; }
.tx-dialog .el-form-item { margin-bottom: 16px; }
.cat-opt-child { padding-left: 14px; }
.cat-opt-parent { font-weight: 600; }

/* 详情抽屉 */
.detail-amount { font-size: 30px; font-weight: 650; letter-spacing: -.01em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.detail-list { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px 10px; font-size: 13.5px; margin-top: 18px; }
.detail-list dt { color: var(--text-3); }
.detail-list dd { margin: 0; color: var(--text-1); word-break: break-all; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.att-tile {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2);
  position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-2); text-align: center; cursor: pointer;
}
.att-tile img { width: 100%; height: 100%; object-fit: cover; }
.att-tile .fname { padding: 0 6px; margin-top: 6px; max-width: 100%; }
.att-tile .del { position: absolute; top: 4px; right: 4px; display: none; }
.att-new { position: absolute; left: 4px; bottom: 4px; font-size: 11px; line-height: 18px; padding: 0 6px; border-radius: 5px; background: var(--brand); color: #fff; }
.drop-zone {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px dashed var(--border-strong); border-radius: 10px;
  background: var(--surface-2); color: var(--text-2); font-size: 13px; cursor: pointer; line-height: 1.5; transition: all .15s;
}
.drop-zone:hover, .drop-zone.over, .drop-zone:focus-visible { border-color: var(--brand); background: var(--brand-soft); outline: none; }
.drop-zone .link { color: var(--brand); }
.drop-zone b { color: var(--text-1); }
.drawer-drop { border-radius: 12px; padding: 0 2px 8px; transition: background .15s; }
.drawer-drop.over { background: var(--brand-soft); outline: 1.5px dashed var(--brand); }
.att-tile:hover .del { display: block; }

/* 登录页 */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 0% 0%, #4d72f4 0%, #2a47b8 45%, #172a73 100%);
}
.auth-art .ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12); }
.auth-art h2 { font-size: 34px; line-height: 1.3; margin: auto 0 16px; font-weight: 650; max-width: 460px; position: relative; }
.auth-art p { opacity: .78; line-height: 1.8; max-width: 440px; margin: 0 0 30px; position: relative; }
.auth-art .feats { display: flex; gap: 10px; flex-wrap: wrap; position: relative; }
.auth-art .feats span { background: rgba(255, 255, 255, .12); padding: 6px 12px; border-radius: 999px; font-size: 13px; }
.auth-art .mini { display: flex; gap: 12px; align-items: center; position: relative; font-weight: 600; font-size: 16px; }
.auth-art .mini .brand-mark { background: rgba(255, 255, 255, .16); box-shadow: none; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h3 { font-size: 24px; margin: 0 0 6px; font-weight: 650; }
.auth-form .lead { color: var(--text-3); margin: 0 0 28px; }
.auth-form .el-input__wrapper { padding: 4px 12px; }
.auth-form .el-button { width: 100%; height: 42px; font-size: 15px; margin-top: 6px; }
.auth-switch { margin: 18px 0 0; font-size: 14px; color: var(--text-3); text-align: center; }
.auth-switch a { color: var(--brand); font-weight: 500; }

/* 日记账 */
.ledger-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.ledger-stats > div { padding: 16px 20px; border-left: 1px solid var(--border); }
.ledger-stats > div:first-child { border-left: none; }
.ledger-stats .l { font-size: 12.5px; color: var(--text-3); }
.ledger-stats .v { font-size: 20px; font-weight: 650; margin-top: 6px; font-variant-numeric: tabular-nums; }
.ledger-stats.compact > div { padding: 12px 16px; }
.ledger-stats.compact .v { font-size: 17px; white-space: nowrap; }

/* 分类管理 */
.cat-panel .cat-row {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 9px; font-size: 13.5px;
}
.cat-panel .cat-row:hover { background: var(--surface-2); }
.cat-panel .cat-row .acts { visibility: hidden; display: flex; gap: 2px; }
.cat-panel .cat-row:hover .acts { visibility: visible; }
.cat-panel .cat-row.child { padding-left: 34px; color: var(--text-2); }
.cat-panel .cat-row.archived { opacity: .5; }
.cat-panel .cat-row .cnt { color: var(--text-3); font-size: 12px; }

/* 导入 */
.import-drop .el-upload-dragger { padding: 34px 20px; border-radius: 12px; }
.import-stat { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
.import-stat b { font-variant-numeric: tabular-nums; }
.status-err { color: var(--bad-text); font-size: 12px; }
.status-warn { color: #b25e00; font-size: 12px; }
html.dark .status-warn { color: #f5b04c; }
.status-new { color: var(--brand); font-size: 12px; }
.status-ok { color: var(--good-text); font-size: 12px; }

/* 人事 */
.month-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.month-chips .chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2); border-radius: 8px; height: 30px; min-width: 50px;
  padding: 0 9px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 3px;
}
.month-chips .chip.none { color: var(--text-3); border-style: dashed; }
.month-chips .chip.draft { border-color: #f0b44c; color: #a25d00; }
html.dark .month-chips .chip.draft { color: #f5b04c; }
.month-chips .chip.paid { border-color: color-mix(in srgb, var(--income) 50%, transparent); color: var(--income-text); }
.month-chips .chip.paid i { font-style: normal; font-weight: 700; }
.month-chips .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.num-input input { text-align: right; font-variant-numeric: tabular-nums; }
.payroll-table.is-draft .el-table__cell { padding: 6px 0; }
.share-list { display: flex; flex-direction: column; gap: 16px; }

/* 职位表 */
.pos-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; max-height: 52vh; overflow-y: auto; }
.pos-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; background: var(--surface);
  border-bottom: 1px solid var(--border); min-height: 44px;
}
.pos-row:last-child { border-bottom: 0; }
.pos-row:hover { background: var(--surface-2); }
.pos-row.dragging { opacity: .45; }
.pos-handle { cursor: grab; color: var(--text-3); font-size: 16px; flex: none; }
.pos-no { width: 22px; flex: none; text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.pos-name { flex: 1; min-width: 0; font-weight: 500; }
.pos-edit { flex: 1; min-width: 0; }
.pos-count { flex: none; font-size: 12px; color: var(--text-3); }
.pos-actions { flex: none; display: flex; }
.pos-actions .el-button { padding: 4px 6px; margin: 0; }
.share-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 12px 0 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.share-stats > div { padding: 12px 20px; border-left: 1px solid var(--border); }
.share-stats > div:first-child { border-left: none; }
.share-stats .l { font-size: 12px; color: var(--text-3); }
.share-stats .v { font-size: 17px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.share-warn { display: flex; align-items: center; gap: 6px; padding: 10px 20px; color: var(--bad-text); font-size: 13px; border-bottom: 1px solid var(--border); }
.share-preview { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--text-2); line-height: 1.7; }
@media (max-width: 960px) { .share-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .share-stats > div:nth-child(odd) { border-left: none; } }

/* 项目成员（项目分成页、项目详情页共用） */
.members-bar { display: flex; align-items: center; gap: 10px; padding: 10px 20px 8px; }
.card-body .members-bar { padding: 0 0 8px; }
a.card-title.link, .card-title.link { cursor: pointer; color: var(--text-1); }
a.card-title.link:hover { color: var(--brand); }

/* 到期提示 */
.due-over { color: var(--bad-text); font-weight: 500; }
.due-soon { color: #b45309; }
html.dark .due-soon { color: #f5b454; }

/* 项目详情 */
.proj-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.proj-head > .el-button:first-child { margin-left: -8px; }
.proj-head > .grow { flex: 1 1 280px; }  /* 窄屏时标题独占一行，按钮换到下一行 */
.proj-title { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 650; min-width: 0; }
.proj-title .el-tag { font-weight: 500; }
.proj-head .sub { font-size: 13px; margin-top: 2px; }
.proj-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; border: 0; }
.task-list { border-top: 1px solid var(--border); margin-top: 10px; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--border); min-height: 42px; }
.task-row:last-child { border-bottom: 0; }
.task-list .task-row:last-child { border-bottom: 1px solid var(--border); }
.task-title { cursor: pointer; line-height: 1.45; }
.task-row.done .task-title { color: var(--text-3); text-decoration: line-through; }
.task-due { font-size: 12.5px; }
.task-add { gap: 8px; margin-top: 12px; }
.mini-tx { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.mini-tx:last-child { border-bottom: 0; }
.mini-tx:hover .cell-main { color: var(--brand); }

/* 工作台 */
.wb-hello { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 4px 0 18px; }
.wb-hello h2 { margin: 0 0 4px; font-size: 22px; font-weight: 650; }
.wb-hello .sub { font-size: 13px; }
.stat.clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.stat.clickable:hover { border-color: var(--brand); }
.wb-proj { display: grid; grid-template-columns: minmax(0, 1fr) 160px 96px; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.wb-proj:last-child { border-bottom: 0; }
.wb-proj:hover b { color: var(--brand); }
.wb-proj-due { text-align: right; font-size: 13px; }
.wb-kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 14px; }
.wb-kv:last-child { border-bottom: 0; }
.wb-kv:hover > span:first-child { color: var(--brand); }
@media (max-width: 1200px) { .proj-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .proj-stats > div:nth-child(4) { border-left: none; } }
@media (max-width: 600px) {
  .wb-proj { grid-template-columns: minmax(0, 1fr) 84px; }
  .wb-proj-progress { display: none; }
  .proj-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proj-stats > div:nth-child(odd) { border-left: none; }
  .proj-stats > div:nth-child(4) { border-left: 1px solid var(--border); }
}

.empty { padding: 36px 0; text-align: center; color: var(--text-3); }
.empty .big { font-size: 38px; margin-bottom: 8px; opacity: .55; }

.el-dialog { border-radius: 16px; max-width: calc(100vw - 32px); }
.el-drawer { max-width: 100vw; }
.el-drawer__header { margin-bottom: 8px; }
.el-tabs__item { font-size: 14px; }
.el-segmented { --el-segmented-item-selected-color: var(--text-1); --el-segmented-item-selected-bg-color: var(--surface); --el-border-radius-base: 8px; }
html.dark .el-segmented { --el-segmented-bg-color: var(--surface-3); }

.mobile-mask { display: none; }

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
  .g-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-hero > .hero { grid-column: 1 / -1; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .g-wide, .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 820px) {
  .layout { background: none; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .2); }
  .sidebar.open { transform: none; }
  .mobile-mask.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 15; }
  .menu-btn { display: inline-flex !important; }
  .topbar { padding: 0 16px; }
  .content { padding: 4px 16px 32px; }
  .g-hero, .g-4 { grid-template-columns: minmax(0, 1fr); }
  .ledger-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger-stats > div:nth-child(3) { border-left: none; }
  .filter-bar .el-input, .filter-bar .el-select, .filter-bar .el-date-editor.el-input__wrapper { width: 100%; }
  .topbar .crumb, .hide-sm { display: none !important; }
  .rank-row { grid-template-columns: minmax(56px, 5.5em) minmax(0, 1fr) 140px; gap: 8px; }
  .rank-row .pct { width: 46px; }
}

/* 员工：我的项目、任务 */
.my-project { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.my-project:hover { border-color: var(--brand); box-shadow: 0 6px 20px rgba(15, 23, 42, .08); transform: translateY(-1px); }
.my-project-meta { display: grid; gap: 6px; font-size: 13px; color: var(--text-3); }
.my-project-meta b { color: var(--text-1); font-weight: 600; margin-left: 4px; }
.member-chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 10px; margin: 0 6px 6px 0; border-radius: 999px; background: var(--surface-2); }
.member-chip small { color: var(--text-3); font-size: 12px; }
.member-chip.me { background: var(--brand-soft); color: var(--brand-ink); }
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: none; }
.task-row.done .task-title { color: var(--text-3); text-decoration: line-through; }
.task-row.mine .task-title { font-weight: 600; }
@media (max-width: 900px) { .my-projects { grid-template-columns: 1fr; } }
