:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #fdfefe;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #687484;
  --gray: #edf1f4;
  --line: #e0e6ec;
  --green: #277a54;
  --green-soft: #e2f2ea;
  --blue: #2f6fa5;
  --blue-soft: #e0edf8;
  --amber: #9b6426;
  --amber-soft: #f6ecd9;
  --red: #b44242;
  --red-soft: #f7e4e1;
  --purple: #61558f;
  --purple-soft: #ebe7f5;
  --shadow: 0 1px 2px rgba(23, 31, 42, 0.04);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 8%, rgba(39, 122, 84, 0.05), transparent 28rem),
    radial-gradient(circle at 34% 18%, rgba(47, 111, 165, 0.04), transparent 26rem),
    var(--bg);
  color: var(--ink);
  font-family: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
}

body.modal-open {
  overflow: hidden;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  transform: translateY(-160%);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.app {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 220px),
    #15202a;
  color: #f4f8fb;
  height: 100dvh;
  overflow-y: auto;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 4px 4px;
}

.brand-logo {
  width: 58px;
  height: 38px;
  flex: 0 0 58px;
  object-fit: contain;
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand h1 {
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.brand p,
.date-picker span,
.hint strong {
  color: #9fb0bf;
  font-size: 12px;
}

.date-picker {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(151, 170, 188, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.date-picker input,
.sidebar button,
.hint pre {
  width: 100%;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 10px 11px;
  min-height: 42px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background-color 160ms var(--ease);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(39, 122, 84, 0.28);
  outline-offset: 2px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.date-picker input,
.date-picker select {
  background: #202d38;
  color: #fff;
  border-color: #334452;
  border-radius: 8px;
  width: 100%;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 2px;
}

button {
  border: 0;
  cursor: pointer;
  border-radius: 6px;
  min-height: 40px;
  transition: transform 160ms var(--ease), background-color 180ms var(--ease), color 180ms var(--ease), box-shadow 180ms var(--ease);
}

button:active {
  transform: translateY(1px) scale(0.99);
}

.nav-icon {
  flex-shrink: 0;
  color: #8fa0af;
  opacity: 0.9;
  transition: color 180ms var(--ease), opacity 180ms var(--ease), transform 180ms var(--ease);
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-item {
  background: transparent;
  color: #c9d3dc;
  text-align: left;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.25;
  border-radius: 9px;
  position: relative;
  min-width: 0;
  transition:
    background-color 160ms var(--ease),
    color 160ms var(--ease),
    transform 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.nav-item > span:not(.nav-item-text),
.nav-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #f4f8fb;
}

.nav-item.active {
  background: rgba(226, 242, 234, 0.94);
  color: #173f2c;
  box-shadow: 0 6px 16px rgba(4, 16, 24, 0.14);
}

.nav-item.active .nav-icon {
  color: #277a54;
  transform: translateX(1px);
}

.nav-item-top {
  font-weight: 600;
  font-size: 13.5px;
  color: #d7e0e8;
}

.nav-item-top.active {
  color: #173f2c;
}

.nav-item-rich {
  align-items: flex-start;
  padding: 10px;
}

.nav-item-rich .nav-icon {
  margin-top: 2px;
}

.nav-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nav-item-label {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  color: inherit;
  line-height: 1.2;
}

.nav-item-meta {
  color: #91a1af;
  font-size: 11px;
  line-height: 1.35;
  transition: color 160ms var(--ease);
}

.nav-item.active .nav-item-meta {
  color: rgba(23, 63, 44, 0.66);
}

.nav-item:hover .nav-item-meta {
  color: #b7c5d0;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-group-header {
  background: transparent;
  color: #91a1af;
  text-align: left;
  padding: 7px 8px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  border-radius: 8px;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.nav-group-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.055);
  border-radius: 7px;
  flex-shrink: 0;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.nav-group-label {
  flex: 1;
  min-width: 0;
}

.nav-group-header .chevron {
  transition: transform 220ms var(--ease);
  color: #6d8191;
  flex-shrink: 0;
}

.nav-group-header:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #d6e0e8;
}

.nav-group-header:hover .nav-group-icon-wrap {
  background: rgba(255, 255, 255, 0.1);
}

.nav-group.open .nav-group-header .chevron {
  transform: rotate(180deg);
}

.nav-group.has-active .nav-group-header {
  color: #d9efe3;
}

.nav-group.has-active .nav-group-icon-wrap {
  background: rgba(39, 122, 84, 0.28);
  color: #86d3a6;
}

.nav-group-items {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 8px;
  margin-left: 11px;
  border-left: 1px solid rgba(128, 148, 166, 0.24);
  transition: 
    max-height 280ms var(--ease),
    opacity 200ms ease,
    border-color 180ms var(--ease),
    padding 200ms var(--ease);
}

.nav-group.open .nav-group-items {
  max-height: 400px;
  opacity: 1;
  padding-top: 3px;
  padding-bottom: 3px;
}

.nav-group.has-active .nav-group-items {
  border-left-color: rgba(96, 186, 132, 0.52);
}

.hint {
  margin-top: auto;
  background: #1d2d38;
  border: 1px solid #3a5263;
  border-radius: 8px;
  padding: 14px;
}

.hint-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hint-header .chevron {
  display: none !important; /* PC端默认隐藏 */
}

.hint-body {
  max-height: none;
  opacity: 1;
  overflow: visible;
}

.hint pre {
  white-space: pre-wrap;
  color: #ecf4f0;
  font-size: 18px;
  line-height: 1.55;
  margin: 12px 0;
  background: #14202a;
  border-radius: 6px;
  padding: 12px;
}

.ghost {
  background: #d8efe1;
  color: #16442d;
}

.ghost:hover,
.primary:hover {
  box-shadow: 0 8px 18px rgba(21, 83, 54, 0.18);
}

.secondary:hover {
  background: #d1e6f6;
}

.main {
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px;
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 20px;
  width: 100%;
  min-width: 0;
}

.main > * {
  width: min(100%, 1280px);
  min-width: 0;
  justify-self: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.topbar-copy {
  min-width: 0;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.topbar h2 {
  font-size: 24px;
}

.topbar p {
  color: var(--muted);
  margin-top: 4px;
}

.secondary,
.primary {
  padding: 0 16px;
}

.secondary {
  background: var(--blue-soft);
  color: #1f5f90;
}

.mobile-date-toggle {
  display: none;
}

.primary {
  background: var(--green);
  color: #fff;
  min-width: 160px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none !important;
}

.danger {
  background: var(--red-soft);
  color: var(--red);
  padding: 0 14px;
}

.danger:hover {
  background: #f0d2cd;
}

.panel {
  display: none;
}

.panel.active {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.panel.active > * {
  min-width: 0;
}

.action-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 31, 42, 0.34);
  backdrop-filter: blur(3px);
}

.action-confirm-sheet {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 41;
  width: min(420px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(224, 230, 236, 0.92);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 251, 0.98)),
    var(--panel);
  color: var(--ink);
  box-shadow: 0 22px 52px rgba(23, 31, 42, 0.24);
  transform: translate(-50%, -50%);
}

.action-confirm-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
}

.action-confirm-sheet.tone-success .action-confirm-mark {
  background: var(--green-soft);
  color: var(--green);
}

.action-confirm-copy {
  min-width: 0;
}

.action-confirm-copy h3 {
  font-size: 17px;
  line-height: 1.25;
}

.action-confirm-copy p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.action-confirm-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

.action-confirm-sheet.tone-danger .action-confirm-actions .primary {
  background: var(--red);
  color: #fff;
}

.action-confirm-sheet.tone-success .action-confirm-actions .primary {
  background: var(--green);
  color: #fff;
}

.link-button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.link-button:hover {
  color: #235983;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.reimburse-name-button {
  max-width: 100%;
}

.reimbursement-detail-sheet {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 41;
  width: min(720px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 48px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(224, 230, 236, 0.94);
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 56px rgba(23, 31, 42, 0.24);
  transform: translate(-50%, -50%);
}

.reimbursement-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.reimbursement-detail-head h3 {
  margin-top: 4px;
  font-size: 18px;
}

.reimbursement-detail-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.reimbursement-detail-totals div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.reimbursement-detail-totals span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.reimbursement-detail-totals strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.reimbursement-detail-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 2px;
}

.reimbursement-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.reimbursement-detail-row:last-child {
  border-bottom: 0;
}

.reimbursement-detail-row strong,
.reimbursement-detail-row span,
.reimbursement-detail-row small {
  display: block;
}

.reimbursement-detail-row strong {
  font-size: 14px;
}

.reimbursement-detail-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.reimbursement-detail-row small {
  margin-top: 3px;
  color: #7b8794;
  font-size: 12px;
}

.reimbursement-detail-amount {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.reimbursement-detail-amount b {
  font-size: 15px;
}

.reimbursement-detail-empty {
  padding: 26px 0;
  text-align: center;
}

.loading-state {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.loading-state div {
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(90deg, #eef3f5 0%, #f8fafb 45%, #eef3f5 100%);
  background-size: 200% 100%;
}

@media (prefers-reduced-motion: no-preference) {
  .panel.active > * {
    animation: quiet-rise 420ms var(--ease) both;
  }

  .panel.active > *:nth-child(2) {
    animation-delay: 45ms;
  }

  .panel.active > *:nth-child(3) {
    animation-delay: 90ms;
  }
}

@keyframes quiet-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .loading-state div {
    animation: skeleton-sheen 1.2s var(--ease) infinite;
  }
}

@keyframes skeleton-sheen {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

.error-state,
.empty-state {
  border: 1px solid var(--line);
  background: #f8fafb;
  border-radius: 8px;
  padding: 16px;
}

.error-state {
  border-color: #e9c8c3;
  background: var(--red-soft);
  color: #71302f;
}

.error-state strong,
.empty-state strong {
  display: block;
  margin-bottom: 5px;
}

.empty-state {
  margin: 12px;
  color: var(--muted);
}

.daily-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}

.daily-strip div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.daily-strip span {
  color: var(--muted);
  font-size: 12px;
}

.daily-strip strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.mobile-only {
  display: none;
}

.mobile-more-trigger,
.mobile-more-backdrop,
.mobile-more-sheet,
.mobile-date-toggle,
.mobile-filter-toggle {
  display: none;
}

.order-analysis-panel {
  padding-top: 10px;
  min-width: 0;
}

.order-analysis-surface {
  position: relative;
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(151, 170, 188, 0.22);
  border-radius: 14px;
  background: rgba(253, 254, 254, 0.92);
  box-shadow:
    0 18px 42px rgba(23, 31, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.order-analysis-surface::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(47, 111, 165, 0.08), transparent 36%),
    radial-gradient(circle at top right, rgba(39, 122, 84, 0.08), transparent 26rem);
  pointer-events: none;
}

.order-analysis-surface > * {
  position: relative;
  z-index: 1;
}

.order-analysis-hero {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 2px 0 0;
}

.order-analysis-kicker {
  width: fit-content;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  padding: 5px 10px;
}

.order-analysis-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 18px;
  min-width: 0;
}

.order-analysis-heading h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.order-analysis-heading p {
  margin-top: 8px;
  max-width: 680px;
  color: var(--muted);
  line-height: 1.62;
}

.order-analysis-badge {
  flex-shrink: 0;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(47, 111, 165, 0.22);
  background: rgba(255, 255, 255, 0.8);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.order-analysis-block {
  min-width: 0;
  border: 1px solid rgba(151, 170, 188, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.order-analysis-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.analysis-filter-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.analysis-filter-actions button {
  width: 100%;
  min-height: 42px;
  white-space: nowrap;
}

.order-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.order-kpi-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 156px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(151, 170, 188, 0.22);
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 10px 26px rgba(23, 31, 42, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  overflow: hidden;
}

.order-kpi-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -28% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(47, 111, 165, 0.07);
}

.order-kpi-eyebrow {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-kpi-card h4,
.order-kpi-card strong,
.order-kpi-card p {
  position: relative;
  z-index: 1;
}

.order-kpi-card h4 {
  font-size: 15px;
  line-height: 1.2;
}

.order-kpi-card strong {
  display: block;
  margin-top: 0;
  font-size: clamp(24px, 2.35vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.order-kpi-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.order-kpi-card.revenue strong {
  color: var(--blue);
}

.order-kpi-card.expense strong {
  color: var(--red);
}

.order-kpi-card.net strong,
.order-kpi-card.balance strong {
  color: var(--green);
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
  min-height: 118px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.metric small {
  display: none;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.revenue strong {
  color: var(--blue);
}

.expense strong {
  color: var(--red);
}

.net strong,
.balance strong {
  color: var(--green);
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px;
}

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

.settings-workbench,
.settings-manager {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.settings-workbench {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  overflow: hidden;
}

.settings-rail {
  background: #f1f5f7;
  border-right: 1px solid var(--line);
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 18px;
}

.settings-rail h3,
.settings-manager h3 {
  margin-top: 4px;
  font-size: 16px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(86px, 1fr);
  gap: 4px;
  padding: 4px;
  background: #e8eef2;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented-control button {
  background: transparent;
  color: #3f4f5f;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.segmented-control button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 1px 2px rgba(23, 31, 42, 0.08);
}

.segmented-control span {
  color: inherit;
  font-size: inherit;
}

.settings-rail .segmented-control {
  width: 100%;
  grid-auto-flow: row;
  grid-auto-columns: auto;
}

.settings-form-stack {
  min-width: 0;
}

.settings-form-panel {
  display: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.settings-form-panel.active {
  display: block;
}

.settings-manager {
  overflow: hidden;
}

.section-title.stacked {
  align-items: flex-start;
  gap: 14px;
}

.manager-panel {
  display: none;
}

.manager-panel.active {
  display: block;
}

.table-section,
.entry-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.section-title {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title h3 {
  font-size: 16px;
}

.section-title span {
  color: var(--muted);
  font-size: 13px;
}

.section-title p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}

.table-wrap {
  overflow: auto;
  max-height: 520px;
  min-width: 0;
  max-width: 100%;
}

.mobile-card-list {
  display: none;
}

.analysis-mobile-list {
  display: none;
}

.overview-mini-summary {
  display: none;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
}

#dividend table {
  min-width: 860px;
}

#dividend th:nth-child(6),
#dividend td:nth-child(6) {
  min-width: 260px;
  white-space: normal;
}

#dividend td:nth-child(6) span {
  display: inline-block;
  margin-bottom: 4px;
  white-space: nowrap;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: #f0f4f7;
  color: #354455;
  font-weight: 700;
  position: sticky;
  top: 0;
}

td.number,
th.number {
  text-align: right;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.account-history-table {
  min-width: 980px;
  table-layout: fixed;
}

.account-history-table .date-col {
  width: 150px;
}

.account-history-table .money-col,
.account-history-table .total-col {
  width: 180px;
}

.account-history-table .action-col {
  width: 190px;
}

.account-history-table th,
.account-history-table td {
  vertical-align: middle;
}

.account-history-table th.number {
  font-family: inherit;
}

.account-history-table td.number,
.account-history-table th.number {
  padding-right: 28px;
}

.account-history-table td:last-child,
.account-history-table th:last-child {
  text-align: left;
}

tbody tr {
  cursor: default;
}

tbody tr:hover {
  background: #f8fafb;
}

.daily-profit {
  color: var(--green);
  font-weight: 700;
}

.daily-loss {
  color: var(--red);
  font-weight: 700;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.pill.ok {
  background: var(--green-soft);
  color: var(--green);
}

.pill.waiting {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.muted {
  background: var(--gray);
  color: var(--muted);
}

.source-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.receipt-thumbs,
.receipt-preview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.receipt-thumbs {
  margin-top: 8px;
}

.receipt-thumb,
.receipt-preview img {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #f8fafb;
}

.receipt-thumb {
  display: inline-block;
  overflow: hidden;
}

.receipt-thumb:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 165, 0.12);
}

.receipt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.receipt-upload-field {
  display: grid;
  gap: 8px;
}

.existing-receipt-section {
  display: grid;
  gap: 10px;
}

.existing-receipt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.existing-receipt-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.existing-receipt-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.existing-receipt-item strong {
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.existing-receipt-item.is-removed {
  opacity: 0.58;
  background: rgba(248, 234, 232, 0.7);
}

.existing-receipt-toggle {
  width: 100%;
}

.receipt-upload-field .field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.receipt-dropzone {
  display: grid;
  gap: 12px;
  min-height: 140px;
  padding: 16px 18px;
  border: 1px dashed rgba(47, 111, 165, 0.28);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(47, 111, 165, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(47, 111, 165, 0.04), rgba(47, 111, 165, 0.01)),
    #f8fafb;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease, transform 160ms ease;
}

.receipt-dropzone:hover,
.receipt-dropzone:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 165, 0.12);
  outline: none;
}

.receipt-dropzone.is-dragover {
  border-color: var(--blue);
  background:
    linear-gradient(180deg, rgba(47, 111, 165, 0.1), rgba(47, 111, 165, 0.03)),
    #eef6fb;
  box-shadow: 0 0 0 4px rgba(47, 111, 165, 0.14);
  transform: translateY(-1px);
}

.receipt-dropzone-copy {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.receipt-dropzone-copy strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.receipt-dropzone-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.receipt-dropzone-copy button {
  margin-top: 4px;
}

.receipt-preview {
  min-height: 0;
}

.receipt-preview:empty {
  display: none;
}

.receipt-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 22px rgba(11, 18, 24, 0.08);
}

.receipt-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.receipt-preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(11, 18, 24, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.receipt-preview-remove:hover {
  background: rgba(180, 40, 40, 0.9);
}

.receipt-viewer {
  width: min(1100px, calc(100vw - 32px));
  max-height: min(880px, calc(100dvh - 32px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.receipt-viewer::backdrop {
  background: rgba(11, 18, 24, 0.72);
  backdrop-filter: blur(3px);
}

.receipt-viewer-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(880px, calc(100dvh - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(11, 18, 24, 0.28);
}

.receipt-viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.receipt-viewer-actions {
  display: flex;
  gap: 8px;
}

.receipt-viewer-actions a,
.receipt-viewer-actions button {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  border-radius: 6px;
  padding: 0 12px;
  text-decoration: none;
}

.receipt-viewer-stage {
  display: grid;
  place-items: center;
  min-height: 320px;
  max-height: calc(100dvh - 120px);
  overflow: auto;
  padding: 14px;
  background: #101820;
}

.receipt-viewer-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 156px);
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.allocation-editor {
  border: 1px solid var(--line);
  background: #f8fafb;
  border-radius: 8px;
  padding: 12px;
}

.allocation-rows {
  display: grid;
  gap: 8px;
}

.allocation-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(80px, 110px) 20px minmax(88px, auto);
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.allocation-row input {
  min-height: 36px;
  text-align: right;
}

.allocation-row em {
  color: var(--muted);
  font-style: normal;
}

.dividend-allocation-amount {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.dividend-ratio-hint {
  padding-top: 4px;
}

.dividend-ratio-hint.ok {
  color: var(--ok);
}

.dividend-ratio-hint.warning {
  color: #b7791f;
}

input[name="retained_cash"][readonly] {
  background: #edf7f1;
  color: var(--ok);
  font-weight: 700;
}

.income-batch-editor,
.income-channel-editor {
  border: 1px solid var(--line);
  background: #f8fafb;
  border-radius: 8px;
  padding: 12px;
}

.batch-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.batch-editor-head strong {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 18px;
}

.batch-editor-head span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.compact {
  min-height: 34px;
  padding: 0 12px;
}

.income-batch-rows,
.income-channel-rows {
  display: grid;
  gap: 8px;
}

.income-batch-row,
.income-channel-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(120px, 0.55fr) minmax(180px, 1fr);
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
}

.income-channel-row {
  grid-template-columns: minmax(160px, 0.9fr) minmax(120px, 0.55fr) minmax(160px, 1fr) auto;
}

.income-channel-remove {
  min-width: 64px;
}

.batch-account {
  min-width: 0;
  align-self: center;
}

.batch-account strong,
.batch-account span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-account span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
}

.income-balance-check {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 12px;
}

.balance-check-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.balance-check-head strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.balance-check-head span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.balance-check-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: end;
}

.balance-check-math {
  min-height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafb;
}

.balance-check-math span {
  color: var(--muted);
  font-size: 12px;
}

.balance-check-math strong {
  color: var(--ink);
  font-size: 18px;
}

.balance-check-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.balance-check-breakdown span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid rgba(224, 230, 236, 0.92);
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafb;
  color: #415263;
  font-size: 12px;
  font-weight: 650;
}

#incomeBalanceStatus.ok,
#incomeBalanceDiff.ok {
  color: var(--green);
}

#incomeBalanceStatus.warning,
#incomeBalanceDiff.warning {
  color: var(--red);
}

#incomeBalanceStatus.muted,
#incomeBalanceDiff.muted {
  color: var(--muted);
}

.entry-form {
  padding: 18px;
}

.record-list-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.record-list-section::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--green), rgba(47, 111, 165, 0.82), rgba(39, 122, 84, 0.18));
}

.record-actionbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: -4px;
  padding: 14px 16px;
  border: 1px solid rgba(224, 230, 236, 0.92);
  border-radius: 8px;
  background: rgba(253, 254, 254, 0.9);
  box-shadow: var(--shadow);
}

.record-actionbar div {
  margin-right: auto;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.record-actionbar strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.record-actionbar span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.record-list-hero {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(224, 230, 236, 0.82);
  background:
    linear-gradient(135deg, rgba(226, 242, 234, 0.62), rgba(253, 254, 254, 0) 48%),
    #fbfcfd;
}

.record-list-hero h3 {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.record-list-hero p {
  margin-top: 7px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.record-kicker,
.record-page-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.record-kicker {
  padding: 0 10px;
  background: rgba(39, 122, 84, 0.1);
  color: #1f6846;
}

.record-page-chip {
  padding: 0 12px;
  border: 1px solid rgba(39, 122, 84, 0.18);
  background: rgba(255, 255, 255, 0.88);
  color: #415263;
}

.entry-dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  background: transparent;
  color: var(--ink);
}

.entry-dialog::backdrop {
  background: rgba(23, 33, 42, 0.62);
  backdrop-filter: blur(5px);
}

.dialog-form {
  max-height: min(760px, calc(100dvh - 32px));
  overflow-x: hidden;
  overflow-y: auto;
}

.expense-dialog-form,
.income-dialog-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(820px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(47, 111, 165, 0.04), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 251, 0.98)),
    #fff;
}

.expense-dialog-form .dialog-title,
.income-dialog-form .dialog-title {
  margin-bottom: 0;
  padding: 22px 22px 16px;
  border-bottom: 1px solid rgba(224, 230, 236, 0.72);
  background: rgba(255, 255, 255, 0.96);
}

.expense-dialog-form .dialog-stack,
.income-dialog-form .dialog-stack {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 22px 20px;
  overscroll-behavior: contain;
  scroll-padding: 18px;
}

.expense-dialog-form .dialog-actions,
.income-dialog-form .dialog-actions {
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(224, 230, 236, 0.86);
  background:
    linear-gradient(180deg, rgba(248, 250, 251, 0.92), rgba(255, 255, 255, 0.98)),
    #fff;
  box-shadow: 0 -12px 26px rgba(23, 31, 42, 0.08);
}

.income-dialog-form .dialog-stack {
  gap: 14px;
}

.income-dialog-form .income-channel-editor,
.income-dialog-form .income-batch-editor {
  margin-top: 12px;
}

.income-dialog-form .income-channel-editor:first-of-type {
  margin-top: 0;
}

.expense-history-dialog {
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(47, 111, 165, 0.04), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 251, 0.98)),
    #fff;
}

.expense-history-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.expense-history-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 242, 236, 0.9));
}

