:root {
  color-scheme: light;
  --brand: #072f63;
  --brand-2: #0a477d;
  --primary: #089c9b;
  --primary-dark: #087b7a;
  --primary-soft: #e7f7f6;
  --bg: #f1f6fb;
  --paper: #ffffff;
  --paper-soft: #f8fbfd;
  --ink: #17283d;
  --muted: #67778c;
  --line: #dce6ef;
  --line-strong: #cbd8e4;
  --success: #16845b;
  --success-soft: #e8f7f0;
  --warning: #b46a08;
  --warning-soft: #fff4df;
  --danger: #bd3d4d;
  --danger-soft: #fff0f2;
  --info: #2366a4;
  --info-soft: #eaf3fc;
  --shadow: 0 18px 46px rgba(7, 47, 99, 0.09);
  --shadow-soft: 0 7px 22px rgba(7, 47, 99, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.is-modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button,
input,
select,
textarea {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  box-shadow: 0 0 0 3px rgba(8, 156, 155, 0.22);
}

[hidden] {
  display: none !important;
}

::selection {
  color: #fff;
  background: var(--primary);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 15px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px rgba(8, 156, 155, 0.2);
}

.button.primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: 0 10px 24px rgba(8, 156, 155, 0.27);
}

.button.secondary {
  border-color: #bdd0e1;
  background: #fff;
  color: var(--brand);
}

.button.secondary:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.button.ghost:hover:not(:disabled) {
  background: #edf3f8;
  color: var(--brand);
}

.button.danger {
  border-color: #f1c6cc;
  background: var(--danger-soft);
  color: var(--danger);
}

.button.warning {
  border-color: #efd8b1;
  background: var(--warning-soft);
  color: #945708;
}

.button.small {
  min-height: 32px;
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12px;
}

.button.busy {
  pointer-events: none;
}

.button.busy::before {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  content: "";
  animation: spin 0.65s linear infinite;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
}

.icon-button:hover {
  background: #edf3f8;
  color: var(--brand);
}

.icon-button.dark {
  color: #bcd0e4;
}

.icon-button.dark:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 登录 */
.login-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 1.18fr) minmax(420px, 0.82fr);
  overflow: hidden;
  background: #fff;
}

.login-intro {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 72px clamp(48px, 8vw, 130px);
  color: #fff;
  background:
    linear-gradient(145deg, rgba(8, 156, 155, 0.16), transparent 48%),
    linear-gradient(155deg, #0a477d 0%, var(--brand) 52%, #041c3d 100%);
}

.login-intro::before,
.login-intro::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  content: "";
}

.login-intro::before {
  right: -170px;
  bottom: -170px;
  width: 520px;
  height: 520px;
}

.login-intro::after {
  right: -60px;
  bottom: -60px;
  width: 290px;
  height: 290px;
  background: rgba(8, 156, 155, 0.08);
}

.login-logo {
  width: min(285px, 70%);
  height: 76px;
  object-fit: contain;
  object-position: left center;
  border-radius: 12px;
  padding: 8px 13px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.16);
}

.login-kicker {
  margin: 55px 0 14px;
  color: #62d0cd;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.22em;
}

.login-intro h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(38px, 4vw, 62px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.23;
}

.login-intro > p:not(.login-kicker) {
  max-width: 580px;
  margin: 22px 0 0;
  color: #c3d7ea;
  font-size: 16px;
  line-height: 1.8;
}

.login-flow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 54px;
  color: #e4eff9;
  font-size: 13px;
  font-weight: 700;
}

.login-flow i {
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, rgba(98, 208, 205, 0.25), #62d0cd);
}

.login-card-wrap {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 50px clamp(32px, 7vw, 110px);
  background:
    radial-gradient(circle at 100% 0, rgba(8, 156, 155, 0.1), transparent 300px),
    #fff;
}

.login-card {
  width: min(100%, 430px);
}

.login-mobile-brand {
  display: none;
}

.login-card h2 {
  margin: 0;
  color: var(--brand);
  font-size: 30px;
  line-height: 1.35;
}

