*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0f1117;
    --card-bg: #1a1d27;
    --border: #2a2d3a;
    --text: #e4e4e7;
    --text-muted: #9ca3af;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --warn: #f59e0b;
    --error: #ef4444;
    --success: #22c55e;
    --radius: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 16px;
}

.step { display: none; }
.step.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
}

.icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 16px;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.lead {
    font-size: 17px;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.sub {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

.notice {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.notice-warn {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
}

.notice-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
}

.platforms {
    margin-bottom: 24px;
}

.platform-group {
    margin-bottom: 20px;
}

.dl-link {
    display: block;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--accent-hover);
    text-decoration: none;
    font-size: 15px;
    transition: background 0.2s, border-color 0.2s;
}

.dl-link:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent);
}

.btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--accent);
    color: #fff;
    margin-bottom: 12px;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-back {
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.btn-back:hover { color: var(--text); }

.btn-copy {
    background: var(--accent);
    color: #fff;
    width: auto;
    padding: 12px 20px;
    flex-shrink: 0;
    font-size: 14px;
    border-radius: 0 8px 8px 0;
}

.btn-copy:hover { background: var(--accent-hover); }

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Timer */
.timer-block {
    text-align: center;
    padding: 12px;
    margin-bottom: 20px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
}

.retry-timer {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-top: 12px;
    color: var(--warn);
}

.timer-block.expired {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* Instruction box */
.instruction-box {
    margin-bottom: 20px;
    font-size: 15px;
}

.instruction-box ol {
    padding-left: 20px;
    margin-top: 8px;
}

.instruction-box li {
    margin-bottom: 6px;
}

/* Subscription URL */
.sub-url-block {
    display: flex;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.sub-url-block input {
    flex: 1;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    color: var(--text);
    font-family: monospace;
    font-size: 13px;
    min-width: 0;
    outline: none;
}

/* Copy hint */
.copy-hint {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Download button */
.btn-download {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--accent-hover);
    text-decoration: none;
    text-align: center;
    margin-bottom: 16px;
    font-size: 16px;
}

.btn-download:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--accent);
}

/* Telegram CTA block */
.next-step-block {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
}

.next-step-block h3 {
    color: var(--text);
    font-size: 18px;
    margin-bottom: 8px;
}

.next-step-block p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

.btn-telegram {
    background: #2AABEE;
    color: #fff;
    text-decoration: none;
    text-align: center;
    font-size: 16px;
    margin-bottom: 0;
}

.btn-telegram:hover {
    background: #3BBDF8;
}

.cleanup-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 14px;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .container { padding: 16px 12px; }
    .card { padding: 24px 16px; }
    h1 { font-size: 24px; }
    .sub-url-block { flex-direction: column; }
    .btn-copy { border-radius: 0 0 8px 8px; }
}