.expense-history-time {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.expense-history-summary {
  font-weight: 600;
  line-height: 1.5;
}

.expense-history-listing {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.chart-fallback-bars {
  position: absolute;
  inset: 12px 14px;
  z-index: 2;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 8px 4px;
  pointer-events: none;
}

.chart-fallback-row {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) minmax(72px, 2fr) minmax(52px, auto);
  align-items: center;
  gap: 9px;
  min-height: 18px;
  color: var(--ink);
  font-size: 11px;
}

.chart-fallback-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 700;
}

.chart-fallback-row div {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(47, 111, 165, 0.08);
}

.chart-fallback-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.chart-fallback-row b {
  text-align: right;
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
}

.chart-fallback-empty {
  display: grid;
  place-items: center;
  min-height: 100%;
  color: var(--muted);
  font-size: 13px;
}

.dialog-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.dialog-title h3 {
  margin-top: 4px;
  font-size: 18px;
}

.dialog-intro {
  margin-top: 8px;
  max-width: 44ch;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.dialog-close {
  min-width: 72px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.dialog-actions button {
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 16px;
  line-height: 42px;
  white-space: nowrap;
}

.dialog-actions .primary,
.dialog-actions .secondary {
  margin-top: 0;
}

.dialog-stack {
  display: grid;
  gap: 16px;
}

.dialog-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(224, 230, 236, 0.92);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 251, 0.96)),
    #fff;
  box-shadow: 0 12px 24px rgba(23, 31, 42, 0.04);
}