.form-note {
  margin: 10px 0 32px;
  color: var(--muted);
  font-size: 14px;
}

.field-label {
  display: block;
  margin: 18px 0 8px;
  color: #33465c;
  font-size: 13px;
  font-weight: 750;
}

.input-shell {
  display: flex;
  min-height: 48px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fbfdff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 156, 155, 0.12);
}

.input-shell input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 12px 6px;
  background: transparent;
}

.input-symbol {
  display: grid;
  width: 43px;
  place-items: center;
  color: #7690aa;
  font-size: 12px;
  font-weight: 800;
}

.password-toggle {
  align-self: stretch;
  border: 0;
  padding: 0 14px;
  background: transparent;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
}

.form-error {
  min-height: 20px;
  margin: 8px 0 2px;
  color: var(--danger);
  font-size: 12px;
}

.login-submit {
  width: 100%;
  min-height: 49px;
  justify-content: space-between;
  margin-top: 5px;
  padding-inline: 20px;
}

.login-security {
  margin: 20px 0 0;
  color: #8b98a8;
  font-size: 12px;
  text-align: center;
}

.login-decor {
  position: absolute;
  z-index: 3;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.login-decor-one { top: 10%; left: 52%; }
.login-decor-two { right: 5%; bottom: 11%; opacity: 0.4; }

/* 应用框架 */
.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  width: 250px;
  height: 100vh;
  flex-direction: column;
  padding: 22px 16px 17px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 18% 0, rgba(8, 156, 155, 0.25), transparent 230px),
    linear-gradient(180deg, #08366c 0%, #062957 57%, #041e42 100%);
  box-shadow: 12px 0 30px rgba(7, 47, 99, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 21px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.brand-icon-frame {
  display: grid;
  width: 45px;
  height: 45px;
  flex: 0 0 45px;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.brand-icon-frame img {
  width: 41px;
  height: 41px;
  object-fit: contain;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: 0.08em;
}

.brand span {
  margin-top: 3px;
  color: #b7cee4;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.sidebar-close {
  display: none;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 24px;
}

.nav {
  display: grid;
  align-content: start;
  gap: 7px;
  flex: 1;
  margin-top: 22px;
  overflow-y: auto;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 11px;
  background: transparent;
  color: #bcd0e4;
  font-size: 14px;
  font-weight: 680;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.nav-item.is-active {
  border-color: rgba(112, 223, 219, 0.18);
  background: linear-gradient(90deg, rgba(8, 156, 155, 0.34), rgba(8, 156, 155, 0.11));
  color: #fff;
  box-shadow: inset 3px 0 0 #4dd0cc;
}

.nav-symbol {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #7ee0dc;
  font-size: 11px;
  font-weight: 900;
}

.nav-item.is-active .nav-symbol {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.nav-count {
  min-width: 21px;
  margin-left: auto;
  border-radius: 999px;
  padding: 2px 6px;
  background: #ec9d34;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  text-align: center;
}

.sidebar-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 2px 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-note-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #55d0a0;
  box-shadow: 0 0 0 4px rgba(85, 208, 160, 0.12);
}

.sidebar-note strong,
.sidebar-note small {
  display: block;
}

.sidebar-note strong {
  color: #e5f0fa;
  font-size: 11px;
}

.sidebar-note small {
  margin-top: 2px;
  color: #8fabc7;
  font-size: 9px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(8, 156, 155, 0.28);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.sidebar-user-copy {
  min-width: 0;
  flex: 1;
}

.sidebar-user-copy strong,
.sidebar-user-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy strong { color: #f7fbff; font-size: 12px; }
.sidebar-user-copy span { margin-top: 2px; color: #90aac5; font-size: 10px; }

.main {
  min-width: 0;
  background:
    radial-gradient(circle at 100% 0, rgba(8, 156, 155, 0.08), transparent 350px),
    var(--bg);
}

.topbar {
  position: sticky;
  z-index: 25;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid rgba(203, 216, 228, 0.85);
  padding: 13px clamp(22px, 3.5vw, 48px);
  background: rgba(248, 251, 253, 0.92);
  backdrop-filter: blur(13px);
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title h1 {
  margin: 0;
  color: var(--brand);
  font-size: 23px;
  line-height: 1.25;
}

.topbar-title .eyebrow {
  margin-bottom: 3px;
  font-size: 10px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.today {
  color: var(--muted);
  font-size: 12px;
}

.mobile-menu {
  display: none;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.mobile-menu span {
  display: block;
  width: 17px;
  height: 2px;
  margin: 3px auto;
  border-radius: 2px;
  background: var(--brand);
}

.main-content {
  width: 100%;
  max-width: 1580px;
  margin: 0 auto;
  padding: 30px clamp(22px, 3.5vw, 48px) 55px;
}

.page-stack {
  display: grid;
  gap: 22px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.page-heading h2,
.page-heading p {
  margin: 0;
}

.page-heading h2 {
  color: var(--brand);
  font-size: 20px;
}

.page-heading p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.card {
  border: 1px solid rgba(216, 226, 236, 0.94);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.card.pad {
  padding: 22px;
}

.card-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #e5edf4;
  padding: 14px 20px;
}

.card-header h3,
.card-header p {
  margin: 0;
}

.card-header h3 {
  color: var(--brand);
  font-size: 15px;
}

.card-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.card-body {
  padding: 20px;
}

/* 首页 */
.welcome-strip {
  position: relative;
  display: flex;
  min-height: 132px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  border: 0;
  padding: 26px 30px;
  color: #fff;
  background:
    linear-gradient(110deg, rgba(8, 156, 155, 0.3), transparent 46%),
    linear-gradient(135deg, #07376f, #072f63 58%, #061f45);
  box-shadow: 0 15px 35px rgba(7, 47, 99, 0.14);
}

.welcome-strip::before,
.welcome-strip::after {
  position: absolute;
  border: 1px solid rgba(101, 218, 212, 0.18);
  border-radius: 50%;
  content: "";
}

.welcome-strip::before { right: 5%; width: 190px; height: 190px; }
.welcome-strip::after { right: 10%; width: 90px; height: 90px; background: rgba(8, 156, 155, 0.09); }

.welcome-copy,
.welcome-actions {
  position: relative;
  z-index: 1;
}

.welcome-copy h2,
.welcome-copy p {
  margin: 0;
}

.welcome-copy h2 {
  font-size: 22px;
}

.welcome-copy p {
  margin-top: 9px;
  color: #bed3e8;
  font-size: 13px;
}

.welcome-actions .button {
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

.welcome-actions .button:hover {
  background: rgba(255, 255, 255, 0.17);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.stat-card {
  position: relative;
  min-height: 128px;
  overflow: hidden;
  padding: 20px;
}

.stat-card::after {
  position: absolute;
  right: -23px;
  bottom: -32px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--stat-soft, #eef4fa);
  content: "";
}

.stat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--stat-soft, #eef4fa);
  color: var(--stat-color, var(--brand));
  font-size: 12px;
  font-weight: 900;
}

.stat-value {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  color: var(--brand);
  font-size: 29px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-value.money {
  font-size: 26px;
}

.stat-meta {
  position: relative;
  z-index: 1;
  margin-top: 9px;
  color: #8795a6;
  font-size: 10px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(560px, 1.6fr);
  gap: 18px;
}

.distribution-list {
  display: grid;
  gap: 16px;
}

.distribution-row {
  display: grid;
  grid-template-columns: minmax(80px, 116px) minmax(90px, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.distribution-name,
.distribution-value {
  font-size: 12px;
}

.distribution-name {
  overflow: hidden;
  color: #41536a;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.distribution-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f6;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #45bfbc);
}

.progress-w-10 { width: 10%; }
.progress-w-20 { width: 20%; }
.progress-w-30 { width: 30%; }
.progress-w-40 { width: 40%; }
.progress-w-50 { width: 50%; }
.progress-w-60 { width: 60%; }
.progress-w-70 { width: 70%; }
.progress-w-80 { width: 80%; }
.progress-w-90 { width: 90%; }
.progress-w-100 { width: 100%; }

/* 筛选、表格 */
.filter-card {
  padding: 17px 19px;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) repeat(3, minmax(130px, 0.85fr)) auto;
  align-items: end;
  gap: 12px;
}

.field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.field > span,
.field > label {
  color: #506178;
  font-size: 11px;
  font-weight: 750;
}

.control {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 11px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.control::placeholder {
  color: #a0adbb;
}

.control:hover {
  border-color: #aac0d3;
}

.control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 156, 155, 0.1);
}

textarea.control {
  min-height: 84px;
  resize: vertical;
  line-height: 1.55;
}

.filter-actions {
  display: flex;
  gap: 7px;
}

.search-wrap {
  position: relative;
}

.search-wrap::before {
  position: absolute;
  top: 50%;
  left: 12px;
  color: #8ea1b4;
  content: "⌕";
  font-size: 17px;
  transform: translateY(-50%);
}

.search-wrap .control {
  padding-left: 36px;
}

.table-card {
  overflow: hidden;
}

.table-summary {
  color: var(--muted);
  font-size: 11px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 13px 15px;
  border-bottom: 1px solid #e7eef4;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  background: #f7fafc;
  color: #64778d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.data-table tbody tr {
  transition: background 0.14s ease;
}

.data-table tbody tr:hover {
  background: #f9fcfd;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .money-cell {
  color: var(--brand);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.data-table .number-cell {
  color: var(--info);
  font-weight: 750;
}

.data-table .purpose-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-actions {
  display: flex;
  gap: 5px;
}

.link-button {
  border: 0;
  padding: 3px 0;
  background: transparent;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 750;
}

.link-button:hover {
  color: var(--brand);
  text-decoration: underline;
}

.status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 9px;
  color: #536478;
  background: #eef3f7;
  font-size: 10px;
  font-weight: 750;
}

.status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status.success { color: var(--success); background: var(--success-soft); }
.status.warning { color: var(--warning); background: var(--warning-soft); }
.status.danger { color: var(--danger); background: var(--danger-soft); }
.status.info { color: var(--info); background: var(--info-soft); }
.status.primary { color: var(--primary-dark); background: var(--primary-soft); }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e7eef4;
  padding: 13px 17px;
  color: var(--muted);
  font-size: 11px;
}

.pagination-actions {
  display: flex;
  gap: 6px;
}

.pagination button {
  min-width: 31px;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--brand);
}

.pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* 审批与复核 */
.task-tabs {
  display: flex;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  background: #fff;
}

.task-tab {
  position: relative;
  border: 0;
  padding: 15px 12px 13px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.task-tab.is-active {
  color: var(--brand);
}

.task-tab.is-active::after {
  position: absolute;
  right: 9px;
  bottom: -1px;
  left: 9px;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
  content: "";
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 19px 21px;
}

.task-card-main {
  min-width: 0;
}

.task-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-card-head strong {
  color: var(--brand);
  font-size: 14px;
}

.task-purpose {
  margin: 10px 0 0;
  overflow: hidden;
  color: #34485e;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.task-meta b {
  color: #41536a;
  font-weight: 700;
}

.task-side {
  min-width: 220px;
  text-align: right;
}

.task-amount {
  color: var(--brand);
  font-size: 21px;
  font-weight: 850;
}

.task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 12px;
}

.settlement-select {
  min-width: 150px;
}

/* 报表 */
.report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.report-total {
  padding: 22px;
}

.report-total span {
  color: var(--muted);
  font-size: 11px;
}

.report-total strong {
  display: block;
  margin-top: 10px;
  color: var(--brand);
  font-size: 25px;
}

.report-total small {
  display: block;
  margin-top: 7px;
  color: #8493a4;
  font-size: 10px;
}

.report-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.rank-list {
  display: grid;
  gap: 14px;
}

.rank-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.rank-number {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 7px;
  color: var(--brand);
  background: #edf3f8;
  font-size: 10px;
  font-weight: 800;
}

.rank-row:nth-child(-n+3) .rank-number {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.rank-name {
  min-width: 0;
  overflow: hidden;
  color: #3e5065;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-value {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

/* 设置 */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(520px, 1.4fr);
  gap: 18px;
  align-items: start;
}

.settings-intro {
  position: sticky;
  top: 105px;
  padding: 24px;
}

.settings-intro-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.settings-intro h3 {
  margin: 18px 0 8px;
  color: var(--brand);
  font-size: 17px;
}

.settings-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.rule-note {
  margin-top: 18px;
  border-radius: 10px;
  padding: 12px;
  color: #53667c;
  background: #f2f7fb;
  font-size: 11px;
  line-height: 1.7;
}

.category-list {
  display: grid;
  gap: 11px;
}

.category-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.category-parent,
.category-child {
  display: flex;
  min-height: 49px;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
}

.category-parent {
  background: #f8fbfd;
}

.category-parent strong,
.category-child strong {
  min-width: 0;
  flex: 1;
  color: #30455c;
  font-size: 12px;
}

.category-parent strong {
  color: var(--brand);
  font-size: 13px;
}

.category-parent-mark {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 900;
}

.category-children {
  border-top: 1px solid var(--line);
}

.category-child {
  margin-left: 40px;
  border-bottom: 1px dashed #e4ebf1;
}

.category-child:last-child {
  border-bottom: 0;
}

.category-child::before {
  color: #92a3b5;
  content: "└";
}

.category-actions {
  display: flex;
  gap: 5px;
}

.inactive-text {
  color: #98a5b4 !important;
  text-decoration: line-through;
}

/* 弹窗与费用单 */
.modal-root {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 25, 54, 0.58);
  backdrop-filter: blur(4px);
}

.modal-root.is-open {
  display: flex;
}

.modal {
  display: flex;
  width: min(760px, 100%);
  max-height: min(90vh, 920px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(3, 28, 60, 0.26);
  animation: modalIn 0.2s ease-out;
}

.modal.large {
  width: min(1040px, 100%);
}

.modal.small {
  width: min(480px, 100%);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line);
  padding: 17px 21px;
}

.modal-title h2,
.modal-title p {
  margin: 0;
}

.modal-title h2 {
  color: var(--brand);
  font-size: 18px;
}

.modal-title p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.modal-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: #f0f5f8;
  color: #516479;
  font-size: 21px;
}

.modal-close:hover {
  background: #e5edf3;
  color: var(--brand);
}

.modal-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 21px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 14px 21px;
  background: #fafcfd;
}

.form-section + .form-section {
  margin-top: 25px;
}

.form-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.form-section-title h3,
.form-section-title p {
  margin: 0;
}

.form-section-title h3 {
  color: var(--brand);
  font-size: 14px;
}

.form-section-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

.user-scope-section {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px;
  background: #f9fbfd;
}

.user-scope-rows {
  display: grid;
  gap: 10px;
}

.user-scope-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) 34px;
  align-items: end;
  gap: 9px;
}

.user-scope-row .field > span {
  font-size: 9px;
}

.required::after {
  margin-left: 3px;
  color: var(--danger);
  content: "*";
}

.radio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.radio-option {
  position: relative;
}

.radio-option input {
  position: absolute;
  opacity: 0;
}

.radio-option span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px;
  color: #53657a;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.radio-option input:checked + span {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(8, 156, 155, 0.08);
}

.expense-lines {
  display: grid;
  gap: 10px;
}

.expense-line {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(180px, 1.5fr) minmax(110px, 0.7fr) minmax(100px, 0.6fr) 34px;
  align-items: end;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  background: #f9fbfd;
}

.expense-line .field > span {
  font-size: 9px;
}

.line-remove {
  width: 34px;
  height: 40px;
  border: 1px solid #f0ccd1;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 18px;
}

.line-remove:hover {
  background: #ffe5e8;
}

.form-totals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  margin-top: 13px;
  border-radius: 9px;
  padding: 12px 15px;
  background: #f0f7f8;
}

.form-total-item {
  color: var(--muted);
  font-size: 11px;
}

.form-total-item b {
  margin-left: 8px;
  color: var(--brand);
  font-size: 16px;
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #d8e8ee;
  border-radius: 12px;
  padding: 18px;
  background: linear-gradient(135deg, #f2faf9, #f6f9fc);
}

.detail-number {
  color: var(--info);
  font-size: 12px;
  font-weight: 750;
}

.detail-hero h3 {
  margin: 7px 0 0;
  color: var(--brand);
  font-size: 18px;
}

.detail-amount {
  color: var(--brand);
  font-size: 24px;
  font-weight: 850;
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.detail-cell {
  min-height: 72px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px;
}

.detail-cell:nth-child(4n) { border-right: 0; }
.detail-cell:nth-last-child(-n+4) { border-bottom: 0; }
.detail-cell span,
.detail-cell strong { display: block; }
.detail-cell span { color: var(--muted); font-size: 9px; }
.detail-cell strong { margin-top: 7px; color: #31465c; font-size: 12px; line-height: 1.5; }

.detail-section {
  margin-top: 22px;
}

.detail-section h3 {
  margin: 0 0 11px;
  color: var(--brand);
  font-size: 14px;
}

.line-table {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  border-spacing: 0;
  overflow: hidden;
  font-size: 11px;
}

.line-table th,
.line-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

.line-table th {
  color: var(--muted);
  background: #f6f9fb;
  font-size: 9px;
}

.line-table tr:last-child td { border-bottom: 0; }

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  padding-bottom: 16px;
}

.timeline-item::before {
  position: absolute;
  top: 15px;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: #d8e4ed;
  content: "";
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 3px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.timeline-copy strong,
.timeline-copy span { display: block; }
.timeline-copy strong { color: #35495f; font-size: 11px; }
.timeline-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.timeline-time { color: #8c9aab; font-size: 9px; white-space: nowrap; }

.comment-tip {
  margin: 0 0 14px;
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  background: var(--primary-soft);
  color: #4f6478;
  font-size: 11px;
  line-height: 1.6;
}

/* 空状态、提示 */
.empty-state {
  display: grid;
  min-height: 250px;
  place-items: center;
  padding: 35px;
  text-align: center;
}

.empty-mark {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  place-items: center;
  border: 1px solid #d8e7ec;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--primary-soft), #f4f8fb);
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 850;
}

.empty-state h3,
.empty-state p { margin: 0; }
.empty-state h3 { color: var(--brand); font-size: 15px; }
.empty-state p { max-width: 400px; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.empty-state .button { margin-top: 17px; }

.loading-state {
  display: grid;
  min-height: 330px;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.loading-state::before {
  width: 27px;
  height: 27px;
  margin: 0 auto 11px;
  border: 3px solid #dce7ee;
  border-right-color: var(--primary);
  border-radius: 50%;
  content: "";
  animation: spin 0.7s linear infinite;
}

.error-panel {
  padding: 32px;
  text-align: center;
}

.error-panel h3 { margin: 0; color: var(--danger); font-size: 15px; }
.error-panel p { margin: 8px 0 16px; color: var(--muted); font-size: 12px; }

.toast-stack {
  position: fixed;
  z-index: 180;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(360px, calc(100vw - 40px));
  gap: 9px;
}

.toast {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid #d9e6ee;
  border-radius: 11px;
  padding: 12px 13px;
  color: #35495f;
  background: #fff;
  box-shadow: 0 14px 35px rgba(4, 31, 66, 0.18);
  font-size: 12px;
  animation: toastIn 0.2s ease-out;
}

.toast-symbol {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  color: var(--success);
  background: var(--success-soft);
  font-weight: 900;
}

.toast.error .toast-symbol { color: var(--danger); background: var(--danger-soft); }
.toast.warning .toast-symbol { color: var(--warning); background: var(--warning-soft); }
.toast button { border: 0; background: transparent; color: #8a99aa; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-overlay {
  position: fixed;
  z-index: 35;
  inset: 0;
  background: rgba(2, 22, 47, 0.5);
}

/* 响应式 */
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { grid-column: span 2; justify-content: flex-end; }
  .expense-line { grid-template-columns: repeat(2, minmax(0, 1fr)) 34px; }
  .expense-line .field:nth-child(3) { grid-column: 1; }
  .expense-line .field:nth-child(4) { grid-column: 2; }
  .expense-line .line-remove { grid-column: 3; grid-row: 1; }
}

@media (max-width: 920px) {
  .login-page { grid-template-columns: 1fr; background: var(--bg); }
  .login-intro { display: none; }
  .login-card-wrap { min-height: 100vh; padding: 38px 24px; }
  .login-card { border: 1px solid var(--line); border-radius: 18px; padding: 30px; background: #fff; box-shadow: var(--shadow); }
  .login-mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 29px; color: var(--brand); }
  .login-mobile-brand img { width: 40px; height: 40px; border-radius: 9px; object-fit: contain; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; transform: translateX(-104%); transition: transform 0.2s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-close { display: grid; place-items: center; }
  .mobile-menu { display: block; }
  .topbar { padding-inline: 20px; }
  .main-content { padding-inline: 20px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-intro { position: static; }
  .report-sections { grid-template-columns: 1fr; }
  .task-card { grid-template-columns: 1fr; }
  .task-side { min-width: 0; border-top: 1px solid var(--line); padding-top: 14px; text-align: left; }
  .task-actions { justify-content: flex-start; }
}

@media (max-width: 680px) {
  .topbar { min-height: 70px; gap: 11px; padding: 10px 14px; }
  .topbar-title h1 { font-size: 18px; }
  .topbar-title .eyebrow, .today { display: none; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .button { min-height: 37px; padding: 7px 10px; font-size: 12px; }
  .main-content { padding: 20px 14px 45px; }
  .page-stack { gap: 15px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-actions { justify-content: flex-start; }
  .welcome-strip { min-height: 158px; align-items: flex-start; flex-direction: column; padding: 22px; }
  .welcome-copy h2 { font-size: 18px; }
  .welcome-actions { align-self: stretch; }
  .welcome-actions .button { width: 100%; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { min-height: 115px; padding: 15px; }
  .stat-value { font-size: 24px; }
  .stat-value.money { font-size: 19px; }
  .card.pad, .card-body { padding: 16px; }
  .card-header { padding: 13px 15px; }
  .filter-grid { grid-template-columns: 1fr; }
  .filter-actions { grid-column: 1; justify-content: stretch; }
  .filter-actions .button { flex: 1; }
  .report-grid { grid-template-columns: 1fr; }
  .task-card { padding: 16px; }
  .task-actions { flex-wrap: wrap; }
  .task-actions .button { flex: 1; }
  .modal-root { align-items: flex-end; padding: 0; }
  .modal, .modal.large, .modal.small { width: 100%; max-height: 94vh; border-radius: 17px 17px 0 0; }
  .modal-header, .modal-body, .modal-footer { padding-left: 15px; padding-right: 15px; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .button { flex: 1; }
  .span-8, .span-6, .span-4, .span-3 { grid-column: span 12; }
  .radio-grid { grid-template-columns: 1fr; }
  .expense-line { grid-template-columns: 1fr 34px; }
  .expense-line .field { grid-column: 1 !important; }
  .expense-line .line-remove { grid-column: 2; grid-row: 1; }
  .user-scope-row { grid-template-columns: 1fr 34px; }
  .user-scope-row .field { grid-column: 1; }
  .user-scope-row .line-remove { grid-column: 2; grid-row: 1; }
  .form-totals { align-items: flex-end; flex-direction: column; gap: 8px; }
  .detail-hero { flex-direction: column; }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-cell:nth-child(4n) { border-right: 1px solid var(--line); }
  .detail-cell:nth-child(2n) { border-right: 0; }
  .detail-cell:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  .detail-cell:nth-last-child(-n+2) { border-bottom: 0; }
  .category-child { margin-left: 18px; }
  .distribution-row { grid-template-columns: minmax(70px, 95px) minmax(70px, 1fr); }
  .distribution-value { grid-column: 2; }
}

@media (max-width: 430px) {
  .login-card-wrap { padding: 20px 14px; }
  .login-card { padding: 25px 20px; }
  .login-card h2 { font-size: 24px; }
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-actions .button span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
