/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #ffd700;
}

.logo h1 {
    font-size: 2.8rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 主要内容区域 */
.main-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    margin-bottom: 40px;
}

/* 输入区域 */
.input-section {
    margin-bottom: 40px;
}

.input-container {
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-icon {
    color: #6c757d;
    margin-left: 15px;
    margin-right: 10px;
    font-size: 1.2rem;
}

.url-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px 10px;
    font-size: 1rem;
    outline: none;
    color: #333;
}

.url-input::placeholder {
    color: #6c757d;
}

.paste-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.paste-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.parse-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.parse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.parse-btn:active {
    transform: translateY(0);
}

.platform-tips {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.9rem;
    padding: 8px 15px;
    background: #f8f9fa;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.tip-item:hover {
    background: #e9ecef;
    color: #495057;
}

/* 结果展示区域 */
.result-section {
    animation: fadeInUp 0.5s ease;
}

.result-container {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 30px;
    background: #f8f9fa;
}

.video-info {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.video-preview {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 9/16;
    background: #000;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.play-overlay:hover {
    background: rgba(0,0,0,0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-details h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.video-author,
.video-duration {
    color: #6c757d;
    margin-bottom: 8px;
}

.video-stats {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #6c757d;
    font-size: 0.9rem;
}

.stat-item i {
    color: #dc3545;
}

/* 下载选项 */
.download-options h4 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.download-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.download-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.video-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.audio-btn {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: white;
}

.cover-btn {
    background: linear-gradient(135deg, #6f42c1 0%, #e83e8c 100%);
    color: white;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误提示 */
.error-message {
    text-align: center;
    padding: 30px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    color: #721c24;
    animation: fadeIn 0.3s ease;
}

.error-message i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* 功能特色 */
.features {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.features h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 30px 20px;
    border-radius: 15px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.1);
}

.feature-card i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3rem;
}

.feature-card p {
    color: #6c757d;
    line-height: 1.6;
}

/* 使用说明 */
.instructions {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.instructions h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.2rem;
    color: #333;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    border-radius: 15px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.step:hover {
    background: #e9ecef;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.2rem;
}

.step-content p {
    color: #6c757d;
    line-height: 1.6;
}

/* 底部 */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: white;
    background: rgba(0,0,0,0.1);
    border-radius: 15px;
}

.footer-links {
    margin-top: 15px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.footer-links a:hover {
    background: rgba(255,255,255,0.2);
}

/* Toast 通知 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 300px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 1.2rem;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .main-content {
        padding: 25px 20px;
    }
    
    .features {
        padding: 30px 20px;
    }
    
    .instructions {
        padding: 30px 20px;
    }
    
    .logo h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .video-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .video-preview {
        max-width: 200px;
        margin: 0 auto;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .download-btn {
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .feature-card {
        padding: 25px 15px;
    }
    
    .feature-card i {
        font-size: 2.5rem;
    }
    
    .steps {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .step {
        padding: 15px;
    }
    
    .platform-tips {
        gap: 10px;
    }
    
    .tip-item {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    /* 图集网格适配 */
    #imageContainer {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
        gap: 10px !important;
    }
    
    /* Toast 通知适配 */
    .toast {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .main-content {
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .features {
        padding: 25px 15px;
        border-radius: 15px;
    }
    
    .instructions {
        padding: 25px 15px;
        border-radius: 15px;
    }
    
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .input-wrapper {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .paste-btn {
        width: 100%;
        justify-content: center;
        margin-right: 0;
    }
    
    .parse-btn {
        width: 100%;
        justify-content: center;
    }
    
    .url-input {
        text-align: center;
        padding: 12px;
    }
    
    .features h2,
    .instructions h2 {
        font-size: 1.8rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .feature-card {
        padding: 20px 15px;
    }
    
    .feature-card i {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .feature-card h3 {
        font-size: 1.1rem;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .step-number {
        align-self: center;
    }
    
    .platform-tips {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .tip-item {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
    
    /* 图集网格小屏适配 */
    #imageContainer {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    /* 视频信息适配 */
    .video-details h3 {
        font-size: 1.2rem;
    }
    
    .video-stats {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* 结果容器适配 */
    .result-container {
        padding: 20px 15px;
    }
}