.dialog-section-emphasis {
  border-color: rgba(47, 111, 165, 0.18);
  background:
    radial-gradient(circle at top right, rgba(47, 111, 165, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 248, 252, 0.98)),
    #fff;
}

.dialog-section-head {
  display: grid;
  gap: 4px;
}

.dialog-section-head strong {
  font-size: 14px;
  letter-spacing: -0.01em;
}

.dialog-section-head span {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.record-filters {
  padding: 16px 18px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafb;
}

.record-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.record-quick-filters button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(195, 207, 217, 0.86);
  background: #fff;
  color: #415263;
  font-size: 13px;
  border-radius: 999px;
  font-weight: 650;
}

.record-quick-filters button:hover {
  background: var(--green-soft);
  border-color: rgba(39, 122, 84, 0.28);
  color: #1f6846;
}

.record-quick-filters button.active {
  background: var(--green-soft);
  border-color: rgba(39, 122, 84, 0.36);
  color: #1f6846;
  box-shadow: inset 0 0 0 1px rgba(39, 122, 84, 0.12);
}

.record-filter-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) repeat(3, minmax(150px, 1fr));
  gap: 12px;
}

.date-range-field {
  display: grid;
  gap: 7px;
  color: #394858;
  font-size: 13px;
  font-weight: 600;
}

.date-range-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.date-range-inputs em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

.record-advanced-filters {
  margin-top: 12px;
}

.record-advanced-filters summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  user-select: none;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
}

.record-advanced-filters[open] summary {
  margin-bottom: 12px;
  color: var(--green);
  background: var(--green-soft);
}

.record-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.record-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.record-summary div {
  border: 1px solid rgba(224, 230, 236, 0.96);
  background:
    linear-gradient(180deg, rgba(248, 250, 251, 0.76), rgba(255, 255, 255, 0.96)),
    #fff;
  border-radius: 8px;
  padding: 13px 14px;
  min-height: 86px;
  display: grid;
  align-content: center;
  gap: 3px;
}

.record-summary .summary-emphasis {
  border-color: rgba(39, 122, 84, 0.2);
  background:
    linear-gradient(135deg, rgba(226, 242, 234, 0.9), rgba(255, 255, 255, 0.96)),
    #fff;
}

.record-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.record-summary strong {
  display: block;
  margin-top: 1px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.record-summary small {
  color: var(--muted);
  font-size: 12px;
}

.record-inline-error,
.record-empty {
  margin: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.record-inline-error {
  border-color: #e9c8c3;
  background: var(--red-soft);
  color: #71302f;
}

.record-empty {
  background: #f8fafb;
  color: var(--muted);
}

.record-table {
  min-width: 980px;
}

.record-list-section .table-wrap {
  max-height: min(68dvh, 680px);
  overflow: auto;
  background: #fff;
}

.record-list-section table {
  font-size: 13px;
}

.record-list-section th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5f8fa;
  font-size: 12px;
}

.record-list-section td {
  padding-top: 12px;
  padding-bottom: 12px;
}

.record-list-section tbody tr:hover {
  background: #fbfdfc;
}

.record-list-section tbody tr.record-row-expanded {
  background: #fbfdfc;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-note {
  display: inline-block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.income-detail-toggle {
  color: var(--blue);
}

.income-channel-detail-row td {
  padding: 0 18px 14px;
  background: #fbfdfc;
  border-top: 0;
}

.income-channel-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  border: 1px solid rgba(39, 122, 84, 0.14);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(226, 242, 234, 0.72), rgba(255, 255, 255, 0.96)),
    #fff;
}

.income-channel-detail-item {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.income-channel-detail-item span,
.income-channel-detail-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.income-channel-detail-item span {
  color: #415263;
  font-size: 12px;
  font-weight: 700;
}

.income-channel-detail-item strong {
  font-size: 17px;
}

.income-channel-detail-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.mobile-income-channel-detail {
  display: grid;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
  padding: 10px;
  border: 1px solid rgba(39, 122, 84, 0.14);
  border-radius: 8px;
  background: rgba(226, 242, 234, 0.45);
}

.mobile-income-channel-detail div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.mobile-income-channel-detail span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-record-table {
  min-width: 1180px;
}

.receipt-thumb.compact {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  vertical-align: top;
}

.record-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #f8fafb;
}

