/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    padding: 20px;
    background: #f6f6f6;
    transition: background-color 0.3s, color 0.3s;
}

input, select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s, background-color 0.3s, color 0.3s;
}

/* 暗黑模式 */
body.dark-mode {
    background: #121212;
    color: #e0e0e0;
}

/* 布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-size: 14px;
    font-weight: bold;
    color: #18191c;
    margin-top: 15px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background: #fb7299;
    margin-right: 8px;
    border-radius: 2px;
    vertical-align: middle;
}

.content-section {
    font-size: 14px;
    color: #61666d;
    white-space: pre-wrap;
    word-break: break-all;
    transition: color 0.3s;
}

.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.show-more {
    color: #fb7299;
    cursor: pointer;
    user-select: none;
    margin-top: 5px;
    display: inline-block;
    font-size: 13px;
}

.show-more:hover {
    color: #e85d84;
}

/* 翻页样式 */
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.page-item {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 36px;
    text-align: center;
}

.page-item:hover:not(:disabled) {
    background: #f5f5f5;
}

.page-item.active {
    background: #fb7299;
    color: white;
    border-color: #fb7299;
}

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

.pagination-ellipsis {
    padding: 6px 12px;
    color: #666;
    user-select: none;
}

.pagination-toggle {
    color: #fb7299;
    cursor: pointer;
    user-select: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.pagination-toggle:hover {
    background: rgba(251, 114, 153, 0.1);
}

/* 按钮样式 */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.action-buttons button {
    padding: 8px 16px;
    background: #fb7299;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.action-buttons button:hover {
    background: #e85d84;
}

.theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fb7299;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.2s;
}

.theme-switcher:hover {
    background: #e85d84;
    transform: scale(1.1);
    will-change: transform, background-color;
    backface-visibility: hidden;
}

.theme-switcher:active {
    transform: scale(0.95);
}

.back-to-top {
    position: fixed;
    bottom: 70px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fb7299;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.2s, opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    background: #e85d84;
    transform: scale(1.1);
    will-change: transform, background-color;
    backface-visibility: hidden;
}

.back-to-top:active {
    transform: scale(0.95);
}

/* 骨架屏样式 */
.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 1000px 100%;
}

.skeleton .video-thumbnail {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.skeleton .video-title {
    width: 80%;
    height: 20px;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton .video-meta {
    width: 100%;
    height: 15px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton .video-stat {
    width: 30%;
    height: 15px;
    margin-right: 10px;
    border-radius: 4px;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 响应式设计 */
@media (max-width: 600px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    input[type="search"],
    select {
        width: 100%;
    }

    .video-card {
        padding: 15px;
    }

    .video-thumbnail {
        height: 150px;
    }
}

@media (max-width: 400px) {
    .video-card {
        padding: 12px;
    }

    .video-thumbnail {
        height: 120px;
    }

    .action-buttons button {
        flex: 1 1 100%;
    }
}