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

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --text: #1a1a2e;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.88);
    --card-border: rgba(255, 255, 255, 0.6);
    --input-bg: rgba(255, 255, 255, 0.6);
    --input-border: rgba(102, 126, 234, 0.2);
}

::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: url('/static/img/beijing.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 28px;
    padding: 48px 44px 36px;
    max-width: 560px;
    width: 100%;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, background 0.4s ease;
    cursor: default;
}

.container:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.container:active {
    transform: translateY(-1px) scale(0.995);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.4) inset;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, transparent);
    border-radius: 28px 28px 0 0;
    opacity: 0;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    pointer-events: none;
    z-index: -1;
}

.glow-1 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: -60px;
    right: -40px;
    animation: glowFloat 8s ease-in-out infinite, btnPulse 4s ease-in-out infinite;
}

.glow-2 {
    width: 160px;
    height: 160px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    bottom: -40px;
    left: -30px;
    animation: glowFloat 10s ease-in-out infinite reverse;
}

@keyframes glowFloat {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    33% { transform: translate(15px, -20px) scale(1.1) rotate(5deg); }
    66% { transform: translate(-10px, 10px) scale(0.95) rotate(-3deg); }
}

@keyframes ripple {
    from {
        transform: scale(0);
        opacity: 0.6;
    }
    to {
        transform: scale(4);
        opacity: 0;
    }
}

@keyframes btnPulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35); }
    50% { box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5); }
}

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

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

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

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.header {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.45);
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.logo svg {
    width: 38px;
    height: 38px;
}

h1 {
    font-size: 30px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.input-section {
    margin-bottom: 16px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 18px;
    padding: 8px 8px 8px 20px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.06);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.12), 0 4px 16px rgba(102, 126, 234, 0.1);
}

.url-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 0.3s;
}

.input-wrapper:focus-within .url-icon {
    color: var(--primary);
}

#url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 15px;
    padding: 14px 12px;
    font-family: inherit;
    font-weight: 500;
}

#url-input::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

#submit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 13px 26px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    animation: btnPulse 4s ease-in-out infinite;
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

.container-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.15);
    transform: scale(0);
    animation: containerRipple 0.8s ease-out;
    pointer-events: none;
    z-index: 0;
}

@keyframes containerRipple {
    from {
        transform: scale(0);
        opacity: 0.8;
    }
    to {
        transform: scale(3);
        opacity: 0;
    }
}

#submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(102, 126, 234, 0.5);
}

#submit-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

#submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#submit-btn .btn-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s;
}

#submit-btn:hover:not(:disabled) .btn-icon {
    transform: translateY(2px);
}

.site-tags {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.site-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 24px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary);
    transition: all 0.3s;
    cursor: default;
}

.site-tag svg {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.site-tag:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.tag-fanqie svg { background: #ff6b6b; color: #ff6b6b; }
.tag-qimao svg { background: #f59e0b; color: #f59e0b; }
.tag-qidian svg { background: #3b82f6; color: #3b82f6; }

.error-msg {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.12));
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger-dark);
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    animation: shake 0.5s ease-out;
}

.result-section {
    animation: fadeIn 0.5s ease-out;
}

.status-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.status-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.status-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-icon.loading {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
    color: var(--primary);
}

.status-icon.loading svg {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

.status-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.15));
    color: var(--success-dark);
}

.status-icon.success svg {
    width: 26px;
    height: 26px;
}

.status-icon.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.15));
    color: var(--danger-dark);
}

.status-icon.error svg {
    width: 24px;
    height: 24px;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    padding-top: 4px;
}

.status-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.2px;
}

.status-source {
    font-size: 12px;
    color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
    padding: 3px 12px;
    border-radius: 12px;
    display: inline-block;
    width: fit-content;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 18px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

.status-message {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 18px;
    line-height: 1.7;
    font-weight: 500;
}

.countdown {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--warning);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.12));
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
}

.countdown svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: #fff;
    text-decoration: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.45);
}

.btn-download:active {
    transform: translateY(0) scale(0.96);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-download svg {
    width: 16px;
    height: 16px;
}

.btn-delete {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger-dark);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    transform: translateY(-2px);
}

.btn-delete svg {
    width: 16px;
    height: 16px;
}

.footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
}

.notice svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--warning);
}

@media (max-width: 600px) {
    .container {
        padding: 36px 22px 28px;
        border-radius: 22px;
    }

    h1 {
        font-size: 26px;
    }

    .input-wrapper {
        flex-wrap: wrap;
        padding: 10px;
        gap: 8px;
    }

    #url-input {
        width: 100%;
        padding: 12px;
    }

    #submit-btn {
        width: 100%;
        justify-content: center;
    }

    .site-tags {
        flex-wrap: wrap;
        gap: 8px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-download,
    .btn-delete {
        justify-content: center;
    }
}