.record-pagination span {
  color: var(--muted);
  font-size: 13px;
}

.record-pagination label {
  display: inline-grid;
  grid-template-columns: auto 86px;
  align-items: center;
  gap: 8px;
}

.record-pagination select {
  min-height: 40px;
}

.mobile-pull-refresh,
.mobile-load-more {
  display: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.entry-form:focus-within {
  box-shadow: 0 10px 24px rgba(23, 31, 42, 0.08);
}

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

.dividend-form-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  align-items: start;
}

.dividend-form-grid > label:not(.wide) {
  grid-template-rows: auto 42px minmax(18px, auto);
  align-content: start;
}

.dividend-form-grid > label:not(.wide) > input {
  height: 42px;
}

.dividend-form-grid > label.wide {
  grid-template-rows: auto auto;
}

@media (max-width: 1160px) and (min-width: 981px) {
  .dividend-form-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

.form-grid.compact {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: #394858;
  font-size: 13px;
  font-weight: 600;
}

.wide {
  grid-column: 1 / -1;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  align-self: end;
}

.check input {
  min-height: auto;
  width: 18px;
  height: 18px;
}

.entry-form .primary {
  margin-top: 18px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.form-actions .primary,
.form-actions .secondary {
  margin-top: 0;
}

.dividend-form-actions {
  padding-top: 6px;
}

#dividendForm textarea[name="note"] {
  display: block;
  min-height: 112px;
}

.dialog-actions .primary,
.dialog-actions .secondary {
  margin-top: 0;
}

.manager-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.manager-row {
  display: grid;
  border: 1px solid var(--line);
  background: #f8fafb;
  border-radius: 8px;
  overflow: hidden;
}

.manager-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.manager-identity {
  min-width: 0;
}

.manager-identity strong,
.manager-identity span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-identity strong {
  color: var(--ink);
  font-size: 15px;
}

.manager-identity span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
}

.manager-edit-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 14px;
}

.manager-row.expanded .manager-edit-panel {
  display: grid;
  gap: 12px;
}

.manager-main,
.manager-actions {
  display: grid;
  gap: 12px;
}

