:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #edf2f8;
  --text: #142033;
  --muted: #66758a;
  --faint: #8d9aad;
  --line: #dfe6ef;
  --brand: #195fbd;
  --brand-strong: #124a98;
  --brand-soft: #eaf3ff;
  --cyan: #1b8fa8;
  --green: #16855b;
  --green-soft: #e7f8f0;
  --red: #c13a4b;
  --red-soft: #fff0f2;
  --amber: #b56a08;
  --amber-soft: #fff6e6;
  --violet: #7553c7;
  --violet-soft: #f1edff;
  --shadow-sm: 0 1px 2px rgba(27, 39, 59, .05);
  --shadow: 0 14px 40px rgba(32, 53, 84, .08);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --sidebar: 248px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09111e;
  --surface: #101b2b;
  --surface-2: #142236;
  --surface-3: #1a2a40;
  --text: #e9f0fa;
  --muted: #9aabc0;
  --faint: #71849c;
  --line: #25364c;
  --brand: #69a8ff;
  --brand-strong: #92c0ff;
  --brand-soft: #132d50;
  --cyan: #5cc4d4;
  --green: #52c693;
  --green-soft: #12372b;
  --red: #ff7c88;
  --red-soft: #411d26;
  --amber: #f5b958;
  --amber-soft: #402f15;
  --violet: #b49aff;
  --violet-soft: #2d2450;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2);
  --shadow: 0 18px 45px rgba(0, 0, 0, .24);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--brand) 7%, transparent), transparent 30rem),
    var(--bg);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: .7rem 1rem;
  color: #fff;
  background: var(--brand-strong);
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 1.35rem 1rem;
  display: flex;
  flex-direction: column;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .55rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #2879d8, #17488d);
  box-shadow: 0 7px 18px rgba(24, 89, 174, .26);
  font-size: 1.08rem;
  font-weight: 800;
}

.brand-mark.large {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 15px;
  font-size: 1.35rem;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: -.02em;
  font-size: 1rem;
}

.brand small {
  margin-top: .18rem;
  color: var(--muted);
  font-size: .72rem;
}

.nav-list {
  display: grid;
  gap: .3rem;
  margin-top: 2rem;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: .72rem;
  padding: .78rem .86rem;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  font-size: .91rem;
  font-weight: 600;
  transition: .18s ease;
}

.nav-list a span {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  color: var(--faint);
  font-size: 1.15rem;
}

.nav-list a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-list a.active {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 14%, transparent);
}

.nav-list a.active span {
  color: var(--brand);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: .5rem;
}

.sidebar-footer p {
  margin: .65rem .45rem 0;
  color: var(--faint);
  font-size: .7rem;
}

.theme-button,
.logout-button,
.icon-button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.theme-button,
.logout-button {
  padding: .68rem .75rem;
  text-align: left;
  color: var(--muted);
  background: transparent;
}

.theme-button {
  display: flex;
  gap: .6rem;
}

.theme-button:hover,
.logout-button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.mobile-header,
.mobile-nav {
  display: none;
}

.main-shell {
  width: min(1500px, calc(100% - var(--sidebar)));
  margin-left: var(--sidebar);
  padding: 2.35rem clamp(1.4rem, 3vw, 3.4rem) 4rem;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.45rem;
}

.page-header h1 {
  margin: .18rem 0 .35rem;
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -.045em;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.page-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: .66rem 1rem;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  font-size: .84rem;
  transition: .18s ease;
}

