:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #152637;
  background: #f4f7fa;
  font-size: 16px;
  font-synthesis: none;
  --surface: #fff;
  --ink: #152637;
  --muted: #53677a;
  --line: #dce5ed;
  --nav: #112437;
  --primary: #09736d;
  --primary-hover: #085b57;
  --soft: #e6f5f3;
  --radius: 16px;
  --shadow: 0 3px 12px #18355007;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .67; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid #41aaa5;
  outline-offset: 2px;
}
h1, h2, p { margin-top: 0; }
h1, h2 { line-height: 1.22; }
h1 { font-size: clamp(2rem, 4vw, 2.65rem); margin-bottom: .6rem; letter-spacing: -.04em; }
h2 { font-size: 1.2rem; margin-bottom: .9rem; }
p { line-height: 1.6; margin-bottom: 0; }
.muted, .field-note { color: var(--muted); }
.numeric { font-variant-numeric: tabular-nums; }
.loading { min-height: 100vh; display: grid; place-items: center; padding: 24px; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; font-weight: 780; letter-spacing: .035em; color: #f4fbff; line-height: 1.05; }
.brand-sub { display: block; color: #b7cfdf; font-size: .81rem; font-weight: 500; letter-spacing: .03em; margin-top: 6px; }
.brand-mark { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #71e1cf; color: #133438; position: relative; }
.brand-mark::before { content: ""; width: 21px; height: 14px; border: 2px solid currentColor; border-radius: 4px; }
.brand-mark::after { content: ""; position: absolute; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }

.login-page { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(385px, 1fr); min-height: 100vh; }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; position: relative; isolation: isolate; overflow: hidden; padding: clamp(32px, 6vw, 88px); background: linear-gradient(145deg, #102034, #143a4a 72%, #1c625f); color: #f4fbff; }
.login-title { margin: auto 0; padding: 54px 0; }
.login-title h1 { font-size: clamp(3rem, 6.5vw, 6rem); line-height: 1.03; letter-spacing: -.06em; margin-bottom: 26px; }
.login-title p { color: #c5dce5; }
.login-decoration { position: absolute; z-index: -1; width: 630px; height: 630px; border-radius: 50%; left: 51%; bottom: -360px; border: 1px solid #8ddbd853; box-shadow: 0 0 0 37px #8ddbd819, 0 0 0 80px #8ddbd817, 0 0 0 131px #8ddbd810; }
.login-main { display: grid; place-items: center; padding: 44px 34px; }
.login-form { width: min(100%, 400px); background: var(--surface); box-shadow: 0 16px 50px #243a5110; border: 1px solid var(--line); border-radius: 22px; padding: clamp(24px, 5vw, 46px); }
.login-form h2 { font-size: 1.65rem; margin-bottom: 8px; }
.login-form .muted { margin-bottom: 24px; }
.login-form .button { margin-top: 22px; width: 100%; }
.login-form .mode-label { display: inline-block; margin-top: 20px; }

.dashboard { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0, 1fr); }
.sidebar { background: var(--nav); color: white; padding: 30px 20px 24px; display: flex; flex-direction: column; align-self: start; position: sticky; top: 0; min-height: 100vh; }
.sidebar .brand { margin: 0 7px 42px; }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.nav-link { display: flex; align-items: center; gap: 13px; text-align: left; text-decoration: none; border: 0; border-radius: 10px; padding: 11px 13px; color: #bdd0df; background: transparent; min-height: 44px; white-space: nowrap; }
.nav-link span { width: 20px; text-align: center; font-size: 1.16rem; }
.nav-link:hover { background: #1e384e; color: #fff; }
.nav-link[aria-current] { background: #214453; color: #b6faec; font-weight: 690; }
.sidebar-footer { display: flex; flex-direction: column; gap: 14px; border-top: 1px solid #344a60; padding: 18px 6px 0; margin-top: auto; }
.profile { display: flex; gap: 10px; align-items: center; min-width: 0; }
.profile-text { display: grid; gap: 4px; min-width: 0; }
.profile-text strong { overflow: hidden; text-overflow: ellipsis; }
.profile small { color: #b7cfdf; font-size: .82rem; }
.avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #335771; font-weight: 700; }
.account-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.account-action { color: #bfd7e5; padding: 5px 0; border: 0; background: none; font-size: .875rem; white-space: nowrap; }
.account-action:hover { color: #fff; text-decoration: underline; }

.main { width: min(100%, 1400px); padding: 40px clamp(18px, 4vw, 65px); margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.page-header h1 { font-size: clamp(1.625rem, 3vw, 2rem); }
.page-header p { color: var(--muted); }
.mode-label { border-radius: 999px; background: #e4efee; color: #265b58; padding: 5px 11px; font-size: .85rem; white-space: nowrap; }
.overview-grid, .compose-grid { display: grid; gap: 20px; margin-bottom: 20px; }
.overview-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.28fr); }
.compose-grid { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); align-items: start; }
.card, .balance-card { border-radius: var(--radius); padding: clamp(19px, 2.6vw, 30px); }
.card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.balance-card { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; position: relative; overflow: hidden; isolation: isolate; min-height: 206px; background: linear-gradient(130deg, #13364c, #195c62); color: #fff; }
.balance-card::after { content: ""; position: absolute; z-index: -1; border: 1px solid #b1efe344; width: 230px; height: 230px; border-radius: 50%; top: 35%; left: 65%; box-shadow: 0 0 0 22px #b1efe319, 0 0 0 46px #b1efe311; }
.balance-card h2 { font-size: 1rem; margin-bottom: 9px; display: flex; align-items: center; gap: 10px; }
.balance-unit { color: #cfebe9; font-size: .76rem; letter-spacing: .04em; border: 1px solid #c1e7e463; border-radius: 5px; padding: 3px 6px; }
.balance-number { font-size: clamp(2rem, 4.2vw, 3.35rem); font-variant-numeric: tabular-nums; font-weight: 760; line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; }
.balance-placeholder { font-size: 1.375rem; letter-spacing: 0; }
.balance-caption { color: #cfebe9; font-size: .875rem; margin-top: 9px; }
.user-balance { display: block; }
.balance-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.balance-heading h2 { margin-bottom: 0; }
.user-balance .balance-number { margin-top: 19px; }

label { display: block; font-weight: 650; font-size: .94rem; margin: 15px 0 7px; }
.compose-card form > label:first-child { margin-top: 0; }
input, textarea { display: block; padding: 10px 12px; min-height: 43px; width: 100%; border: 1px solid #cbd8e3; border-radius: 9px; color: var(--ink); background: #fff; }
input::placeholder, textarea::placeholder { color: #697c8f; }
textarea { resize: vertical; line-height: 1.55; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.create-card .button { margin-top: 18px; }
.field-note { font-size: .875rem; margin: 6px 0 18px; }
.field-error { color: #8b2d28; background: #fdebe8; border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; }
.counter { text-align: right; margin-bottom: 14px; }
.send-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 17px; }
.send-footer .muted { font-size: .875rem; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 8px 15px; border: 1px solid transparent; border-radius: 8px; font-weight: 680; white-space: nowrap; }
.button.primary { background: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-hover); }
.button.secondary { color: #254456; background: #fff; border-color: #cfdee7; }
.button.secondary:hover { background: #edf4f8; }
.button.danger-outline { color: #8b2d28; border-color: #e7c4c1; }
.button.danger-outline:hover { background: #fdebe8; }
.button.danger { background: #a42d2b; color: #fff; }
.button.danger:hover { background: #842421; }
.button.on-dark { font-size: .875rem; color: #fff; background: #ffffff16; border-color: #c1e7e477; }
.button.on-dark:hover { background: #ffffff32; }
.button.compact { font-size: .875rem; padding: 6px 11px; min-height: 36px; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.section-heading h2 { margin: 0; }
.section-heading p { margin-top: 6px; font-size: .94rem; }
.table-card > div:last-child { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .94rem; white-space: nowrap; }
th, td { padding: 12px; }
th { background: #edf3f7; color: #395368; font-weight: 650; }
td { border-bottom: 1px solid #e4ecf2; }
tr:last-child td { border-bottom: 0; }
th:first-child { border-radius: 7px 0 0 7px; }
th:last-child { border-radius: 0 7px 7px 0; }
td:last-child, th:last-child { text-align: right; }
.table-actions { display: inline-flex; gap: 8px; }
.empty { padding: 24px 8px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 9px; }
.status { display: inline-block; border-radius: 999px; background: #edf2f7; color: #375269; padding: 4px 9px; font-size: .84rem; font-weight: 650; }
.status-cell { display: inline-flex; align-items: center; gap: 8px; }
.demo-label { color: var(--muted); font-size: .84rem; }
.status-submitted { color: #0f5e55; background: #def4ed; }
.status-uncertain, .status-partial { color: #795000; background: #fff0cf; }
.status-rejected { color: #8b2d28; background: #fdebe8; }
.result-card > p, .result-card > button { margin-top: 12px; }
.message-preview { white-space: pre-wrap; overflow-wrap: anywhere; background: #f1f6f9; border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; margin: 12px 0; }
.record-list { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
ul.record-list { padding-left: 22px; }
.record-list li + li { margin-top: 7px; }
.batch-controls { display: flex; align-items: center; gap: 10px; }
.batch-controls select { flex: 1; min-width: 0; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font: inherit; color: var(--ink); background: #fff; }
.batch-result { margin-top: 15px; }
.batch-result .record-list { max-height: 230px; overflow-y: auto; }
.recipients-table { max-height: min(24rem, 42vh); overflow: auto; margin: 10px 0 14px; border: 1px solid var(--line); border-radius: 8px; }
.recipients-table table { font-variant-numeric: tabular-nums; }
.recipients-table th { position: sticky; top: 0; }
.recipients-table th, .recipients-table td { padding: 8px 12px; text-align: left; }
.recipients-table th:first-child { width: 5rem; }
.recipients-table:focus-visible { outline: 3px solid #41aaa5; outline-offset: 2px; }
.receipt-details { margin-bottom: 12px; }
.receipt-details summary { color: var(--primary); cursor: pointer; }
dialog { width: min(calc(100% - 28px), 540px); border: 1px solid var(--line); color: var(--ink); border-radius: var(--radius); padding: 24px; box-shadow: 0 12px 60px #11243755; }
dialog::backdrop { background: #11243790; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.inline-error { margin-top: 12px; }
.toast { position: fixed; z-index: 2; bottom: 22px; right: 22px; max-width: min(440px, calc(100% - 44px)); background: #173c43; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 6px 22px #17354545; }
.toast.error { background: #802e2f; }

@media (max-width: 1060px) {
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 900px) {
  .dashboard { grid-template-columns: 183px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .compose-grid { grid-template-columns: minmax(0, 1fr); }
  .user-balance { grid-row: 1; min-height: 145px; }
}
@media (max-width: 720px) {
  .login-page { grid-template-columns: 1fr; }
  .login-intro { padding: 24px; }
  .login-title { padding: 32px 0 8px; }
  .login-title h1 { font-size: 2.8rem; margin-bottom: 12px; }
  .login-title br { display: none; }
  .login-main { padding: 25px 18px; align-items: start; }
  .dashboard { display: block; }
  .sidebar { min-height: auto; position: static; padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
  .sidebar .brand { margin: 0; }
  .sidebar nav { grid-row: 2; grid-column: 1 / -1; flex-direction: row; }
  .nav-link { min-height: 39px; padding: 6px 10px; gap: 6px; }
  .sidebar-footer { border: 0; padding: 0; margin: 0; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 3px 8px; }
  .account-actions { gap: 4px 8px; }
  .avatar { display: none; }
  .profile-text { max-width: 92px; font-size: .8rem; }
  .profile small { display: none; }
  .main { padding-top: 26px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 390px) {
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .send-footer { flex-wrap: wrap; }
}
