/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 400;
}

/* 主要内容区域 */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 输入区域 */
.input-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.url-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.url-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.parse-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 120px;
}

.parse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.parse-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    font-size: 18px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tips {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.tips p {
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.tips p:last-child {
    margin-bottom: 0;
}

.tips code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #495057;
}

/* URL提示样式 */
.url-tip {
    display: none;
    margin-top: 8px;
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
    font-size: 14px;
    line-height: 1.4;
    border-left: 4px solid #f39c12;
}

/* 结果显示区域 */
.result-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.video-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.video-preview {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.video-cover {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.video-meta {
    flex: 1;
}

.video-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-weight: 500;
    color: #34495e;
}

.video-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
}

/* 下载区域 */
.download-section h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.download-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
}

.download-notice p {
    margin: 0;
    color: #856404;
    font-size: 14px;
    line-height: 1.4;
}

.download-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.download-label {
    font-weight: 500;
    color: #34495e;
    min-width: 80px;
}

.download-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* 错误信息 */
.error-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: slideInUp 0.5s ease;
}

.error-message {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #e74c3c;
    font-size: 16px;
}

.error-icon {
    font-size: 24px;
}

/* 调试面板 */
.debug-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.debug-header h4 {
    color: #2c3e50;
    font-size: 1.1rem;
}

.toggle-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-btn:hover {
    background: #5a6268;
}

.debug-content {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.debug-logs {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
}

.debug-log {
    padding: 5px 0;
    border-bottom: 1px solid #f1f3f4;
}

.debug-log:last-child {
    border-bottom: none;
}

.log-timestamp {
    color: #666;
    margin-right: 10px;
}

.log-level-info {
    color: #007bff;
}

.log-level-error {
    color: #dc3545;
}

.log-level-success {
    color: #28a745;
}

/* 底部 */
footer {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    margin-top: 30px;
    color: #666;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 30px 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .input-section, .result-section, .error-section {
        padding: 25px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .video-preview {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .video-cover {
        width: 100%;
        max-width: 300px;
    }
    
    .download-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .input-section, .result-section, .error-section {
        padding: 20px;
    }
    
    .video-stats {
        flex-direction: column;
        gap: 10px;
    }
}