:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #233047;
  background: #f4f6fa;
  --accent: #3565e8;
  --muted: #7a879a;
  --line: #e7ebf2;
  --surface: #fff;
  --sidebar: #142037;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
button:hover { background: #2755d1; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible { outline: 3px solid #3565e83b; outline-offset: 2px; }
.secondary { background: var(--surface); border-color: #dbe2ed; color: #47556b; }
.secondary:hover { background: #f6f8fc; border-color: #bbc9df; }
.link { color: var(--accent); background: transparent; padding: 4px 8px; min-height: 30px; font-weight: 500; }
.link:hover { background: #eef3ff; }
.icon { width: 18px; height: 18px; flex: 0 0 auto; }
input, select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 8px 11px;
  border: 1px solid #dce3ed;
  border-radius: 6px;
  background: var(--surface);
  color: #28364c;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover { border-color: #b9c8df; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #3565e813; }
label { display: flex; flex-direction: column; gap: 8px; color: #59677d; font-size: 13px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 24px; font-weight: 650; letter-spacing: -.4px; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin-bottom: 20px; }
h3 { font-size: 14px; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.brand { font-size: 25px; letter-spacing: -.8px; font-weight: 800; color: #20448f; }
.app-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 16px 24px; background: var(--sidebar); }
.sidebar-brand { padding: 0 14px 28px; }
.sidebar-brand .brand { color: #fff; }
.sidebar-title { margin-top: 8px; color: #9caecc; font-size: 12px; line-height: 1.6; }
.navigation { display: grid; gap: 8px; }
.navigation button { justify-content: flex-start; width: 100%; min-height: 44px; padding: 12px 14px; color: #9eafcb; background: transparent; font-weight: 500; }
.navigation .icon { margin-right: 3px; }
.navigation button:hover { color: #fff; background: #ffffff09; }
.navigation button.active { color: #fff; background: #3565e8; box-shadow: 0 5px 16px #00000018; }
.scope { padding: 22px 14px 0; border-top: 1px solid #ffffff12; margin-top: auto; overflow-wrap: anywhere; }
.scope-label { color: #8596b5; font-size: 11px; }
.scope strong { display: block; color: #dce6f8; font-weight: 550; margin: 8px 0; line-height: 1.6; }
.channel-code { display: inline-block; color: #a9bbdb; background: #ffffff0a; border: 1px solid #ffffff0f; border-radius: 4px; font-size: 11px; padding: 3px 7px; }
.workspace { min-width: 0; }
.topbar { height: 72px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.breadcrumb { display: flex; align-items: center; gap: 14px; font-size: 13px; min-width: 0; white-space: nowrap; }
.breadcrumb-root { color: var(--muted); }
.breadcrumb-divider { color: #c7cfdb; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.top-actions select, .login-topbar select { width: 104px; height: 36px; font-size: 12px; }
.language-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 32px 8px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='m3 4.5 3 3 3-3' stroke='%236b7c96' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
  cursor: pointer;
}
.top-username { font-size: 12px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; font-size: 11px; color: #5472b6; background: #edf2fd; margin-left: 4px; }
.avatar .icon { width: 15px; height: 15px; }
.logout-button { border: 0; background: transparent; font-size: 12px; padding: 8px; font-weight: 500; }
.logout-button .icon { width: 16px; height: 16px; }
.badge { display: inline-block; border: 1px solid #e0e7f2; background: #f6f8fc; color: #77869c; border-radius: 4px; padding: 4px 8px; font-size: 11px; white-space: nowrap; }
.badge.sandbox { background: #fff8ea; color: #a77b30; border-color: #f6e8cb; }
.badge.production { background: #ecf8f0; color: #318054; border-color: #d2ebdc; }
.page { width: 100%; max-width: 1660px; margin: 0 auto; padding: 30px 32px 40px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.timezone { color: #8994a6; font-size: 12px; text-align: right; line-height: 1.6; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin-bottom: 20px; box-shadow: 0 2px 4px #13234202; }
.filter-panel { padding: 20px 24px; }
.filters { display: grid; grid-template-columns: 180px 180px max-content; gap: 16px; align-items: end; }
.filters.detailed { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.filters.detailed .wide { grid-column: span 1; }
.filters.detailed button { justify-self: start; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 20px; }
.card { min-width: 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.card-title { color: #68778e; font-size: 13px; line-height: 1.5; }
.card-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 6px; background: #eff3fe; color: #6c89d9; }
.card-icon .icon { width: 16px; height: 16px; }
.usdtTotal .card-icon { color: #54a28a; background: #eef8f4; }
.pointsTotal .card-icon { color: #a190ce; background: #f4f1fb; }
.card-value { font-size: 28px; line-height: 1.3; font-weight: 650; color: #1e2b42; letter-spacing: -.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.unit { color: #92a0b2; font-size: 11px; font-weight: 500; letter-spacing: 0; margin-left: 8px; white-space: nowrap; }
.card-foot { margin-top: 12px; color: #a0aabb; font-size: 11px; }
.currency-note { grid-column: 1 / -1; color: #758297; font-size: 12px; padding: 0 4px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h2 { margin: 0; }
.panel-head button { font-size: 12px; }
.panel-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.table-wrap { overflow: auto; width: 100%; }
table { border-collapse: collapse; width: 100%; min-width: 760px; text-align: left; font-size: 13px; }
th { color: #7d8a9e; background: #f7f9fc; font-size: 12px; font-weight: 500; line-height: 1.6; }
th, td { padding: 14px 12px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
th:first-child { border-radius: 5px 0 0 5px; }
th:last-child { border-radius: 0 5px 5px 0; }
td { line-height: 1.6; color: #4b5b72; }
tbody tr:hover { background: #fafbfe; }
td small { display: block; color: #97a3b6; font-size: 11px; margin-top: 4px; }
td:last-child:has(button) { white-space: nowrap; }
.actions-cell { position: sticky; right: 0; background: var(--surface); }
th.actions-cell { background: #f7f9fc; }
tbody tr:hover .actions-cell { background: #fafbfe; }
.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; }
.numeric { font-variant-numeric: tabular-nums; color: #26364e; font-weight: 500; }
.empty { padding: 60px 16px; text-align: center; color: #99a4b5; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; color: #8592a5; font-size: 12px; }
.pager > div { display: flex; align-items: center; gap: 14px; }
.pager button { min-height: 32px; padding: 6px 12px; font-size: 12px; font-weight: 500; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 4px; font-size: 11px; line-height: 1.6; background: #f0f3f8; color: #7a889d; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.PAID { background: #edf8f2; color: #3c9767; }
.status.REVIEW { background: #fff7e8; color: #be9344; }
.status.PENDING { background: #edf3ff; color: #6287cc; }
.status.FAILED { background: #fff0f0; color: #ca7676; }
.status.REFUNDED { background: #edf8f2; color: #3c9767; }
.status.REFUND_PENDING, .status.REFUND_WAITING_REFERENCE { background: #edf3ff; color: #6287cc; }
.status.REFUND_FAILED { background: #fff0f0; color: #ca7676; }
.status.REFUND_REVIEW { background: #fff7e8; color: #be9344; }
.status-panel table { min-width: 0; }
.status-panel th:first-child { width: 30%; }
.status-panel th:nth-child(2) { width: 20%; }
.share-cell { white-space: nowrap; }
.share-track { display: inline-block; width: min(240px, 75%); height: 5px; border-radius: 4px; background: #f0f3f8; margin-right: 14px; vertical-align: middle; overflow: hidden; }
.share-bar { display: block; height: 100%; border-radius: inherit; background: #b1bdd1; }
.share-bar.PAID { background: #76ba96; }
.share-bar.REVIEW { background: #e1bb76; }
.share-bar.PENDING { background: #83a6e5; }
.share-bar.FAILED { background: #df9c9c; }
.share-value { font-size: 12px; color: #8997ab; font-variant-numeric: tabular-nums; }
.note { border: 1px solid #e5ecfa; border-radius: 6px; padding: 12px 16px; color: #8192b1; background: #f8faff; font-size: 12px; line-height: 1.7; margin: 18px 0; }
.account-panel { display: grid; grid-template-columns: 260px minmax(0, 1fr); padding: 32px; }
.account-identity { padding: 10px 24px 24px 0; border-right: 1px solid var(--line); overflow-wrap: anywhere; }
.account-avatar { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 12px; color: #6684c8; background: #edf2fd; font-size: 20px; font-weight: 600; margin-bottom: 20px; }
.account-avatar .icon { width: 26px; height: 26px; }
.account-identity h2 { margin-bottom: 8px; }
.account-identity .muted { font-size: 12px; }
.account-security { padding: 6px 0 8px 36px; }
.account-form { display: grid; gap: 20px; max-width: 440px; }
.account-form button { justify-self: start; }
.password-help { margin: -4px 0 0; font-size: 12px; line-height: 1.8; }
.login-screen { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% 38%, #fff 0, #f4f6fb 65%); }
.login-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px 48px; }
.login-panel { display: flex; align-items: center; justify-content: center; flex: 1; padding: 30px 24px 80px; }
.login-form { width: 100%; max-width: 420px; padding: 36px 38px 16px; border: 1px solid #e4eaf4; border-radius: 12px; background: var(--surface); box-shadow: 0 12px 40px #182e5e08, 0 2px 6px #182e5e03; }
.login-emblem { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 1px solid #e7edfd; background: #f1f5ff; border-radius: 10px; color: #6486dc; margin-bottom: 20px; }
.login-emblem .icon { width: 23px; height: 23px; }
.login-form h1 { font-size: 22px; line-height: 1.4; margin-bottom: 30px; }
.login-form form { display: grid; gap: 20px; }
.login-form input { height: 44px; }
.login-form button { min-height: 44px; margin-top: 4px; }
.captcha-field { display: grid; gap: 8px; }
.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 144px; gap: 12px; }
.captcha-row input { min-width: 0; letter-spacing: 4px; }
.login-form .captcha-refresh { display: flex; align-items: center; justify-content: center; height: 46px; min-height: 0; padding: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); }
.captcha-refresh img { display: block; width: 100%; height: 100%; object-fit: contain; }
.captcha-refresh img[hidden] { display: none; }
.captcha-refresh span { font-size: 12px; }
.captcha-help { font-size: 11px; }
.login-footer { text-align: center; color: #a8b2c2; font-size: 11px; padding: 16px 24px 24px; }
.form-error { color: #bf6565; font-size: 12px; line-height: 1.7; min-height: 18px; overflow-wrap: anywhere; }
.form-error:empty { margin-top: -8px; }
.loading { padding: 72px 24px; text-align: center; color: var(--muted); }
#notice { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); border-radius: 7px; padding: 12px 20px; background: #253653; color: #fff; font-size: 13px; line-height: 1.7; box-shadow: 0 6px 24px #14203722; z-index: 100; }
#notice.error { background: #a55656; }
dialog { width: min(1060px, 94vw); max-height: 88vh; overflow: auto; padding: 0; color: #233047; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 24px 100px #111c3930; }
dialog::backdrop { background: #14203765; backdrop-filter: blur(2px); }
.dialog-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dialog-header h2 { font-size: 18px; margin: 0; }
.dialog-header button { font-size: 12px; min-height: 32px; }
#detail-content { padding: 12px 28px 28px; }
.snapshot-content { padding: 12px 28px 28px; }
.reference-cell { min-width: 170px; max-width: 240px; overflow-wrap: anywhere; }
.reference-cell small { font-family: inherit; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin: 0; }
.details-grid > div { min-width: 0; padding: 12px 0; border-bottom: 1px solid #edf0f5; }
.details-grid dt { font-size: 12px; color: #8b98ab; margin-bottom: 8px; }
.details-grid dd { margin: 0; line-height: 1.6; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.section-title { padding-left: 10px; border-left: 3px solid #90aae9; margin: 28px 0 8px; font-size: 14px; font-weight: 600; }
dialog .table-wrap { margin-top: 16px; }
dialog .cards { margin-top: 20px; }
dialog .card { padding: 16px; }
dialog .card-value { font-size: 24px; }
.mobile-brand { display: none; }
.inline-error { border: 1px solid #f0d5d5; border-radius: 8px; padding: 22px; color: #b16767; background: #fff8f8; line-height: 1.8; overflow-wrap: anywhere; }
@media (min-width: 1500px) {
  .filters.detailed { grid-template-columns: 170px 170px 130px 130px minmax(140px, 1fr) minmax(200px, 1.4fr) max-content; gap: 12px; }
}
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 200px minmax(0, 1fr); }
  .topbar { padding: 0 24px; }
  .page { padding: 24px; }
  .breadcrumb-root, .breadcrumb-divider { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 20px; }
  .filters.detailed { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .account-panel { grid-template-columns: 190px minmax(0, 1fr); padding: 24px; }
  .account-security { padding-left: 24px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { height: auto; position: static; padding: 10px 12px; }
  .sidebar-brand, .scope { display: none; }
  .navigation { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .navigation button { justify-content: center; width: 100%; min-width: 0; min-height: 38px; padding: 9px 5px; font-size: 12px; }
  .navigation .icon { display: none; }
  .topbar { height: 60px; padding: 0 16px; gap: 8px; }
  .mobile-brand { display: block; font-size: 20px; }
  #current-view, .top-username, .avatar { display: none; }
  .top-actions { gap: 8px; }
  .top-actions select { width: 96px; height: 32px; }
  .logout-button span { display: none; }
  .logout-button { padding: 6px; min-height: 32px; }
  .page { padding: 22px 16px; }
  .heading { margin-bottom: 20px; gap: 8px; flex-wrap: wrap; }
  h1 { font-size: 21px; }
  .timezone { font-size: 11px; }
  .panel, .filter-panel { padding: 18px 16px; }
  .filters, .filters.detailed { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .filters button, .filters.detailed button { width: 100%; justify-self: stretch; }
  .cards { gap: 12px; }
  .card { padding: 16px; }
  .card-head { margin-bottom: 14px; }
  .card-title { font-size: 12px; }
  .card-icon { width: 25px; height: 25px; }
  .card-value { font-size: 24px; }
  .unit { display: block; margin: 4px 0 0; font-size: 10px; }
  .card-foot { font-size: 10px; }
  th, td { padding: 12px; }
  .status-panel th:first-child { width: 40%; }
  .share-track { display: none; }
  .pager { flex-wrap: wrap; gap: 14px; }
  .account-panel { display: block; }
  .account-identity { display: none; }
  .account-security { padding: 4px 0; }
  .account-form { max-width: none; }
  .login-topbar { padding: 24px; }
  .login-panel { padding: 30px 20px 55px; }
  .login-form { padding: 30px 26px 14px; }
  .login-form h1 { font-size: 21px; }
  dialog { width: 94vw; max-height: 90vh; }
  .dialog-header { padding: 16px 20px; }
  #detail-content { padding: 8px 20px 24px; }
  .details-grid { grid-template-columns: 1fr; }
  dialog .cards { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  button, input, select { transition: none; }
  dialog::backdrop { backdrop-filter: none; }
}
