* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root { color-scheme: dark; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif; }
html, body { min-height: 100%; }
body {
    background: #090b0d;
    color: #f7f7f8;
    letter-spacing: 0;
}
button, input, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
.donate-topbar {
    min-height: 68px;
    padding: 8px max(16px, calc((100vw - 1180px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(12,15,17,.94);
}
.donate-brand img { display: block; width: auto; height: 46px; }
.back-home {
    min-height: 40px;
    padding: 9px 16px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 7px;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
}
.donate-main { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 70px 0 90px; }
.donate-intro { max-width: 720px; margin-bottom: 34px; }
.donate-eyebrow { color: #4ade80; font-size: 12px; font-weight: 900; }
.donate-intro h1 { margin-top: 10px; font-size: clamp(38px, 7vw, 68px); line-height: 1; }
.donate-intro p { max-width: 660px; margin-top: 18px; color: #aeb5bc; font-size: 16px; line-height: 1.8; }
.amount-panel, .donor-panel, .payment-result {
    padding: 28px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    background: #15191d;
    box-shadow: 0 28px 70px rgba(0,0,0,.34);
}
.donor-panel { margin-top: 22px; animation: panel-in .42s cubic-bezier(.22,1,.36,1); }
@keyframes panel-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.panel-heading span { display: block; margin-bottom: 4px; color: #4ade80; font-size: 11px; font-weight: 900; }
.panel-heading h2 { font-size: 24px; }
.panel-heading > strong { color: #86efac; font-size: 23px; white-space: nowrap; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.preset-button {
    min-height: 58px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 7px;
    background: #20262b;
    color: #fff;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.preset-button:hover { transform: translateY(-2px); border-color: rgba(74,222,128,.6); }
.preset-button.is-active { border-color: #4ade80; background: #173523; color: #bbf7d0; }
.amount-slider { margin-top: 26px; padding: 20px; display: block; border: 1px solid rgba(255,255,255,.08); border-radius: 7px; background: #0f1215; }
.amount-slider > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.amount-slider b { font-size: 15px; }
.amount-slider small { color: #8e979f; }
.amount-slider input { width: 100%; margin: 22px 0 8px; accent-color: #22c55e; cursor: pointer; }
.range-scale { display: flex; justify-content: space-between; color: #7f8991; font-size: 11px; }
.range-scale i { font-style: normal; }
.amount-confirm, .donate-submit {
    width: 100%;
    min-height: 54px;
    margin-top: 18px;
    border: 0;
    border-radius: 7px;
    background: #22c55e;
    color: #06150b;
    font-weight: 950;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, opacity .2s ease;
}
.amount-confirm:hover, .donate-submit:hover { background: #4ade80; transform: translateY(-2px); }
.donate-submit:disabled { opacity: .5; cursor: wait; transform: none; }
.donor-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.donor-form label > span { display: block; margin-bottom: 7px; color: #d6d9dc; font-size: 13px; font-weight: 800; }
.donor-form input, .donor-form textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #394148;
    border-radius: 6px;
    outline: none;
    background: #0c0f11;
    color: #fff;
}
.donor-form input:focus, .donor-form textarea:focus { border-color: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.11); }
.donor-form textarea { min-height: 110px; resize: vertical; }
.wide-field { grid-column: 1 / -1; }
.payment-summary { padding: 18px; border: 1px solid rgba(74,222,128,.24); border-radius: 7px; background: rgba(34,197,94,.06); }
.payment-summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.payment-summary span { color: #aeb5bc; }
.payment-summary small { display: block; margin-top: 10px; color: #869098; line-height: 1.6; }
.form-message { padding: 12px; border-radius: 6px; background: rgba(239,68,68,.12); color: #fca5a5; font-size: 13px; }
.confirm-overlay {
    position: fixed;
    z-index: 1000;
    inset: 0;
    padding: 20px;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,.66);
    backdrop-filter: blur(10px);
}
.confirm-dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 28px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    background: rgba(24,29,33,.96);
    box-shadow: 0 30px 90px rgba(0,0,0,.55);
    animation: dialog-in .36s cubic-bezier(.22,1,.36,1);
}
@keyframes dialog-in { from { opacity: 0; transform: scale(.94) translateY(15px); } to { opacity: 1; transform: none; } }
.confirm-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 6px; background: rgba(255,255,255,.07); color: #fff; font-size: 25px; cursor: pointer; }
.confirm-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: #22c55e; color: #07120a; font-size: 28px; font-weight: 950; box-shadow: 0 0 0 8px rgba(34,197,94,.1); }
.confirm-label { display: block; margin-top: 22px; color: #4ade80; font-size: 11px; font-weight: 900; }
.confirm-dialog h2 { margin-top: 7px; font-size: 26px; line-height: 1.35; }
.confirm-dialog h2 strong { color: #86efac; }
.confirm-details { margin-top: 20px; padding: 16px; border: 1px solid rgba(255,255,255,.09); border-radius: 7px; background: #0f1215; }
.confirm-details > div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; }
.confirm-details span { color: #8f989f; }
.confirm-details p { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); color: #aeb5bc; font-size: 13px; line-height: 1.65; }
.confirm-check { margin-top: 18px; display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 10px; cursor: pointer; }
.confirm-check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box { width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid #59636b; border-radius: 5px; color: transparent; }
.confirm-check input:checked + .check-box { border-color: #22c55e; background: #22c55e; color: #07120a; }
.confirm-check b { font-size: 14px; }
.confirm-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }
.confirm-actions button { min-height: 44px; padding: 10px 16px; border-radius: 6px; font-weight: 900; cursor: pointer; }
.confirm-cancel { border: 1px solid rgba(255,255,255,.13); background: transparent; color: #fff; }
.confirm-proceed { border: 0; background: #22c55e; color: #07120a; }
.confirm-proceed:disabled { background: #333a3f; color: #737d84; cursor: not-allowed; }
body.modal-open { overflow: hidden; }
.payment-result { text-align: center; }
.payment-result-label { color: #4ade80; font-size: 12px; font-weight: 900; }
.payment-result h1 { margin-top: 8px; font-size: 31px; }
.payment-result-copy { margin: 14px auto 0; max-width: 620px; color: #aeb5bc; line-height: 1.75; }
.payment-code-box { margin: 26px auto 0; padding: 18px; border: 1px solid #4ade80; border-radius: 7px; background: #0d1711; }
.payment-code-box span { display: block; color: #9aa39f; font-size: 12px; }
.payment-code-box strong { display: block; margin: 8px 0; color: #bbf7d0; font-family: ui-monospace, monospace; font-size: clamp(25px, 8vw, 42px); letter-spacing: 2px; overflow-wrap: anywhere; }
.payment-code-box button, .payment-result-actions a { min-height: 40px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: #22c55e; color: #07120a; text-decoration: none; font-weight: 900; cursor: pointer; }
.payment-facts { margin-top: 18px; display: grid; gap: 8px; text-align: left; }
.payment-facts div { padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; border-radius: 6px; background: #0f1215; }
.payment-facts dt { color: #919ba2; }
.payment-facts dd { font-weight: 900; }
.payment-result-actions { margin-top: 22px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.payment-result-actions a.secondary { border: 1px solid rgba(255,255,255,.13); background: transparent; color: #fff; }
.payment-polling { margin-top: 18px; color: #8c969d; font-size: 12px; }
@media (max-width: 700px) {
    .donate-topbar { min-height: 60px; padding: 7px 12px; }
    .donate-brand img { height: 39px; }
    .back-home { min-height: 36px; padding: 7px 11px; font-size: 13px; }
    .donate-main { width: calc(100% - 20px); padding: 42px 0 100px; }
    .donate-intro { margin-bottom: 24px; }
    .donate-intro h1 { font-size: 42px; }
    .donate-intro p { font-size: 14px; }
    .amount-panel, .donor-panel, .payment-result { padding: 18px 14px; }
    .panel-heading { align-items: flex-start; }
    .panel-heading h2 { font-size: 20px; }
    .panel-heading > strong { font-size: 18px; }
    .preset-grid { grid-template-columns: 1fr; }
    .preset-button { min-height: 48px; }
    .amount-slider { padding: 16px 13px; }
    .donor-form { grid-template-columns: 1fr; }
    .wide-field { grid-column: auto; }
    .confirm-overlay { padding: 10px; align-items: end; }
    .confirm-dialog { width: 100%; max-height: calc(100dvh - 20px); padding: 24px 18px calc(20px + env(safe-area-inset-bottom)); border-radius: 8px 8px 0 0; }
    .confirm-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .confirm-actions button { padding: 9px 8px; font-size: 13px; }
}
