:root {
    --bg: #0b1020;
    --card: #121833;
    --text: #e6e8ef;
    --muted: #9aa3b2;
    --primary: #4f7cf7;
    --primary-hover: #3a66e6;
    --border: #1e2747;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 20% 0%, #0e152d 0%, #0b1020 55%, #070b18 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.5;
}

.fab-refresh {
    position: fixed;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(30,39,71,0.85);
    background: rgba(12,19,40,0.65);
    color: #c9d7ff;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 16px 50px rgba(0,0,0,0.45);
}

.fab-refresh:hover { border-color: rgba(79,124,247,0.45); background: rgba(79,124,247,0.12) }
.fab-refresh:active { transform: translateY(1px) }

.container { max-width: 920px; margin: 0 auto; padding: 20px; }
.header { margin: 10px 0 22px; text-align: left; }
.header h1 {
    margin: 10px 0 6px;
    font-size: 2rem;
    background: linear-gradient(135deg, #4f7cf7 0%, #8b5cf6 60%, #22c55e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card {
    background: linear-gradient(180deg, rgba(18,24,51,0.9) 0%, rgba(18,24,51,0.65) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 12px 28px rgba(16,24,48,0.45);
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; min-width: 220px; }

.input-control {
    width: 100%;
    padding: 12px 12px;
    background: #0c1328;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-control:focus { outline: none; border-color: #2a5cff; box-shadow: 0 0 0 3px rgba(79,124,247,0.18) }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 12px 16px; background: var(--primary); color: white;
    border: 1px solid #3a5ed9; border-radius: 10px; font-size: 0.95rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(58,102,230,.28) }
.btn.secondary { background: #1a2344; border-color: var(--border); color: var(--text) }
.btn.secondary:hover { background: #222d57; box-shadow: 0 10px 22px rgba(16,24,48,.35) }

.preview { margin-top: 16px; display: grid; place-items: center; }
.qr-box {
    width: 300px; height: 300px;
    display: grid; place-items: center;
    background: rgba(12,19,40,0.35);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.qr-box img {
    max-width: 90%;
    max-height: 90%;
    image-rendering: pixelated;
    background: #fff;
    padding: 0;
    border-radius: 12px;
}
.qr-text {
    margin-top: 12px;
    max-width: 320px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(30,39,71,0.85);
    background: rgba(12,19,40,0.35);
    color: #c9d7ff;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-all;
    text-align: center;
}

.center-message { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; z-index: 9999; pointer-events: none }
.center-message-text {
    font-size: clamp(20px, 4vw, 42px);
    font-weight: 900; letter-spacing: 1px; text-align: center; padding: 8px 14px;
    border-radius: 16px; background: rgba(12,19,40,0.35); border: 1px solid var(--border);
    box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}
.center-message.success .center-message-text { color: #22c55e; border-color: rgba(34,197,94,0.35) }
.center-message.error .center-message-text { color: #fca5a5; border-color: rgba(239,68,68,0.35) }
.center-message.info .center-message-text { color: #c9d7ff; border-color: rgba(79,124,247,0.35) }

@media (max-width: 720px) {
    .container { padding: 14px }
    .card { padding: 14px; border-radius: 14px }
    .row .grow { min-width: 0 }
    .btn { width: 100% }
    .qr-box { width: 260px; height: 260px }
    .qr-text { max-width: 280px }
}
