@import url("./cir.css");

:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --border: #e4e9f2;
  --text: #141824;
  --muted: #6b7280;
  --muted-2: #9aa3b2;
  --primary: #2e7def;
  --primary-hover: #1f6fe0;
  --success: #2bc48a;
  --danger: #ef5b5b;
  --warning: #ff7a3d;
  --cir-blue: #2e7def;
  --cir-orange: #ff7a3d;
  --cir-green: #2bc48a;
  --cir-purple: #8b5cf6;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 36, 0.06);
  --shadow: 0 8px 24px rgba(20, 24, 36, 0.08);
  font-family: "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.main-nav {
  display: flex;
  align-items: center;
  flex: 1;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(46, 125, 239, 0.15);
}

.topbar-meta { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.muted { color: var(--muted); font-size: 13px; }

.load-banner {
  max-width: 1180px;
  margin: 12px auto 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(239, 91, 91, 0.08);
  color: var(--danger);
  border: 1px solid rgba(239, 91, 91, 0.2);
  font-size: 14px;
}
.load-banner.hidden { display: none; }
.load-banner.ok {
  background: rgba(43, 196, 138, 0.08);
  color: var(--success);
  border-color: rgba(43, 196, 138, 0.2);
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-on { background: rgba(43, 196, 138, 0.12); color: var(--success); }
.badge-off { background: rgba(239, 91, 91, 0.1); color: var(--danger); }
.badge-warn { background: rgba(255, 122, 61, 0.12); color: var(--warning); }

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-wide { grid-column: 1 / -1; }
.card h2 { margin: 0 0 16px; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-header h2 { margin: 0; }

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 220px;
  justify-content: center;
}
#qr-image {
  width: 200px; height: 200px;
  background: #fff;
  border-radius: 12px;
  object-fit: contain;
  display: none;
  border: 1px solid var(--border);
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.form input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}
.form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 125, 239, 0.12);
}

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.row-wrap { margin-top: 0; }

.btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn.primary:hover { background: var(--primary-hover); color: #fff; }
.btn.danger {
  background: rgba(239, 91, 91, 0.08);
  border-color: rgba(239, 91, 91, 0.25);
  color: var(--danger);
}
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.info-list { margin: 0; }
.info-list div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.info-list dt { color: var(--muted); margin: 0; font-weight: 500; }
.info-list dd { margin: 0; word-break: break-all; }
.error-text { color: var(--danger); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.filters-title { font-size: 13px; color: var(--muted); margin-right: 4px; font-weight: 500; }
.filters label { font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }

.output {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  min-height: 200px;
  max-height: 480px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.message { font-size: 13px; margin-top: 8px; min-height: 20px; }
.message.error { color: var(--danger); }
.message.ok { color: var(--success); }

.subheading {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

#xianyu-qr-render {
  width: 160px;
  height: 160px;
  background: #fff;
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
}
#xianyu-qr-render img,
#xianyu-qr-render canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.info-list.compact { margin-top: 12px; font-size: 13px; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

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

.data-table th,
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table .center { text-align: center; }
.data-table .title,
.data-table .col-title { max-width: 220px; word-break: break-word; }

.cell-clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  line-height: 1.45;
}

.data-table .col-order.mono,
.data-table .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.data-table--xianyu .col-title {
  max-width: 280px;
}

.data-table--xianyu .col-memo {
  min-width: 120px;
  max-width: 240px;
  font-weight: 500;
  color: var(--warning);
}

.data-table--xianyu .col-amount {
  min-width: 64px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.fulfill-result { margin-top: 16px; }

.flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

.flow-steps li {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-2);
}

.flow-steps li.done {
  border-color: rgba(43, 196, 138, 0.35);
  color: var(--success);
  background: rgba(43, 196, 138, 0.08);
}

.flow-steps li.active {
  border-color: rgba(46, 125, 239, 0.35);
  color: var(--primary);
  background: rgba(46, 125, 239, 0.08);
}

.flow-steps li.error {
  border-color: rgba(239, 91, 91, 0.35);
  color: var(--danger);
}

.flow-hint { margin: 0 0 16px; min-height: 18px; }
.flow-hint a { color: var(--primary); }

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.data-table .col-check { width: 36px; }
.data-table .col-memo { min-width: 140px; max-width: 280px; }
.data-table .memo-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--warning);
  font-weight: 500;
}
.data-table .col-order { min-width: 150px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.data-table .col-bill { min-width: 130px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.data-table .col-amount { min-width: 64px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table .col-action { width: 88px; white-space: nowrap; }

.memo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.memo-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--warning);
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.35);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.print-labels-section {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.print-workspace {
  margin-top: 4px;
}

.print-workspace.hidden { display: none; }

.print-view-tabs {
  margin-bottom: 12px;
}

.print-panel {
  display: none;
}

.print-panel.is-active {
  display: block;
}

.print-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.memo-audit-desc {
  margin: 0 0 10px;
  font-size: 13px;
}

.data-table .col-status {
  min-width: 56px;
  white-space: nowrap;
}

.table-wrap--compact {
  max-height: min(420px, 55vh);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.table-wrap--compact thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
}

.data-table--dense th,
.data-table--dense td {
  padding: 6px 10px;
  font-size: 12px;
  vertical-align: top;
}

.label-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.label-raw {
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.print-labels-section.hidden { display: none; }

.print-labels-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.print-labels-head .subheading { margin: 0; }

.label-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.label-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
}

.label-list-idx {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(46, 125, 239, 0.1);
}

.label-list-text {
  flex: 1;
  word-break: break-word;
  color: var(--warning);
  font-weight: 500;
}

.print-export-section {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.print-export-section.hidden { display: none; }

.print-export-warn {
  font-size: 13px;
  color: var(--muted);
}

.print-export-warn.is-warn {
  color: var(--warning);
  font-weight: 600;
}

.data-table .col-idx { width: 44px; text-align: center; }
.data-table .col-ml { width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.data-table .col-check { width: 88px; }
.data-table .col-name { min-width: 140px; }

.data-table tr.row-check-warn {
  background: rgba(245, 166, 35, 0.08);
}

.label-check {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.label-check-ok {
  color: #1a9f5c;
  background: rgba(43, 196, 138, 0.12);
  border: 1px solid rgba(43, 196, 138, 0.35);
}

.label-check-warn {
  color: var(--warning);
  background: rgba(245, 166, 35, 0.12);
  border: 1px solid rgba(245, 166, 35, 0.35);
}

.label-check-error {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 36, 0.35);
  backdrop-filter: blur(2px);
}

.modal-panel {
  position: relative;
  width: min(720px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-panel h3 { margin: 0 0 8px; }
.preview-body {
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-2);
  font-size: 13px;
}

.preview-card .row { margin-bottom: 6px; word-break: break-word; }
.preview-card .label { color: var(--muted); margin-right: 8px; font-weight: 500; }

.modal-actions { justify-content: flex-end; }

.result-modal-panel { width: min(640px, 100%); }
.result-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.result-modal-head h3 { margin: 0; }
.result-modal-head h3.is-ok { color: var(--success); }
.result-modal-head h3.is-error { color: var(--danger); }
.result-modal-body { margin-bottom: 16px; }
.result-modal-output {
  min-height: 80px;
  max-height: 50vh;
  margin: 0;
}

#result-modal.is-busy .modal-backdrop {
  pointer-events: none;
}

#result-modal.is-busy #result-modal-close,
#result-modal.is-busy #result-modal-actions {
  display: none;
}

.muted.small { font-size: 12px; margin: 4px 0 8px; }

.account-login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  grid-column: 1 / -1;
}

.xy-captcha-panel {
  width: min(520px, 100%);
}

.xy-captcha-stage {
  position: relative;
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #111;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.xy-captcha-shot {
  display: block;
  width: 100%;
  height: auto;
  min-height: 280px;
  object-fit: contain;
  background: #1a1a1a;
  cursor: crosshair;
}

.xy-captcha-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  font-size: 14px;
  pointer-events: none;
}

.xy-captcha-loading.is-hidden {
  display: none;
}

.xy-captcha-x5sec {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.xy-captcha-x5sec input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2, #fff);
  font-size: 13px;
}

.layout a { color: var(--primary); }

.page-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .cir-stat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .topbar {
    padding: 10px 12px;
    gap: 10px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .main-nav {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar { display: none; }

  .cir-tabs--nav {
    width: max-content;
    min-width: 100%;
  }

  .cir-tabs--nav .cir-tabs__t {
    padding: 10px 12px;
    font-size: 13px;
  }

  .topbar-meta {
    margin-left: 0;
    flex-wrap: wrap;
    gap: 8px;
  }

  #server-time { display: none; }

  .layout {
    padding: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    gap: 12px;
  }

  .card,
  .card-wide {
    padding: 14px;
    border-radius: 14px;
  }

  .card-header,
  .page-toolbar,
  .print-labels-head {
    flex-direction: column;
    align-items: stretch;
  }

  .card-header .actions,
  .print-labels-head .actions {
    width: 100%;
  }

  .card-header .actions .btn,
  .print-labels-head .actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }

  .cir-tabs {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .print-view-tabs {
    display: flex;
    width: 100%;
  }

  .print-view-tabs .cir-tabs__t {
    flex: 1;
    text-align: center;
  }

  .table-wrap,
  .table-wrap--compact {
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
  }

  .table-wrap--compact {
    max-height: min(360px, 52vh);
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }

  .data-table--dense th,
  .data-table--dense td {
    padding: 8px 10px;
  }

  .label-raw {
    max-width: 42vw;
  }

  .modal-panel {
    width: calc(100% - 24px);
    margin: 12px;
    max-height: calc(100vh - 24px);
    overflow: auto;
  }

  .result-modal-panel {
    width: calc(100% - 24px);
  }

  .account-login-grid {
    grid-template-columns: 1fr;
  }

  .cir-stat {
    min-height: auto;
    padding: 14px 16px;
  }

  .cir-stat__value {
    font-size: 24px;
  }

  .btn {
    min-height: 42px;
    padding: 10px 14px;
  }

  .btn.small {
    min-height: 36px;
    padding: 8px 12px;
  }

  .load-banner {
    margin-left: 12px;
    margin-right: 12px;
  }

  .flow-steps {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .flow-steps::-webkit-scrollbar { display: none; }

  .flow-steps li {
    flex-shrink: 0;
  }

  .table-wrap--xianyu {
    border: none;
    background: transparent;
    overflow: visible;
  }

  #xianyu-table {
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  #xianyu-table thead {
    display: none;
  }

  #xianyu-table tbody tr {
    display: block;
    position: relative;
    padding: 12px 12px 12px 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  #xianyu-table tbody td {
    display: block;
    border: none;
    padding: 0;
  }

  #xianyu-table tbody tr:last-child td {
    border-bottom: none;
  }

  #xianyu-table .col-check {
    position: absolute;
    left: 12px;
    top: 14px;
    width: auto;
  }

  #xianyu-table .col-check input {
    width: 18px;
    height: 18px;
  }

  #xianyu-table .col-memo {
    max-width: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--warning);
    margin-bottom: 8px;
    word-break: break-word;
  }

  #xianyu-table .col-title {
    max-width: none;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 4px;
    -webkit-line-clamp: 2;
  }

  #xianyu-table .col-amount {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
  }

  #xianyu-table .col-order,
  #xianyu-table .col-buyer,
  #xianyu-table .col-time {
    display: inline;
    font-size: 12px;
    color: var(--muted);
    word-break: break-all;
  }

  #xianyu-table .col-order::after,
  #xianyu-table .col-buyer::after {
    content: " · ";
    color: var(--muted-2);
  }

  #xianyu-table .col-time {
    display: inline;
  }

  .preview-card .row {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .preview-card .label {
    display: block;
    margin-right: 0;
    margin-bottom: 2px;
  }
}

