/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px;
}

/* 头部样式 */
header {
    background-color: #4a6fa5;
    color: white;
    padding: 15px 0;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

header h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
}

/* 上传区域样式 */
.upload-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.upload-section h2 {
    margin-bottom: 15px;
    color: #4a6fa5;
    font-size: 1.25rem;
    font-weight: 600;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.form-group textarea {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
    background-color: #fafafa;
}

.form-group textarea:focus {
    outline: none;
    border-color: #4a6fa5;
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.1);
    background-color: white;
}

.file-input {
    padding: 8px;
    border: 2px dashed #e0e0e0;
    border-radius: 6px;
    background-color: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input:hover {
    border-color: #4a6fa5;
    background-color: #f0f4f8;
}

.file-input input[type="file"] {
    display: none;
}

.file-input-label {
    display: block;
    text-align: center;
    padding: 15px;
    color: #666;
    font-size: 0.9rem;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #4a6fa5;
    color: white;
    align-self: flex-start;
}

.btn-primary:hover {
    background-color: #3a5a85;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* 内容列表样式 */
.files-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.files-section h2 {
    margin-bottom: 15px;
    color: #4a6fa5;
    font-size: 1.25rem;
    font-weight: 600;
}

.contents-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.content-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.content-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.content-meta {
    font-size: 0.8rem;
    color: #666;
}

.content-time {
    margin-right: 10px;
}

.content-text {
    margin-bottom: 12px;
    line-height: 1.7;
    font-size: 0.95rem;
    word-break: break-word;
}



.content-text-edit {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
}

.content-text-edit:focus {
    outline: none;
    border-color: #4a6fa5;
    box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.1);
}

.edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.content-text-edit-form {
    margin-bottom: 12px;
}

/* 媒体容器样式 */
.media-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.media-item {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.media-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.media-preview {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
    -webkit-touch-callout: default;
}

.video-item video {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
}

.image-item img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
}

/* 媒体下载按钮 */
.media-download {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    text-decoration: none;
}

.media-item:hover .media-download {
    opacity: 1;
}

.media-download:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    text-align: center;
    gap: 8px;
}

.file-icon-large {
    font-size: 3rem;
    color: #4a6fa5;
    margin-bottom: 8px;
}

.file-name-large {
    font-size: 0.85rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* 消息样式 */
.message {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-weight: 500;
    font-size: 0.9rem;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.75rem;
    }
    
    .upload-section,
    .files-section {
        padding: 15px;
    }
    
    .media-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .content-actions {
        align-self: flex-end;
    }
    
    .upload-form {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .media-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .content-card {
        padding: 12px;
    }
    
    .file-icon-large {
        font-size: 2.5rem;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #666;
}

.empty-state p {
    font-size: 1rem;
}

/* 预览样式 */
.preview {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    margin: 10px 0;
    border-radius: 4px;
}

/* 进度条 */
.progress {
    width: 100%;
    height: 8px;
    background-color: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #4a6fa5;
    border-radius: 4px;
    transition: width 0.3s ease;
}