:root {
    --bg: #f4efe6;
    --surface: rgba(255, 252, 247, 0.96);
    --line: rgba(71, 49, 28, 0.12);
    --text: #231a12;
    --muted: #6f5d4f;
    --accent: #b64a1f;
    --shadow: 0 22px 60px rgba(80, 49, 24, 0.12);
    --blue: #165dff;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Noto Sans TC", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(182,74,31,.12), transparent 28%), radial-gradient(circle at right 20%, rgba(42,124,93,.12), transparent 24%), linear-gradient(180deg, #f8f2ea 0%, #f1e8dc 100%);
}
.shell { width: min(1100px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 40px; }
.hero { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; margin-bottom: 18px; }
.hero-copy, .hero-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 24px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; }
h1, h2 { margin: 0; }
.intro { color: var(--muted); line-height: 1.7; margin: 14px 0 0; }
.status-row, .action-row, .result-header, .grid.two { display: flex; gap: 12px; flex-wrap: wrap; }
.grid.two > * { flex: 1 1 280px; }
.status-pill, .small-pill { display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.8); font-weight: 600; color: var(--muted); }
.status-pill.status-normal { color: #1e7a4d; }
.status-pill.status-busy { color: #a05a00; }
.status-pill.status-warning, .status-pill.status-error { color: #b42318; }
.field-label { display: block; font-weight: 700; margin-bottom: 10px; }
.text-box, .code-box { width: 100%; border: 1px solid rgba(71,49,28,.18); border-radius: 16px; background: rgba(255,255,255,.88); padding: 14px 16px; color: var(--text); font: inherit; }
.code-box { resize: vertical; min-height: 180px; font-family: Consolas, "Courier New", monospace; font-size: 15px; }
.text-box:focus, .code-box:focus { outline: none; border-color: rgba(182,74,31,.45); box-shadow: 0 0 0 4px rgba(182,74,31,.12); }
.action-row { margin-top: 14px; justify-content: flex-end; }
.action-row.left { justify-content: flex-start; }
.wrap-row { align-items: center; }
.compact-actions { margin-top: 0; }
button, .link-button, .file-button { border: 0; border-radius: 14px; padding: 12px 18px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.primary-button { background: linear-gradient(135deg, var(--accent), #d56b3b); color: #fff; }
.ghost-button, .file-button { background: rgba(255,255,255,.86); color: var(--text); border: 1px solid var(--line); }
.method-button { background: rgba(255,255,255,.78); color: var(--text); border: 1px solid var(--line); }
.method-button.active { background: linear-gradient(135deg, #fff, #f7ecde); border-color: rgba(182,74,31,.35); color: var(--accent); }
.hidden-file-input { display: none; }
.message { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; font-weight: 600; }
.hidden { display: none !important; }
.success { background: rgba(22,93,255,.08); color: var(--blue); border: 1px solid rgba(22,93,255,.16); }
.error { background: rgba(180,35,24,.08); color: #b42318; border: 1px solid rgba(180,35,24,.16); }
.inline-note { color: var(--muted); line-height: 1.7; }
.qr-wrap { display: flex; align-items: center; justify-content: center; }
.qr-image, .qr-code-box img, .qr-code-box canvas { max-width: 100%; height: auto; }
.qr-image, .qr-code-box, .paypal-box { width: min(360px, 100%); min-height: 320px; border-radius: 20px; background: #fff; border: 1px solid rgba(71,49,28,.1); padding: 14px; }
.result-box { min-height: 220px; }
.qr-panel { margin-top: 16px; }
.qr-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.82); }
.qr-note { margin: 0; color: var(--muted); }
.mono { font-family: Consolas, "Courier New", monospace; }
.modal-shell { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,16,12,.48); backdrop-filter: blur(4px); }
.modal-card { position: relative; width: min(900px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 24px; }
.narrow-card { width: min(520px, 100%); }
.modal-grid { margin-top: 14px; }
.payment-method-row { display: flex; gap: 12px; margin-top: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.payment-pane { border: 1px solid var(--line); border-radius: 20px; padding: 18px; background: rgba(255,255,255,.55); }
.reader-box { width: 100%; min-height: 320px; background: #111; border-radius: 18px; overflow: hidden; }
@media (max-width: 860px) {
    .hero { grid-template-columns: 1fr; }
    .action-row > * { width: 100%; }
    .compact-actions > * { width: auto; }
    .payment-method-row > * { width: 100%; }
}
.paypal-redirect {
    margin-top: 14px;
}
.paypal-redirect .primary-button {
    width: 100%;
}
.topbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.lang-switch { display: inline-flex; gap: 8px; }
.mini-button { min-width: 56px; padding: 10px 14px; }
.lang-switch .active { background: linear-gradient(135deg, #fff, #f7ecde); border-color: rgba(182,74,31,.35); color: var(--accent); }
.card-label { margin: 0 0 10px; color: var(--muted); font-weight: 700; }
.paypal-pane-official {
    background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
    border-color: rgba(0, 48, 135, 0.16);
}
.paypal-brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.paypal-brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 12px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #003087, #0070e0);
    color: #fff;
    font-weight: 800;
    letter-spacing: .02em;
}
.paypal-brand-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.paypal-brand-meta strong {
    font-size: 16px;
    color: #003087;
}
.paypal-brand-meta span {
    color: #4f6b8a;
    font-size: 13px;
}
.paypal-primary {
    background: linear-gradient(135deg, #0070e0, #003087);
}