:root {
  --ink: #132846;
  --muted: #6d7f99;
  --line: #d8e3f1;
  --bg: #f3f6fb;
  --primary: #2567d8;
  --primary-dark: #1853b9;
  --danger: #c9483f;
  --shadow: 0 14px 34px rgba(31, 66, 113, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; color: var(--ink); background: radial-gradient(1200px 420px at -5% -20%, #dce9ff, transparent 65%), var(--bg); font: 14px/1.5 "PingFang SC", "Microsoft YaHei", sans-serif; }
h1, h2, p { margin-top: 0; }
h1, h2 { letter-spacing: -.02em; }
button, input, select, textarea { font: inherit; }

.top { padding: 15px 22px; color: #fff; background: linear-gradient(130deg, #0f2f63, #1c5bb1); box-shadow: 0 12px 28px rgba(9, 34, 76, .25); }
.top-main, .section-title, .actions, .pager, .dialog-actions, .nav, .filters { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; flex: 0 0 auto; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #20a3be, #1d73bb); font-size: 24px; font-weight: 750; line-height: 1; }
.brand { font-size: 24px; font-weight: 750; line-height: 1.15; }
.sub { margin-top: 4px; color: #d7e8ff; }
.main { width: min(1440px, 96vw); margin: 18px auto; }
.card { margin-bottom: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.login-card { max-width: 420px; margin: 8vh auto; }
.login-card p, .section-title p, .pager, .message { color: var(--muted); }
.login-card label, dialog label { display: block; margin: 12px 0; }

input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid #c8d8eb; border-radius: 9px; color: var(--ink); background: #fff; }
input::placeholder, textarea::placeholder { color: #94a0b0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #4b83dc; box-shadow: 0 0 0 3px rgba(54, 116, 218, .12); }
textarea { min-height: 74px; resize: vertical; }
.button { border: 0; border-radius: 9px; padding: 8px 13px; color: #27466b; background: #edf3fc; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; transition: background .18s, transform .18s, box-shadow .18s; }
.button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(36, 83, 147, .12); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.primary { color: #fff; background: var(--primary); }
.primary:hover:not(:disabled) { background: var(--primary-dark); }
.danger { color: #fff; background: var(--danger); }
.success { color: #fff; background: #197a43; }
.nav { justify-content: flex-start; flex-wrap: wrap; margin: 0 0 14px; }
.filters { justify-content: flex-start; flex-wrap: wrap; margin: 0 0 14px; }
.filters input { width: auto; margin: 0; }
#filterAdvertiserKind { width: auto; margin: 0; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 8px; text-align: left; white-space: nowrap; border-bottom: 1px solid #e7eef8; }
th { color: #375270; background: #f7fbff; font-weight: 650; }
.table-wrap { overflow-x: auto; }
.pager { justify-content: flex-start; margin-top: 12px; }
#orderDataPanel .pager { flex-wrap: wrap; }
.page-jump { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.page-jump input { width: 76px; margin: 0; padding: 7px 8px; }
.message { min-height: 20px; margin-top: 10px; }
.message.error { color: #b33831; }
dialog { width: min(520px, 94vw); border: 0; border-radius: 16px; box-shadow: 0 25px 55px rgba(10, 26, 48, .27); }
dialog::backdrop { background: rgba(9, 25, 45, .46); }
.dialog-note { color: var(--muted); line-height: 1.5; }
.dialog-actions { justify-content: flex-end; margin-top: 16px; }
.app-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.notice { padding: 12px 15px; border: 1px solid #f1d79d; border-radius: 9px; color: #825d13; background: #fff8e8; line-height: 1.7; }
.notice.off { border-color: #f2c2bd; color: #9c312c; background: #fff0ef; }

/* Transfer page */
[data-page="transfers"] { background: var(--bg); }
[data-page="transfers"] .top.transfer-topbar { padding: 12px 32px; border-bottom: 1px solid #dbe5f1; color: var(--ink); background: #fff; box-shadow: none; }
[data-page="transfers"] .transfer-topbar .brand { font-size: 20px; }
[data-page="transfers"] .transfer-topbar .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
[data-page="transfers"] .transfer-topbar #who { color: #71829b; font-size: 15px; }
[data-page="transfers"] .transfer-topbar .danger { padding: 4px 0; color: #71829b; background: transparent; font-weight: 500; }
[data-page="transfers"] .main { width: min(1440px, 96vw); margin: 18px auto; }
/* 转账管理是同级子菜单：保留与授权管理、广告主账户一致的头部和导航。 */
[data-page="transfers"] .nav { display: flex; }
[data-page="transfers"] #transferPanel > .card { padding: 20px; border-radius: 15px; }
[data-page="transfers"] #transferPanel > .card:first-child { margin-bottom: 16px; }
[data-page="transfers"] .notice { padding: 13px 15px; border-radius: 9px; }
[data-page="transfers"] .transfer-form-card { padding: 23px 20px 21px !important; }
[data-page="transfers"] .section-title { align-items: flex-end; }
[data-page="transfers"] .section-title h1 { margin-bottom: 5px; font-size: 22px; }
[data-page="transfers"] .section-title p { margin-bottom: 0; }
.eyebrow { margin-bottom: 4px; color: #4c7ac1; font-size: 12px; font-weight: 750; letter-spacing: .08em; }
.transfer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px 20px; margin-top: 23px; }
[data-page="transfers"] .transfer-grid > label { display: block; min-width: 0; color: #304564; font-size: 13px; font-weight: 650; }
[data-page="transfers"] .transfer-grid input,
[data-page="transfers"] .transfer-grid select { height: 44px; margin-top: 7px; padding: 9px 12px; border-color: #cbd9eb; border-radius: 8px; }
[data-page="transfers"] .transfer-grid textarea { min-height: 72px; margin-top: 7px; padding: 10px 12px; border-color: #cbd9eb; border-radius: 8px; }
.transfer-field-wide { grid-column: 1 / -1; }
.transfer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 21px; padding-top: 20px; border-top: 1px solid #edf1f7; }
.transfer-actions .button { min-height: 41px; padding: 9px 17px; }
.transfer-actions span { color: var(--muted); font-size: 13px; }
.transfer-preview { margin-top: 17px; padding: 16px; border: 1px solid #cbdcf7; border-radius: 10px; background: #f6f9ff; }
.transfer-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.transfer-summary > div { padding: 12px; border: 1px solid #e1e8f3; border-radius: 9px; background: #fff; }
.transfer-summary small { display: block; margin-bottom: 6px; color: var(--muted); }
.transfer-summary strong { font-size: 17px; }
.transfer-preview details { margin-top: 12px; }
.transfer-preview summary { color: #466184; cursor: pointer; }
.transfer-preview pre { max-height: 240px; overflow: auto; padding: 12px; border-radius: 8px; color: #dfe8f7; background: #13213a; font-size: 12px; white-space: pre-wrap; }
[data-page="transfers"] #transferPanel > section:last-child { padding: 21px 20px 18px; }
[data-page="transfers"] #transferPanel > section:last-child .section-title { align-items: center; }
[data-page="transfers"] #transferPanel > section:last-child .section-title h1 { margin-bottom: 4px; }
[data-page="transfers"] #transferPanel > section:last-child table { min-width: 1040px; }
[data-page="transfers"] #transferPanel > section:last-child th { padding-top: 11px; padding-bottom: 11px; background: #f5f8fc; }
.status-tag { display: inline-block; padding: 4px 9px; border-radius: 999px; color: #456080; background: #edf2fa; font-weight: 700; }
.status-tag.SUCCESS { color: #117657; background: #e6f7f0; }
.status-tag.FAILED, .status-tag.MANUAL_REVIEW { color: #bc3d35; background: #fff0ee; }
.status-tag.PROCESSING, .status-tag.SUBMITTING, .status-tag.UNKNOWN { color: #94630a; background: #fff6de; }
.empty { padding: 28px; color: var(--muted); text-align: center; }
.orders-source { display: flex; gap: 8px; margin: 15px 0; }
.orders-filters label { display: flex; align-items: center; gap: 7px; color: var(--muted); white-space: nowrap; }
.orders-filters input { min-width: 135px; }
.orders-filters input[type="date"] { width: 155px; min-width: 0; }
.orders-panel table { min-width: 850px; }
.orders-panel th, .orders-panel td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.orders-panel .order-id { white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-details { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 0; margin: 14px 0; }
.order-details dt, .order-details dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.order-details dt { color: var(--muted); }
.order-details pre { max-height: 280px; overflow: auto; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.live-star-filters { margin-top: 18px; align-items: flex-end; }
.live-star-filters label { min-width: 220px; max-width: 420px; flex: 1 1 220px; color: var(--muted); }
.live-star-filters input, .live-star-filters select { margin-top: 5px; }
.live-star-filters input { width: 100%; }
.live-star-panel table { min-width: 760px; }
.live-star-panel th, .live-star-panel td { white-space: normal; overflow-wrap: anywhere; }
#orderDataPanel table { width: max-content; min-width: 1800px; table-layout: auto; }
#orderDataPanel th, #orderDataPanel td { white-space: nowrap; overflow: visible; overflow-wrap: normal; text-overflow: clip; vertical-align: middle; }
#orderDataPanel th:nth-child(9), #orderDataPanel td:nth-child(9) { width: 360px; min-width: 360px; max-width: 360px; }
#orderDataPanel td:nth-child(9) { white-space: normal; overflow-wrap: anywhere; }
#postDataPanel table { width: max-content; min-width: 1200px; table-layout: auto; }
#postDataPanel th, #postDataPanel td { white-space: nowrap; overflow: visible; overflow-wrap: normal; text-overflow: clip; vertical-align: middle; }
.live-star-panel .order-id { white-space: nowrap; font-variant-numeric: tabular-nums; }
.live-orders-title { margin-top: 28px; }
.live-orders-title h2 { margin: 0; font-size: 18px; }
.live-post-updated { margin: 8px 0; color: var(--muted); }
.live-star-panel .table-wrap a:not(.button) { color: var(--primary); }
.finance-filters input, .finance-filters select { width: auto; min-width: 145px; }
[data-page="finance"] #financePanel table { table-layout: fixed; width: 1360px; min-width: 1360px; }
[data-page="finance"] #financePanel th,
[data-page="finance"] #financePanel td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; line-height: 1.6; }
.finance-col-time { width: 140px; }
.finance-col-port { width: 175px; }
.finance-col-source { width: 105px; }
.finance-col-brand { width: 135px; }
.finance-col-id { width: 155px; }
.finance-col-name { width: 155px; }
.finance-col-consumption { width: 135px; }
.finance-col-balance { width: 120px; }
.finance-col-credit { width: 120px; }
.finance-col-date { width: 120px; }
[data-page="finance"] #financePanel th { background: #f5f8fc; }
[data-page="finance"] #financePanel thead th { white-space: nowrap; overflow-wrap: normal; }
.finance-sort-button { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-weight: inherit; white-space: nowrap; cursor: pointer; }
.finance-sort-button:hover, .finance-sort-button:focus-visible { color: #1f5fbf; }
.finance-sort-icon, .finance-sort-icon svg { display: block; width: 16px; height: 16px; flex: none; }
.finance-source { display: block; color: var(--muted); font-size: 11px; }
.finance-filters #filterFinancePort { min-width: 260px; max-width: 420px; }
.finance-filters select { margin: 0; }
.finance-filters .finance-date { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 13px; }
.finance-date-separator { color: var(--muted); }
.finance-filter-summary { caption-side: top; padding: 11px 8px; text-align: left; color: #375270; background: #f7fbff; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }

@media (max-width: 880px) {
  [data-page="transfers"] .main { width: min(calc(100% - 28px), 680px); }
  [data-page="transfers"] .transfer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-page="transfers"] .transfer-field-wide { grid-column: 1 / -1; }
  .transfer-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .top-main, .section-title { align-items: flex-start; flex-direction: column; }
  .actions { width: 100%; justify-content: space-between; }
  [data-page="transfers"] .top.transfer-topbar { padding: 11px 16px; }
  [data-page="transfers"] .main { width: calc(100% - 20px); margin-top: 16px; }
  [data-page="transfers"] .transfer-grid, .transfer-summary { grid-template-columns: 1fr; }
  [data-page="transfers"] .transfer-field-wide { grid-column: auto; }
  [data-page="transfers"] .section-title { gap: 15px; }
}
