/* ========================================
   51吃瓜网 - 蓝色科技主题
   ======================================== */

:root {
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-hover: #243044;
    --text-primary: #ffffff;
    --text-secondary: #c4d4e8;
    --text-muted: #7a8ba8;
    --accent: #00d4ff;
    --accent-hover: #33ddff;
    --accent-light: rgba(0, 212, 255, 0.15);
    --accent-glow: rgba(0, 212, 255, 0.5);
    --gradient: linear-gradient(135deg, #00d4ff 0%, #0099ff 50%, #6366f1 100%);
    --gradient-hover: linear-gradient(135deg, #33ddff 0%, #33aaff 50%, #818cf8 100%);
    --border-color: #2a3a50;
    --shadow: 0 8px 32px rgba(0, 212, 255, 0.2);
    --shadow-hover: 0 20px 50px rgba(0, 212, 255, 0.4);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    background-image: 
        radial-gradient(ellipse at top left, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 头部 --- */
header {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.98) 0%, rgba(10, 15, 26, 0.95) 100%);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 30px;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

header h1 a {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px var(--accent-glow);
}

/* --- 搜索框 --- */
.search-form {
    display: flex;
    max-width: 400px;
    flex: 1;
}

.search-form input {
    flex: 1;
    padding: 14px 22px;
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.search-form input::placeholder {
    color: var(--text-muted);
}

.search-form button {
    padding: 14px 28px;
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--gradient);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-form button:hover {
    background: var(--gradient-hover);
    transform: scale(1.05);
    box-shadow: 0 5px 20px var(--accent-glow);
}

/* --- 导航栏 --- */
.nav-scroller {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-item {
    flex-shrink: 0;
}

.nav-link {
    display: block;
    padding: 16px 22px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--accent-light);
}

.nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--accent-light);
}

/* --- 热门标签 --- */
.hot-tags {
    background: var(--bg-secondary);
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
}

.hot-tags .container {
    display: flex;
    align-items: center;
    gap: 15px;
    overflow-x: auto;
}

.hot-tags span {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.hot-tags a {
    display: inline-block;
    padding: 10px 20px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.hot-tags a:hover {
    background: var(--gradient);
    color: white;
    border-color: var(--accent);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px var(--accent-glow);
}

/* --- 主内容区 --- */
main {
    padding: 40px 0;
    min-height: calc(100vh - 300px);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

/* --- 视频卡片 --- */
.card {
    display: block;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.card-image-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-secondary);
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card:hover .card-image-wrapper img {
    transform: scale(1.15);
    filter: brightness(1.1);
}

/* 播放按钮 */
.card-image-wrapper::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 70px;
    height: 70px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    z-index: 10;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 10px 40px var(--accent-glow);
}

.card:hover .card-image-wrapper::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 渐变遮罩 */
.card-image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 212, 255, 0.3) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition);
}

.card:hover .card-image-wrapper::after {
    opacity: 1;
}

.card-content {
    padding: 18px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 12px 0;
    line-height: 1.5;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover .card-title {
    color: var(--accent);
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.card-meta span {
    padding: 4px 12px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.8rem;
    transition: var(--transition);
}

.card:hover .card-meta span {
    background: var(--gradient);
    color: white;
}

/* --- 分页 --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 50px 0 30px;
}

.pagination a {
    padding: 14px 32px;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius);
    font-weight: 600;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--gradient);
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.pagination .current-page {
    color: var(--text-muted);
}

/* --- 页脚 --- */
footer {
    background: var(--bg-secondary);
    padding: 50px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

footer p {
    color: var(--text-muted);
}

/* --- 播放器 --- */
#dplayer {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

/* --- 搜索结果页 --- */
.search-header {
    padding: 25px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 25px;
}

.search-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.search-result-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 15px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.search-result-item:hover {
    border-color: var(--accent);
    transform: translateX(10px);
    box-shadow: var(--shadow);
}

.search-thumb {
    flex-shrink: 0;
    width: 200px;
    border-radius: var(--radius);
    overflow: hidden;
}

.search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-info h3 a {
    color: var(--text-primary);
}

.search-info h3 a:hover {
    color: var(--accent);
}

.search-meta {
    color: var(--text-muted);
}

/* --- Tag页 --- */
.tag-header {
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.tag-header h1 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.related-tags {
    margin: 40px 0;
    padding: 25px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.related-tags a {
    display: inline-block;
    padding: 8px 18px;
    margin: 5px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-radius: 25px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.related-tags a:hover {
    background: var(--gradient);
    color: white;
    transform: translateY(-3px);
}

/* --- 响应式 --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    .search-form {
        max-width: 100%;
        width: 100%;
    }
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .card-content {
        padding: 14px;
    }
    .card-title {
        font-size: 0.9rem;
    }
    .card-image-wrapper::before {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    .search-result-item {
        flex-direction: column;
    }
    .search-thumb {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .grid {
        gap: 12px;
    }
    .card-content {
        padding: 12px;
    }
    .card-title {
        font-size: 0.85rem;
    }
}

/* --- 滚动条 --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient);
    border-radius: 5px;
}

::selection {
    background: var(--accent);
    color: white;
}