.manager-main {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.manager-actions {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
}

.manager-status {
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.manager-status.ok {
  background: var(--green-soft);
  color: var(--green);
}

.manager-status.muted {
  background: var(--gray);
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #17212b;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .metrics,
  .daily-strip,
  .grid.two,
  .settings-grid,
  .settings-workbench,
  .form-grid,
  .record-filter-grid,
  .record-summary {
    grid-template-columns: 1fr;
  }

  .settings-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .manager-main,
  .manager-actions,
  .form-grid.compact,
  .order-analysis-grid--customer,
  .order-analysis-filter-grid {
    grid-template-columns: 1fr;
  }

  .order-analysis-heading {
    display: grid;
  }

  .record-filter-actions,
  .record-actionbar,
  .dialog-actions,
  .record-pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .record-actionbar {
    margin-bottom: 0;
  }

  .record-actionbar div {
    margin-right: 0;
  }

  .record-list-hero {
    display: grid;
    gap: 12px;
    padding: 16px;
  }

  #all.panel.active .record-list-hero,
  #expense.panel.active .record-list-hero,
  #income.panel.active .record-list-hero {
    display: none;
  }

  .record-list-hero h3 {
    font-size: 18px;
  }

  .record-list-hero p {
    font-size: 12px;
  }

  .record-page-chip {
    width: fit-content;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .record-filter-actions button,
  .record-actionbar button,
  .dialog-actions button,
  .record-pagination button,
  .record-pagination label {
    width: 100%;
  }

  .record-pagination label {
    grid-template-columns: 1fr;
  }

  .date-range-inputs {
    grid-template-columns: 1fr;
  }

  .date-range-inputs em {
    display: none;
  }

  .order-analysis-badge {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  :root {
    --mobile-header-h: 68px;
    --mobile-nav-h: 76px;
  }

  body {
    min-height: 100dvh;
    overflow: hidden;
    background:
      radial-gradient(circle at 80% 4%, rgba(39, 122, 84, 0.07), transparent 18rem),
      var(--bg);
  }

  .app {
    display: block;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    height: calc(var(--mobile-header-h) + env(safe-area-inset-top));
    min-height: calc(var(--mobile-header-h) + env(safe-area-inset-top));
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    gap: 10px;
    overflow: visible;
    box-shadow: 0 8px 22px rgba(23, 31, 42, 0.14);
  }

  .brand {
    min-width: 0;
    justify-content: center;
    align-items: center;
    padding: 0;
  }

  .brand-logo {
    width: 86px;
    height: 48px;
    flex-basis: 86px;
  }

  .brand h1 {
    display: none;
  }

  .brand p {
    display: none;
  }

  .date-picker {
    display: none;
  }

  .mobile-date-toggle {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
    height: 44px;
    margin-top: 2px;
    padding: 0 12px;
    border: 1px solid rgba(151, 170, 188, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    color: #1f5f90;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
    box-shadow:
      0 8px 18px rgba(23, 31, 42, 0.045),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .mobile-date-toggle span {
    display: inline-flex;
    align-items: center;
    height: 100%;
    color: #6b7b8c;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
  }

  .mobile-date-toggle .el-date-editor.el-input {
    --el-date-editor-width: 145px;
    display: flex;
    align-items: center;
    flex: 0 0 145px;
    height: 100%;
  }

  .mobile-date-toggle .el-input__wrapper {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .mobile-date-toggle .el-input__inner {
    height: 100% !important;
    background: transparent !important;
    color: #17324d;
    font-size: 15px;
    font-weight: 850 !important;
    line-height: 44px !important;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  .mobile-date-toggle .el-input__prefix,
  .mobile-date-toggle .el-input__suffix {
    display: none !important;
  }

  .date-picker span {
    display: block;
    color: #667789;
    font-size: 12px;
    font-weight: 750;
  }

  .date-picker input {
    min-height: 40px;
    border-radius: 10px;
  }

  .date-picker .el-input__wrapper {
    height: 42px !important;
    min-height: 42px !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow:
      inset 0 0 0 1px rgba(151, 170, 188, 0.24),
      0 10px 24px rgba(23, 31, 42, 0.06) !important;
  }

  .date-picker .el-input__inner {
    color: var(--ink) !important;
    font-size: 16px !important;
    font-weight: 750 !important;
    letter-spacing: 0 !important;
  }

  .nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    overflow: hidden;
    padding: 6px;
    background: rgba(23, 33, 42, 0.96);
    border: 1px solid #334657;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(23, 31, 42, 0.22);
  }

  .nav .nav-item:not(.mobile-nav-main) {
    display: none !important;
  }

  .nav-group {
    display: contents;
  }

  .nav-group-header {
    display: none !important;
  }

  .nav-group-items {
    display: contents;
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
  }

  .settings-rail,
  .manager-list,
  .manager-edit-panel {
    padding: 12px;
  }

  .section-title.stacked,
  .manager-summary {
    align-items: stretch;
  }

  .section-title.stacked {
    flex-direction: column;
  }

  .manager-summary {
    grid-template-columns: 1fr;
  }

  .section-title.stacked .segmented-control,
  .settings-rail .segmented-control {
    width: 100%;
    grid-auto-flow: row;
  }

  .manager-summary .manager-status,
  .manager-summary .secondary,
  .manager-summary .danger {
    width: 100%;
  }

  .nav-item {
    min-height: 48px;
    padding: 6px 4px;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
    border-radius: 8px;
    box-shadow: none !important;
  }

  .nav-item.active {
    background: rgba(39, 122, 84, 0.25) !important;
    color: #4ec68a !important;
  }

  .nav-item-rich {
    padding: 6px 4px !important;
  }

  .nav-item-rich .nav-icon {
    margin-top: 0 !important;
  }

  .nav-item-meta {
    display: none !important; /* 移动端隐藏较长的详情描述，确保紧凑 */
  }

  .nav-item-label {
    font-size: 11px !important;
    font-weight: 500 !important;
  }

  .nav-icon {
    width: 18px !important;
    height: 18px !important;
  }

  .mobile-more-trigger {
    min-height: 48px;
    padding: 6px 4px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    color: #c9d3dc;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
    border-radius: 8px;
    white-space: nowrap;
  }

  .mobile-more-trigger.active {
    background: rgba(39, 122, 84, 0.25);
    color: #4ec68a;
  }

  .mobile-more-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 11;
    background: rgba(15, 23, 32, 0.28);
  }

  .mobile-more-sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    z-index: 12;
    display: grid;
    gap: 14px;
    max-height: min(64dvh, 520px);
    overflow-y: auto;
    padding: 10px 14px 16px;
    border: 1px solid rgba(224, 230, 236, 0.86);
    border-radius: 18px;
    background: rgba(253, 254, 254, 0.98);
    color: var(--ink);
    box-shadow: 0 18px 44px rgba(23, 31, 42, 0.24);
    transform: translateY(18px);
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms var(--ease), opacity 180ms ease;
  }

  .mobile-more-sheet.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-more-handle {
    justify-self: center;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #d6dde3;
  }

  .mobile-more-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 38px;
    margin-top: -6px;
  }

  .mobile-logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 96px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(180, 66, 66, 0.18);
    border-radius: 10px;
    background: rgba(247, 228, 225, 0.72);
    color: var(--red);
    font-size: 12px;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .mobile-logout-button:active {
    transform: translateY(1px);
    background: rgba(247, 228, 225, 0.96);
  }

  .mobile-more-group strong {
    display: block;
    font-size: 14px;
  }

  .mobile-more-group {
    display: grid;
    gap: 8px;
  }

  .mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .mobile-more-grid button {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--gray);
    color: #354455;
    font-size: 12px;
    font-weight: 700;
  }

  .action-confirm-backdrop {
    z-index: 30;
    background: rgba(20, 31, 42, 0.38);
  }

  .action-confirm-sheet {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: auto;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 16px;
    border-radius: 18px;
    transform: translateY(0);
    box-shadow: 0 18px 44px rgba(23, 31, 42, 0.26);
  }

  .action-confirm-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .action-confirm-copy h3 {
    font-size: 16px;
  }

  .action-confirm-actions {
    grid-template-columns: 1fr 1fr;
  }

  .action-confirm-actions button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    border-radius: 12px;
    font-weight: 700;
  }

  .reimbursement-detail-sheet {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: calc(88px + env(safe-area-inset-bottom));
    width: auto;
    max-height: calc(100dvh - 120px);
    padding: 16px;
    border-radius: 18px;
    transform: translateY(0);
  }

  .reimbursement-detail-totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reimbursement-detail-totals div {
    padding: 9px 8px;
  }

  .reimbursement-detail-totals strong {
    font-size: 14px;
  }

  .reimbursement-detail-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .reimbursement-detail-amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .hint {
    display: none;
  }

  .hint-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
  }

  .hint-header .chevron {
    display: block !important;
    transition: transform 220ms var(--ease);
    color: #8899a6;
  }

  .hint.open .hint-header .chevron {
    transform: rotate(180deg);
  }

  .hint-body {
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    transition: 
      max-height 280ms var(--ease),
      opacity 200ms ease;
  }

  .hint.open .hint-body {
    max-height: 800px !important;
    opacity: 1 !important;
    overflow: visible !important;
  }

  .hint pre {
    font-size: 16px;
    line-height: 1.48;
    margin: 8px 0 10px;
    padding: 10px;
  }

  .ghost,
  .primary,
  .secondary {
    min-height: 44px;
  }

  .main {
    height: calc(100dvh - var(--mobile-header-h) - env(safe-area-inset-top));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px calc(var(--mobile-nav-h) + 28px + env(safe-area-inset-bottom));
    gap: 16px;
  }

  .main:has(#all.panel.active),
  .main:has(#expense.panel.active),
  .main:has(#income.panel.active) {
    overflow: hidden;
    padding: 12px 12px calc(var(--mobile-nav-h) + 12px + env(safe-area-inset-bottom));
  }

  .main:has(#all.panel.active) .topbar,
  .main:has(#expense.panel.active) .topbar,
  .main:has(#income.panel.active) .topbar {
    display: none;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }

  .topbar-actions {
    align-items: start;
    gap: 8px;
  }

  .topbar h2 {
    font-size: 22px;
    text-wrap: balance;
  }

  .topbar p {
    max-width: 22rem;
    font-size: 13px;
    line-height: 1.45;
  }

  #refreshButton {
    min-width: 64px;
    padding: 0 12px;
  }

  .panel.active {
    gap: 14px;
  }

  #all.panel.active,
  #expense.panel.active,
  #income.panel.active {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  #expense.panel.active,
  #income.panel.active {
    position: relative;
  }

  #overview.panel.active {
    gap: 16px;
  }

  .loading-state,
  .daily-strip,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mobile-only {
    display: block;
  }

  .overview-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .overview-primary-metric {
    grid-column: 1 / -1;
    min-height: 116px;
    background:
      radial-gradient(circle at 92% 20%, rgba(39, 122, 84, 0.12), transparent 9rem),
      linear-gradient(135deg, rgba(226, 242, 234, 0.94), rgba(255, 255, 255, 0.98));
    border-color: rgba(39, 122, 84, 0.2);
  }

  .daily-strip div,
  .metric {
    border-radius: 12px;
    padding: 12px;
  }

  .metric {
    min-height: 102px;
  }

  .metric strong {
    font-size: clamp(24px, 8vw, 30px);
  }

  .overview-primary-metric strong {
    margin-top: 10px;
    font-size: clamp(32px, 10vw, 40px);
  }

  .metric small {
    display: block;
    margin-top: 8px;
  }

  .grid.two {
    gap: 14px;
  }

  .table-section,
  .entry-form,
  .record-list-section {
    border-radius: 12px;
  }

  #overview .table-section {
    border-color: rgba(224, 230, 236, 0.82);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 251, 0.96)),
      var(--panel);
    box-shadow: 0 10px 24px rgba(23, 31, 42, 0.055);
  }

  .entry-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 14px;
  }

  .dialog-form {
    max-height: calc(100dvh - 20px);
  }

  .expense-dialog-form,
  .income-dialog-form {
    max-height: calc(100dvh - 20px);
    padding: 0;
  }

  .expense-dialog-form .dialog-title,
  .income-dialog-form .dialog-title {
    padding: 16px 16px 12px;
  }

  .expense-dialog-form .dialog-stack,
  .income-dialog-form .dialog-stack {
    padding: 14px 16px 16px;
  }

  .expense-dialog-form .dialog-actions,
  .income-dialog-form .dialog-actions {
    padding: 12px 16px 14px;
  }

  .dialog-title {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-section {
    padding: 14px;
    border-radius: 12px;
  }

  .batch-editor-head,
  .income-batch-row,
  .income-channel-row,
  .balance-check-head,
  .balance-check-grid {
    grid-template-columns: 1fr;
  }

  .balance-check-breakdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-editor-head,
  .balance-check-head {
    display: grid;
  }

  .receipt-viewer {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 14px;
  }

  .receipt-viewer-shell {
    max-height: calc(100dvh - 20px);
    border-radius: 14px;
  }

  .receipt-viewer-topbar,
  .receipt-viewer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .receipt-viewer-actions a,
  .receipt-viewer-actions button {
    width: 100%;
  }

  .section-title {
    padding: 14px;
  }

  .overview-section-title {
    align-items: flex-start;
    gap: 12px;
  }

  .section-title h3 {
    font-size: 15px;
  }

  .overview-mini-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 12px 0;
  }

  .overview-mini-summary span {
    min-width: 0;
    border-radius: 10px;
    background: var(--gray);
    color: #425161;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    padding: 7px 4px;
    white-space: nowrap;
  }

  .table-wrap {
    max-height: none;
    overflow: visible;
  }

  .record-list-section {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  #all.panel.active .record-list-section,
  #expense.panel.active .record-list-section,
  #income.panel.active .record-list-section {
    height: 100%;
    overflow: hidden;
  }

  .main:has(.record-filters.mobile-filters-open),
  #all.panel.active:has(.record-filters.mobile-filters-open),
  #expense.panel.active:has(.record-filters.mobile-filters-open),
  #income.panel.active:has(.record-filters.mobile-filters-open),
  #all.panel.active .record-list-section:has(.record-filters.mobile-filters-open),
  #expense.panel.active .record-list-section:has(.record-filters.mobile-filters-open),
  #income.panel.active .record-list-section:has(.record-filters.mobile-filters-open),
  .record-list-section:has(.record-filters.mobile-filters-open) {
    overflow: visible;
  }

  .record-list-section .record-list-hero,
  .record-list-section .mobile-filter-toggle,
  .record-list-section .record-quick-filters,
  .record-list-section .mobile-pull-refresh,
  .record-list-section .record-summary,
  .record-list-section .record-inline-error {
    flex: 0 0 auto;
  }

  .record-list-section .table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .table-wrap table {
    display: none;
  }

  .mobile-card-list {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  .record-list-section .mobile-card-list {
    border-top: 1px solid var(--line);
  }

  .record-summary {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .record-summary div {
    min-height: auto;
    padding: 11px 12px;
  }

  .record-summary strong {
    font-size: 18px;
  }

  .mobile-filter-toggle {
    display: block;
    align-self: flex-end;
    width: fit-content;
    min-height: 32px;
    margin: 8px 10px 0 auto;
    padding: 0 14px;
    border: 1px solid rgba(39, 122, 84, 0.2);
    border-radius: 999px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 251, 0.92));
    color: #1f6846;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 5px 12px rgba(23, 31, 42, 0.055);
  }

  .mobile-filter-toggle::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border: 2px solid currentColor;
    border-top: 0;
    border-left: 0;
    transform: translateY(-1px) rotate(45deg);
    transition: transform 160ms var(--ease);
  }

  .mobile-filter-toggle.active {
    background: var(--green-soft);
    border-color: rgba(39, 122, 84, 0.34);
    box-shadow: inset 0 0 0 1px rgba(39, 122, 84, 0.08);
  }

  .mobile-filter-toggle.active::before {
    transform: translateY(2px) rotate(225deg);
  }

  .mobile-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 32, 0.34);
    backdrop-filter: blur(3px);
  }

  #expense.panel.active .record-actionbar,
  #income.panel.active .record-actionbar {
    position: fixed;
    right: 18px;
    bottom: calc(var(--mobile-nav-h) + 26px + env(safe-area-inset-bottom));
    z-index: 900;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
  }

  #expense.panel.active .record-actionbar div,
  #income.panel.active .record-actionbar div {
    display: none;
  }

  #expense.panel.active .record-actionbar button,
  #income.panel.active .record-actionbar button {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 58px !important;
    min-height: 58px !important;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 50%;
    background: #277a54;
    color: transparent;
    font-size: 0;
    box-shadow:
      0 16px 34px rgba(23, 31, 42, 0.26),
      inset 0 1px 0 rgba(255, 255, 255, 0.32);
    pointer-events: auto;
  }

  #expense.panel.active .record-actionbar button::before,
  #income.panel.active .record-actionbar button::before {
    content: "+";
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    font-weight: 500;
    transform: translateY(-2px);
  }

  .main:has(.record-filters.mobile-filters-open) #expense.panel.active .record-actionbar,
  .main:has(.record-filters.mobile-filters-open) #income.panel.active .record-actionbar {
    display: none;
  }

  .record-filters {
    position: fixed;
    top: auto;
    left: 10px;
    right: 10px;
    bottom: calc(var(--mobile-nav-h) + 14px + env(safe-area-inset-bottom));
    z-index: 1201;
    height: min(64dvh, calc(100dvh - var(--mobile-header-h) - var(--mobile-nav-h) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    max-height: none;
    padding: 16px 14px 0;
    border: 1px solid rgba(205, 216, 224, 0.9);
    border-radius: 18px;
    background: rgba(253, 254, 254, 0.98);
    box-shadow: 0 -18px 46px rgba(23, 31, 42, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(calc(100% + var(--mobile-nav-h) + 40px));
    transition: transform 220ms var(--ease), opacity 160ms ease, visibility 0s linear 220ms;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    pointer-events: none;
  }

  .record-filters.mobile-filters-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: transform 220ms var(--ease), opacity 160ms ease;
    pointer-events: auto;
  }

  .record-filters::before {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: rgba(144, 158, 170, 0.42);
  }

  .record-filters .record-filter-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .record-filters .record-advanced-filters {
    margin-top: 10px;
  }

  .record-filters .record-advanced-filters summary {
    min-height: 38px;
    padding: 0 2px;
    color: #273642;
    font-weight: 800;
  }

  .record-filters .record-filter-actions {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 14px -14px 0;
    padding: 12px 14px 14px;
    border-top: 1px solid rgba(224, 230, 236, 0.82);
    background: rgba(253, 254, 254, 0.98);
  }

  .record-list-section .record-pagination {
    display: none;
  }

  .mobile-pull-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    transition: height 180ms var(--ease), border-color 180ms var(--ease);
  }

  .mobile-pull-refresh.visible {
    height: 30px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(237, 241, 244, 0.58);
  }

  .mobile-pull-refresh.ready {
    color: #1f6846;
  }

  .mobile-loading-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(104, 116, 132, 0.22);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 760ms linear infinite;
  }

  .mobile-pull-refresh.loading .mobile-loading-spinner,
  .mobile-load-more.loading .mobile-loading-spinner {
    display: inline-block;
  }

  .mobile-load-more:not(.visible) {
    min-height: 1px;
    overflow: hidden;
  }

  .record-quick-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px 6px;
    margin-bottom: 0;
    overflow: visible;
  }

  .record-quick-filters button {
    min-width: 0;
    min-height: 31px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 11.5px;
    line-height: 1;
    white-space: nowrap;
  }

  .record-list-section > .record-quick-filters {
    flex: 0 0 auto;
  }

  .mobile-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-record-summary.record-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px;
  }

  .mobile-record-summary.record-summary div {
    min-height: 52px;
    padding: 8px 9px;
    border-radius: 10px;
  }

  .mobile-record-summary.record-summary span,
  .mobile-record-summary.record-summary small {
    font-size: 10.5px;
    line-height: 1.2;
  }

  .mobile-record-summary.record-summary strong {
    margin-top: 3px;
    font-size: 15px;
    line-height: 1.1;
    overflow-wrap: anywhere;
  }

  .mobile-record-card,
  .mobile-day-card {
    width: 100%;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    border-radius: 12px;
    padding: 12px;
    text-align: left;
  }

  .mobile-record-card {
    display: grid;
    gap: 10px;
  }

  .mobile-record-summary-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }

  .mobile-record-summary-row b {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 17px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .overview-record-card {
    padding: 0;
    overflow: hidden;
    background: #fff;
  }

  .overview-record-card.expanded {
    border-color: rgba(47, 111, 165, 0.22);
    box-shadow: 0 8px 18px rgba(23, 31, 42, 0.06);
  }

  .mobile-record-main {
    width: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px 8px;
    padding: 12px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    border-radius: 0;
  }

  .mobile-record-main strong {
    grid-column: 2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-record-main > span:not(.mobile-record-type) {
    grid-column: 2;
    margin-top: 0;
  }

  .mobile-record-main b {
    grid-column: 3;
    grid-row: 1 / span 2;
    justify-self: end;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 17px;
    white-space: nowrap;
  }

  .mobile-record-type {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 24px;
    margin-top: 0 !important;
    border-radius: 8px;
    background: var(--gray);
    color: #425161 !important;
    font-size: 12px !important;
    font-weight: 700;
  }

  .mobile-record-detail {
    display: grid;
    gap: 5px;
    padding: 0 12px 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
  }

  .overview-record-card .mobile-record-detail {
    padding-left: 58px;
  }

  .mobile-record-detail .receipt-thumbs {
    margin-top: 4px;
  }

  .mobile-record-card strong,
  .mobile-day-card strong {
    display: block;
    font-size: 16px;
  }

  .mobile-record-card span,
  .mobile-day-card small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    white-space: normal;
  }

  .mobile-record-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .overview-record-card .mobile-record-meta {
    padding: 0 12px 12px 58px;
  }

  .mobile-danger-action,
  .mobile-settle-action {
    width: 100%;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 700;
  }

  .mobile-danger-action {
    background: var(--red-soft);
    color: var(--red);
  }

  .mobile-settle-action {
    background: var(--green);
    color: #fff;
  }

  .mobile-record-meta .record-actions {
    width: 100%;
  }

  .mobile-record-meta b {
    margin-right: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 18px;
  }

  .mobile-record-meta .receipt-thumb.compact {
    margin-top: 8px;
  }

  .mobile-day-card {
    display: grid;
    gap: 5px;
    color: var(--ink);
  }

  .overview-day-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 251, 0.96));
  }

  .overview-day-card span,
  .overview-day-card small,
  .overview-day-card em {
    min-width: 0;
  }

  .overview-day-card strong {
    grid-column: 2;
    grid-row: 1 / span 3;
    justify-self: end;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    white-space: nowrap;
  }

  .overview-day-card em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
  }

  .overview-account-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(240, 246, 243, 0.76));
  }

  .overview-account-card span {
    color: var(--muted);
    font-size: 12px;
  }

  .overview-account-card strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-account-card em {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    color: var(--green);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 17px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
  }

  .mobile-account-card {
    display: grid;
    gap: 10px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
  }

  .mobile-account-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-account-card-head strong {
    min-width: 0;
    font-size: 15px;
  }

  .mobile-account-card-head b {
    color: var(--green);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 16px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .mobile-account-balance-grid {
    display: grid;
    gap: 8px;
  }

  .mobile-account-balance-grid div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .mobile-account-balance-grid span {
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
  }

  .mobile-account-balance-grid strong {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    line-height: 1.25;
    white-space: nowrap;
  }

  .mobile-account-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 2px;
  }

  .mobile-account-actions button {
    width: 100%;
    min-height: 40px;
    margin: 0;
  }

  .mobile-day-card span {
    color: var(--muted);
    font-size: 12px;
  }

  .mobile-expand-toggle {
    width: 100%;
    min-height: 44px;
    border: 1px dashed rgba(104, 116, 132, 0.36);
    border-radius: 12px;
    background: rgba(237, 241, 244, 0.72);
    color: #354455;
    font-weight: 700;
  }

  .mobile-reimburse-card {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 251, 0.94));
  }

  .mobile-reimburse-card .mobile-record-meta {
    align-items: stretch;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .entry-form {
    padding: 14px;
  }

  input,
  select,
  textarea {
    min-height: 46px;
    border-radius: 10px;
    font-size: 16px;
  }

  textarea {
    min-height: 110px;
  }

  .entry-form .primary {
    width: 100%;
    margin-top: 14px;
    border-radius: 10px;
  }

  .dialog-actions .primary,
  .dialog-actions .secondary {
    margin-top: 0;
  }

  .manager-list {
    padding: 12px;
  }

  .manager-row {
    border-radius: 12px;
  }

  .manager-actions .secondary,
  .manager-actions .danger {
    width: 100%;
    min-height: 44px;
    border-radius: 10px;
  }

  .toast {
    left: 14px;
    right: 14px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    text-align: center;
  }
}