.primary-button {
  color: #fff;
  background: linear-gradient(140deg, #226ec8, #174f9b);
  box-shadow: 0 7px 18px rgba(24, 88, 174, .18);
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.secondary-button {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

.secondary-button:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  color: var(--brand);
}

.full {
  width: 100%;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.asset-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  gap: 2rem;
  padding: clamp(1.4rem, 3vw, 2.25rem);
  color: #eef6ff;
  background:
    radial-gradient(circle at 90% 15%, rgba(72, 176, 255, .28), transparent 28rem),
    linear-gradient(135deg, #0e2a50, #113d70 58%, #175990);
  border: 1px solid rgba(121, 181, 242, .2);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(17, 55, 98, .2);
}

.section-label {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #b7cbe2;
  font-size: .8rem;
  font-weight: 700;
}

.source-badge,
.split-badge,
.report-kind {
  display: inline-flex;
  align-items: center;
  width: max-content;
  padding: .24rem .5rem;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 800;
}

.asset-hero .source-badge {
  color: #cce6ff;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .13);
}

.hero-amount {
  margin: .65rem 0 .35rem;
  line-height: 1.15;
}

.hero-amount strong,
.hero-amount span {
  display: block;
}

.hero-amount strong {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -.05em;
}

.hero-amount span {
  margin-top: .45rem;
  color: #b9cce1;
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.hero-note {
  margin: 0;
  max-width: 36rem;
  color: #b9cce1;
  font-size: .77rem;
  line-height: 1.65;
}

.asset-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
}

.asset-mini-grid article {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 6.6rem;
  padding: 1rem;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 14px;
}

.asset-mini-grid article:last-child:nth-child(3) {
  grid-column: 1 / -1;
}

.asset-mini-grid span,
.asset-mini-grid small {
  color: #b9cce1;
  font-size: .68rem;
}

.asset-mini-grid strong {
  margin: .35rem 0;
  font-size: clamp(.92rem, 1.5vw, 1.15rem);
  line-height: 1.35;
}

.snapshot-note {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  color: color-mix(in srgb, var(--brand) 82%, var(--text));
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
  border-radius: 14px;
}

.snapshot-icon {
  display: inline-grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  color: #fff;
  background: var(--brand);
  border-radius: 50%;
  font-weight: 800;
  font-size: .78rem;
}

.snapshot-note strong {
  font-size: .84rem;
}

.snapshot-note p {
  margin: .25rem 0 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.6;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--brand);
}

.kpi-card.income::before { background: var(--cyan); }
.kpi-card.expense::before { background: var(--amber); }
.kpi-card.positive::before { background: var(--green); }
.kpi-card.negative::before { background: var(--red); }
.kpi-card.snapshot-kpi::before { background: var(--brand); }
.kpi-card.personal::before { background: var(--violet); }

.kpi-card > span {
  display: block;
  color: var(--muted);
  font-size: .74rem;
}

.kpi-card strong {
  display: block;
  overflow-wrap: anywhere;
  margin: .55rem 0 .42rem;
  font-size: clamp(.95rem, 1.35vw, 1.2rem);
  letter-spacing: -.025em;
}

.kpi-card small {
  display: block;
  color: var(--faint);
  font-size: .65rem;
  line-height: 1.45;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 1rem;
  margin: 1rem 0;
}

.dashboard-grid.structures {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.2rem .4rem;
}

.panel-header h2 {
  margin: .2rem 0 0;
  font-size: 1rem;
}

.legend {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--muted);
  font-size: .68rem;
}

.legend i {
  width: .55rem;
  height: .55rem;
  background: var(--brand);
  border-radius: 50%;
}

.chart-wrap {
  padding: .2rem 1rem .65rem;
}

.line-chart,
.bar-chart {
  display: block;
  width: 100%;
  height: 245px;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--line);
  stroke-width: .35;
  stroke-dasharray: 2 3;
}

.chart-line {
  stroke: var(--brand);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.chart-dot {
  fill: var(--brand);
  stroke: var(--surface);
  stroke-width: .8;
}

.chart-dot.partial {
  fill: var(--surface);
  stroke: var(--brand);
  stroke-width: 1.1;
}

.chart-label {
  fill: var(--faint);
  font-size: 3.7px;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

.chart-axis {
  stroke: var(--line);
  stroke-width: .55;
}

.profit-bar.gain {
  fill: var(--green);
}

.profit-bar.loss {
  fill: var(--red);
}

.profit-bar.partial {
  fill: var(--brand);
  opacity: .45;
  stroke: currentColor;
  stroke-dasharray: 1 1;
}

.chart-footnote {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 0 1.2rem 1rem;
  color: var(--faint);
  font-size: .65rem;
}

.dot-partial {
  width: .55rem;
  height: .55rem;
  border: 2px solid var(--brand);
  border-radius: 50%;
}

.structure-list {
  display: grid;
  gap: 1rem;
  padding: .9rem 1.2rem 1.3rem;
}

.structure-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .38rem .7rem;
  align-items: center;
}

.structure-item > div {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.structure-item strong {
  font-size: .8rem;
}

.structure-item span,
.structure-item small {
  color: var(--muted);
  font-size: .68rem;
}

.structure-item progress {
  width: 100%;
  height: .42rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
}

progress::-webkit-progress-bar {
  background: var(--surface-3);
  border-radius: 999px;
}

.income-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--cyan), var(--brand));
  border-radius: 999px;
}

.expense-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--amber), #e6962c);
  border-radius: 999px;
}

