:root {
  color: #18212f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f7fb;
  --ink: #18212f;
  --night: #101b2d;
  --blue: #1769e0;
  --paper: #ffffff;
  --line: #dce4ef;
  --muted: #657186;
  --green: #168260;
  --amber: #a5660b;
  --red: #c83c4a;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: inherit;
  text-decoration: none;
}
.wordmark.dark { color: var(--ink); }
.wordmark strong { display: block; font-size: 17px; font-weight: 750; letter-spacing: -.02em; line-height: 1.2; }
.wordmark .brand-name-en { display: inline; font-weight: 500; }
.wordmark small { display: block; margin-top: 2px; color: #9eb0c8; font-family: inherit; font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.wordmark-mark { width: 36px; height: 36px; flex: 0 0 auto; object-fit: contain; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.auth-layout { display: grid; grid-template-columns: minmax(390px, 46%) 1fr; min-height: 100vh; }
.auth-story { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(28px, 5vw, 70px); color: #fff; background: var(--night); }
.auth-story::after { position: absolute; right: -95px; bottom: 70px; width: 280px; height: 280px; border: 52px solid rgb(49 124 232 / 20%); border-radius: 50%; content: ""; }
.story-copy { position: relative; z-index: 1; max-width: 560px; margin: 90px 0; }
.story-copy h1 { margin: 0 0 22px; font-family: "Avenir Next", "PingFang SC", sans-serif; font-size: clamp(36px, 4.4vw, 66px); font-weight: 650; letter-spacing: -.055em; line-height: 1.08; }
.story-copy p { max-width: 510px; margin: 0; color: #aebcd0; font-size: 16px; line-height: 1.85; }
.story-steps { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: steps; }
.story-steps li { position: relative; display: grid; gap: 6px; border-top: 1px solid #3b4960; padding: 18px 12px 0 0; counter-increment: steps; }
.story-steps li::before { position: absolute; top: -6px; left: 0; width: 11px; height: 11px; border: 2px solid var(--night); border-radius: 50%; background: #6ea6fa; content: ""; }
.story-steps strong { font-size: 16px; line-height: 1.35; }
.story-steps span { color: #8594aa; font-size: 13px; line-height: 1.45; }

.auth-panel { display: grid; place-items: center; padding: 36px; background: #f4f7fb; }
.auth-card { width: min(100%, 440px); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.auth-tabs button { height: 48px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 700; background: transparent; }
.auth-tabs button.active { border-color: var(--blue); color: var(--ink); }
.auth-form { display: grid; gap: 17px; }
.form-heading { margin-bottom: 8px; }
.form-heading h2 { margin: 0 0 7px; font-family: "Avenir Next", "PingFang SC", sans-serif; font-size: 30px; letter-spacing: -.035em; }
.form-heading p, .withdraw-panel > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.auth-form label, .auth-form .form-field, .withdraw-panel label { display: grid; gap: 7px; }
.auth-form label > span, .auth-form .form-field > label, .withdraw-panel label > span { color: #48566b; font-size: 12px; font-weight: 700; }
input { width: 100%; height: 43px; border: 1px solid #cbd6e5; border-radius: 8px; outline: 0; padding: 0 12px; color: var(--ink); background: var(--paper); transition: border-color 150ms, box-shadow 150ms; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(23 105 224 / 12%); }
.verification-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.verification-code-row input { min-width: 0; }
.verification-button { min-width: 104px; height: 43px; border: 1px solid #b9c7da; border-radius: 8px; padding: 0 12px; color: var(--blue); font-size: 12px; font-weight: 750; white-space: nowrap; background: #fff; }
.verification-button:hover:not(:disabled) { border-color: var(--blue); background: #f1f6fe; }
.verification-button:disabled { color: #8b98aa; background: #edf1f6; cursor: not-allowed; }
.form-link-row { display: flex; justify-content: flex-end; margin-top: -7px; }
.text-button { border: 0; padding: 2px 0; color: var(--blue); font-size: 12px; font-weight: 700; background: transparent; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.check-field { display: flex !important; align-items: center; grid-template-columns: auto 1fr; }
.check-field input { width: 16px; height: 16px; accent-color: var(--blue); }
.primary-button { min-height: 43px; border: 1px solid var(--blue); border-radius: 8px; padding: 0 17px; color: #fff; font-weight: 750; background: var(--blue); box-shadow: 0 5px 14px rgb(23 105 224 / 15%); }
.primary-button:hover:not(:disabled) { background: #0f5cca; }
.primary-button:disabled { border-color: #aeb9c8; background: #aeb9c8; box-shadow: none; cursor: not-allowed; }
.secondary-button { min-height: 43px; border: 1px solid #cbd6e5; border-radius: 8px; padding: 0 17px; color: #48566b; font-weight: 700; background: #fff; }
.secondary-button:hover { border-color: #9fb0c7; background: #f8fafc; }
.form-status { min-height: 20px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-status:empty { min-height: 0; }
.form-status.error { color: var(--red); }
.form-status.success { color: var(--green); }

.dashboard { min-height: 100vh; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; height: 72px; border-bottom: 1px solid var(--line); padding: 0 max(24px, calc((100vw - 1280px) / 2)); background: rgb(255 255 255 / 92%); backdrop-filter: blur(12px); }
.account-actions { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.account-actions button, .voucher-link button { height: 34px; border: 1px solid #cbd6e5; border-radius: 7px; padding: 0 12px; color: var(--ink); font-weight: 700; background: #fff; }
.dashboard-content { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 34px 0 60px; }
.invite-voucher { position: relative; display: grid; grid-template-columns: 1fr minmax(340px, 45%); align-items: end; overflow: hidden; min-height: 210px; border-radius: 16px; padding: clamp(25px, 4vw, 46px); color: #fff; background: linear-gradient(126deg, #101b2d 0%, #172a48 72%, #17447f 100%); box-shadow: 0 18px 46px rgb(34 54 85 / 16%); }
.invite-voucher::after { position: absolute; top: -65px; right: 28%; width: 170px; height: 340px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 50%; transform: rotate(28deg); content: ""; }
.invite-voucher > * { position: relative; z-index: 1; }
.invite-voucher .eyebrow { color: #85b6ff; }
.invite-voucher h1 { margin: 16px 0 5px; font-family: "SFMono-Regular", Consolas, monospace; font-size: clamp(36px, 5vw, 60px); letter-spacing: .04em; }
.invite-voucher p { margin: 0; color: #aebed5; font-size: 14px; }
.voucher-link { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; border-left: 1px dashed rgb(255 255 255 / 24%); padding-left: clamp(22px, 4vw, 54px); }
.voucher-link span { grid-column: 1 / -1; color: #8ea2be; font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.voucher-link code { min-width: 0; overflow: hidden; color: #e7effb; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.voucher-link button { border-color: rgb(255 255 255 / 25%); color: #fff; background: rgb(255 255 255 / 9%); }

.money-rail { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.money-rail::before { position: absolute; top: 0; right: 0; left: 0; height: 3px; background: linear-gradient(90deg, #7e8ca1 0 25%, var(--amber) 25% 50%, var(--green) 50% 75%, var(--blue) 75%); content: ""; }
.money-rail article { display: grid; gap: 5px; border-left: 1px solid var(--line); padding: 23px 24px 20px; }
.money-rail article:first-child { border-left: 0; }
.money-rail span, .money-rail small { color: var(--muted); font-size: 11px; }
.money-rail strong { font-family: "Avenir Next", sans-serif; font-size: 27px; letter-spacing: -.03em; }
.money-rail .frozen strong { color: var(--amber); }
.money-rail .available strong { color: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(310px, .75fr); gap: 18px; align-items: start; margin-top: 18px; }
.main-stack, .side-stack { display: grid; gap: 18px; }
.side-stack { align-content: start; align-items: start; }
.panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; padding: 23px; background: var(--paper); }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-head.compact { margin-bottom: 14px; }
.panel h2 { margin: 5px 0 0; font-family: "Avenir Next", "PingFang SC", sans-serif; font-size: 20px; letter-spacing: -.025em; }
.panel h2:first-child { margin-top: 0; }
.mini-stat { display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 5px; color: var(--muted); white-space: nowrap; }
.mini-stat strong { color: var(--ink); font-family: "Avenir Next", sans-serif; font-size: 23px; line-height: 1; }
.mini-stat span { font-size: 12px; }
.data-table { overflow-x: auto; }
.data-row { display: grid; grid-template-columns: minmax(145px, 1.3fr) 90px 58px 82px 72px 130px; gap: 11px; align-items: center; min-width: 680px; min-height: 52px; border-top: 1px solid #edf1f6; color: #3e4a5e; font-size: 12px; }
.data-head { min-height: 36px; border-top: 0; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.data-row code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.status-pill { display: inline-flex; width: fit-content; border-radius: 999px; padding: 4px 8px; color: #546175; font-size: 10px; font-weight: 800; background: #edf1f6; }
.status-pill.available, .status-pill.paid { color: #0d7252; background: #e4f5ee; }
.status-pill.frozen, .status-pill.pending { color: #94600e; background: #fff2d8; }
.status-pill.reversed, .status-pill.rejected { color: #b32d3b; background: #fde9eb; }
.empty-state { padding: 34px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.withdraw-panel { border-top: 3px solid var(--blue); }
.withdraw-panel > p { margin: 9px 0 18px; }
.withdraw-panel form { display: grid; gap: 13px; }
.withdraw-panel > .form-status { margin: 13px 0 0; }
.withdraw-panel > .form-status:empty { margin: 0; }
.withdrawal-list { display: grid; }
.withdrawal-item { display: grid; grid-template-columns: 1fr auto; gap: 5px 15px; border-top: 1px solid #edf1f6; padding: 13px 0; }
.withdrawal-item:first-child { border-top: 0; }
.withdrawal-item strong { font-size: 13px; }
.withdrawal-item time, .withdrawal-item small { color: var(--muted); font-size: 10px; }
.withdrawal-item .status-pill { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-story { min-height: 410px; padding: 28px; }
  .story-copy { margin: 55px 0; }
  .story-copy h1 { font-size: 42px; }
  .auth-panel { padding: 50px 24px; }
  .invite-voucher { grid-template-columns: 1fr; gap: 28px; }
  .voucher-link { border-top: 1px dashed rgb(255 255 255 / 24%); border-left: 0; padding-top: 22px; padding-left: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .money-rail { grid-template-columns: repeat(2, 1fr); }
  .money-rail article:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .money-rail article:nth-child(4) { border-top: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .auth-story { min-height: 360px; }
  .story-copy { margin: 38px 0; }
  .story-copy h1 { font-size: 34px; }
  .story-steps span { display: none; }
  .dashboard-header { height: 64px; padding: 0 16px; }
  .account-actions span { display: none; }
  .dashboard-content { width: calc(100% - 24px); padding-top: 16px; }
  .invite-voucher { min-height: 250px; border-radius: 12px; padding: 24px 20px; }
  .voucher-link { grid-template-columns: 1fr; }
  .voucher-link button { width: 100%; }
  .money-rail { grid-template-columns: 1fr; }
  .money-rail article { border-top: 1px solid var(--line); border-left: 0; }
  .money-rail article:first-child { border-top: 0; }
  .money-rail article { padding: 18px 15px; }
  .money-rail strong { font-size: 21px; }
  .panel { border-radius: 10px; padding: 18px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
