:root {
  --primary: #3d62f2;
  --primary-hover: #5d7eff;
  --primary-light: #eff2fe;
  --primary-border: #bbc8fb;
  --link: #1890ff;
  --success: #09a120;
  --warning: #f14500;
  --title: #090f24;
  --text: rgba(9, 15, 36, .85);
  --secondary: rgba(9, 15, 36, .65);
  --tertiary: rgba(9, 15, 36, .45);
  --border: #cdced5;
  --line: #e5e6e9;
  --page-bg: #eef3ff;
  --white: #fff;
  --shadow: 0 1px 3px rgba(9, 15, 36, .05);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1280px;
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font: 14px/22px "HarmonyOS Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 16px 0 18px;
  background: var(--white);
  color: var(--title);
  border-bottom: 1px solid rgba(9, 15, 36, .08);
  box-shadow: 0 2px 8px rgba(9, 15, 36, .06);
}

.brand {
  min-width: 184px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--title);
  font-size: 16px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: inline-block;
  border-radius: 7px;
  background: linear-gradient(135deg, #f14500 0 20%, transparent 20%),
    repeating-linear-gradient(90deg, #1f9fd7 0 4px, #3d62f2 4px 8px);
  box-shadow: inset 0 0 0 1px rgba(9, 15, 36, .06);
}

.divider {
  height: 24px;
  border-left: 1px solid var(--line);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.main-nav button,
.work-tabs button,
.primary-tabs button,
.secondary-tabs button,
.drawer-tabs button {
  border: 0;
  background: transparent;
  color: inherit;
}

.main-nav button {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--text);
}

.main-nav button:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text);
}

.user-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: linear-gradient(135deg, #9fb2d9, #657da9);
}

.page {
  padding: 16px;
}

.work-tabs,
.receipt-panel,
.data-shell {
  background: var(--white);
  border: 1px solid rgba(9, 15, 36, .12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.work-tabs {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.work-tabs button,
.primary-tab,
.secondary-tab,
.drawer-tab {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--secondary);
}

.work-tabs .active,
.primary-tab.active,
.secondary-tab.active,
.drawer-tab.active {
  color: var(--primary);
  background: var(--white);
  box-shadow: 0 2px 8px rgba(9, 15, 36, .14);
  font-weight: 600;
}

.quick-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 0;
}

.quick-actions button,
.ghost {
  min-width: 58px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
}

.quick-actions button:hover,
.ghost:hover {
  color: var(--primary);
  border-color: var(--primary-border);
}

.receipt-panel {
  margin-bottom: 16px;
}

.receipt-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 14px 36px;
  padding: 16px;
}

.receipt-form label,
.filter-grid label,
.mini-filter label,
.record-filter label {
  display: flex;
  align-items: center;
  min-width: 0;
}

.receipt-form span,
.filter-grid span,
.mini-filter span,
.record-filter span {
  width: 92px;
  flex: none;
  text-align: right;
  margin-right: 10px;
  color: var(--secondary);
}

.required::before {
  content: "*";
  color: var(--warning);
  margin-right: 4px;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
  outline: none;
}

input,
select {
  height: 32px;
  padding: 0 12px;
}

select {
  appearance: none;
  padding-right: 32px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--secondary) 50%),
    linear-gradient(135deg, var(--secondary) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

textarea {
  height: 78px;
  padding: 8px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(61, 98, 242, .08);
}

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

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

.form-actions button,
.filter-actions button,
.mini-filter button,
.record-actions button {
  min-width: 60px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--primary);
  color: var(--white);
}

.form-actions button:hover,
.filter-actions button:hover,
.mini-filter button:hover,
.record-actions button:hover {
  background: var(--primary-hover);
}

.data-shell {
  overflow: hidden;
}

.primary-tabs,
.secondary-tabs,
.drawer-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  margin: 12px 16px;
  padding: 2px;
  border: 0;
  border-radius: 8px;
  background: #f5f6fa;
}

.secondary-tabs {
  margin-top: 0;
}

.page-block,
.wallet-panel,
.detail-panel {
  display: none;
}

.page-block.active,
.wallet-panel.active,
.detail-panel.active {
  display: block;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 14px 28px;
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--line);
}

.filter-actions {
  grid-column: 1 / -1;
  text-align: right;
}

.mini-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--line);
}

.mini-filter label {
  width: 240px;
}

.mini-filter span {
  width: 38px;
}

.record-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 0 16px 16px;
  border-bottom: 1px solid var(--line);
}

.record-filter label {
  width: auto;
}

.record-filter span {
  width: 68px;
  margin-right: 0;
}

.record-filter > label:nth-of-type(1),
.record-filter > label:nth-of-type(2) {
  width: 200px;
}

.record-filter > label:nth-of-type(3) {
  width: 360px;
}

.record-filter > label:nth-of-type(4),
.record-filter > label:nth-of-type(5) {
  width: 210px;
}

.date-range {
  gap: 6px;
}

.date-range input {
  width: 138px;
}

.date-range b {
  font-weight: 400;
  color: var(--tertiary);
}

.record-actions {
  display: flex;
  margin-left: auto;
  justify-content: flex-end;
  gap: 8px;
}

.ghost {
  background: var(--white) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.ghost:hover {
  border-color: var(--primary-border) !important;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

th {
  position: relative;
  background: #f8faff;
  color: var(--secondary);
  font-weight: 500;
}

td {
  background: var(--white);
}

tbody tr {
  transition: background .14s ease-out;
}

tbody tr:hover td,
tr:nth-child(even):hover td {
  background: #f8faff;
}

tr:nth-child(even) td {
  background: #fbfcff;
}

.sticky-action {
  position: sticky;
  right: 0;
  text-align: right;
  z-index: 1;
  box-shadow: -4px 0 6px rgba(17, 44, 80, .06);
}

td.sticky-action {
  background: inherit;
}

.link-btn {
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--primary);
  padding: 0 4px;
}

.link-btn:hover {
  background: var(--primary-light);
}

.resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 100%;
  cursor: col-resize;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  background: rgba(23, 35, 75, .16);
}

.drawer-mask.show {
  display: block;
}

.drawer {
  width: min(920px, calc(100vw - 30px));
  height: 100%;
  margin-left: auto;
  background: var(--white);
  box-shadow: -8px 0 18px rgba(16, 35, 63, .16);
}

.drawer-head {
  height: 54px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  color: var(--title);
  font-size: 18px;
}

.close {
  width: 32px;
  height: 32px;
  margin-left: auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--secondary);
  font-size: 28px;
  line-height: 28px;
}

.close:hover {
  background: var(--page-bg);
}

.drawer-body {
  padding: 16px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 8px;
  background: #f8faff;
}

.summary span {
  display: block;
  color: var(--secondary);
  font-size: 12px;
  margin-bottom: 6px;
}

.summary b {
  color: var(--title);
  font-weight: 500;
}

.detail-panel h3 {
  margin: 14px 0 10px;
  padding-left: 8px;
  border-left: 3px solid var(--primary);
  color: var(--title);
  font-size: 15px;
}

.compact-table {
  min-width: 760px;
}

.warn {
  color: var(--warning);
}

.ok {
  color: var(--success);
}

@media (max-width: 1180px) {
  .receipt-form,
  .filter-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .record-filter {
    gap: 12px;
  }
}
