/* ========================================
   91吃瓜网 - 粉色高端主题
   ======================================== */

:root {
    --bg-primary: #1a1520;
    --bg-secondary: #231c29;
    --bg-card: #2d2433;
    --bg-hover: #3d3245;
    --text-primary: #ffffff;
    --text-secondary: #d4c4df;
    --text-muted: #9a8aa8;
    --accent: #ff69b4;
    --accent-hover: #ff85c8;
    --accent-light: rgba(255, 105, 180, 0.15);
    --accent-glow: rgba(255, 105, 180, 0.5);
    --gradient: linear-gradient(135deg, #ff69b4 0%, #ff8dc7 50%, #da70d6 100%);
    --gradient-hover: linear-gradient(135deg, #ff85c8 0%, #ffa4d4 50%, #e085e0 100%);
    --border-color: #3d3245;
    --shadow: 0 8px 32px rgba(255, 105, 180, 0.2);
    --shadow-hover: 0 20px 50px rgba(255, 105, 180, 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(255, 105, 180, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(218, 112, 214, 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(35, 28, 41, 0.98) 0%, rgba(26, 21, 32, 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 .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

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

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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);
}

header h1 a:hover {
    filter: brightness(1.2);
}

/* --- 搜索框 --- */
.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);
    background: var(--bg-card);
    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;
    -webkit-overflow-scrolling: touch;
}

.nav-scroller::-webkit-scrollbar {
    height: 0;
}

.nav-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    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);
    text-shadow: 0 0 10px var(--accent-glow);
}

.nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: var(--accent-light);
    text-shadow: 0 0 15px var(--accent-glow);
}

/* --- 热门标签 --- */
.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;
    -webkit-overflow-scrolling: touch;
}

.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;
    white-space: nowrap;
    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);
}

main.container {
    padding: 40px 20px;
}

/* --- 视频网格 --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

/* --- 视频卡片 --- */
.article-item,
.video-card,
.grid > article,
.grid > div {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
}

.article-item:hover,
.video-card:hover,
.grid > article:hover,
.grid > div:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.article-item a,
.video-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* 缩略图容器 */
.article-item .thumb,
.video-card .thumb,
.grid article a > div:first-child,
.grid > div a img {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-secondary);
}

.article-item img,
.video-card img,
.grid article img,
.grid > div img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-item:hover img,
.video-card:hover img,
.grid article:hover img,
.grid > div:hover img {
    transform: scale(1.15);
    filter: brightness(1.1);
}

/* 播放按钮覆盖层 */
.article-item::before,
.video-card .thumb::before,
.grid article::before,
.grid > div::before {
    content: '▶';
    position: absolute;
    top: 35%;
    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);
}

.article-item:hover::before,
.video-card:hover .thumb::before,
.grid article:hover::before,
.grid > div:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 渐变遮罩 */
.article-item::after,
.video-card .thumb::after,
.grid article::after,
.grid > div::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 40%;
    background: linear-gradient(180deg, transparent 0%, rgba(255, 105, 180, 0.2) 100%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.article-item:hover::after,
.video-card:hover .thumb::after,
.grid article:hover::after,
.grid > div:hover::after {
    opacity: 1;
}

.article-item .info,
.video-card .info,
.grid article .info {
    padding: 18px;
    position: relative;
    z-index: 5;
}

.article-item h3,
.video-card h3,
.grid article h3,
.grid > div h3 {
    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);
}

.article-item:hover h3,
.video-card:hover h3,
.grid article:hover h3,
.grid > div:hover h3 {
    color: var(--accent);
}

.article-item .category,
.video-card .meta,
.grid article .meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category {
    display: inline-block;
    padding: 6px 14px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.article-item:hover .category,
.video-card:hover .category {
    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,
.pagination span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

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

footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

/* --- 推荐视频 --- */
.recommend-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.recommend-section h2 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    color: var(--text-primary);
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- 空状态 --- */
.empty-state,
.no-result {
    text-align: center;
    padding: 80px 20px;
}

.empty-state h3,
.no-result h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.empty-state p,
.no-result p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state a,
.no-result a {
    color: var(--accent);
}

.empty-state a:hover,
.no-result a:hover {
    text-shadow: 0 0 15px var(--accent-glow);
}

/* --- 按钮通用样式 --- */
.btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background: var(--gradient-hover);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

/* --- 搜索结果页 --- */
.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);
    margin: 0 0 10px 0;
}

.search-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.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;
    transition: var(--transition);
}

.search-result-item:hover .search-thumb img {
    transform: scale(1.1);
}

.search-info {
    flex: 1;
}

.search-info h3 {
    font-size: 1.1rem;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

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

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

.search-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.search-meta span {
    margin-right: 20px;
}

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

.tag-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0 0 15px 0;
}

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

.tag-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

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

.related-tags h4 {
    margin: 0 0 18px 0;
    color: var(--text-primary);
    font-size: 1.1rem;
}

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

.related-tags a:hover {
    background: var(--gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--accent-glow);
}

/* --- 响应式设计 --- */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 15px 0;
    }

    header h1 {
        font-size: 1.4rem;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
    }

    .search-form {
        max-width: 100%;
        width: 100%;
    }

    .nav-link {
        padding: 14px 18px;
        font-size: 0.9rem;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .article-item .info,
    .video-card .info {
        padding: 14px;
    }

    .article-item h3,
    .video-card h3 {
        font-size: 0.9rem;
    }

    main {
        padding: 25px 0;
    }

    .pagination {
        padding: 30px 0 20px;
    }

    .pagination a {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .search-result-item {
        flex-direction: column;
    }

    .search-thumb {
        width: 100%;
        aspect-ratio: 16/9;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .article-item .info,
    .video-card .info {
        padding: 12px;
    }

    .article-item h3,
    .video-card h3 {
        font-size: 0.85rem;
    }

    .category {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .hot-tags a {
        padding: 8px 16px;
        font-size: 0.8rem;
    }

    .article-item::before,
    .grid > div::before {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-hover);
}

/* --- 选中文字样式 --- */
::selection {
    background: var(--accent);
    color: white;
}

/* --- 首页视频卡片 .card 悬停效果 --- */
.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;
    text-decoration: none;
    color: inherit;
}

.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(255, 105, 180, 0.3) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

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

.card-content {
    padding: 18px;
    position: relative;
    z-index: 5;
}

.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;
    align-items: center;
}

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

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

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

/* 响应式 */
@media (max-width: 768px) {
    .card-content {
        padding: 14px;
    }
    .card-title {
        font-size: 0.9rem;
    }
    .card-image-wrapper::before {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .card-content {
        padding: 12px;
    }
    .card-title {
        font-size: 0.85rem;
    }
    .card-meta span {
        font-size: 0.7rem;
        padding: 3px 8px;
    }
}
