:root {
    --bg: #101312;
    --panel: #171c1a;
    --panel-strong: #202725;
    --line: #33413c;
    --text: #edf4ef;
    --muted: #99aaa3;
    --accent: #36d399;
    --accent-strong: #19b37c;
    --warn: #ff5f57;
    --gold: #e7c65b;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(16, 19, 18, 0.96), rgba(20, 28, 25, 0.94)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0, rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 72px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 72px);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    width: min(100%, 520px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
}

.steam-card {
    width: 100%;
    padding: 28px;
    background: linear-gradient(180deg, rgba(32, 39, 37, 0.96), rgba(18, 22, 21, 0.98));
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.brand-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    background: #edf4ef;
    border: 1px solid rgba(54, 211, 153, 0.45);
    border-radius: 8px;
}

.brand-mark img {
    width: 36px;
    height: auto;
    filter: invert(1);
}

.eyebrow {
    margin: 0 0 3px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 1.85rem;
    line-height: 1.15;
    font-weight: 800;
}

.status-pill {
    min-width: 54px;
    padding: 7px 10px;
    color: #082119;
    background: var(--accent);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.error-message {
    margin-bottom: 18px;
    padding: 11px 13px;
    color: #fff;
    background: rgba(255, 95, 87, 0.18);
    border: 1px solid rgba(255, 95, 87, 0.55);
    border-radius: 8px;
}

.error-message p {
    margin: 0;
}

.field-group {
    margin-bottom: 18px;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 9px;
}

.label-row label {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.timer {
    min-width: 54px;
    color: var(--gold);
    font-family: "Courier New", monospace;
    font-size: 0.95rem;
    font-weight: 800;
    text-align: right;
}

.input-field {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    color: var(--text);
    background: #0f1513;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.input-field::placeholder {
    color: #6f8078;
}

.input-field:focus {
    background: #111a17;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(54, 211, 153, 0.18);
}

.input-field:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.token-panel {
    margin-bottom: 22px;
}

.code-display {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    color: #ffffff;
    background: linear-gradient(180deg, #0d1211, #131a18);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: "Courier New", monospace;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
    overflow-wrap: anywhere;
}

.action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.steam-button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    color: #062017;
    background: var(--accent);
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.steam-button:hover:not(:disabled) {
    background: #54e4ad;
    transform: translateY(-1px);
}

.steam-button:active:not(:disabled) {
    transform: translateY(0);
}

.steam-button:disabled {
    color: #9aa6a1;
    background: #29302e;
    cursor: not-allowed;
    opacity: 0.7;
}

.secondary-action {
    color: var(--text);
    background: transparent;
    border-color: var(--line);
}

.secondary-action:hover:not(:disabled) {
    color: #062017;
    border-color: var(--accent);
}

.recent-section {
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-heading h2 {
    margin-bottom: 0;
    font-size: 1.02rem;
    font-weight: 800;
}

.section-heading span {
    color: var(--muted);
    font-size: 0.78rem;
}

.recent-list {
    display: grid;
    gap: 8px;
}

.recent-list > div {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px !important;
    color: var(--text);
    background: #121816;
    border: 1px solid rgba(51, 65, 60, 0.88);
    border-radius: 8px;
    transition: border-color 0.16s ease, background 0.16s ease;
}

.recent-account {
    cursor: pointer;
}

.recent-account span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.recent-list > div:hover {
    background: #18221f !important;
    border-color: rgba(54, 211, 153, 0.55);
}

.recent-list .text-\[\#66c0f4\] {
    color: var(--gold) !important;
}

.empty-hint {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.loading::after {
    content: "加载中...";
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.35;
    }
}

footer {
    color: var(--muted);
    font-size: 0.86rem;
    text-align: center;
}

footer p {
    margin-bottom: 4px;
}

.beian-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
    margin-top: 8px;
}

.beian-links a {
    color: #aebbb6;
}

@media (max-width: 520px) {
    .app-shell {
        justify-content: flex-start;
        padding: 18px 12px;
    }

    .steam-card {
        padding: 20px;
    }

    .brand-row {
        grid-template-columns: auto 1fr;
    }

    .status-pill {
        grid-column: 1 / -1;
        width: 100%;
    }

    .code-display {
        min-height: 68px;
        font-size: 1.45rem;
    }

    .action-row {
        grid-template-columns: 1fr;
    }
}