.income-progress::-moz-progress-bar {
  background: var(--cyan);
}

.expense-progress::-moz-progress-bar {
  background: var(--amber);
}

.text-link,
.row-link,
.back-link {
  color: var(--brand);
  font-size: .74rem;
  font-weight: 700;
}

.back-link {
  display: inline-block;
  margin-bottom: .65rem;
}

.action-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.action-strip > div {
  display: flex;
  align-items: center;
  gap: .8rem;
}

.action-count {
  display: inline-grid;
  place-items: center;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0 .55rem;
  color: var(--amber);
  background: var(--amber-soft);
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 800;
}

.action-strip strong {
  font-size: .82rem;
}

.action-strip p {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .68rem;
}

.empty-state {
  margin: 1rem 0;
  color: var(--muted);
  text-align: center;
  font-size: .8rem;
}

/* 流水与筛选 */
.filter-panel {
  margin-bottom: 1rem;
  padding: 1rem;
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(5, minmax(125px, .7fr)) auto;
  gap: .75rem;
  align-items: end;
}

.filter-form label {
  display: grid;
  gap: .35rem;
}

.filter-form label > span,
.login-form label > span {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 2.55rem;
  padding: .6rem .7rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}

.filter-actions {
  display: flex;
  gap: .4rem;
}

.table-panel {
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
}

th,
td {
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  background: var(--surface-2);
  font-size: .66rem;
  letter-spacing: .03em;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: color-mix(in srgb, var(--brand-soft) 35%, transparent);
}

.number {
  text-align: right;
}

.amount {
  font-weight: 800;
  white-space: nowrap;
}

.amount.gain {
  color: var(--green);
}

.amount.loss {
  color: var(--red);
}

.cell-main {
  font-weight: 700;
}

.cell-sub {
  margin-top: .25rem;
  color: var(--muted);
  font-size: .68rem;
}

.split-badge {
  margin-left: .35rem;
  color: var(--violet);
  background: var(--violet-soft);
}

.status {
  display: inline-flex;
  padding: .28rem .52rem;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: .65rem;
  font-weight: 800;
  white-space: nowrap;
}

.status.pending {
  color: var(--amber);
  background: var(--amber-soft);
}

.status.large,
.report-kind.large {
  padding: .42rem .72rem;
  font-size: .74rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.15rem 0;
  color: var(--muted);
  font-size: .76rem;
}

.pagination a {
  padding: .48rem .75rem;
  color: var(--brand);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-weight: 700;
}

/* 流水详情 */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr);
  gap: 1rem;
}

.detail-amount-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 14rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.detail-amount-card.income {
  color: var(--green);
  background: var(--green-soft);
}

.detail-amount-card.expense {
  color: var(--red);
  background: var(--red-soft);
}

.detail-amount-card > span {
  font-size: .76rem;
  font-weight: 700;
}

.detail-amount-card strong {
  margin: .65rem 0;
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  letter-spacing: -.04em;
}

.detail-amount-card small {
  color: var(--muted);
  font-size: .66rem;
}

.detail-list {
  padding: .55rem 1.2rem;
}

.detail-list dl {
  margin: 0;
}

.detail-list dl > div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem;
  padding: .78rem 0;
  border-bottom: 1px solid var(--line);
}

.detail-list dl > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: .72rem;
}

.detail-list dd {
  margin: 0;
  font-size: .78rem;
  font-weight: 700;
}

.address,
code {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.split-panel {
  margin-top: 1rem;
  overflow: hidden;
}

.split-panel .source-badge {
  color: var(--violet);
  background: var(--violet-soft);
}

.split-list {
  padding: .5rem 1.2rem;
}

.split-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
}

.split-list article:last-child {
  border-bottom: 0;
}

.split-index {
  display: inline-grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  color: var(--violet);
  background: var(--violet-soft);
  border-radius: 8px;
  font-size: .7rem;
  font-weight: 800;
}

.split-list strong,
.split-list p {
  display: block;
  margin: 0;
}

.split-list strong {
  font-size: .78rem;
}

.split-list p {
  margin-top: .2rem;
  color: var(--muted);
  font-size: .67rem;
}

.split-amount {
  font-size: .78rem;
  font-weight: 800;
}

.split-panel footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.2rem;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  font-size: .78rem;
}

.hash-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  font-size: .7rem;
}

.hash-panel > span {
  color: var(--muted);
}

.hash-panel code {
  padding: .42rem .55rem;
  background: var(--surface-2);
  border-radius: 7px;
}

