:root {
    --bg: #f3f6f8;
    --surface: #fff;
    --surface-soft: #f8fafb;
    --text: #18232c;
    --muted: #687681;
    --line: #dce5ea;
    --primary: #286a8a;
    --primary-dark: #1d526d;
    --primary-soft: #eaf5fa;
    --danger: #c94b50;
    --danger-soft: #fff0f1;
    --success: #23815c;
    --success-soft: #eaf8f0;
    --shadow: 0 12px 30px rgba(31, 53, 67, .08);
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 42px; }
.hero { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.hero-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--primary); color: #fff; font-size: 24px; font-weight: 800; }
.hero h1, .hero p, .field-label, .field-hint, .result-panel h2, .result-panel p { margin: 0; }
.hero h1 { font-size: 24px; line-height: 1.25; }
.hero p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.query-panel { padding: 20px; }
.mode-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 22px; padding: 5px; border-radius: 9px; background: var(--surface-soft); }
.mode-tab { min-height: 40px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.mode-tab:hover { color: var(--text); }
.mode-tab.is-active { border-color: #c7dfe9; background: #fff; color: var(--primary-dark); box-shadow: 0 2px 6px rgba(31, 53, 67, .07); }
.mode-tab.is-danger.is-active { border-color: #f0c8ca; color: var(--danger); }
.field-label { display: block; margin-bottom: 7px; color: #364651; font-weight: 800; }
.input-wrap { position: relative; }
input { width: 100%; height: 48px; border: 1px solid #cbd8df; border-radius: 8px; outline: none; padding: 0 42px 0 14px; background: #fff; color: var(--text); font-size: 16px; transition: border-color .16s, box-shadow .16s; }
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(40, 106, 138, .13); }
input::placeholder { color: #9aa8b1; }
.clear-input { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: #92a0a8; cursor: pointer; font-size: 24px; line-height: 1; }
.clear-input:hover { background: var(--surface-soft); color: var(--text); }
.field-hint { min-height: 23px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.submit-button { width: 100%; min-height: 46px; margin-top: 12px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; cursor: pointer; font-weight: 800; transition: background .16s, transform .08s; }
.submit-button:hover:not(:disabled) { background: var(--primary-dark); }
.submit-button:active:not(:disabled) { transform: translateY(1px); }
.submit-button:disabled { cursor: wait; opacity: .65; }
.result-panel { margin-top: 16px; padding: 20px; }
.result-panel.is-hidden, .modal-backdrop.is-hidden { display: none; }
.result-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.result-header h2 { font-size: 20px; line-height: 1.3; }
.status-badge, .count-badge { border-radius: 6px; padding: 4px 9px; background: var(--success-soft); color: var(--success); font-size: 12px; font-weight: 800; }
.count-badge { background: var(--primary-soft); color: var(--primary-dark); }
.card-number-block { border: 1px solid #cae2ec; border-radius: 9px; background: linear-gradient(110deg, #eff9fc, #f7fbfc); padding: 15px; cursor: pointer; }
.card-number-block:hover { border-color: var(--primary); }
.small-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.card-number { overflow-wrap: anywhere; color: var(--primary-dark); font: 700 21px/1.35 "JetBrains Mono", Consolas, monospace; letter-spacing: .04em; }
.copy-note { margin-top: 5px !important; color: var(--primary); font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-top: 12px; }
.detail-item { min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 11px; cursor: pointer; }
.detail-item:hover { border-color: #aacbd9; background: #fcfeff; }
.detail-value { overflow-wrap: anywhere; color: var(--text); font-family: Consolas, "Microsoft YaHei", monospace; font-weight: 700; }
.address-box { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; cursor: pointer; white-space: pre-line; }
.address-box:hover { border-color: #aacbd9; background: #fcfeff; }
.expiry-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; border: 1px solid #efd9a8; border-radius: 8px; background: #fff8e9; padding: 9px 11px; color: #825b16; font-size: 13px; }
.expiry-row strong { font-variant-numeric: tabular-nums; }
.transaction-list { display: grid; gap: 10px; }
.transaction-item { border: 1px solid var(--line); border-left: 4px solid #9aabb4; border-radius: 8px; background: #fff; padding: 12px; }
.transaction-item.is-completed, .transaction-item.is-sent { border-left-color: var(--success); }
.transaction-item.is-failed, .transaction-item.is-cancelled { border-left-color: var(--danger); }
.transaction-item.is-pending { border-left-color: #ce8d2c; }
.tx-top, .tx-line { display: flex; justify-content: space-between; gap: 12px; }
.tx-top { align-items: center; }
.tx-merchant { overflow-wrap: anywhere; font-weight: 800; }
.tx-amount { color: var(--primary-dark); font-weight: 800; }
.tx-status { border-radius: 5px; padding: 2px 7px; background: #eef2f4; color: var(--muted); font-size: 12px; font-weight: 800; }
.tx-status.is-completed, .tx-status.is-sent { background: var(--success-soft); color: var(--success); }
.tx-status.is-failed, .tx-status.is-cancelled { background: var(--danger-soft); color: var(--danger); }
.tx-line { margin-top: 7px; color: var(--muted); font-size: 13px; }
.tx-line strong { color: var(--text); font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.empty-result { padding: 22px 0 8px; color: var(--muted); text-align: center; }
.empty-result strong { display: block; color: #364651; }
.privacy-note { margin: 16px 0 0; color: #7e8b93; font-size: 12px; text-align: center; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); max-width: calc(100% - 32px); transform: translate(-50%, 16px); border-radius: 7px; background: #1f2c34; color: #fff; padding: 10px 15px; opacity: 0; pointer-events: none; text-align: center; transition: opacity .18s, transform .18s; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 18px; background: rgba(20, 31, 38, .45); }
.confirm-modal { width: min(420px, 100%); border: 1px solid #d5e0e6; border-radius: 12px; background: #fff; box-shadow: 0 20px 70px rgba(20, 31, 38, .25); padding: 22px; }
.confirm-modal h2, .confirm-modal p { margin: 0; }
.confirm-modal h2 { font-size: 19px; }
.confirm-modal p { margin-top: 8px; color: var(--muted); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 20px; }
.modal-button { min-height: 42px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text); cursor: pointer; font-weight: 700; }
.modal-button-danger { border-color: #d46b70; background: var(--danger); color: #fff; }
.modal-button:hover { filter: brightness(.98); }
@media (max-width: 600px) {
    .app-shell { width: min(100% - 24px, 760px); padding: 18px 0 28px; }
    .hero h1 { font-size: 21px; }
    .query-panel, .result-panel { padding: 15px; }
    .mode-tabs { margin-bottom: 17px; }
    .mode-tab { min-height: 42px; padding: 5px 3px; font-size: 13px; }
    .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-number { font-size: 18px; }
    .result-header { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 360px) {
    .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .mode-tab { font-size: 12px; }
}
