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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 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;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 28px;
    color: #667eea;
    margin-bottom: 5px;
}

.subtitle {
    color: #666;
    font-size: 14px;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    color: #666;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: #667eea;
    color: white;
}

/* 解析区域 */
.parse-section {
    margin-bottom: 30px;
}

.parse-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.url-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    box-sizing: border-box;
}

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

/* 输入框包装器 */
.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 历史记录下拉列表 */
.history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #667eea;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: -2px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f8f8;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    font-weight: bold;
    color: #666;
    position: sticky;
    top: 0;
    z-index: 1;
}

.clear-history-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s;
    color: #999;
}

.clear-history-btn:hover {
    background: #fee;
    color: #c33;
}

.history-list {
    max-height: 250px;
    overflow-y: auto;
}

.history-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-item:hover {
    background: #f5f5f5;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item-icon {
    font-size: 14px;
    opacity: 0.6;
}

.history-item-url {
    flex: 1;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-time {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.history-item-delete {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.2s;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    color: #c33;
    background: #fee;
}

.history-empty {
    padding: 30px 15px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

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

.parse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.platform-hint {
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* 结果区域 */
.result-section {
    margin-bottom: 30px;
}

.result-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.result-header h3 {
    color: #333;
    font-size: 22px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 30px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 30px;
    transition: all 0.3s;
}

.close-btn:hover {
    color: #667eea;
    transform: rotate(90deg);
}

.video-preview {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.thumbnail {
    width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.video-info {
    flex: 1;
    min-width: 250px;
}

.video-info h4 {
    font-size: 20px;
    color: #333;
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    margin-bottom: 10px;
    font-size: 14px;
}

.info-label {
    color: #666;
    width: 80px;
    font-weight: bold;
}

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

.download-btn,
.copy-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
}

.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.copy-btn {
    background: #f0f0f0;
    color: #333;
}

.download-btn:hover,
.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    margin-bottom: 30px;
}

.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 {
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #c33;
}

.error-icon {
    font-size: 20px;
}

/* 平台网格 */
.platforms-section,
.help-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.platform-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.platform-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.platform-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.platform-card p {
    font-size: 12px;
    opacity: 0.9;
}

/* FAQ */
.faq-list {
    margin-top: 20px;
}

.faq-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 18px;
}

.faq-item p {
    color: #666;
    line-height: 1.8;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.footer p {
    margin-bottom: 5px;
}

/* 分辨率选择区域 */
.resolution-options {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #e0e0e0;
}

.resolution-title {
    color: #666;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: normal;
}

.resolution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.resolution-btn {
    padding: 12px 20px;
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.resolution-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.resolution-btn .size {
    font-size: 12px;
    opacity: 0.7;
    font-weight: normal;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }

    .nav {
        margin-top: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .input-group {
        flex-direction: column;
    }

    .parse-btn {
        width: 100%;
        justify-content: center;
    }

    .video-preview {
        flex-direction: column;
    }

    .thumbnail {
        width: 100%;
    }

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

    .download-btn,
    .copy-btn {
        width: 100%;
    }

    .platform-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