/* 待处理 */
.pending-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.pending-card {
  display: block;
  min-width: 0;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: .18s ease;
}

.pending-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  box-shadow: var(--shadow);
}

.pending-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
}

.pending-top time {
  color: var(--faint);
  font-size: .65rem;
}

.pending-card h2 {
  overflow: hidden;
  margin: .9rem 0 .35rem;
  font-size: .9rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pending-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .7rem;
}

.pending-card > strong {
  display: block;
  font-size: .95rem;
}

.pending-card > .split-badge {
  margin: .7rem 0 0;
}

.empty-panel {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  text-align: center;
}

.empty-panel h2 {
  margin: .8rem 0 .3rem;
  font-size: 1rem;
}

.empty-panel p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
}

.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 50%;
  font-weight: 800;
}

/* 月度报告 */
.report-principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.report-principles article {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.principle-icon {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  border-radius: 11px;
  font-weight: 800;
}

.principle-icon.snapshot {
  color: var(--brand);
  background: var(--brand-soft);
}

.principle-icon.final {
  color: var(--green);
  background: var(--green-soft);
}

.report-principles strong {
  font-size: .8rem;
}

.report-principles p {
  margin: .28rem 0 0;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.55;
}

.reports-list {
  display: grid;
  gap: .65rem;
}

.report-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  transition: .18s ease;
}

.report-row:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  transform: translateX(2px);
}

.report-date {
  display: grid;
  place-items: center;
  width: 3.4rem;
  padding: .5rem;
  background: var(--surface-2);
  border-radius: 11px;
}

.report-date strong {
  font-size: 1rem;
}

.report-date span {
  color: var(--muted);
  font-size: .62rem;
}

.report-main > div {
  display: flex;
  align-items: center;
  gap: .55rem;
}

.report-main h2 {
  margin: 0;
  font-size: .88rem;
}

.report-main p {
  margin: .35rem 0 0;
  color: var(--muted);
  font-size: .69rem;
}

.report-kind.snapshot {
  color: var(--brand);
  background: var(--brand-soft);
}

.report-kind.final {
  color: var(--green);
  background: var(--green-soft);
}

.report-arrow {
  color: var(--faint);
  font-size: 1.2rem;
}

.report-asset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  align-items: center;
  padding: 1.25rem;
}

.report-asset > div:first-child > span,
.report-asset > div:first-child > small {
  display: block;
  color: var(--muted);
  font-size: .7rem;
}

.report-asset > div:first-child > strong {
  display: block;
  margin: .45rem 0;
  font-size: clamp(1.25rem, 2.3vw, 1.85rem);
}

.report-asset-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}

.report-asset-breakdown p {
  margin: 0;
  padding: .8rem;
  background: var(--surface-2);
  border-radius: 11px;
}

.report-asset-breakdown span,
.report-asset-breakdown strong {
  display: block;
}

.report-asset-breakdown span {
  color: var(--muted);
  font-size: .66rem;
}

.report-asset-breakdown strong {
  margin-top: .35rem;
  font-size: .78rem;
}

/* 登录、错误与消息 */
.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1.2rem;
  background:
    radial-gradient(circle at 25% 15%, rgba(39, 116, 207, .18), transparent 28rem),
    radial-gradient(circle at 85% 85%, rgba(17, 148, 153, .12), transparent 26rem);
}

.login-card {
  width: min(100%, 430px);
  padding: clamp(1.35rem, 5vw, 2rem);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.login-brand h1 {
  margin: .2rem 0 0;
  font-size: 1.4rem;
  letter-spacing: -.035em;
}

.login-intro {
  margin: 1.2rem 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.65;
}

.login-form {
  display: grid;
  gap: .9rem;
}

.login-form label {
  display: grid;
  gap: .38rem;
}

.security-note {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  margin-top: 1.1rem;
  padding: .75rem;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 11px;
}

.security-note span {
  font-weight: 800;
}

.security-note p {
  margin: 0;
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.5;
}

.flash-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 60;
  width: min(90vw, 390px);
}

.flash {
  padding: .8rem 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: .78rem;
}

.flash.error {
  color: var(--red);
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 25%, var(--line));
}

