* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

.input-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 25px;
    animation: fadeInUp 0.6s ease;
}

.input-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.url-input {
    width: 100%;
    padding: 15px 40px 15px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s;
    outline: none;
}

.url-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #e0e0e0;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.clear-btn:hover {
    background: #ccc;
}

.parse-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.parse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.parse-btn:active {
    transform: translateY(0);
}

.parse-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result-section {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeInUp 0.6s ease;
}

.video-container {
    position: relative;
    width: 100%;
    background: #000;
}

.video-player {
    width: 100%;
    display: block;
    max-height: 500px;
}

.info-card {
    padding: 25px;
}

.info-item {
    margin-bottom: 20px;
}

.info-label {
    display: block;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.title-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.video-title {
    flex: 1;
    line-height: 1.6;
    color: #333;
    word-break: break-word;
}

.copy-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.copy-btn:active {
    transform: scale(0.95);
}

.cover-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-cover {
    width: 100%;
    max-width: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.cover-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.preview-btn {
    background: #4CAF50;
    color: white;
}

.preview-btn:hover {
    background: #45a049;
}

.download-btn {
    background: #2196F3;
    color: white;
}

.download-btn:hover {
    background: #0b7dda;
}

.author-info {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.author-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-size: 1rem;
    color: #333;
    font-weight: 500;
}

.download-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.download-video-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.download-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(17, 153, 142, 0.4);
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 0.95rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

.modal-img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: transform 0.3s;
}

.modal-close:hover {
    transform: rotate(90deg);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .input-section {
        padding: 20px;
    }

    .url-input {
        font-size: 0.95rem;
        padding: 12px 35px 12px 12px;
    }

    .parse-btn {
        font-size: 1rem;
        padding: 12px;
    }

    .info-card {
        padding: 20px;
    }

    .video-cover {
        max-width: 100%;
    }

    .cover-actions {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }
}
