/* ===== 企业财务工作台 · Fynx 风格（浅绿 + 深绿）三端自适应 ===== */
:root {
  --primary: #004028;          /* 深绿：主品牌 / 主按钮 / 激活态 */
  --primary-deep: #00301F;
  --accent: #A3E870;           /* 浅绿：点缀 / 高亮 / 图表 */
  --accent-soft: #EAF7DC;
  --success: #1FA05A;          /* 收入 */
  --success-bg: #E4F6EC;
  --danger: #E4574D;           /* 支出 */
  --danger-bg: #FDEAE8;
  --warn: #C77F0A;
  --warn-bg: #FBF1DC;
  --ink: #0E2A21;
  --ink-2: #5E6E66;
  --ink-3: #93A49B;
  --line: #E3EBE6;
  --bg: #F1F5F2;
  --card: #FFFFFF;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14,42,33,.05), 0 2px 8px rgba(14,42,33,.04);
  --shadow-lg: 0 12px 34px rgba(14,42,33,.14);
  --font: 'Space Grotesk', 'Urbanist', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #C6D5CC; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 布局骨架 ===== */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 50;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 14px;
}
.sidebar .brand .logo {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), #7ED05A);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; color: #0E2A21; font-weight: 800; flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0,64,40,.16);
}
.sidebar .brand .brand-text {
  color: var(--ink); font-size: 16px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-user {
  display: flex; align-items: center; gap: 11px;
  margin: 4px 12px 10px; padding: 12px 12px;
  background: var(--bg); border-radius: 12px;
  border: 1px solid var(--line);
}
.side-user .side-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #0A5C40);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.side-user .side-avatar.guest { background: linear-gradient(135deg, #7ED05A, var(--accent)); color: #0E2A21; font-size: 15px; }
.side-user-info { min-width: 0; }
.side-user-name { font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-role { font-size: 11px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar .nav-menu-label {
  font-size: 11px; color: var(--ink-3); padding: 8px 20px 4px;
  letter-spacing: .08em; font-weight: 600;
}
.sidebar nav { flex: 1; padding: 6px 10px 10px; overflow-y: auto; }
.sidebar .nav-group { font-size: 11px; color: var(--ink-3); padding: 12px 12px 5px; letter-spacing: .06em; font-weight: 600; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin-bottom: 2px;
  border-radius: 10px; color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  transition: background .15s;
  position: relative;
}
.sidebar .nav-item:hover { background: var(--bg); color: var(--ink); }
.sidebar .nav-item.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 3px 8px rgba(0,64,40,.22); }
.sidebar .nav-item.active .ico { color: var(--accent); }
.sidebar .nav-item .ico { width: 22px; text-align: center; font-size: 16px; flex-shrink: 0; }
.side-promo {
  margin: 0 12px 16px; padding: 14px;
  background: linear-gradient(135deg, var(--accent-soft), #F4FBE9);
  border: 1px solid #DCEFD0; border-radius: 13px;
}
.side-promo-ico { font-size: 20px; }
.side-promo-title { font-size: 13px; font-weight: 700; color: var(--primary); margin: 5px 0 2px; }
.side-promo-sub { font-size: 11px; color: var(--ink-2); line-height: 1.5; }
.side-promo-link { display: inline-block; margin-top: 7px; font-size: 12px; font-weight: 600; color: var(--primary); }
.side-promo-link:hover { text-decoration: underline; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 0 22px; height: 60px;
  display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 40;
}
.topbar .burger { display: none; background: none; border: none; font-size: 22px; color: var(--ink); padding: 4px; }
.topbar .crumb { display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumb > span:first-child { color: var(--ink-3); }
.topbar .crumb-sep { color: var(--line); }
.topbar .crumb-cur { font-weight: 700; color: var(--ink); }
.topbar .spacer { flex: 1; }
.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; min-width: 180px; max-width: 320px; flex: 1 1 200px;
  color: var(--ink-3); transition: border-color .15s, box-shadow .15s;
}
.searchbox:focus-within { border-color: var(--accent-strong); box-shadow: 0 0 0 3px rgba(163,232,112,.25); }
.searchbox input { border: none; background: none; outline: none; font-size: 13px; color: var(--ink); width: 100%; }
.searchbox input::placeholder { color: var(--ink-3); }
.ico-svg { width: 18px; height: 18px; flex: 0 0 auto; vertical-align: middle; }
.ico-lg { width: 26px; height: 26px; flex: 0 0 auto; }
.btn .ico-svg, .btn .ico-lg { margin-right: 4px; }
.mobile-nav .ico-svg { width: 20px; height: 20px; }
.sidebar .ico-svg { width: 19px; height: 19px; }
.nav-group + .nav-item { margin-top: 2px; }
.ledger-select {
  min-width: 136px; max-width: 220px;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 500;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235E6E66' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  outline: none;
}
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.user-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #0A5C40); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.content { padding: 22px; flex: 1; max-width: 1440px; width: 100%; margin: 0 auto; }

/* 移动端底部导航 */
.mobile-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--card); border-top: 1px solid var(--line);
  z-index: 50; padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(14,42,33,.06);
}
.mobile-nav .mnav-inner { display: flex; }
.mobile-nav .mnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 7px; font-size: 10px; color: var(--ink-3); font-weight: 500;
}
.mobile-nav .mnav-item.active { color: var(--primary); }
.mobile-nav .mnav-item .ico { font-size: 20px; line-height: 1; }