.error-card {
  width: min(100%, 430px);
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.error-card > span {
  color: var(--brand);
  font-size: 3rem;
  font-weight: 900;
}

.error-card h1 {
  margin: .35rem 0;
}

.error-card p {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: .8rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1250px) {
  .asset-hero {
    grid-template-columns: 1fr;
  }

  .filter-form {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .search-field {
    grid-column: span 2;
  }

  .filter-actions {
    justify-content: flex-end;
  }

  .pending-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  :root {
    --sidebar: 210px;
  }

  .asset-hero {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .sidebar {
    display: none;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4rem;
    padding: .65rem 1rem;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(18px);
  }

  .brand.compact {
    padding: 0;
  }

  .brand.compact .brand-mark {
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    font-size: .85rem;
  }

  .brand.compact strong {
    font-size: .88rem;
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
  }

  .mobile-header-actions form {
    margin: 0;
  }

  .icon-button {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line);
  }

  .mobile-logout {
    width: auto;
    padding: 0 .65rem;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
  }

  .main-shell {
    width: 100%;
    margin: 0;
    padding: 1.15rem 1rem calc(5.5rem + env(safe-area-inset-bottom));
  }

  .mobile-nav {
    position: fixed;
    inset: auto .65rem calc(.6rem + env(safe-area-inset-bottom)) .65rem;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: .42rem;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid var(--line);
    border-radius: 17px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }

  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .4rem .15rem;
    color: var(--muted);
    border-radius: 11px;
    font-size: .6rem;
    font-weight: 700;
  }

  .mobile-nav a span {
    font-size: 1rem;
  }

  .mobile-nav a.active {
    color: var(--brand);
    background: var(--brand-soft);
  }

  .page-header {
    align-items: flex-start;
    margin-bottom: 1rem;
  }

  .page-header > .secondary-button,
  .page-header > .status,
  .page-header > .report-kind {
    flex: 0 0 auto;
  }

  .page-header h1 {
    font-size: 1.6rem;
  }

  .page-subtitle {
    font-size: .72rem;
    line-height: 1.5;
  }

  .asset-hero {
    gap: 1.25rem;
    padding: 1.2rem;
    border-radius: 20px;
  }

  .hero-amount {
    margin-top: .55rem;
  }

  .hero-amount strong {
    font-size: clamp(1.8rem, 8vw, 2.45rem);
  }

  .asset-mini-grid {
    gap: .55rem;
  }

  .asset-mini-grid article {
    min-height: 5.7rem;
    padding: .8rem;
  }

  .kpi-grid {
    gap: .65rem;
  }

  .kpi-card {
    padding: .95rem;
    border-radius: 15px;
  }

  .kpi-card strong {
    font-size: .9rem;
    line-height: 1.45;
  }

  .dashboard-grid.structures,
  .report-principles,
  .report-asset,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .line-chart,
  .bar-chart {
    height: 205px;
  }

  .filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .filter-actions {
    grid-column: 1 / -1;
  }

  .filter-actions > * {
    flex: 1;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tbody {
    padding: .35rem .8rem;
  }

  tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  td {
    padding: 0;
    border: 0;
  }

  td:nth-child(1),
  td:nth-child(3),
  td:nth-child(4) {
    color: var(--muted);
    font-size: .65rem;
  }

  td:nth-child(2) {
    grid-column: 1;
  }

  td:nth-child(3) {
    display: none;
  }

  td:nth-child(4) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  td:nth-child(5) {
    grid-column: 2;
    grid-row: 2 / 4;
    align-self: center;
    font-size: .76rem;
  }

  td:nth-child(6) {
    grid-column: 1 / -1;
  }

  .pending-grid {
    grid-template-columns: 1fr;
  }

  .detail-amount-card {
    min-height: 10rem;
  }

  .detail-list dl > div {
    grid-template-columns: 7rem minmax(0, 1fr);
  }

  .split-list article {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .split-amount {
    grid-column: 2;
  }

  .hash-panel {
    grid-template-columns: 1fr;
  }

  .report-main > div {
    align-items: flex-start;
    flex-direction: column;
    gap: .25rem;
  }

  .report-main p {
    line-height: 1.5;
  }

  .report-asset-breakdown {
    grid-template-columns: 1fr;
  }

  .action-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .action-strip .primary-button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .page-header > .secondary-button {
    display: none;
  }

  .asset-mini-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .asset-mini-grid article:last-child:nth-child(3) {
    grid-column: auto;
  }

  .kpi-card small {
    font-size: .62rem;
  }

  .report-row {
    gap: .7rem;
    padding: .8rem;
  }

  .report-date {
    width: 3rem;
  }

  .report-main p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .detail-list dl > div {
    grid-template-columns: 1fr;
    gap: .3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
