:root {
    color-scheme: light dark;
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #1f2329;
    --muted: #8a9099;
    --accent: #2f6bff;
    --border: rgba(15, 23, 42, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #101216;
        --card: #191c22;
        --text: #e8eaed;
        --muted: #9aa1ab;
        --border: rgba(255, 255, 255, 0.08);
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}

.card {
    width: 100%;
    max-width: 360px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(47, 107, 255, 0.18);
    border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.countdown {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    min-height: 18px;
}

.progress {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: rgba(47, 107, 255, 0.12);
    overflow: hidden;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: var(--accent);
    transition: width 0.2s linear;
}

.copy-button {
    width: 100%;
    max-width: 360px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--accent);
    background: transparent;
    border: 1px solid rgba(47, 107, 255, 0.4);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.copy-button:active {
    background: rgba(47, 107, 255, 0.1);
}

.copy-button.done {
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.4);
}

.footer {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.footer a {
    color: inherit;
}

.confirm-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(47, 107, 255, 0.1);
    color: var(--accent);
}

.confirm-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
}

.confirm-text {
    margin: 0 0 18px;
    font-size: 14px;
    color: var(--muted);
}

.confirm-button {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.confirm-button:disabled {
    opacity: 0.6;
}

.error-text {
    margin: 0;
    font-size: 14px;
    color: #e5484d;
}