/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand h1 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.nav-actions {
    display: flex;
    gap: 1rem;
}

/* 按钮样式 */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* 欢迎区域 */
.welcome-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.welcome-section h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.welcome-section p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 视频网格 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.video-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.video-thumbnail {
    position: relative;
    height: 160px;
    background: linear-gradient(45deg, #3498db, #2c3e50);
    overflow: hidden;
}

.thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 3rem;
    color: rgba(255,255,255,0.9);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-card:hover .video-overlay {
    opacity: 1;
}

.btn-play {
    background: rgba(255,255,255,0.9);
    color: #2c3e50;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    flex: 1;
    padding: 0.5rem;
    background: #ecf0f1;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.btn-action:hover {
    background: #d5dbdb;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #2c3e50;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
}

.modal-body {
    padding: 1rem;
}

.video-info {
    margin-top: 1rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 10px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

/* 上传页面样式 */
.upload-container {
    display: grid;
    gap: 2rem;
}

.upload-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.upload-header {
    margin-bottom: 2rem;
    text-align: center;
}

.upload-header h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.upload-header p {
    color: #7f8c8d;
}

.upload-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.file-drop-area {
    border: 2px dashed #bdc3c7;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-drop-area:hover,
.file-drop-area.dragover {
    border-color: #3498db;
    background: #f8f9fa;
}

.file-drop-content {
    pointer-events: none;
}

.file-drop-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.file-types,
.file-limit {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.file-info {
    margin-top: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    padding: 1rem;
}

.file-info-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-name {
    font-weight: 500;
    color: #2c3e50;
}

.file-size {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 上传进度 */
.upload-progress {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: width 0.3s ease;
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    text-align: center;
}

.detail-item span:first-child {
    display: block;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.detail-item span:last-child {
    color: #2c3e50;
    font-weight: 600;
}

.chunk-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.chunk {
    width: 20px;
    height: 8px;
    background: #ecf0f1;
    border-radius: 2px;
    transition: background 0.3s;
}

.chunk.uploaded {
    background: #2ecc71;
}

.chunk.uploading {
    background: #3498db;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 上传控制按钮 */
.upload-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* 上传说明 */
.upload-instructions {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.upload-instructions h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.upload-instructions ul {
    list-style: none;
}

.upload-instructions li {
    padding: 0.5rem 0;
    color: #34495e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 上传状态 */
.upload-status {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 5px;
    text-align: center;
}

.upload-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .progress-details {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
    font-style: italic;
}

.error {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
    background: #fadbd8;
    border-radius: 5px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
}

.section-header h3 {
    color: #2c3e50;
}

.controls select {
    padding: 0.5rem;
    border: 2px solid #ecf0f1;
    border-radius: 5px;
    background: white;
    color: #2c3e50;
    font-weight: 500;
}