:root {
    --primary-color: #ff0000;
    --secondary-color: #282828;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--light-gray);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: #f0f2f5;
    flex-direction: column;
    padding: 2rem 0;
}

.container {
    background: white;
    padding: 2em;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 500px;
    width: 90%;
    max-width: 550px;
    margin-bottom: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.header {
    text-align: center;
    margin-bottom: 2em;
}

.header h1 {
    color: var(--primary-color);
    font-size: 2em;
    margin-bottom: 0.5em;
}

.header h1 i {
    margin-right: 0.3em;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.download-form {
    display: flex;
    flex-direction: column;
    gap: 1.5em;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 15px;
    color: #666;
}

.input {
    width: 100%;
    padding: 1em 1em 1em 2.5em;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkbox-group {
    display: flex;
    gap: 1em;
    justify-content: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5em;
    cursor: pointer;
    padding: 0.5em 1em;
    border-radius: var(--border-radius);
    background: var(--light-gray);
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: #e0e0e0;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn {
    padding: 1em;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
}

.btn:hover {
    background: #cc0000;
}

.player-link {
    display: block;
    margin-top: 1.5em;
    text-align: center;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
}

.player-link:hover {
    color: #cc0000;
}

.player-link i {
    margin-right: 0.5em;
}

/* 任务相关样式 */
.task-container {
    background: white;
    padding: 1.5rem;
}

.task-container h3 {
    color: #1a73e8;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.task-url {
    color: #1a73e8;
    word-break: break-all;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #e8f0fe;
    border-radius: 4px;
}

.task-list {
    list-style: none;
    padding: 0;
}

.task-list li {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: background-color 0.2s ease;
}

.task-list li:hover {
    background-color: #f8f9fa;
}

.task-list li:last-child {
    border-bottom: none;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.badge.video {
    background-color: #e8f0fe;
    color: #1a73e8;
}

.badge.audio {
    background-color: #fce8e6;
    color: #d93025;
}

.task-id {
    font-family: monospace;
    background: #f1f3f4;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* 视频信息样式 */
.video-info {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.video-thumbnail {
    flex-shrink: 0;
    width: 160px;
    height: 90px;
    border-radius: 4px;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.video-title {
    margin: 0;
    font-size: 1.1rem;
    color: #1a73e8;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    gap: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-meta i {
    color: #1a73e8;
}

/* 骨架屏样式 */
.video-info-skeleton {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.skeleton-thumbnail {
    flex-shrink: 0;
    width: 160px;
    height: 90px;
    border-radius: 4px;
    background: #f0f0f0;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.skeleton-title {
    width: 80%;
    height: 1.5rem;
    background: #f0f0f0;
    border-radius: 4px;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-meta {
    display: flex;
    gap: 1rem;
}

.skeleton-text {
    width: 120px;
    height: 1rem;
    background: #f0f0f0;
    border-radius: 4px;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0 50%;
    }
}

.skeleton-thumbnail,
.skeleton-title,
.skeleton-text {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 37%,
        #f0f0f0 63%
    );
    background-size: 400% 100%;
}

/* URL 复制区域样式 */
.url-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e8f0fe;
    padding: 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.url-display {
    color: #1a73e8;
    font-size: 0.9rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    background: none;
    border: none;
    color: #1a73e8;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.copy-btn:hover {
    background-color: rgba(26, 115, 232, 0.1);
}

.copy-btn:active {
    background-color: rgba(26, 115, 232, 0.2);
}

@media (max-width: 480px) {
    .container {
        padding: 1.5em;
    }

    .header h1 {
        font-size: 1.5em;
    }

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

    .checkbox-label {
        width: 100%;
        justify-content: center;
    }

    .badge span {
        display: none;  /* 在小屏幕下隐藏文字 */
    }

    .badge {
        padding: 0.25rem;  /* 减小内边距 */
    }

    .task-id {
        font-size: 0.75rem;  /* 减小任务ID字体大小 */
    }

    .task-list li {
        padding: 0.75rem;  /* 减小列表项内边距 */
        gap: 0.5rem;  /* 减小间距 */
    }

    .task-url {
        font-size: 0.875rem;  /* 减小URL字体大小 */
    }

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

    .video-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .video-title {
        font-size: 1rem;
    }

    .video-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .video-info-skeleton {
        flex-direction: column;
    }

    .skeleton-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .skeleton-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .url-copy {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .url-display {
        max-width: 200px;
    }
}
