:root {
  --ink: #18212E;
  --ink-2: #5C6878;
  --ink-3: #8B96A5;
  --line: #E1E6ED;
  --line-soft: #EDF0F4;
  --paper: #FFFFFF;
  --canvas: #F2F4F7;
  --navy: #16324F;
  --navy-2: #22486D;
  --navy-soft: #EDF3FB;
  --gold: #B3925A;
  --seal: #B03A2E;
  --warn-bg: #FFF9EC;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --mono: ui-monospace, Menlo, Consolas, "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, dt, ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
}

a {
  color: var(--navy);
}

:focus-visible {
  outline: 2px solid var(--navy-2);
  outline-offset: 2px;
}

.serif {
  font-family: var(--serif);
}

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

/* ===== 登录 ===== */
.login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 24px;
  background:
    linear-gradient(90deg, rgba(22, 50, 79, 0.04) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(rgba(22, 50, 79, 0.04) 1px, transparent 1px) 0 0 / 56px 56px,
    var(--canvas);
}

.login-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  width: min(900px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(14, 31, 51, 0.14);
}

.login-brand {
  position: relative;
  padding: 52px 40px;
  background: var(--navy);
  color: #FFFFFF;
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.brand-eyebrow {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.brand-title {
  margin-top: 34px;
  font-size: 46px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.35;
}

.brand-sub {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.brand-seal {
  position: absolute;
  right: 38px;
  bottom: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.12em;
  transform: rotate(-8deg);
}

.login-form {
  padding: 52px 44px;
}

.login-title {
  color: var(--navy);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.login-hint {
  margin-top: 8px;
  color: var(--ink-3);
  font-size: 12.5px;
}

.field-label {
  display: block;
  margin-top: 34px;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.input {
  display: block;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #CDD6E1;
  border-radius: 4px;
  background: #FFFFFF;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.input:focus {
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(34, 72, 109, 0.12);
}

.input::placeholder {
  color: #AEB7C4;
}

.select {
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 18px, calc(100% - 10px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.form-error {
  min-height: 20px;
  margin-top: 8px;
  color: var(--seal);
  font-size: 12.5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.16s, border-color 0.16s, color 0.16s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--navy);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--navy-2);
}

.btn-ghost {
  border-color: #CDD6E1;
  background: #FFFFFF;
  color: var(--navy);
}

.btn-ghost:hover {
  background: #F4F7FA;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.login-form .btn {
  width: 100%;
  height: 46px;
  margin-top: 8px;
}

.login-foot {
  margin-top: 18px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.7;
}

body.drawer-open {
  overflow: hidden;
}

/* ===== 主框架 ===== */
.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 26px 16px 20px;
  background: var(--navy);
  color: #FFFFFF;
}

.side-brand {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 8px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.side-mark {
  flex-shrink: 0;
  width: 4px;
  height: 34px;
  margin-top: 2px;
  background: var(--gold);
}

.side-brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.side-brand small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11.5px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 22px;
}

.nav-item {
  position: relative;
  padding: 11px 12px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.16s, color 0.16s;
}

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

.nav-item.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 0;
  width: 2px;
  background: var(--gold);
}

.side-foot {
  margin-top: auto;
  padding: 18px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.session-note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11.5px;
}

.session-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6FA88A;
}

.side-logout {
  margin-top: 12px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.side-logout:hover {
  color: #FFFFFF;
}

.main {
  min-width: 0;
}

.topline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 32px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.page-title {
  color: var(--navy);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.page-sub {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 12px;
}

.admin-chip {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid #D7C9AC;
  border-radius: 3px;
  color: #8A6A2F;
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.content {
  max-width: 1320px;
  padding: 24px 32px 64px;
}

/* ===== 台账统计 ===== */
.ledger {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--paper);
}

.ledger-cell {
  padding: 20px 22px 18px;
  border-right: 1px solid var(--line);
}

.ledger-cell:last-child {
  border-right: none;
}

.ledger-label {
  display: block;
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.ledger-value {
  display: inline-block;
  margin-top: 10px;
  color: var(--navy);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.ledger-unit {
  margin-left: 4px;
  color: var(--ink-3);
  font-size: 12px;
}

/* ===== 面板 ===== */
.panel {
  margin-top: 20px;
  border: 1px solid var(--line);
  background: var(--paper);
}

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

.panel-title {
  color: var(--navy);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.panel-note {
  color: var(--ink-3);
  font-size: 12px;
}

.link-btn {
  padding: 0;
  border: none;
  background: transparent;
  color: var(--navy);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--navy-2);
}

/* ===== 动力类型分布 ===== */
.package-bar {
  display: flex;
  height: 10px;
  margin: 22px 22px 0;
  background: var(--line-soft);
}

.package-seg {
  height: 100%;
  transition: width 0.3s ease;
}

.package-seg.seg-basic {
  background: #AFC0D2;
}

.package-seg.seg-premium {
  background: var(--navy);
}

.package-seg.seg-flagship {
  background: var(--gold);
}

.package-seg.seg-fuel {
  background: var(--navy);
}

.package-seg.seg-ev {
  background: var(--gold);
}

.package-seg.seg-phev {
  background: #6B8F71;
}

.package-seg.seg-hev {
  background: #AFC0D2;
}

.package-seg.seg-other {
  background: #B0A6C9;
}

.package-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  padding: 16px 22px 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
}

.legend-dot.seg-basic {
  background: #AFC0D2;
}

.legend-dot.seg-premium {
  background: var(--navy);
}

.legend-dot.seg-flagship {
  background: var(--gold);
}

.legend-dot.seg-fuel {
  background: var(--navy);
}

.legend-dot.seg-ev {
  background: var(--gold);
}

.legend-dot.seg-phev {
  background: #6B8F71;
}

.legend-dot.seg-hev {
  background: #AFC0D2;
}

.legend-dot.seg-other {
  background: #B0A6C9;
}

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

/* ===== 表格 ===== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.data-table th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #FAFBFD;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: left;
  white-space: nowrap;
}

.data-table th.num {
  text-align: right;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  vertical-align: middle;
  white-space: nowrap;
}

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

.data-table tbody tr.is-clickable {
  cursor: pointer;
}

.data-table tbody tr.is-clickable:hover {
  background: #F7F9FC;
}

.cell-check {
  width: 42px;
  padding-right: 0 !important;
  text-align: center;
}

.cell-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--navy);
  cursor: pointer;
}

.cell-main {
  color: var(--ink);
  font-weight: 500;
}

.cell-sub {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11.5px;
}

.mono-cell {
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: nowrap;
}

.remark-chip {
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--warn-bg);
  color: #8A6A2F;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.row-btn {
  padding: 4px 10px;
  border: 1px solid #CDD6E1;
  border-radius: 3px;
  background: #FFFFFF;
  color: var(--navy);
  font-size: 12px;
  cursor: pointer;
}

.row-btn:hover {
  background: #F4F7FA;
}

.empty {
  padding: 42px 20px;
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
}

/* ===== 工具栏 ===== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.search-box {
  flex: 1 1 260px;
  min-width: 220px;
}

.filter {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
}

.filter .input {
  width: 148px;
}

.toolbar .select {
  width: 132px;
}

.selection-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid #D5E1F1;
  background: var(--navy-soft);
  font-size: 12.5px;
}

.selection-bar strong {
  color: var(--navy);
}

.selection-bar .link-btn:first-of-type {
  margin-left: auto;
}

.table-panel {
  margin-top: 12px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12.5px;
}

.page-size {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size .select {
  width: 76px;
  height: 34px;
}

.pager-buttons {
  display: flex;
  gap: 8px;
}

.pager-buttons .btn {
  height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
}

/* ===== 导出 ===== */
.export-panel {
  padding-bottom: 22px;
}

.export-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  padding: 22px;
}

.export-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.export-field .input {
  width: 180px;
}

.export-note {
  margin: 0 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.8;
}

.login-form .field-label {
  margin-top: 20px;
}

.login-form .field-label:first-of-type {
  margin-top: 34px;
}

/* ===== 合同配置 ===== */
.config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 20px;
}

.config-grid + .config-panel {
  margin-top: 20px;
}

.config-grid .panel {
  margin-top: 0;
}

.config-body {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 20px 22px;
}

.config-grid-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 20px;
}

.config-field {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.config-grid-inner .config-field {
  grid-template-columns: 128px minmax(0, 1fr);
}

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

.config-field .input {
  height: 38px;
}

.seal-block {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.seal-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  border: 1px dashed #C9D3DF;
  background: #FFFFFF;
  color: var(--ink-3);
  font-size: 11.5px;
  text-align: center;
  overflow: hidden;
}

.seal-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.seal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-hint {
  margin: 0;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.6;
}

.template-body {
  gap: 16px;
}

.template-hint {
  padding: 0 22px 12px;
}

.json-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 12.5px;
}

.json-editor {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  border: 1px solid #CDD6E1;
  border-radius: 4px;
  background: #FAFBFD;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  white-space: pre;
  overflow: auto;
}

.json-editor:focus {
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(34, 72, 109, 0.12);
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}

.account-body {
  max-width: 560px;
}

.config-actions-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.config-status {
  color: var(--ink-3);
  font-size: 12px;
}

.config-buttons {
  display: flex;
  gap: 10px;
}

/* ===== 抽屉 ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(13, 26, 42, 0.42);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: 560px;
  max-width: 94vw;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(13, 26, 42, 0.18);
  animation: drawer-in 0.24s ease-out both;
}

@keyframes drawer-in {
  from {
    transform: translateX(36px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.drawer-eyebrow {
  color: var(--ink-3);
  font-size: 11.5px;
  letter-spacing: 0.14em;
}

.drawer-title {
  margin-top: 6px;
  color: var(--navy);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.icon-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  background: #F2F5F9;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 32px;
}

.detail-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
}

.detail-section:last-child {
  border-bottom: none;
}

.detail-heading {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.detail-grid {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px 14px;
  font-size: 13px;
}

.detail-key {
  color: var(--ink-3);
}

.detail-val {
  color: var(--ink);
  word-break: break-all;
}

.detail-val.mono {
  font-family: var(--mono);
  font-size: 11.5px;
}

.signature-paper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 12px;
  border: 1px dashed #C9D3DF;
  background: #FFFFFF;
}

.signature-paper img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.detail-caption {
  margin-top: 8px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: center;
  word-break: break-all;
}

.trace-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  margin-top: 4px;
}

.trace-cell {
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.trace-cell:last-child {
  border-right: none;
}

.trace-value {
  color: var(--navy);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}

.trace-label {
  margin-top: 2px;
  color: var(--ink-3);
  font-size: 11px;
}

.timeline {
  margin-top: 4px;
}

.timeline li {
  position: relative;
  padding: 0 0 13px 20px;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: -2px;
  left: 3px;
  width: 1px;
  background: var(--line);
}

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

.timeline li::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 7px;
  height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
}

.timeline-label {
  color: var(--ink);
  font-size: 13px;
}

.timeline-time {
  margin-top: 1px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
}

.remark-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid #CDD6E1;
  border-radius: 4px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

.textarea:focus {
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(34, 72, 109, 0.12);
}

.remark-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.remark-meta {
  color: var(--ink-3);
  font-size: 11.5px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
}

.detail-actions .btn {
  flex: 1 1 140px;
}

/* ===== 提示 ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  z-index: 90;
  max-width: 80vw;
  padding: 10px 18px;
  border-radius: 4px;
  background: rgba(24, 33, 46, 0.92);
  color: #FFFFFF;
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ===== 打印 ===== */
.print-sheet {
  display: none;
}

@media print {
  @page {
    margin: 16mm 15mm;
  }

  body {
    background: #FFFFFF;
  }

  body > *:not(#printSheet) {
    display: none !important;
  }

  #printSheet {
    display: block;
    color: #111;
    font-family: var(--serif);
    font-size: 11pt;
    line-height: 1.9;
  }

  .print-title {
    font-size: 20pt;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-align: center;
  }

  .print-sub {
    margin-top: 6pt;
    color: #555;
    font-size: 9pt;
    text-align: center;
  }

  .print-rule {
    margin: 14pt 0;
    border-top: 1px solid #999;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5pt;
  }

  .print-table td {
    padding: 5pt 8pt;
    border: 1px solid #DDD;
    vertical-align: top;
  }

  .print-key {
    width: 26%;
    color: #555;
  }

  .print-digest {
    font-size: 8.5pt;
    word-break: break-all;
  }

  .print-signature {
    margin-top: 14pt;
    padding: 10pt;
    border: 1px dashed #BBB;
    text-align: center;
  }

  .print-signature img {
    max-height: 120pt;
  }

  .print-foot {
    margin-top: 16pt;
    padding-top: 8pt;
    border-top: 1px solid #DDD;
    color: #666;
    font-size: 8.5pt;
  }
}

/* ===== 响应式 ===== */
@media (max-width: 1080px) {
  .ledger {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ledger-cell:nth-child(3) {
    border-right: none;
  }

  .ledger-cell:nth-child(4),
  .ledger-cell:nth-child(5) {
    border-top: 1px solid var(--line);
  }
}

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

  .config-grid-inner {
    grid-template-columns: 1fr;
  }

  .config-field,
  .config-grid-inner .config-field {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px 16px 0;
  }

  .side-brand {
    padding-bottom: 14px;
  }

  .side-nav {
    flex-direction: row;
    gap: 4px;
    margin-top: 12px;
    padding-bottom: 12px;
    overflow-x: auto;
  }

  .nav-item {
    flex-shrink: 0;
    padding: 8px 14px;
  }

  .nav-item.is-active::before {
    top: auto;
    right: 14px;
    bottom: 0;
    left: 14px;
    width: auto;
    height: 2px;
  }

  .side-foot {
    display: none;
  }

  .topline {
    padding: 20px 20px 14px;
  }

  .content {
    padding: 18px 20px 48px;
  }

  .login-card {
    grid-template-columns: 1fr;
    max-width: 460px;
  }

  .login-brand {
    padding: 34px 32px;
  }

  .brand-title {
    margin-top: 20px;
    font-size: 34px;
  }

  .brand-seal {
    right: 26px;
    bottom: 22px;
    width: 60px;
    height: 60px;
    font-size: 18px;
  }

  .login-form {
    padding: 32px;
  }
}

@media (max-width: 640px) {
  .seal-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .config-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .config-buttons {
    flex-direction: column;
  }

  .records-table {
    min-width: 600px;
  }

  .records-table th:nth-child(4),
  .records-table td:nth-child(4),
  .records-table th:nth-child(7),
  .records-table td:nth-child(7) {
    display: none;
  }

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

  .ledger-cell {
    border-right: 1px solid var(--line);
    border-top: 1px solid var(--line);
  }

  .ledger-cell:nth-child(-n + 2) {
    border-top: none;
  }

  .ledger-cell:nth-child(even) {
    border-right: none;
  }

  .ledger-value {
    font-size: 26px;
  }

  .toolbar {
    padding: 12px;
  }

  .filter {
    flex: 1 1 100%;
  }

  .filter .input {
    flex: 1;
    width: auto;
  }

  .toolbar .select {
    width: 100%;
  }

  .toolbar .btn {
    flex: 1;
  }

  .drawer {
    width: 100%;
    max-width: none;
  }

  .detail-grid {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .export-field,
  .export-field .input {
    width: 100%;
  }

  .export-form .btn {
    width: 100%;
  }
}

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