.all-record-table {
  min-width: 1280px;
}

@media (min-width: 981px) {
  #allRecordSummary.record-summary {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }
}

/* 软删除划线样式 */
tr.deleted {
  text-decoration: line-through;
  color: var(--muted);
  opacity: 0.65;
}
tr.deleted td.number {
  color: var(--muted) !important;
}
.mobile-record-card.deleted {
  text-decoration: line-through;
  color: var(--muted);
  opacity: 0.65;
}
.mobile-record-card.deleted b {
  color: var(--muted) !important;
}

/* 悬浮即时显示提示气泡样式 */
.tooltip-trigger {
  position: relative;
  cursor: help;
  margin-left: 4px;
  color: var(--muted);
  font-size: 13px;
  display: inline-block;
}

.tooltip-trigger .tooltip-text {
  visibility: hidden;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translate(-50%, 0) scale(0.9);
  background-color: #1a242f;
  color: #ecf0f1;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: normal;
  line-height: 1.4;
  width: max-content;
  max-width: 220px;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid #3a5263;
  text-align: left;
}

.tooltip-trigger:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, -2px) scale(1);
}

/* ==========================================================================
   小票订单分析 Dashboard 专属样式
   ========================================================================== */

.ticket-import-panel {
  display: grid;
  gap: 18px;
}

.ticket-import-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

/* 拖拽上传区 */
.ticket-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 236px;
  padding: 24px;
  border: 1px dashed rgba(47, 111, 165, 0.36);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(247, 250, 252, 0.96), rgba(240, 247, 244, 0.66)),
    #fafbfc;
  cursor: pointer;
  transition: all 200ms var(--ease);
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.ticket-dropzone:hover {
  border-color: var(--blue);
  background-color: #f5f9fc;
}

.ticket-dropzone.dragover {
  border-color: var(--green);
  background-color: #f0f7f4;
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(39, 122, 84, 0.08);
}