/* ===== 通用组件 ===== */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
  border: 1px solid rgba(227,235,230,.6);
}
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--ink); }
.card .sub { font-size: 12px; color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 13px; font-weight: 600;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { background: var(--bg); border-color: #D3DFD8; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-deep); }
.btn.danger { color: var(--danger); border-color: #F5C4C0; background: #fff; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.success:hover { background: #17894D; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.sm { padding: 5px 11px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; }
.field .hint, .hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; line-height: 1.6; }
.field .hint code, .hint code { background: var(--bg); padding: 1px 5px; border-radius: 5px; font-size: 11px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,64,40,.10); }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 16px; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px;
  border: 1px solid rgba(227,235,230,.6);
}
.toolbar input, .toolbar select {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 13px; outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,64,40,.08); }
.toolbar .spacer { flex: 1; }

/* 表格 */
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid rgba(227,235,230,.6); }
.table-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
table.tbl th, table.tbl td { padding: 12px 14px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl th { background: #F6F9F7; color: var(--ink-2); font-weight: 700; font-size: 12px; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: #F8FBF9; }
.amount-income { color: var(--success); font-weight: 700; }
.amount-expense { color: var(--danger); font-weight: 700; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.income { background: var(--success-bg); color: #147A45; }
.badge.expense { background: var(--danger-bg); color: #C33B33; }
.badge.blue { background: var(--accent-soft); color: var(--primary); }
.badge.gray { background: var(--bg); color: var(--ink-2); }
.badge.green { background: var(--success-bg); color: #147A45; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }

/* KPI 卡片（Fynx 风格：图标气泡 + 首卡突出） */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; position: relative; overflow: hidden;
  border: 1px solid rgba(227,235,230,.6);
  transition: transform .15s, box-shadow .15s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi .kpi-ico {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--accent-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.kpi .kpi-ico.up { background: var(--success-bg); color: #147A45; }
.kpi .kpi-ico.down { background: var(--danger-bg); color: #C63F38; }
.kpi .label { font-size: 12px; color: var(--ink-3); margin-bottom: 7px; font-weight: 600; }
.kpi .value { font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; padding-right: 44px; }
.kpi .value small { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.kpi .foot { font-size: 12px; color: var(--ink-3); margin-top: 7px; }
.kpi.income .value { color: var(--success); }
.kpi.expense .value { color: var(--danger); }
.kpi.primary .value { color: var(--primary); }
.kpi .bar { position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; }
.kpi.income .bar { background: var(--success); }
.kpi.expense .bar { background: var(--danger); }
.kpi.primary .bar { background: var(--primary); }
/* 突出卡：深绿渐变 Total-Balance 风格 */
.kpi.featured {
  background: linear-gradient(135deg, #004028 0%, #0A5C40 100%);
  color: #fff; border: none; box-shadow: 0 10px 26px rgba(0,64,40,.28);
}
.kpi.featured .kpi-ico { background: rgba(163,232,112,.18); color: var(--accent); top: auto; right: auto; left: 20px; bottom: 18px; position: absolute; }
.kpi.featured .label { color: rgba(255,255,255,.78); }
.kpi.featured .value { color: #fff; padding-right: 0; font-size: 30px; }
.kpi.featured .foot { color: rgba(255,255,255,.7); }

/* 看板主区：趋势大图 + AI 助手组件（参考 Fynx 排版） */
.dash-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.dash-main .chart-canvas { height: 320px; }
.ai-widget { display: flex; flex-direction: column; }
.ai-w-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.ai-w-ico {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--primary), #0A5C40); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.ai-w-head h4 { font-size: 14.5px; font-weight: 700; margin: 0; }
.ai-w-head .chart-sub { margin: 2px 0 0; }
.ai-w-input { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; }
.ai-w-input input {
  flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 9px 16px; font-size: 13px; background: var(--bg); outline: none;
  transition: border-color .15s;
}
.ai-w-input input:focus { border-color: var(--accent-strong); }
.ai-w-input .btn { border-radius: 999px; padding: 8px 12px; flex: 0 0 auto; }
.ai-w-ans {
  margin-top: 12px; background: var(--accent-soft); border-radius: 12px;
  padding: 12px 14px; font-size: 13px; line-height: 1.75; color: var(--ink); white-space: pre-wrap;
  max-height: 180px; overflow-y: auto;
}
.ai-w-ans.err { background: var(--danger-bg); color: #B3372F; }
.ai-w-more { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none; }
.ai-w-more:hover { text-decoration: underline; }

/* 图表网格 */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.chart-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 1px solid rgba(227,235,230,.6); }
.chart-box h4 { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
.chart-box .chart-sub { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }
.chart-canvas { width: 100%; height: 300px; }

/* 统计两列 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* 汇总列表 */
.rank-list { list-style: none; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rank-list li:last-child { border-bottom: none; }
.rank-list .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.rank-list .amt { font-weight: 700; font-size: 13px; }
.rank-list .pct { width: 46px; text-align: right; font-size: 12px; color: var(--ink-3); }
.rank-list .pct-bar { height: 6px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; flex: 1; }
.rank-list .pct-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* 分页 */
.pagination { display: flex; align-items: center; gap: 8px; padding: 12px 16px; flex-wrap: wrap; }
.pagination .info { font-size: 12px; color: var(--ink-3); margin-right: auto; }
.pagination button {
  min-width: 30px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; font-weight: 600;
}
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination button:disabled { opacity: .4; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(14,42,33,.45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 16px;
}
.modal {
  background: var(--card); border-radius: 18px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--line);
}
.modal .modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal .modal-head h3 { font-size: 16px; font-weight: 700; }
.modal .modal-body { padding: 18px 20px; }
.modal .modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.modal .close { background: none; border: none; font-size: 20px; color: var(--ink-3); line-height: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* Toast */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 10px;
  font-size: 13px; z-index: 200; box-shadow: var(--shadow-lg);
  animation: slideDown .25s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideDown { from { opacity: 0; transform: translate(-50%,-10px); } to { opacity: 1; transform: translate(-50%,0); } }

/* 登录页 */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1200px 500px at 80% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.login-card {
  width: 100%; max-width: 400px; background: var(--card);
  border-radius: 20px; box-shadow: var(--shadow-lg); padding: 36px 34px;
  border: 1px solid var(--line);
}
.login-card .logo {
  width: 56px; height: 56px; border-radius: 15px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--accent), #7ED05A);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #0E2A21; font-weight: 800;
  box-shadow: 0 6px 16px rgba(0,64,40,.18);
}
.login-card h1 { text-align: center; font-size: 20px; margin-bottom: 4px; color: var(--ink); }
.login-card .sub { text-align: center; color: var(--ink-3); font-size: 12px; margin-bottom: 24px; }
.login-card .field { margin-bottom: 14px; }
.login-card .btn { width: 100%; justify-content: center; padding: 11px; font-size: 14px; margin-top: 8px; border-radius: 11px; }
.login-foot { text-align: center; margin-top: 18px; font-size: 12px; color: var(--ink-3); }
.login-foot a { color: var(--primary); font-weight: 600; }

/* 访客提示条 */
.guest-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--warn-bg); color: #8A5A0A;
  border-radius: var(--radius); padding: 11px 16px; margin-bottom: 16px;
  font-size: 13px; border: 1px solid #F0DFB8;
}
.guest-banner .spacer { flex: 1; }

/* 空态 */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .empty-ico { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; background: var(--accent-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.empty .empty-ico .ico-svg { width: 28px; height: 28px; }
.empty p { font-size: 13px; }

/* 复选 */
.check-cell { width: 36px; text-align: center; }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); }

/* 分段控件（按周/按月等切换） */
.seg {
  display: inline-flex; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px; gap: 2px;
}
.seg button {
  border: none; background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  padding: 6px 14px; border-radius: 8px; transition: all .15s;
}
.seg button.active { background: var(--card); color: var(--primary); box-shadow: 0 1px 4px rgba(14,42,33,.10); }

/* AI 助手页 */
.ai-hero {
  text-align: center; padding: 34px 20px 26px;
}
.ai-hero .ai-hello { font-size: 15px; color: var(--ink-2); font-weight: 600; }
.ai-hero .ai-title { font-size: 26px; font-weight: 800; color: var(--ink); margin: 6px 0 8px; letter-spacing: -.01em; }
.ai-hero .ai-sub { font-size: 13px; color: var(--ink-3); max-width: 560px; margin: 0 auto; }
.ai-input-wrap {
  display: flex; align-items: center; gap: 10px;
  max-width: 640px; margin: 0 auto; padding: 6px 6px 6px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  box-shadow: var(--shadow); transition: box-shadow .15s, border-color .15s;
}
.ai-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(0,64,40,.08); }
.ai-input-wrap input { flex: 1; border: none; outline: none; font-size: 14px; color: var(--ink); background: transparent; padding: 10px 0; }
.ai-input-wrap .btn { border-radius: 999px; padding: 9px 22px; }
.ai-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; max-width: 900px; margin: 20px auto 0; }
.ai-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 16px 14px; text-align: left; cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.ai-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #CFE5BE; }
.ai-card .ai-card-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.ai-card .ai-card-ico.up { background: var(--success-bg); color: #147A45; }
.ai-card .ai-card-ico .ico-svg { width: 21px; height: 21px; }
.ai-card .ai-card-title { font-size: 14px; font-weight: 700; margin-top: 10px; color: var(--ink); }
.ai-card .ai-card-desc { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.55; }
.ai-card .ai-card-more { font-size: 12px; font-weight: 600; color: var(--primary); margin-top: 8px; display: inline-block; }

/* ===== 响应式断点 ===== */
/* 平板：侧栏收窄 */
@media (max-width: 1024px) {
  .sidebar { width: 78px; }
  .sidebar .brand { justify-content: center; padding: 18px 6px 12px; }
  .sidebar .brand .logo { width: 40px; height: 40px; font-size: 20px; }
  .sidebar .brand .brand-text, .sidebar .nav-menu-label, .sidebar .nav-group, .sidebar .side-user-info, .sidebar .side-promo { display: none; }
  .sidebar .side-user { justify-content: center; padding: 10px; margin: 4px 8px 8px; }
  .sidebar .side-avatar { width: 36px; height: 36px; }
  .sidebar nav { padding: 6px 8px; }
  .sidebar .nav-item { justify-content: center; padding: 12px; }
  .sidebar .nav-item .ico { font-size: 19px; }
  .sidebar .nav-item .nav-label { display: none; }
}

/* 手机：侧栏隐藏，底部导航 */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .mobile-nav { display: block; }
  .main { padding-bottom: 62px; }
  .topbar { padding: 0 14px; height: 54px; }
  .topbar .crumb { font-size: 14px; }
  .topbar .searchbox { display: none; }
  .ledger-select { max-width: 140px; }
  .content { padding: 14px; }
  .card { padding: 14px; }
  .toolbar { padding: 12px 14px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px 15px; }
  .kpi .value { font-size: 21px; }
  .kpi .kpi-ico { width: 32px; height: 32px; top: 12px; right: 12px; }
  .kpi.featured .value { font-size: 24px; }
  .dash-row { grid-template-columns: 1fr; }
  .dash-main .chart-canvas { height: 260px; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-canvas { height: 260px; }
  .form-grid { grid-template-columns: 1fr; }
  .user-chip .uname { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn span.btn-label { display: none; }
  .ai-hero { padding: 22px 10px 18px; }
  .ai-hero .ai-title { font-size: 21px; }
  .ai-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .topbar .user-chip .uname { display: none; }
  .ai-cards { grid-template-columns: 1fr; }
}

/* 安全区 */
@supports (padding: env(safe-area-inset-bottom)) {
  .mobile-nav { padding-bottom: env(safe-area-inset-bottom); }
}
