:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --ink: #17211c;
  --muted: #68736d;
  --line: #e1e7e3;
  --brand: #176b4d;
  --brand-dark: #0f4e38;
  --brand-soft: #e5f3ed;
  --green: #168558;
  --green-soft: #e8f6f0;
  --yellow: #a76500;
  --yellow-soft: #fff4d9;
  --orange: #c85216;
  --orange-soft: #ffede3;
  --red: #bc3535;
  --red-soft: #fdeaea;
  --blue: #3769a8;
  --shadow: 0 12px 32px rgba(29, 47, 38, .07);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(23, 107, 77, .18); outline-offset: 2px; }
.app-shell { min-height: 100vh; }
.topbar {
  height: 76px;
  padding: 0 max(24px, calc((100vw - 1200px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: white; font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .12em; margin-top: 2px; text-transform: uppercase; }
.top-actions { display: flex; gap: 10px; }
.btn { border: 0; border-radius: 12px; min-height: 42px; padding: 0 17px; font-weight: 700; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: white; box-shadow: 0 8px 20px rgba(23,107,77,.18); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-block { width: 100%; }
.main-nav { max-width: 1200px; margin: 20px auto 0; padding: 0 24px; display: flex; gap: 6px; }
.nav-item { border: 0; background: transparent; color: var(--muted); padding: 10px 14px; border-radius: 12px; font-weight: 700; }
.nav-item.active { background: var(--surface); color: var(--ink); box-shadow: 0 4px 14px rgba(29,47,38,.06); }
main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 100px; }
.view { display: none; }
.view.active { display: block; animation: enter .22s ease; }
@keyframes enter { from { opacity: .25; transform: translateY(6px); } }
.hero-row, .page-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.045em; line-height: 1.08; }
h2, h3, p { margin-top: 0; }
.hero-copy, .page-heading p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); }
.privacy-pill { margin: 0; padding: 9px 13px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12px; font-weight: 700; white-space: nowrap; }
.privacy-pill span { color: var(--green); margin-right: 5px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.summary-grid.compact { grid-template-columns: repeat(3, 1fr); }
.summary-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 19px; min-height: 116px; box-shadow: 0 5px 18px rgba(29,47,38,.035); }
.summary-card.highlight { background: linear-gradient(145deg, #123c2d, #176b4d); color: white; border-color: transparent; }
.summary-label { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.highlight .summary-label, .highlight .summary-note { color: rgba(255,255,255,.72); }
.summary-value { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.summary-note { margin-top: 6px; color: var(--muted); font-size: 12px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: 0 5px 18px rgba(29,47,38,.035); }
.toolbar-panel { padding: 12px; display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.search-wrap { flex: 1; min-width: 250px; position: relative; }
.search-wrap span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 21px; }
input, select, textarea { color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; min-height: 42px; padding: 9px 12px; }
.search-wrap input { width: 100%; padding-left: 40px; border-color: transparent; }
.filters-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filters-row select { max-width: 180px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 0 0 14px; }
.section-heading h2 { margin: 0; font-size: 21px; }
.section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.text-btn { border: 0; background: transparent; color: var(--brand); font-weight: 700; padding: 8px; }
.hidden { display: none !important; }
.cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.credit-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.card-head { padding: 20px 21px 16px; display: flex; justify-content: space-between; gap: 18px; background: linear-gradient(135deg, #f8fbf9, #eef5f1); border-bottom: 1px solid var(--line); }
.card-bank { color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 5px; }
.card-title { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.card-meta { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.card-total { text-align: right; }
.card-total strong { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.card-total small { color: var(--muted); }
.tasks-stack { padding: 8px 20px 4px; }
.task-block { padding: 16px 0; border-bottom: 1px solid var(--line); }
.task-block:last-child { border-bottom: 0; }
.task-top { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.task-name { font-size: 15px; margin: 0; }
.status-badge { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status-progress, .status-not-started { background: #edf2ef; color: #526159; }
.status-completed, .status-over { background: var(--green-soft); color: var(--green); }
.status-expiring { background: var(--orange-soft); color: var(--orange); }
.status-expired { background: var(--red-soft); color: var(--red); }
.amount-line { display: flex; align-items: baseline; gap: 6px; margin: 15px 0 8px; font-variant-numeric: tabular-nums; }
.amount-line strong { font-size: 25px; letter-spacing: -.035em; }
.amount-line span { color: var(--muted); font-size: 13px; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-track { height: 8px; flex: 1; background: #e9eeeb; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; background: var(--brand); transition: width .35s ease; }
.progress-row strong { width: 49px; text-align: right; font-size: 12px; }
.task-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.metric { background: var(--surface-soft); border-radius: 10px; padding: 9px; min-width: 0; }
.metric small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.metric strong { font-size: 12px; word-break: break-word; font-variant-numeric: tabular-nums; }
.reward-box { margin-top: 12px; padding: 11px 12px; border-radius: 11px; background: #faf7ef; color: #66572e; font-size: 12px; }
.reward-box strong { display: block; color: #493d20; margin-top: 3px; }
.reward-meta { display: flex; gap: 10px; flex-wrap: wrap; color: #7d6f4a; margin-top: 5px; font-size: 10px; }
.alert-line { margin: 10px 0 0; font-size: 11px; font-weight: 700; }
.alert-good { color: var(--green); }.alert-warn { color: var(--yellow); }.alert-urgent { color: var(--orange); }.alert-danger { color: var(--red); }
.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 15px 20px 20px; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 54px 20px; background: var(--surface); border: 1px dashed #ccd6d0; border-radius: var(--radius-lg); }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); font-size: 24px; }
.empty-state h3 { margin-bottom: 8px; }.empty-state p { color: var(--muted); margin-bottom: 18px; }
.transaction-tools { flex-wrap: wrap; }
.transaction-tools label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.transactions-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.tx-row { display: grid; grid-template-columns: 100px 1.3fr 1fr 1fr auto; gap: 16px; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.tx-row:last-child { border-bottom: 0; }
.tx-date, .tx-meta { color: var(--muted); font-size: 12px; }
.tx-card strong, .tx-amount strong { display: block; }.tx-card small, .tx-amount small { color: var(--muted); }
.tx-amount { text-align: right; font-variant-numeric: tabular-nums; }.tx-amount strong { font-size: 17px; }
.tx-actions { display: flex; gap: 5px; }
.icon-btn { border: 0; width: 34px; height: 34px; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 18px; }
.icon-btn:hover { color: var(--ink); background: #edf2ef; }
.invalid-tag { display: inline-block; color: var(--red); background: var(--red-soft); border-radius: 6px; padding: 2px 5px; font-size: 10px; font-weight: 700; }
.month-picker { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.monthly-hero { background: linear-gradient(145deg, #152d24, #1d684e); color: white; border-radius: var(--radius-lg); padding: 28px; margin-bottom: 16px; }
.monthly-hero p { color: rgba(255,255,255,.7); margin-bottom: 8px; }.monthly-hero strong { font-size: clamp(34px, 6vw, 54px); letter-spacing: -.04em; }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.chart-card h2 { font-size: 18px; margin-bottom: 22px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1.1fr) 3fr 110px; gap: 13px; align-items: center; margin: 16px 0; }
.bar-label strong { display: block; font-size: 13px; }.bar-label small { color: var(--muted); }
.bar-track { height: 12px; background: #edf1ef; border-radius: 99px; overflow: hidden; }.bar-fill { height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #42a77e); }
.bar-value { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.back-btn { border: 0; background: transparent; color: var(--muted); font-weight: 700; padding: 0 0 18px; }
.detail-hero { display: flex; justify-content: space-between; gap: 20px; align-items: start; padding: 25px; margin-bottom: 16px; border-radius: var(--radius-lg); color: white; background: linear-gradient(140deg, #17251f, #176b4d); }
.detail-hero .eyebrow { color: #93d7ba; }.detail-hero p { color: rgba(255,255,255,.7); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; }.detail-actions .btn-secondary { background: rgba(255,255,255,.12); color: white; border-color: rgba(255,255,255,.18); }
.detail-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.detail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; margin-bottom: 16px; }
.detail-card h2 { font-size: 18px; margin-bottom: 15px; }.detail-card h3 { font-size: 15px; margin-bottom: 8px; }
.detail-task { border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-top: 11px; }
.detail-task-actions { display: flex; gap: 5px; }
.quick-box { background: var(--brand-soft); border-radius: 14px; padding: 16px; }
.quick-box p { color: var(--muted); font-size: 12px; margin-bottom: 10px; }.quick-box .btn { width: 100%; }
.mini-list { list-style: none; padding: 0; margin: 10px 0 0; }.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }.mini-list li:last-child { border-bottom: 0; }
.fab-wrap { position: fixed; right: max(22px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); z-index: 30; }
.fab { border: 0; width: 56px; height: 56px; border-radius: 18px; background: var(--ink); color: white; font-size: 30px; box-shadow: 0 12px 30px rgba(23,33,28,.25); transition: .2s; }
.fab.open { transform: rotate(45deg); }
.fab-menu { position: absolute; right: 0; bottom: 67px; display: grid; gap: 7px; width: 185px; opacity: 0; transform: translateY(8px) scale(.97); pointer-events: none; transition: .18s; }
.fab-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.fab-menu button { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; text-align: left; box-shadow: var(--shadow); font-weight: 700; }.fab-menu span { display: inline-grid; place-items: center; width: 25px; color: var(--brand); }
footer { padding: 26px 24px 90px; text-align: center; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); } footer p { margin-bottom: 5px; }
.app-dialog { border: 0; padding: 0; max-width: none; width: 100%; height: 100%; background: transparent; }.app-dialog::backdrop { background: rgba(14,25,20,.52); backdrop-filter: blur(5px); }
.dialog-card { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 40px); overflow-y: auto; margin: 20px auto; background: var(--surface); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.25); padding: 22px; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; padding-bottom: 15px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }.dialog-header h2 { margin: 0; font-size: 23px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.form-field { display: grid; gap: 6px; }.form-field.full { grid-column: 1 / -1; }.form-field label, .field-label { font-size: 12px; font-weight: 700; color: #526159; }.form-field small { color: var(--muted); font-size: 10px; }.form-field input, .form-field select, .form-field textarea { width: 100%; }.form-field textarea { min-height: 76px; resize: vertical; }
.checkbox-field { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; }.checkbox-field input { min-height: auto; width: 18px; height: 18px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-error { color: var(--red); background: var(--red-soft); padding: 9px 11px; border-radius: 9px; font-size: 12px; margin-bottom: 12px; }
.quick-input { width: 100%; height: 62px; font-size: 28px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }.quick-hint { text-align: center; color: var(--muted); font-size: 11px; margin: 8px 0 18px; }.quick-total { display: flex; justify-content: space-between; align-items: center; background: var(--brand-soft); padding: 13px; border-radius: 11px; margin-bottom: 10px; }.quick-total strong { font-size: 20px; color: var(--brand-dark); }.quick-records { max-height: 240px; overflow-y: auto; }
.data-actions { display: grid; gap: 9px; }.data-action { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px; border: 1px solid var(--line); background: var(--surface); border-radius: 13px; text-align: left; }.data-action:hover { background: var(--surface-soft); }.data-action strong { display: block; }.data-action small { color: var(--muted); }.data-action span { color: var(--brand); font-size: 22px; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 60; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; background: #17211c; color: white; padding: 11px 15px; border-radius: 11px; box-shadow: 0 10px 30px rgba(0,0,0,.22); font-size: 13px; transition: .22s; }.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }.toast button { border: 0; background: transparent; color: #8ce2bb; font-weight: 800; margin-left: 12px; }

@media (max-width: 860px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid, .detail-grid { grid-template-columns: 1fr; }
  .toolbar-panel { align-items: stretch; flex-direction: column; }.filters-row > * { flex: 1; }.filters-row select { max-width: none; }
  .tx-row { grid-template-columns: 85px 1fr auto; }.tx-meta { grid-column: 2; }.tx-actions { grid-column: 3; grid-row: 1 / 3; }.tx-amount { grid-column: 3; grid-row: 1; margin-right: 78px; }
}
@media (max-width: 600px) {
  .topbar { height: 66px; padding: 0 16px; }.brand strong { font-size: 14px; }.brand-mark { width: 35px; height: 35px; }.top-actions .btn { padding: 0 12px; min-height: 38px; }.desktop-only { display: none; }
  .main-nav { margin-top: 8px; padding: 0 10px; overflow-x: auto; }.nav-item { white-space: nowrap; padding: 9px 11px; font-size: 12px; }
  main { padding: 20px 14px 90px; }.hero-row, .page-heading { align-items: start; flex-direction: column; gap: 14px; }.privacy-pill { align-self: start; }
  h1 { font-size: 30px; }.hero-copy { font-size: 13px; }
  .summary-grid, .summary-grid.compact { grid-template-columns: 1fr 1fr; gap: 9px; }.summary-card { min-height: 100px; padding: 14px; }.summary-value { font-size: 22px; }
  .search-wrap { min-width: 0; }.filters-row { display: grid; grid-template-columns: 1fr 1fr; }.filters-row select:last-child { grid-column: 1 / -1; }
  .card-head { padding: 17px; }.tasks-stack { padding: 6px 17px 2px; }.card-actions { padding: 13px 17px 17px; }
  .task-metrics { grid-template-columns: 1fr 1fr; }.task-metrics .metric:last-child { grid-column: 1 / -1; }
  .transaction-tools > * { width: 100%; }.transaction-tools label { justify-content: space-between; }.transaction-tools input { flex: 1; }
  .tx-row { grid-template-columns: 70px 1fr auto; gap: 8px; padding: 13px 12px; }.tx-amount { margin-right: 0; grid-column: 2; grid-row: 2; text-align: left; }.tx-meta { grid-column: 1 / 3; grid-row: 3; }.tx-actions { grid-column: 3; grid-row: 1 / 4; flex-direction: column; }
  .bar-row { grid-template-columns: 1fr 85px; }.bar-track { grid-column: 1 / -1; grid-row: 2; }.bar-value { grid-column: 2; grid-row: 1; }.monthly-hero { padding: 22px; }
  .detail-hero { flex-direction: column; }.detail-actions { justify-content: start; }.form-grid { grid-template-columns: 1fr; }.form-field.full { grid-column: auto; }.dialog-card { width: 100%; min-height: 100%; max-height: none; margin: 0; border-radius: 0; padding: 18px; }.app-dialog { max-height: 100%; }
  .fab-wrap { right: 16px; bottom: 16px; }.fab { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
