/*  公共  */
*{
    box-sizing: border-box;
}

body, html {
    overflow-x: hidden; /* 暴力但有效：禁止 body 的水平滚动 */
    width: 100vw;       /* 强制宽度为视口宽度 */
}

body, html { margin: 0; padding: 0; background: var(--bg-body); font-family: "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text-main); scroll-behavior: smooth; }

:root {
    --primary-color: #ff4757;
    --novel-color: #eccc68;
    --bg-body: #f5f6fa;
    --card-bg: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.98);
    --text-main: #2f3542;
    --text-muted: #747d8c;
    --content-width: 1200px;
}

/* 验证码图片美化 */
.codeimage {
    display: block;
    width: 120px;       /* 固定宽度 */
    height: 45px;       /* 固定高度 */
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    object-fit: contain; /* 关键：确保验证码图片不被裁切 */
    background: #f8f9fa;
}
.codeimage:hover {
    border-color: var(--primary-color);
    opacity: 0.8;
}

/* 新增：验证码容器布局 */
.captcha-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
}
.captcha-row input {
    margin-bottom: 0 !important; /* 覆盖掉全局 margin */
    flex: 1;
}

/* 消息提示框动画增强 */
.v-msg-box {
    animation: slideDown 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
@keyframes slideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}
/* end 验证码图片美化 */

/* 注册登录弹出层 */
/* 登录注册按钮 */
.auth-btns { display: flex; align-items: center; gap: 5px; }
.btn-login { font-size: 14px; font-weight: 600; color: var(--text-main); padding: 8px 15px; }
.btn-login:hover { color: var(--primary-color); }
.btn-reg {
    background: var(--primary-color); color: #fff !important;
    padding: 8px 20px; border-radius: 20px; font-size: 14px;
    font-weight: bold; box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
}