@media (max-width: 480px) {
  .brand h1 { font-size: 15px; }

  .badge {
    font-size: 11px;
    padding: 4px 8px;
  }

  #btn-web-logout {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .data-table .col-order,
  .data-table .col-bill {
    min-width: 108px;
  }

  .data-table .col-receiver {
    min-width: 96px;
  }

  .data-table .col-time {
    min-width: 88px;
  }

  .memo-tag {
    max-width: 140px;
  }

  .login-card {
    padding: 20px 16px;
  }
}

body.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-card {
  padding: 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.login-brand h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}

.btn.block {
  width: 100%;
  justify-content: center;
}

/* —— 发货记账页 —— */
.ledger-page .ledger-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ledger-header {
  align-items: flex-start;
}

.ledger-header__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ledger-lead {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ledger-stats {
  margin: 4px 0 18px;
}

.ledger-stat {
  position: relative;
  overflow: hidden;
}

.ledger-stat::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.12;
}

.ledger-stat--today::after { background: var(--cir-blue); }
.ledger-stat--month::after { background: var(--cir-orange); }
.ledger-stat--all::after { background: var(--cir-green); }

.ledger-stat--today .cir-stat__label svg { color: var(--cir-blue); }
.ledger-stat--month .cir-stat__label svg { color: var(--cir-orange); }
.ledger-stat--all .cir-stat__label svg { color: var(--cir-green); }

.ledger-stat__money {
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text) !important;
}

.ledger-stat__money.is-muted {
  color: var(--muted) !important;
  font-weight: 500;
}

.ledger-toolbar {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) repeat(2, minmax(140px, 0.7fr)) auto;
  gap: 12px 14px;
  align-items: end;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.ledger-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ledger-field--grow { min-width: 180px; }

.ledger-label {
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
}

.ledger-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
}

.ledger-input:focus {
  outline: none;
  border-color: rgba(46, 125, 239, 0.55);
  box-shadow: 0 0 0 3px rgba(46, 125, 239, 0.12);
}

.ledger-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ledger-meta {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.ledger-table-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}

.ledger-table th {
  background: #f7f9fc;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.ledger-table tbody tr:hover td {
  background: rgba(46, 125, 239, 0.03);
}

.ledger-time {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}

.ledger-time__date {
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
}

.ledger-time__clock {
  font-size: 12px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}

.ledger-copy {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-copy:hover {
  text-decoration: underline;
}

.ledger-copy:disabled {
  color: var(--muted-2);
  cursor: default;
  text-decoration: none;
}

.ledger-copy.is-copied {
  color: var(--success);
}

.ledger-memo {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--warning);
  font-weight: 500;
  line-height: 1.35;
  max-width: 280px;
}

.ledger-amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -0.01em;
}

.ledger-table .col-nick {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}

.ledger-empty {
  padding: 48px 20px;
  text-align: center;
}

.ledger-empty__icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted-2);
  font-size: 18px;
}

.ledger-empty__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.ledger-empty__hint {
  font-size: 13px;
  color: var(--muted);
}

.ledger-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 4px;
}

@media (max-width: 900px) {
  .ledger-toolbar {
    grid-template-columns: 1fr 1fr;
  }
  .ledger-field--grow,
  .ledger-field--actions {
    grid-column: 1 / -1;
  }
}