.ticket-dropzone svg {
  margin-bottom: 12px;
  color: var(--blue);
  transition: transform 200ms var(--ease);
}

.ticket-dropzone:hover svg {
  transform: translateY(-2px);
}

.ticket-dropzone.dragover svg {
  color: var(--green);
}

.ticket-dropzone-dialog {
  min-height: 260px;
}

.ticket-dropzone-copy {
  display: grid;
  gap: 5px;
  max-width: 260px;
}

.ticket-dropzone-copy strong {
  color: var(--ink);
  font-size: 15px;
}

.ticket-dropzone p {
  font-size: 14px;
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.5;
}

.ticket-dropzone p strong {
  color: var(--blue);
}

.upload-status {
  display: inline-block;
  padding: 3px 8px;
  background: var(--gray);
  border-radius: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.upload-status.success {
  background: var(--green-soft);
  color: var(--green);
}

.upload-status.error {
  background: var(--red-soft);
  color: var(--red);
}

/* 检索区域 */
.ticket-filters .form-grid {
  background: transparent;
}

.ticket-filter-grid {
  padding: 4px 16px 16px;
}

.ticket-filters .date-quick-bar {
  padding: 14px 16px 10px;
}

.ticket-filter-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 0;
  padding: 0 16px 16px;
}

.ticket-filter-actions button {
  white-space: nowrap;
}

.wechat-ticket-sync-status {
  margin: -6px 16px 16px;
  padding: 8px 10px;
  border: 1px solid rgba(47, 111, 165, 0.16);
  border-radius: 8px;
  background: rgba(47, 111, 165, 0.06);
  color: var(--muted);
  font-size: 12px;
}

.ticket-upload-dialog {
  width: min(620px, calc(100vw - 28px));
}

.ticket-upload-form {
  gap: 16px;
}

.ticket-upload-progress {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(151, 170, 188, 0.24);
  border-radius: 10px;
  background: rgba(245, 247, 248, 0.78);
}

.ticket-upload-progress-head,
.ticket-upload-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ticket-upload-progress-head strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
}

.ticket-upload-progress-head span,
.ticket-upload-progress-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ticket-upload-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(151, 170, 188, 0.18);
}

.ticket-upload-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 180ms var(--ease), background 180ms var(--ease);
}

.ticket-upload-progress.is-done .ticket-upload-progress-track i {
  background: var(--green);
}

.ticket-upload-progress.is-error .ticket-upload-progress-track i {
  background: var(--red);
}

.ticket-ledger-section {
  margin-top: 2px;
}

.ticket-ledger-head {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.ticket-ledger-head p {
  margin-top: 4px;
}

.ticket-ledger-section table th {
  background: rgba(245, 247, 248, 0.92);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
}

.ticket-ledger-section table td {
  vertical-align: top;
}

.ticket-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(151, 170, 188, 0.18);
}

.ticket-pagination .btn-group {
  display: flex;
  gap: 8px;
}

/* 图表 Bento 布局 */
.chart-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
  min-width: 0;
}

.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.order-analysis-grid .chart-card {
  border-radius: 12px;
  border-color: rgba(151, 170, 188, 0.24);
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 12px 30px rgba(23, 31, 42, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  padding: 18px;
}

.order-analysis-grid .chart-header {
  display: grid;
  gap: 5px;
  margin-bottom: 14px;
  min-width: 0;
}

.order-analysis-grid .chart-header h4 {
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.order-analysis-grid .chart-header span {
  margin-top: 0;
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.order-analysis-grid .chart-stage {
  min-height: 280px;
  min-width: 0;
  border-radius: 10px;
  padding: 12px;
  background: rgba(245, 247, 248, 0.78);
  border: 1px solid rgba(151, 170, 188, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.order-analysis-grid .chart-stage canvas {
  position: relative;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
}

.order-analysis-grid--customer {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-card.wide {
  grid-column: span 2;
}

.chart-header {
  margin-bottom: 14px;
}

.chart-header h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.chart-header span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.chart-stage {
  position: relative;
  height: 250px;
  width: 100%;
  min-width: 0;
}

.chart-stage.small {
  height: 280px;
  max-width: none;
  margin: 0 auto;
}

.analysis-sort-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.analysis-sort-control select {
  min-width: 140px;
  min-height: 36px;
}

/* 图表响应式适配 */
@media (max-width: 1024px) {
  .ticket-import-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-bento-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-analysis-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .order-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-card.wide {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .ticket-import-panel {
    gap: 14px;
  }

  .ticket-dropzone {
    min-height: 176px;
    padding: 18px;
  }

  .ticket-filter-grid {
    padding: 4px 12px 12px;
  }

  .ticket-filters .date-quick-bar {
    padding: 12px 12px 8px;
  }

  .ticket-filter-actions {
    padding: 0 12px 14px;
  }

  .ticket-filter-actions button,
  .ticket-filter-actions .danger {
    width: 100%;
    margin-left: 0 !important;
  }

  .ticket-ledger-head {
    flex-direction: column;
    align-items: stretch;
  }

  .ticket-ledger-head .segmented-control {
    width: 100%;
  }

  .ticket-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .ticket-pagination .btn-group {
    width: 100%;
  }

  .ticket-pagination .btn-group button {
    flex: 1;
  }

  .order-analysis-surface {
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
  }

  .order-analysis-heading {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .order-analysis-heading h3 {
    font-size: 22px;
  }

  .order-analysis-heading p {
    font-size: 13px;
  }

  .order-analysis-badge {
    justify-self: start;
  }

  .order-analysis-filter-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px !important;
  }

  .analysis-filter-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .order-kpi-card {
    min-height: auto;
    padding: 14px;
  }

  .order-kpi-card strong {
    font-size: 26px;
  }

  .chart-bento-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 12px !important;
  }

  .order-kpi-grid,
  .order-analysis-grid--customer {
    grid-template-columns: minmax(0, 1fr);
  }

  .chart-card.wide {
    grid-column: span 1;
  }

  .order-analysis-grid .chart-card {
    padding: 14px;
  }

  .order-analysis-grid .chart-stage,
  .chart-stage.small {
    height: 310px;
    min-height: 310px;
    padding: 8px;
  }

  .chart-fallback-bars {
    inset: 8px;
  }

  .chart-fallback-row {
    grid-template-columns: minmax(56px, 0.9fr) minmax(54px, 1.4fr) minmax(44px, auto);
    gap: 6px;
    font-size: 10.5px;
  }

  .chart-fallback-row b {
    font-size: 10.5px;
  }

  .order-analysis-block .section-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: flex-start;
    gap: 8px;
  }

  .order-analysis-block .table-wrap {
    max-height: none !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .order-analysis-block table {
    min-width: 560px;
  }

  .order-analysis-block .date-quick-bar {
    padding: 12px !important;
    gap: 8px;
  }

  .order-analysis-block .date-quick-label {
    flex: 0 0 100%;
    margin-right: 0;
  }

  .order-analysis-block .date-quick-btn {
    flex: 1 1 calc(33.333% - 8px);
    min-height: 38px;
    padding: 6px 10px;
  }

  .analysis-sort-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .analysis-sort-control select {
    width: 100%;
    min-height: 42px;
  }
}

@media (max-width: 720px) {
  .order-analysis-block > .table-wrap {
    display: none;
  }

  .order-analysis-block .analysis-mobile-list {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid rgba(224, 230, 236, 0.78);
  }

  .analysis-mobile-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(151, 170, 188, 0.24);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 18px rgba(23, 31, 42, 0.045);
  }

  .analysis-mobile-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
  }

  .analysis-mobile-card-head strong {
    min-width: 0;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .analysis-mobile-card-head b {
    color: var(--green);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 15px;
    line-height: 1.3;
    text-align: right;
    white-space: nowrap;
  }

  .analysis-mobile-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
  }

  .analysis-mobile-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .analysis-mobile-metrics span {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(237, 241, 244, 0.72);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
  }

  .analysis-mobile-metrics strong {
    min-width: 0;
    color: var(--ink);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  .analysis-mobile-empty {
    display: grid;
    place-items: center;
    min-height: 72px;
    border: 1px dashed rgba(151, 170, 188, 0.42);
    border-radius: 12px;
    color: var(--muted);
    font-size: 13px;
  }
}

/* 多维高级联动筛选 Select 美化 */
.ticket-filters select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 42px;
  cursor: pointer;
  font-size: 13.5px;
  transition: all 160ms var(--ease);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23687484' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 32px;
}

.ticket-filters select:hover {
  border-color: var(--blue);
  background-color: #f7fafc;
}

.ticket-filters select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 122, 84, 0.12);
}

.ticket-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}

/* 快速日期选择栏 */
.date-quick-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  flex-wrap: wrap;
}

.date-quick-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  margin-right: 2px;
}

.date-quick-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: all 150ms var(--ease);
  white-space: nowrap;
  line-height: 1.5;
}

.date-quick-btn:hover {
  border-color: var(--green);
  color: var(--green);
  background: rgba(39, 122, 84, 0.06);
}

.date-quick-btn.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 6px rgba(39, 122, 84, 0.25);
}


/* ============================================================
   商品管理模块
   ============================================================ */

.product-panel-header {
  padding: 24px 24px 0;
}

.product-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  flex-wrap: wrap;
}

.product-search-wrap {
  flex: 0 0 220px;
}

.product-search-wrap input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 150ms;
}

.product-search-wrap input:focus {
  outline: none;
  border-color: var(--green);
}

.product-cat-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.product-cat-btn {
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition: all 150ms;
}

.product-cat-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.product-cat-btn.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 0 24px 32px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: all 180ms var(--ease);
}

.product-card:hover {
  border-color: var(--green);
  box-shadow: 0 4px 16px rgba(39, 122, 84, 0.10);
  transform: translateY(-2px);
}