/* 弹出层容器 */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
    display: none; align-items: center; justify-content: center; z-index: 2000;
}
.modal-box {
    background: #fff; width: 90%; max-width: 400px; border-radius: 24px;
    padding: 40px; position: relative; animation: modalAnim 0.3s ease-out;
}
@keyframes modalAnim {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-close { position: absolute; top: 20px; right: 20px; cursor: pointer; color: #ccc; font-size: 24px; }
.modal-title { font-size: 24px; font-weight: 800; margin-bottom: 30px; text-align: center; }

/* 表单样式 */
.auth-form input {
    width: 100%; padding: 14px 20px; margin-bottom: 15px;
    border: 1px solid #eee; background: #f9f9f9; border-radius: 12px;
    outline: none; transition: 0.3s; font-size: 15px;
}
.auth-form input:focus { border-color: var(--primary-color); background: #fff; }
.auth-submit {
    width: 100%; padding: 15px; background: var(--primary-color);
    color: #fff; border: none; border-radius: 12px; font-size: 16px;
    font-weight: bold; cursor: pointer; margin-top: 10px;
}
.auth-switch { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.auth-switch span { color: var(--primary-color); cursor: pointer; font-weight: bold; }

/* 自定义消息提示框 */
.v-msg-box {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: none;
}
.v-msg-content {
    padding: 12px 30px; border-radius: 50px; color: #fff; font-weight: bold;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15); font-size: 14px;
}
.v-msg-box.success .v-msg-content { background: #2ed573; }
.v-msg-box.error .v-msg-content { background: #ff4757; }

/* 按钮点击反馈 */
.auth-submit:active { transform: scale(0.98); opacity: 0.9; }
.auth-submit:disabled { background: #ccc; cursor: not-allowed; }

/* 响应式微调 */
@media screen and (max-width: 480px) {
    .modal-box { padding: 30px 20px; width: 85%; }
    .modal-title { font-size: 20px; }
}
/* end 登录注册按钮 */

/* 首页 */

a { text-decoration: none; color: inherit; cursor: pointer; transition: 0.3s; }

/* --- 智能导航栏 --- */
header {
    position: fixed; top: 0; width: 100%; background: var(--nav-bg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    backdrop-filter: blur(10px);
}
header.collapsed { transform: translateY(-120px); } /* 隐藏时向上偏移 */

.nav-container { max-width: var(--content-width); margin: 0 auto; padding: 15px 20px; }

/* 顶部栏：Logo + 搜索 + 会员 */
.nav-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.logo { font-size: 24px; font-weight: 900; color: var(--primary-color); letter-spacing: 1px; flex-shrink: 0; }

/* 搜索框区域 */
.search-form {
    flex: 1; display: flex; align-items: center;
    background: #f1f2f6; border-radius: 25px; padding: 2px 5px 2px 18px;
    max-width: 450px; border: 1px solid transparent; transition: 0.3s;
}
.search-form:focus-within { background: #fff; border-color: var(--primary-color); box-shadow: 0 0 8px rgba(255, 71, 87, 0.1); }
.search-input {
    flex: 1; border: none; background: transparent; height: 36px;
    outline: none; font-size: 14px; color: var(--text-main);
}
.search-btn {
    border: none; background: var(--primary-color); color: white;
    padding: 7px 20px; border-radius: 20px; cursor: pointer;
    font-size: 14px; font-weight: bold;
}

/* 会员区 */
.user-box { display: flex; align-items: center; gap: 12px; white-space: nowrap; flex-shrink: 0; }
.btn-login { font-size: 14px; font-weight: 600; padding: 8px 12px; }
.btn-reg { background: var(--primary-color); color: #fff; padding: 8px 18px; border-radius: 10px; font-size: 14px; font-weight: bold; }
/* 已登录状态样式 */
.user-logged { display: flex; align-items: center; gap: 8px; color: var(--primary-color); font-weight: bold; }
.user-logged i { font-style: normal; font-size: 11px; background: #ffeaa7; color: #d63031; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }

/* 分类组 */
.category-group { display: flex; align-items: flex-start; gap: 15px; margin-bottom: 12px; }
.bar-label { font-size: 13px; font-weight: bold; color: #a4b0be; padding-top: 6px; white-space: nowrap; }
.cat-list { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }
.cat-list a { font-size: 13px; padding: 5px 14px; border-radius: 8px; background: #fff; border: 1px solid #eee; color: #57606f; }
.cat-list a:hover { border-color: var(--primary-color); color: var(--primary-color); }
.active-red { background: var(--primary-color) !important; color: #fff !important; border: none !important; }
.active-gold { background: var(--novel-color) !important; color: #fff !important; border: none !important; }

/* --- 轮播图 --- */
.banner-section { margin-bottom: 30px; position: relative; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.slider-wrapper { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.slider-wrapper::-webkit-scrollbar { display: none; }
.slide-item { flex: 0 0 100%; scroll-snap-align: start; position: relative; aspect-ratio: 21/9; min-height: 200px; }
.slide-item img { width: 100%; height: 100%; object-fit: cover; }
.slide-info {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 50px 25px 25px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8)); color: #fff;
}
.slide-info h2 { margin: 0; font-size: 26px; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.slider-dots { position: absolute; bottom: 20px; right: 25px; display: flex; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 5px; background: rgba(255,255,255,0.4); cursor: pointer; transition: 0.3s; }
.dot.active { width: 25px; background: var(--primary-color); }

/* --- 列表布局 --- */
main { max-width: var(--content-width); margin: 0 auto; padding: 0 20px; }
.section-block { margin-bottom: 50px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; border-bottom: 2px solid #eee; padding-bottom: 12px; }
.section-title { font-size: 22px; font-weight: 800; position: relative; margin: 0; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; position: absolute; bottom: -14px; left: 0; width: 50px; height: 4px; background: var(--primary-color); border-radius: 2px; }

.video-grid { display: grid; gap: 20px; grid-template-columns: repeat(5, 1fr); margin: 30px 0; }
.video-item { display: block; background: var(--card-bg); border-radius: 14px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.video-item:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.12); }
.video-item:hover .v-title { color: var(--primary-color); }

.cover-box { width: 100%; aspect-ratio: 16/10; position: relative; background: #e9ecef; overflow: hidden; }
.cover-box img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: 0.8s; }
.cover-box img.loaded { opacity: 1; }
.v-duration { position: absolute; bottom: 10px; right: 10px; background: rgba(0,0,0,0.75); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 5px; font-weight: bold; }

.v-content { padding: 18px; }
.v-title { font-size: 15px; font-weight: bold; line-height: 1.5; height: 45px; margin: 0 0 12px 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.v-stats { font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; }

/* 回到顶部 */
#backToTop {
    position: fixed; bottom: 40px; right: 40px; width: 55px; height: 55px;
    background: linear-gradient(135deg, #ff4757, #ff6b81); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.4); z-index: 1001;
    opacity: 0; visibility: hidden; transform: scale(0.5); transition: 0.4s;
}
#backToTop.show { opacity: 1; visibility: visible; transform: scale(1); }

/* 响应式调整 */
@media screen and (max-width: 900px) {
    header.collapsed { transform: translateY(-101%); }
    .nav-top { gap: 10px; }
    .search-form { max-width: none; order: 3; flex: 0 0 100%; margin-top: 10px; }
    .nav-top { flex-wrap: wrap; }
    .video-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .slide-item { aspect-ratio: 16/9; }
    .slide-info h2 { font-size: 18px; }
    .btn-reg { display: none; } /* 手机端隐藏注册按钮节省空间 */
}






/* --- type.html 分类页增强 --- */
.filter-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 15px 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #eee;
}
.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}
.filter-row:not(:last-child) { border-bottom: 1px dashed #f1f2f6; }
.filter-label { font-size: 13px; font-weight: bold; color: #a4b0be; white-space: nowrap; }
.filter-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 13px; padding: 4px 14px; border-radius: 6px; background: #fff; border: 1px solid #eee; color: #57606f; }
.tag.active { background: var(--primary-color) !important; color: #fff !important; border-color: var(--primary-color) !important; }

/* VIP 角标 */
.v-badge {
    position: absolute; top: 10px; left: 10px;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #fff; font-size: 10px; font-weight: 900; padding: 2px 6px; border-radius: 4px;
}

/* 分页美化 */
/* --- 移动端友好型分页样式 --- */
.pagination-wrapper {
    margin: 30px auto;
    display: flex;
    justify-content: center; /* 居中显示 */
    align-items: center;
    gap: 8px;                /* 页码之间的间距 */
    flex-wrap: wrap;         /* 关键：超出宽度自动换行 */
    padding: 0 15px;         /* 防止贴边 */
    max-width: 100%;
}

/* 每一个页码按钮的基础样式 */
.p-btn, .p-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;         /* 稍微缩小尺寸以适应手机 */
    height: 38px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 10px;      /* 圆角保持一致 */
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

/* 当前选中页 */
.p-num.current {
    background: var(--primary-color) !important; /* 使用你的红色主题 */
    color: #fff !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 10px rgba(255, 71, 87, 0.2);
}

/* 激活/悬停状态 */
.p-btn:active, .p-num:active {
    transform: scale(0.95); /* 点击时的缩放反馈 */
    background: #fafafa;
}

/* 省略号样式 */
.p-dot {
    color: #bbb;
    padding: 0 2px;
    font-weight: bold;
}

/* --- 针对超小屏幕（手机）的特殊优化 --- */
@media screen and (max-width: 480px) {
    .pagination-wrapper {
        gap: 6px;            /* 手机上间距再缩小一点 */
        margin: 20px auto;
    }

    .p-num, .p-btn {
        min-width: 34px;
        height: 34px;
        padding: 0 10px;
        font-size: 13px;
        border-radius: 8px;
    }

    /* 如果你觉得手机上“首页/末页”太占地方，可以选择隐藏，只留“上一页/下一页” */
    /*
    .p-btn:first-child, .p-btn:last-child {
        display: none;
    }
    */
}




/* --- 视频详情页专属 --- */
.video-play-section {
    background: #000; /* 播放区背景深色，更沉浸 */
    margin: 0 -20px 30px -20px; /* 移动端拉满全屏 */
}
.video-container {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* 播放器容器 16:9 比例 */
.player-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #1a1a1a;
    position: relative;
}
.player-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.player-tip {
    text-align: center;
    color: #666;
    font-size: 14px;
}
.vip-notice {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 25px;
    font-weight: bold;
}

/* 详情信息区 */
.video-detail-info {
    padding: 20px;
    background: #fff;
}
.video-main-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 15px 0;
    line-height: 1.4;
}
.video-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.meta-tag {
    background: #f1f2f6;
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
}
.meta-item {
    font-size: 13px;
    color: var(--text-muted);
}

/* 点赞按钮 */
.action-btn {
    border: 1px solid #eee;
    background: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.like-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 响应式适配 */
@media screen and (max-width: 900px) {
    .video-play-section { margin: 0; }
    .video-main-title { font-size: 18px; }
}

#dplayer{
    width: 100%;
    height: 100%;
}

/* 1. 强制播放器内部的 video 标签铺满，不留任何空隙 */
#dplayer .dplayer-video-wrap video {
    object-fit: contain !important; /* 或者用 cover，如果你想彻底没黑边 */
    background: #000 !important;
}

/* 2. 针对手机端竖屏视频可能出现的上下黑边优化 */
@media screen and (max-width: 768px) {
    .player-wrapper {
        /* 如果你的视频大部分是 16:9，这里保持比例；
           如果是为了适配各种比例，可以去掉 aspect-ratio 改为固定高度或动态计算 */
        background: #000;
        display: flex;
        align-items: center;
    }
}

/* 3. 隐藏 DPlayer 初始加载时的灰色背景 */
.dplayer-loading-icon {
    display: none !important;
}

/* 评论区样式 */
.comment-section { background: #fff; padding-bottom: 20px; }
.comment-post-box { display: flex; gap: 12px; padding: 20px 0; border-bottom: 1px solid #f0f0f0; margin-bottom: 20px; }
.user-avatar-mini img { width: 40px; height: 40px; border-radius: 50%; background: #eee; }
.post-wrapper { flex: 1; }
.post-wrapper textarea { width: 100%; height: 80px; border: 1px solid #ddd; border-radius: 8px; padding: 10px; font-size: 14px; outline: none; transition: border 0.3s; resize: none; }
.post-wrapper textarea:focus { border-color: #ff4757; }
.post-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.word-limit { color: #999; font-size: 12px; }
.submit-comment-btn { background: #ff4757; color: #fff; border: none; padding: 6px 20px; border-radius: 20px; cursor: pointer; }
.login-to-comment { width: 100%; background: #f8f9fa; text-align: center; padding: 30px; border-radius: 8px; color: #666; }
.login-link { color: #ff4757; font-weight: bold; cursor: pointer; }

/* 评论列表 */
.comment-item { display: flex; gap: 12px; margin-bottom: 20px; }
.c-user-avatar img { width: 40px; height: 40px; border-radius: 50%; }
.c-body { flex: 1; border-bottom: 1px solid #f5f5f5; padding-bottom: 15px; }
.c-user-info { margin-bottom: 6px; }
.c-username { font-weight: bold; color: #333; font-size: 14px; margin-right: 10px; }
.c-time { color: #999; font-size: 12px; }
.c-content { line-height: 1.6; color: #444; font-size: 14px; margin-bottom: 8px; }
.c-actions { font-size: 12px; color: #bbb; }
.c-action-item { cursor: pointer; }
.no-comment { text-align: center; padding: 40px; color: #999; }

/* 默认头像样式 */
.c-user-avatar, .user-avatar-mini {
    width: 40px;
    height: 40px;
    background-color: #e0e0e0; /* 浅灰色背景 */
    background-image: radial-gradient(circle at 50% 40%, #fff 25%, transparent 26%),
    radial-gradient(circle at 50% 120%, #fff 45%, transparent 46%);
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    border: 1px solid #ddd;
}

/* 如果是评论区的头像框，确保它包裹住这个生成的形状 */
.c-user-avatar img, .user-avatar-mini img {
    display: none; /* 如果没有真实图片，隐藏 img 标签 */
}

/* 楼中楼回复区域容器 */
.reply-container {
    background: #f4f6f8; /* 浅灰色背景区别于主楼 */
    padding: 12px;
    margin-top: 12px;
    border-radius: 8px;
    border-left: 3px solid #e0e0e0; /* 左侧装饰线 */
}

/* 每一条子回复 */
.reply-item {
    font-size: 13px;
    line-height: 1.8;
    margin-bottom: 8px;
    color: #444;
}

.reply-item:last-child {
    margin-bottom: 0;
}

/* 回复中的用户名 */
.reply-user {
    font-weight: 600;
    color: #2f3542;
    cursor: pointer;
}

.reply-user:hover {
    color: #ff4757;
}

/* @某人的样式 */
.reply-at {
    color: #1e90ff;
    margin: 0 4px;
}

/* 子回复的时间 */
.reply-time {
    color: #bbb;
    font-size: 11px;
    margin-left: 8px;
}