:root {
  --navy: #173f63;
  --navy-2: #24577f;
  --teal: #0f766e;
  --gold: #b7791f;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --soft: #eef5fb;
  --input: #fff7d6;
  --grid: #d9e2ec;
  --text: #172033;
  --muted: #64748b;
  --good: #d9ead3;
  --warn: #fce4d6;
  --bad: #f4cccc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

.cdn-fallback {
  width: min(720px, calc(100% - 32px));
  margin: 36px auto;
  padding: 16px 18px;
  border: 1px solid var(--grid);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.cdn-fallback.is-error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

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

button:not(.el-button) {
  border: 0;
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  padding: 9px 14px;
}

button:not(.el-button):disabled,
.data-form input:disabled,
.data-form select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button.secondary:not(.el-button) {
  background: #e2e8f0;
  color: #0f172a;
}

button.danger:not(.el-button) {
  background: #b91c1c;
}

button.small:not(.el-button) {
  padding: 5px 8px;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(980px, 100%);
  background: var(--panel);
  border: 1px solid var(--grid);
  border-radius: 8px;
  padding: 28px;
}

.auth-title {
  border-bottom: 1px solid var(--grid);
  padding-bottom: 18px;
  margin-bottom: 18px;
}

.auth-title span,
.eyebrow {
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-card h1,
.topbar h1 {
  margin: 4px 0 0;
  font-size: 26px;
}

.auth-card p,
.topbar p,
.module-head p {
  color: var(--muted);
  margin: 8px 0 0;
}

.auth-grid,
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.app-shell {
  width: min(90vw, 1720px);
  margin: 0 auto;
  padding: 14px 0 24px;
}

.topbar {
  background: var(--panel);
  border: 1px solid var(--grid);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.top-actions,
.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.module-tabs {
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.module-menu {
  margin: 12px 0;
  border: 1px solid var(--grid);
  border-radius: 8px;
  overflow: hidden;
}

.module-tabs button,
.module-tabs a {
  text-align: left;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--grid);
  border-radius: 6px;
  padding: 13px 14px;
  text-decoration: none;
}

.module-tabs button span,
.module-tabs button small,
.module-tabs a span,
.module-tabs a small {
  display: block;
}

.module-tabs button span,
.module-tabs a span {
  font-weight: 700;
  font-size: 15px;
}

.module-tabs button small,
.module-tabs a small {
  color: var(--muted);
  margin-top: 4px;
}

.module-tabs button.active,
.module-tabs a.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.module-tabs button.active small,
.module-tabs a.active small {
  color: #dbeafe;
}

.module-page {
  display: none;
}

.module-page.active {
  display: block;
}

.module-head {
  background: var(--panel);
  border: 1px solid var(--grid);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.deposit-head {
  border-left-color: var(--gold);
}

.settings-head {
  border-left-color: var(--navy-2);
}

.module-head h2,
.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.module-head h2 {
  margin-bottom: 0;
}

.module-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--grid);
  border-radius: 8px;
  min-width: 0;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

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

.home-entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.home-entry-card {
  cursor: pointer;
}

.home-entry-card .el-card__body {
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-entry-card h3 {
  margin: 0;
  font-size: 18px;
}

.home-entry-card p {
  margin: 6px 0 10px;
  color: var(--muted);
}

.home-entry-card strong {
  font-size: 20px;
}

.home-entry-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef5fb;
  color: var(--navy);
}

.home-entry-card.deposit .home-entry-icon {
  background: #fff7ed;
  color: var(--gold);
}

.home-entry-icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.deposit-chart {
  display: grid;
  gap: 12px;
}

.deposit-chart svg {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--grid);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.chart-axis {
  stroke: #cbd5e1;
  stroke-width: 1.4;
}

.chart-guide {
  stroke: #e2e8f0;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: #fff;
  stroke: var(--gold);
  stroke-width: 2.4;
}

.chart-label {
  fill: var(--muted);
  font-size: 12px;
}

.chart-month-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.chart-month-item {
  border: 1px solid var(--grid);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
}

.chart-month-item span,
.chart-month-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.chart-month-item strong {
  display: block;
  margin: 4px 0;
  color: var(--text);
  font-size: 14px;
}

.kpi {
  background: var(--panel);
  border: 1px solid var(--grid);
  border-radius: 8px;
  padding: 12px;
}

.kpi.el-card {
  padding: 0;
}

.kpi .el-card__body {
  padding: 12px;
}

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

.kpi strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.data-form {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

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

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

.dialog-form .el-select,
.dialog-form .el-date-editor,
.dialog-form .el-input-number {
  width: 100%;
}

.el-dialog {
  --el-dialog-width: min(1040px, 96vw);
}

.el-dialog__body {
  overflow: visible;
}

.el-overlay-dialog {
  overflow: auto;
  padding: 24px 0;
}

.el-select__popper,
.el-popper {
  z-index: 3000 !important;
}

.el-select-dropdown {
  min-width: 180px;
}

.modal .data-form {
  display: grid;
  margin: 0;
  border: 0;
  padding: 0;
}

.data-form h2,
.data-form .wide,
.data-form .form-actions {
  grid-column: 1 / -1;
}

.data-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
}

.data-form input,
.data-form select,
.data-form textarea,
.pagination-actions select {
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 8px 9px;
  background: #fff;
  color: var(--text);
}

.data-form input:focus,
.data-form select:focus,
.data-form textarea:focus,
.pagination-actions select:focus {
  border-color: #409eff;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
  outline: none;
}

.data-form input,
.data-form select,
.data-form textarea {
  background: var(--input);
}

.data-form textarea {
  min-height: 140px;
  resize: vertical;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--grid);
  border-radius: 8px;
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.table-toolbar > input {
  width: min(320px, 100%);
  background: #fff;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table-wrap th,
.table-wrap td {
  border-bottom: 1px solid var(--grid);
  padding: 8px 9px;
  text-align: left;
  white-space: nowrap;
}

.table-wrap th {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}

.el-table thead,
.el-table th.el-table__cell {
  background: #eef5fb !important;
  color: var(--text) !important;
  font-weight: 700;
}

.table-wrap td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.trend-positive {
  color: #15803d;
  font-weight: 700;
}

.trend-negative {
  color: #dc2626;
  font-weight: 700;
}

.table-wrap tr:nth-child(even) td {
  background: #f8fafc;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--grid);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #fff;
  color: var(--muted);
  padding: 10px 12px;
}

.data-table-vue .pagination-bar {
  border-top: 1px solid var(--grid);
  margin-top: 8px;
}

.data-table-vue {
  min-width: 0;
}

.data-table-vue .el-table {
  --el-table-header-bg-color: #eef5fb;
  --el-table-row-hover-bg-color: #f8fafc;
}

.data-table-vue .el-table .cell {
  line-height: 1.35;
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-actions select {
  padding: 5px 8px;
}

[aria-busy="true"] {
  position: relative;
}

.status-good {
  background: var(--good);
  color: #166534;
  font-weight: 700;
}

.status-warn {
  background: var(--warn);
  color: #9a3412;
  font-weight: 700;
}

.status-bad {
  background: var(--bad);
  color: #991b1b;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.snapshot-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.snapshot-panel .snapshot-actions {
  margin-bottom: 18px;
}

.subsection-title {
  border-top: 1px solid var(--grid);
  padding-top: 14px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.46);
  padding: 18px;
}

.modal-card {
  width: min(980px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--grid);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.32);
  padding: 16px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--grid);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.settlement-renew.is-hidden,
.settlement-withdraw.is-hidden {
  display: none;
}

.snapshot-actions h2 {
  grid-column: 1 / -1;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #0f172a;
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  z-index: 10;
}

@media (max-width: 1100px) {
  .app-shell {
    width: 100%;
  }

  .grid-2,
  .home-entry-grid,
  .chart-month-list,
  .kpi-grid,
  .data-form,
  .dialog-form,
  .module-tabs,
  .snapshot-actions {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .module-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .module-actions {
    justify-content: flex-start;
  }

  .pagination-bar,
  .pagination-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
