:root {
    --bg: #f3f6fb;
    --card: #ffffff;
    --ink: #0f172a;
    --ink-soft: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #e5eaf2;
    --line-strong: #d8e0ec;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --brand-2: #7c3aed;
    --green: #059669;
    --green-bg: #ecfdf5;
    --red: #dc2626;
    --red-bg: #fef2f2;
    --amber: #d97706;
    --amber-bg: #fffbeb;
    --info: #0284c7;
    --info-bg: #f0f9ff;
    --sidebar: #0b1220;
    --sidebar-soft: #131d31;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.12);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; line-height: 1.3; }
p { margin: 0; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
    white-space: nowrap;
    line-height: 1.3;
    background: #fff;
    color: var(--ink);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, .24); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 26px rgba(37, 99, 235, .32); }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-soft { background: #eef4ff; color: var(--brand); }
.btn-soft:hover { background: #e3edff; }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: var(--green-bg); color: var(--green); border-color: #a7f3d0; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--ink-soft); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.input, .select, .textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    outline: none;
    transition: border-color .18s, box-shadow .18s;
    font-size: 14px;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.textarea { resize: vertical; min-height: 110px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 10px 0 0 10px; }
.input-group .btn { border-radius: 0 10px 10px 0; border-left: 0; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--brand); }
.radio-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-card { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 9px; cursor: pointer; font-size: 13px; background: #fff; }
.radio-card input { accent-color: var(--brand); }
.radio-card:has(input:checked) { border-color: var(--brand); background: #f5f8ff; color: var(--brand); }

/* ---------- Alerts ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 15px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; border: 1px solid transparent; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--green-bg); color: #047857; border-color: #a7f3d0; }
.alert-danger { background: var(--red-bg); color: #b91c1c; border-color: #fecaca; }
.alert-warning { background: var(--amber-bg); color: #92400e; border-color: #fde68a; }
.alert-info { background: var(--info-bg); color: #0369a1; border-color: #bae6fd; }
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.flash-stack .alert { margin-bottom: 0; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.badge-success { background: var(--green-bg); color: var(--green); }
.badge-warning { background: var(--amber-bg); color: var(--amber); }
.badge-danger { background: var(--red-bg); color: var(--red); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #f1f5f9; color: var(--muted); }
.badge-brand { background: #eef4ff; color: var(--brand); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar {
    width: 252px;
    flex: none;
    background: linear-gradient(180deg, var(--sidebar) 0%, #0d1626 100%);
    color: #cbd5e1;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px; }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #3b82f6, #8b5cf6); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 18px; box-shadow: 0 6px 16px rgba(59, 130, 246, .35); flex: none; }
.brand-text strong { display: block; font-size: 15px; color: #fff; letter-spacing: .3px; }
.brand-text span { display: block; font-size: 11px; color: #7c8ca5; letter-spacing: 1.5px; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #26344d; border-radius: 4px; }
.nav-group { margin-top: 18px; }
.nav-label { font-size: 11px; letter-spacing: 1.5px; color: #5b6b84; padding: 0 12px 7px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: #a9b6c9; font-size: 13.5px; margin-bottom: 3px; transition: all .15s; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(59, 130, 246, .22), rgba(124, 58, 237, .12)); color: #fff; box-shadow: inset 2px 0 0 #60a5fa; }
.nav-item .icon { color: #7f90a8; }
.nav-item.active .icon, .nav-item:hover .icon { color: #93c5fd; }
.nav-badge { margin-left: auto; background: rgba(239, 68, 68, .9); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #8b5cf6); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.side-user .meta { min-width: 0; flex: 1; }
.side-user .meta strong { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .meta span { display: block; color: #7f90a8; font-size: 11px; }
.logout-btn { background: none; border: 0; color: #7f90a8; cursor: pointer; padding: 6px; border-radius: 7px; display: flex; }
.logout-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.main { flex: 1; min-width: 0; margin-left: 252px; display: flex; flex-direction: column; }
.topbar { height: 66px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 28px; position: sticky; top: 0; z-index: 40; }
.topbar h1 { font-size: 17px; }
.topbar .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.balance-chip { display: inline-flex; align-items: center; gap: 8px; background: #f1f5ff; border: 1px solid #dbe6ff; color: var(--brand); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
.balance-chip span { color: var(--muted); font-weight: 500; font-size: 12px; }
.menu-toggle { display: none; background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; width: 38px; height: 38px; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-soft); }
.page { padding: 26px 28px 48px; max-width: 1500px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; }
.page-head p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 20px 22px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 1.65fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stat-card { padding: 20px 22px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(37, 99, 235, .08), transparent 70%); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #eef4ff; color: var(--brand); }
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.amber { background: var(--amber-bg); color: var(--amber); }
.stat-icon.purple { background: #f5f3ff; color: var(--brand-2); }
.stat-value { font-size: 25px; font-weight: 700; margin-top: 12px; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat-foot { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.trend-up { color: var(--green); font-weight: 600; }
.trend-down { color: var(--red); font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 12px 16px; color: var(--muted); font-weight: 600; font-size: 12px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafcff; }
.table .mono { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.table .amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .amount.plus { color: var(--green); }
.table .amount.minus { color: var(--red); }
.table .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-empty { padding: 54px 20px; text-align: center; color: var(--muted); }
.table-empty .icon { width: 40px; height: 40px; color: var(--muted-2); margin-bottom: 10px; }
.table-empty strong { display: block; color: var(--ink-soft); font-size: 14px; margin-bottom: 4px; }

/* ---------- Filters ---------- */
.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.filters .field { margin: 0; }
.filters .input, .filters .select { height: 38px; padding-top: 7px; padding-bottom: 7px; font-size: 13px; }
.filters .input[type="date"] { min-width: 140px; }
.filters .search { min-width: 220px; }
.filter-summary { margin-left: auto; font-size: 12px; color: var(--muted); padding-bottom: 9px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pagination .info { font-size: 12px; color: var(--muted); }
.pager { display: flex; gap: 5px; }
.pager a, .pager span { min-width: 32px; height: 32px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 12.5px; border: 1px solid var(--line); color: var(--ink-soft); background: #fff; }
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager .disabled { color: var(--muted-2); background: #f8fafc; }

/* ---------- Charts ---------- */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding: 8px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart-bar-wrap { width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: 60%; max-width: 34px; min-height: 4px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #60a5fa, #2563eb); position: relative; transition: height .3s; }
.chart-bar:hover { background: linear-gradient(180deg, #818cf8, #4f46e5); }
.chart-bar .tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 10px; padding: 3px 7px; border-radius: 5px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
.chart-bar:hover .tip { opacity: 1; }
.chart-label { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---------- API / code ---------- */
.code-block { background: #0f172a; color: #dbeafe; border-radius: 12px; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.75; }
.code-block .c { color: #64748b; }
.code-block .k { color: #93c5fd; }
.code-block .s { color: #86efac; }
.code-inline { font-family: var(--mono); font-size: 12px; background: #f1f5f9; color: #0f172a; padding: 2px 6px; border-radius: 5px; }
.copy-field { display: flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 7px 8px 7px 12px; }
.copy-field code { flex: 1; font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); word-break: break-all; }
.copy-field .btn { flex: none; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 11px 18px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink-soft); word-break: break-all; }
.section-title { font-size: 16px; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title .num { width: 24px; height: 24px; border-radius: 7px; background: #eef4ff; color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.doc-text { color: var(--ink-soft); font-size: 14px; line-height: 1.85; }
.doc-text p { margin-bottom: 10px; }
.doc-list { padding-left: 20px; color: var(--ink-soft); line-height: 1.9; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 20px; overflow-x: auto; }
.tab { padding: 13px 14px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- Pay type logos ---------- */
.pay-logo { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 700; flex: none; }
.pay-logo.sm { width: 26px; height: 26px; font-size: 12px; border-radius: 7px; }
.pay-type-cell { display: flex; align-items: center; gap: 9px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: #fff; }
.auth-side { background: linear-gradient(150deg, #0b1220 0%, #172554 55%, #312e81 100%); color: #fff; padding: 52px 58px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-side::before { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(96, 165, 250, .28), transparent 65%); right: -120px; top: -100px; }
.auth-side::after { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(167, 139, 250, .22), transparent 65%); left: -120px; bottom: -120px; }
.auth-side > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-logo { width: 44px; height: 44px; font-size: 20px; }
.auth-brand strong { font-size: 17px; display: block; }
.auth-brand span { font-size: 11px; color: #93a4bf; letter-spacing: 2px; }
.auth-hero { margin: auto 0; padding: 40px 0; }
.auth-hero h2 { font-size: 34px; line-height: 1.35; letter-spacing: -.5px; }
.auth-hero h2 em { font-style: normal; background: linear-gradient(90deg, #60a5fa, #c4b5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: #a7b6cc; font-size: 14px; margin-top: 14px; max-width: 430px; line-height: 1.9; }
.auth-points { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 32px; }
.auth-point { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); border-radius: 12px; padding: 14px 15px; }
.auth-point .icon { color: #93c5fd; margin-bottom: 8px; }
.auth-point strong { display: block; font-size: 13px; }
.auth-point span { font-size: 11.5px; color: #93a4bf; }
.auth-foot { font-size: 12px; color: #64748b; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 28px; background: #fff; }
.auth-form { width: 100%; max-width: 390px; }
.auth-form .eyebrow { font-size: 12px; color: var(--brand); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.auth-form h2 { font-size: 26px; letter-spacing: -.5px; }
.auth-form .lead { color: var(--muted); font-size: 13.5px; margin: 8px 0 26px; }
.auth-form .btn { margin-top: 6px; }
.auth-alt { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }
.auth-alt a { font-weight: 600; }
.auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 24px; }
.auth-back:hover { color: var(--brand); }
.auth-note { margin-top: 22px; padding: 12px 14px; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.auth-side.admin { background: linear-gradient(150deg, #0b1220 0%, #1e1b4b 55%, #4c1d95 100%); }

/* ---------- Landing ---------- */
.landing { background: #fff; }
.site-head { max-width: 1180px; margin: 0 auto; padding: 20px 24px; display: flex; align-items: center; gap: 14px; }
.site-head .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.site-head .brand strong { font-size: 16px; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.site-nav a { color: var(--ink-soft); font-size: 13.5px; padding: 8px 13px; border-radius: 8px; }
.site-nav a:hover { background: #f1f5f9; color: var(--ink); }
.site-nav .btn { margin-left: 8px; }
.hero { background: radial-gradient(circle at 18% 20%, #e0eaff 0%, transparent 42%), radial-gradient(circle at 82% 12%, #ede9fe 0%, transparent 40%), linear-gradient(180deg, #f8faff 0%, #fff 100%); border-bottom: 1px solid var(--line); }
.hero-inner { max-width: 1180px; margin: 0 auto; padding: 72px 24px 78px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; background: #eef4ff; color: var(--brand); font-size: 12px; font-weight: 600; border: 1px solid #dbe6ff; }
.hero h1 { font-size: 46px; line-height: 1.22; letter-spacing: -1.2px; margin: 18px 0 16px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 15px; line-height: 1.9; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; margin-top: 38px; flex-wrap: wrap; }
.hero-stat strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: 12px; color: var(--muted); }
.hero-visual { position: relative; }
.mock-window { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; transform: rotate(-1.2deg); }
.mock-head { height: 42px; background: #f8fafc; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; padding: 0 15px; }
.mock-dot { width: 9px; height: 9px; border-radius: 50%; background: #e2e8f0; }
.mock-dot:nth-child(1) { background: #fca5a5; }
.mock-dot:nth-child(2) { background: #fcd34d; }
.mock-dot:nth-child(3) { background: #86efac; }
.mock-body { padding: 20px; }
.mock-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.mock-row:last-child { border-bottom: 0; }
.mock-row .t { color: var(--muted); }
.mock-row .v { font-weight: 600; }
.mock-amount { font-size: 30px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 4px; }
.mock-pays { display: flex; gap: 8px; margin-top: 14px; }
.mock-pay { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: 9px 4px; font-size: 11px; color: var(--muted); }
.mock-pay.active { border-color: var(--brand); background: #f5f8ff; color: var(--brand); font-weight: 600; }
.mock-float { position: absolute; right: -18px; bottom: 26px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 16px; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.mock-float .ok-ico { width: 30px; height: 30px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: flex; align-items: center; justify-content: center; }
.section { max-width: 1180px; margin: 0 auto; padding: 70px 24px; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 42px; }
.section-head .eyebrow { font-size: 12px; letter-spacing: 2px; color: var(--brand); font-weight: 700; text-transform: uppercase; }
.section-head h2 { font-size: 31px; letter-spacing: -.6px; margin: 10px 0 12px; }
.section-head p { color: var(--muted); font-size: 14px; line-height: 1.9; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; transition: all .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c7d7f5; }
.feature .ico { width: 42px; height: 42px; border-radius: 11px; background: #eef4ff; color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feature h3 { font-size: 15.5px; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 13px; line-height: 1.85; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.flow-step { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; position: relative; }
.flow-step .num { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; margin-bottom: 14px; }
.flow-step h4 { font-size: 14px; margin-bottom: 6px; }
.flow-step p { font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.notice-strip { background: #f8fafc; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.notice-inner { max-width: 1180px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-soft); }
.notice-inner .icon { color: var(--brand); }
.notice-inner a { margin-left: auto; font-size: 12.5px; }
.site-foot { border-top: 1px solid var(--line); background: #fff; }
.site-foot-inner { max-width: 1180px; margin: 0 auto; padding: 26px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.site-foot-inner a { color: var(--muted); }
.site-foot-inner a:hover { color: var(--brand); }

/* ---------- Public doc ---------- */
.doc-page { max-width: 980px; margin: 0 auto; padding: 46px 24px 70px; }
.doc-page h1 { font-size: 32px; letter-spacing: -.6px; }
.doc-page .lead { color: var(--muted); font-size: 14px; margin: 10px 0 30px; }
.doc-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; margin-bottom: 18px; }
.doc-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.doc-nav a { padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--ink-soft); background: #fff; }
.doc-nav a:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Cashier ---------- */
.cashier-page { min-height: 100vh; background: radial-gradient(circle at 20% 10%, #e5edff, transparent 38%), radial-gradient(circle at 80% 0%, #f3e8ff, transparent 34%), #f4f7fc; display: flex; flex-direction: column; }
.cashier-head { padding: 24px 20px 0; display: flex; align-items: center; justify-content: center; }
.cashier-brand { display: flex; align-items: center; gap: 10px; }
.cashier-brand strong { font-size: 15px; }
.cashier-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 28px 16px 44px; }
.cashier-card { width: 100%; max-width: 470px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.cashier-top { padding: 26px 28px 22px; text-align: center; border-bottom: 1px dashed var(--line); background: linear-gradient(180deg, #fbfdff, #fff); }
.cashier-top .merchant-name { font-size: 12.5px; color: var(--muted); }
.cashier-amount { font-size: 36px; font-weight: 700; letter-spacing: -1px; margin: 8px 0 6px; font-variant-numeric: tabular-nums; }
.cashier-amount small { font-size: 16px; font-weight: 600; margin-right: 3px; }
.cashier-order { font-size: 12.5px; color: var(--muted); word-break: break-all; }
.cashier-body { padding: 22px 28px 26px; }
.cashier-body h3 { font-size: 14px; margin-bottom: 14px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-option { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 11px; padding: 12px 14px; background: #fff; transition: all .16s; cursor: pointer; color: var(--ink-soft); font-size: 13.5px; font-weight: 600; }
.pay-option:hover { border-color: var(--brand); background: #f7faff; box-shadow: 0 4px 14px rgba(37, 99, 235, .1); color: var(--ink); }
.pay-option .arrow { margin-left: auto; color: var(--muted-2); }
.cashier-notice { margin-top: 18px; background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.cashier-timer { margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted); }
.cashier-timer strong { color: var(--amber); font-variant-numeric: tabular-nums; }
.qr-box { width: 216px; height: 216px; margin: 0 auto 12px; padding: 10px; background: #fff; border: 1px solid var(--line-strong); border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qr-box img, .qr-box canvas, .qr-box svg, .qr-box table { max-width: 100%; max-height: 100%; display: block; }
.qr-tip { text-align: center; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.qr-tip strong { color: var(--ink); font-size: 15px; }
.cashier-foot { text-align: center; padding: 16px; font-size: 11.5px; color: var(--muted-2); border-top: 1px solid var(--line); background: #fbfcfe; }
.cashier-result { text-align: center; padding: 38px 30px; }
.result-icon { width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.result-icon.ok { background: var(--green-bg); color: var(--green); }
.result-icon.wait { background: var(--amber-bg); color: var(--amber); }
.result-icon.fail { background: var(--red-bg); color: var(--red); }
.result-icon .icon { width: 34px; height: 34px; }
.cashier-result h2 { font-size: 21px; }
.cashier-result p { color: var(--muted); font-size: 13px; margin-top: 8px; }
.result-amount { font-size: 30px; font-weight: 700; margin: 18px 0 4px; }
.result-meta { margin: 20px 0; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; text-align: left; }
.result-meta .row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 5px 0; gap: 16px; }
.result-meta .row span:first-child { color: var(--muted); }
.result-meta .row span:last-child { word-break: break-all; text-align: right; }
.sandbox-tag { display: inline-flex; align-items: center; gap: 6px; background: #fffbeb; color: #b45309; border: 1px solid #fde68a; border-radius: 999px; padding: 4px 11px; font-size: 11.5px; font-weight: 600; margin-bottom: 12px; }

/* ---------- Misc ---------- */
.notice-box { display: flex; gap: 11px; background: #f0f7ff; border: 1px solid #cfe3ff; border-radius: 11px; padding: 14px 16px; color: #1e4f8f; font-size: 13px; line-height: 1.75; }
.notice-box .icon { margin-top: 2px; }
.mini-list { display: flex; flex-direction: column; }
.mini-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.mini-item:last-child { border-bottom: 0; }
.mini-item .meta { flex: 1; min-width: 0; }
.mini-item .meta strong { display: block; font-size: 13px; font-weight: 600; }
.mini-item .meta span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.mini-item .right { text-align: right; font-size: 12px; }
.mini-item .right strong { display: block; font-size: 13.5px; }
.empty-state { text-align: center; padding: 38px 16px; color: var(--muted); font-size: 13px; }
.empty-state .icon { width: 34px; height: 34px; color: var(--muted-2); margin-bottom: 8px; }
.quick-api { background: linear-gradient(135deg, #0f172a, #1e2a44); border-radius: var(--radius); color: #cbd5e1; padding: 22px; }
.quick-api h3 { color: #fff; font-size: 15px; margin-bottom: 4px; }
.quick-api p { font-size: 12px; color: #94a3b8; margin-bottom: 16px; }
.quick-api .row { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); font-size: 12.5px; }
.quick-api .row:last-of-type { border-bottom: 0; }
.quick-api .row span { color: #94a3b8; }
.quick-api .row code { color: #bfdbfe; font-family: var(--mono); font-size: 12px; word-break: break-all; text-align: right; }
.quick-api .btn { margin-top: 16px; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); }
.timeline-item.success::before { border-color: var(--green); }
.timeline-item.fail::before { border-color: var(--red); }
.timeline-item strong { font-size: 13px; display: block; }
.timeline-item span { font-size: 11.5px; color: var(--muted); }
.timeline-item p { font-size: 12px; color: var(--ink-soft); margin-top: 4px; word-break: break-all; }
.mono { font-family: var(--mono); }
.text-muted { color: var(--muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-brand { color: var(--brand); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.nowrap { white-space: nowrap; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 50; }
.overlay.show { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
    .flow { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(15, 23, 42, .3); }
    .main { margin-left: 0; }
    .menu-toggle { display: inline-flex; }
    .hero-inner { grid-template-columns: 1fr; gap: 40px; padding: 52px 24px 60px; }
    .hero h1 { font-size: 38px; }
    .hero-visual { max-width: 520px; }
    .auth { grid-template-columns: 1fr; }
    .auth-side { display: none; }
    .auth-main { min-height: 100vh; }
    .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .page { padding: 20px 16px 40px; }
    .topbar { padding: 0 16px; height: 60px; }
    .topbar h1 { font-size: 15px; }
    .balance-chip { display: none; }
    .grid-4, .grid-3, .grid-2, .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .feature-grid, .flow { grid-template-columns: 1fr; }
    .hero h1 { font-size: 31px; }
    .hero-stats { gap: 24px; }
    .section { padding: 48px 18px; }
    .site-nav a:not(.btn) { display: none; }
    .site-head { padding: 16px 18px; }
    .cashier-card { max-width: 100%; }
    .pay-grid { grid-template-columns: 1fr; }
    .filters { padding: 14px 16px; }
    .filters .search { min-width: 100%; }
    .filter-summary { margin-left: 0; width: 100%; padding-bottom: 0; }
    .card-head, .card-body, .card-foot { padding-left: 16px; padding-right: 16px; }
    .table th, .table td { padding: 11px 13px; }
    .doc-page { padding: 30px 18px 50px; }
    .doc-card { padding: 20px; }
    .kv { grid-template-columns: 1fr; gap: 4px; }
    .kv dd { margin-bottom: 10px; }
}