.product-card.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(39, 122, 84, 0.18), 0 10px 24px rgba(39, 122, 84, 0.12);
}

.product-detail-shell {
  margin: 0 24px 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 18px 40px rgba(23, 31, 42, 0.06);
}

.product-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.product-detail-title {
  display: grid;
  gap: 8px;
}

.product-detail-title h4 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0;
}

.product-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.product-detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.product-detail-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.product-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.product-detail-stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(39, 122, 84, 0.03), rgba(39, 122, 84, 0));
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.product-detail-stat span {
  font-size: 12px;
  color: var(--muted);
}

.product-detail-stat strong {
  font-size: 20px;
  color: var(--ink);
}

.product-detail-block h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.detail-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 12px;
  color: var(--ink);
}

.variant-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.variant-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  background: #fff;
}

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

.variant-table th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(39, 122, 84, 0.04);
}

.variant-name {
  font-weight: 600;
  color: var(--ink);
}

.variant-empty {
  text-align: center;
  color: var(--muted);
  padding: 20px 12px;
}

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

.product-review-panel {
  padding: 16px 24px 32px;
}

.review-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(47, 111, 165, 0.03), rgba(255, 255, 255, 0.96));
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 24px rgba(23, 31, 42, 0.04);
}

.review-card-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.review-card strong {
  font-size: 16px;
  color: var(--ink);
}

.review-card .muted {
  font-size: 13px;
  line-height: 1.5;
}

.review-card-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.review-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.product-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.product-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

.product-status-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.product-status-badge.active {
  background: rgba(39, 122, 84, 0.12);
  color: var(--green);
}

.product-status-badge.inactive {
  background: rgba(200, 80, 80, 0.10);
  color: #c85050;
}

.product-card-cat {
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  display: inline-block;
  width: fit-content;
}

.product-card-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.5px;
}

.product-card-price span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.product-card-notes {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.product-modal-overlay[hidden] { display: none; }

.product-modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  animation: modalIn 180ms var(--ease);
  overflow: hidden;
}

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

.product-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.product-modal-header h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0; }

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms;
}

.modal-close:hover { background: var(--line); color: var(--ink); }

.product-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  background: var(--surface);
}

.pm-field { display: flex; flex-direction: column; gap: 6px; }

.pm-field label { font-size: 12px; font-weight: 600; color: var(--muted); }

.pm-field .req { color: #e05050; }

.pm-field input,
.pm-field select,
.pm-field textarea {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color 150ms;
  font-family: inherit;
}

.pm-field input:focus,
.pm-field select:focus,
.pm-field textarea:focus { outline: none; border-color: var(--green); }

.pm-field textarea { resize: vertical; min-height: 72px; }

.pm-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.product-modal-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

@media (max-width: 720px) {
  .product-modal-overlay {
    align-items: flex-start;
    padding: 12px;
  }

  .product-modal {
    max-height: calc(100vh - 24px);
  }

  .product-modal-header,
  .product-modal-body,
  .product-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .pm-field-row {
    grid-template-columns: 1fr;
  }

  .product-modal-footer {
    flex-wrap: wrap;
  }

  .product-modal-footer button {
    flex: 1 1 120px;
  }

  .product-panel-header,
  .product-toolbar,
  .product-grid,
  .product-review-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .product-detail-shell {
    margin: 0 16px 24px;
    padding: 14px;
  }

  .product-detail-title h4 {
    font-size: 18px;
  }

  .product-detail-actions {
    width: 100%;
  }

  .product-detail-actions button {
    flex: 1 1 160px;
  }

  .variant-table th,
  .variant-table td {
    padding: 8px 6px;
    font-size: 12px;
  }
}

/* 自定义 Element Plus 日期选择器在侧边栏的暗色样式 */
.date-picker .el-date-editor.el-input {
  --el-date-editor-width: 100%;
}
.date-picker .el-input__wrapper {
  background-color: #202d38 !important;
  box-shadow: 0 0 0 1px #334452 inset !important;
  border-radius: 8px !important;
  padding: 1px 11px !important;
  height: 40px !important;
}
.date-picker .el-input__inner {
  color: #fff !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 500 !important;
}
.date-picker .el-input__icon {
  color: #8a9ba8 !important;
}

/* ── Element Plus 日期选择器样式净化（防止全局 table/td 样式污染） ────────────────── */
.el-picker-panel * {
  box-sizing: border-box !important;
}
.el-picker-panel table {
  min-width: auto !important;
  width: 100% !important;
  border-collapse: separate !important;
}
.el-picker-panel th,
.el-picker-panel td {
  padding: 0 !important;
  border-bottom: none !important;
  text-align: center !important;
  vertical-align: middle !important;
  white-space: normal !important;
}
.el-picker-panel tbody tr:hover {
  background: transparent !important;
}
.el-date-table th {
  background: transparent !important;
  color: var(--el-text-color-regular) !important;
  font-weight: normal !important;
  position: static !important;
}
.el-date-table td {
  cursor: pointer !important;
}
.el-picker-panel button {
  min-height: auto !important;
  height: auto !important;
  background: transparent !important;
  padding: 0 !important;
}

/* ==========================================================================
   登录页面样式 (Login Card Style)
   ========================================================================== */
.login-wrapper {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  width: 100%;
  overflow: auto;
  background:
    radial-gradient(circle at 50% 110%, rgba(26, 160, 255, 0.64), transparent 34rem),
    radial-gradient(circle at 26% 88%, rgba(46, 128, 255, 0.26), transparent 26rem),
    linear-gradient(180deg, #eef8ff 0%, #f9fdff 48%, #dff4ff 100%);
  font-family: var(--font-sans);
  padding: 32px 20px;
  box-sizing: border-box;
}

.login-wrapper::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(125deg, transparent 0 47%, rgba(255, 255, 255, 0.42) 47% 58%, transparent 58%),
    linear-gradient(155deg, transparent 0 42%, rgba(129, 211, 255, 0.18) 42% 54%, transparent 54%);
  opacity: 0.9;
}

.login-shell {
  position: relative;
  width: min(100%, 420px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(53, 126, 196, 0.16);
}

.login-brand-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 118px;
  padding: 26px 28px;
  color: #182638;
  background:
    linear-gradient(156deg, rgba(245, 251, 255, 0.96), rgba(227, 246, 255, 0.78)),
    #f3fbff;
  overflow: hidden;
}

.login-brand-panel::after {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 46%;
  height: 100%;
  background: linear-gradient(150deg, rgba(88, 183, 255, 0.18), rgba(255, 255, 255, 0.36));
  clip-path: polygon(0 0, 100% 0, 100% 42%, 32% 100%);
}

.login-brand-mark {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 82px;
  height: 54px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.login-brand-mark img {
  width: 72px;
  height: 46px;
  object-fit: contain;
}

.login-brand-panel h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #172232;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}

.login-card {
  width: 100%;
  min-width: 0;
  background: #fff;
  padding: 34px 46px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.login-header {
  text-align: left;
}

.login-header h2 {
  color: #263445;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-group label {
  width: 1px;
  height: 1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 0;
  color: #1f2933;
  font-size: 15px;
  background: #f6f7f9;
  box-shadow: none;
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), background-color 180ms var(--ease);
}

.input-wrapper input::placeholder {
  color: #98a2b3;
}

.input-wrapper input:focus {
  outline: none;
  border-color: rgba(47, 111, 165, 0.22);
  box-shadow: 0 0 0 3px rgba(49, 119, 247, 0.12);
  background: #fff;
}

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fff2f0;
  border: 1px solid #f3c4bd;
  color: #9f2d20;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.login-error svg {
  flex: 0 0 auto;
  margin-top: 2px;
}

.login-submit-btn {
  min-height: 50px;
  margin-top: 4px;
  background: #3177f7;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  padding: 0 18px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: none;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background-color 180ms var(--ease);
}

.login-submit-btn:hover:not(:disabled) {
  background: #2467e3;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(49, 119, 247, 0.2);
}

.login-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-submit-btn:disabled {
  background: #9bbcf8;
  box-shadow: none;
  cursor: not-allowed;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .input-wrapper input,
  .login-submit-btn,
  .spinner {
    transition: none;
    animation: none;
  }
}

@media (max-width: 840px) {
  .login-wrapper {
    padding: 24px 18px;
  }

  .login-shell {
    width: min(100%, 390px);
  }

  .login-card {
    padding: 30px 34px 36px;
  }
}

@media (max-width: 520px) {
  .balance-check-breakdown {
    grid-template-columns: 1fr;
  }

  .login-wrapper {
    display: grid;
    align-items: start;
    padding: 28px 18px;
  }

  .login-shell {
    width: 100%;
    border-radius: 4px;
  }

  .login-brand-panel {
    min-height: 102px;
    padding: 22px 20px;
    gap: 10px;
  }

  .login-brand-mark {
    width: 68px;
    height: 46px;
    border-radius: 8px;
  }

  .login-brand-mark img {
    width: 60px;
    height: 38px;
  }

  .login-brand-panel h2 {
    font-size: 20px;
  }

  .login-card {
    padding: 28px 22px 32px;
    gap: 24px;
  }

  .login-form {
    gap: 16px;
  }

  .input-wrapper input,
  .login-submit-btn {
    min-height: 48px;
  }

  .login-submit-btn {
    margin-top: 2px;
  }
}

/* 全局初始化鉴权加载样式 */
.app-loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 86% 8%, rgba(39, 122, 84, 0.05), transparent 28rem),
              radial-gradient(circle at 34% 18%, rgba(47, 111, 165, 0.04), transparent 26rem),
              var(--bg, #f5f7f8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.app-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 0, 0, 0.05);
  border-top-color: #277a54; /* 泰对味的品牌墨绿色 */
  border-radius: 50%;
  animation: app-loading-spin 0.8s linear infinite;
}

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