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

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --background: #F9FAFB;
    --card-background: #FFFFFF;
    --border-color: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

header h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.progress-bar {
    background: var(--card-background);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    position: relative;
    height: 40px;
    flex-shrink: 0;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #818CF8);
    border-radius: 8px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 24px;
}

.main-content {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    margin-bottom: 0.75rem;
}

/* 视频区域 */
.video-section {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    margin-bottom: 0.75rem;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 60vh;
}

.video-info h2 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.video-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 表单区域 */
.form-section {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    max-height: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.4;
}

.label-desc {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* 星星评分行 */
.rating-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rating-label-left,
.rating-label-right {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.4;
}

.rating-label-left {
    order: -1;
}

.rating-feedback {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rating-feedback.show {
    opacity: 1;
}

.star-rating {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.star {
    font-size: 1.75rem;
    color: #D1D5DB;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1;
}

.star:hover,
.star.active,
.star.hover {
    color: #FCD34D;
    transform: scale(1.1);
}

.star.active {
    color: #F59E0B;
}

.rating-group,
.choice-group {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.rating-btn,
.choice-btn {
    flex: 1;
    min-width: 90px;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-color);
    background: var(--card-background);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-weight: 500;
}

.rating-btn:hover,
.choice-btn:hover {
    border-color: var(--primary-color);
    background: #EEF2FF;
    transform: translateY(-2px);
}

.rating-btn.active,
.choice-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    transition: all 0.2s ease;
    min-height: 80px;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea::placeholder {
    color: #9CA3AF;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn {
    flex: 1;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: var(--card-background);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--secondary-color);
    background: var(--background);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 视频缩略图导航 */
.video-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    background: var(--card-background);
    padding: 0.75rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.thumbnail {
    position: relative;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--card-background);
}

.thumbnail:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.thumbnail.active {
    border-color: var(--primary-color);
    background: #EEF2FF;
}

.thumbnail.completed {
    border-color: var(--success-color);
    background: #ECFDF5;
}

.thumbnail.completed::after {
    content: "✓";
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: var(--success-color);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.thumbnail-number {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.125rem;
}

.thumbnail-title {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.1;
}

/* 完成弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-background);
    padding: 3rem;
    border-radius: 16px;
    max-width: 500px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.modal-content .btn {
    display: block;
    width: 100%;
    margin-bottom: 0.75rem;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.modal-content input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#confettiCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .video-section {
        order: 1;
    }

    .form-section {
        order: 2;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .rating-group,
    .choice-group {
        flex-direction: column;
    }

    .rating-btn,
    .choice-btn {
        min-width: 100%;
    }

    .video-thumbnails {
        grid-template-columns: repeat(3, 1fr);
    }
}
