/*
Theme Name: MyMovieTheme
Version: 1.0
Description: Movie website theme with black and red style
Author: Your Name
*/

/* 通用重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: #fff;
}

/* 链接样式 */
a {
    color: #ffffff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 顶部导航 */
header {
    background-color: #1f1f1f;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

header h1 a {
    color: #ff4c4c;
    text-decoration: none;
}

nav a {
    margin-left: 20px;
    font-size: 1rem;
}

/* 主布局 */
main {
    display: flex;
    flex-wrap: wrap;
    padding: 20px 30px;
    gap: 20px;
}

/* 主内容区：网格布局列表 
.content {
    flex: 3;
    display: grid;
    grid-template-columns: repeat(4, 1fr); 
    gap: 15px;
	
}
*/

/* 主内容容器，只控制宽度 */
.main-section {
    flex: 3;
}

/* 电影网格容器 */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* PC 默认 4 列 */
    gap: 15px;
}



/* 标题（类似你之前 h2 的行内样式） */
.section-title {
    font-size: 1.4rem;
    color: #ff4c4c;
    padding-left: 10px;
    margin-bottom: 10px;
}




/* 侧边栏 */
.sidebar {
    flex: 1;
    background-color: #1f1f1f;
    border-radius: 8px;
    padding: 15px;
}

.sidebar h2 {
    color: #ff4c4c;
    margin-bottom: 15px;
}

.sidebar ul {
    list-style: none;
}

.sidebar ul li {
    margin-bottom: 10px;
}

/* 轮播组件 */
.carousel {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    margin: 15px auto;
    border-radius: 10px;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    gap: 10px;
    padding: 0 5px;
    box-sizing: border-box;
}

.slide-item {
    flex: 0 0 calc((100% - 20px) / 3); /* 3 张 */
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.slide-item:hover img {
    transform: scale(1.05);
}

/* 半透明黑底 + 标题 */
.slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
    padding: 20px 10px 10px;
    color: #fff;
    text-align: left;
}

.slide-title {
    font-size: 1rem;
    font-weight: bold;
    text-shadow: 0 0 5px #000;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 轮播导航按钮 */
.carousel .prev,
.carousel .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: #ff4c4c;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 50%;
    z-index: 10;
}

.carousel .prev {
    left: 10px;
}
.carousel .next {
    right: 10px;
}

/* 电影卡片 */
.movie-card {
    background-color: #1f1f1f;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
}

/* 🔥 关键：给图片固定比例，修复 iPhone X 高度塌陷 */
.movie-card img {
    /*
    aspect-ratio: 2 / 3;
    */
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: right center; /* 从右边截取 */
    display: block;
}




.movie-card:hover {
    transform: scale(1.05);
}

.movie-card .info {
    padding: 10px;
    text-align: center;
}

/* 标题单行省略 */
.movie-card .info h3 {
    margin-bottom: 5px;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 标题链接 */
.movie-card .info h3 a {
    text-decoration: none;
}

.movie-card .info h3 a:hover {
    text-decoration: none;
}

/* 分类文字链接（在卡片下方的分类） */
.movie-card .info p {
    font-size: 0.9rem;
    color: #ccc;
}

.movie-card .info p a {
    text-decoration: none;
    color: #858585;
}

.movie-card .info p a:hover {
    text-decoration: none;
}

/* 评分（如果后面用得到） */
.rating {
    color: #ff4c4c;
    font-weight: bold;
    margin-top: 5px;
}

/* 分页 */
.pagination {
    text-align: center;
    margin: 20px 0;
}

.pagination .page-navigator {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 5px;
}

.pagination .page-navigator li {
    display: inline-block;
}

.pagination .page-navigator li a {
    display: inline-block;
    background-color: #1f1f1f;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
}

.pagination .page-navigator li.current a {
    background-color: #ff4c4c;
    color: #1f1f1f;
}

.pagination .page-navigator li a:hover {
    background-color: #ff4c4c;
    color: #1f1f1f;
}

/* ==================== 响应式 ==================== */

/* 大屏到 iPad（<= 1024px） */
@media (max-width: 1024px) {
    main {
        flex-direction: column;
        padding: 20px 15px;
    }
	/*
    .content {
        flex: 1 1 100%;
        grid-template-columns: repeat(4, 1fr);  iPad 仍然 4 列 
    }
	*/
	.main-section {
        flex: 1 1 100%;
    }
    .movie-grid {
        grid-template-columns: repeat(4, 1fr);
    }
	
	

    .sidebar {
        display: none; /* iPad/小屏可以隐藏侧边 */
    }
}


@media (max-width:1024px) {
    
}



/* 平板/小屏（<= 768px） */
@media (max-width: 768px) {

    /* 内容区域：平板下 3 列 
    .content {
        grid-template-columns: repeat(3, 1fr);
    }
	*/
	 .movie-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* 幻灯片：手机竖屏下只显示 1 张 */
    .slide-item {
        flex: 0 0 100%;
    }

    .slide-title {
        font-size: 0.9rem;
    }

    .carousel-track {
        gap: 0;
        padding: 0;
    }
}

/* 手机横屏（<= 768px 且横屏） 显示 2 张幻灯片 */
@media (max-width: 768px) and (orientation: landscape) {
    .slide-item {
        flex: 0 0 calc((100% - 10px) / 2);
    }

    .carousel-track {
        gap: 10px;
        padding: 0 5px;
    }

    .slide-title {
        font-size: 0.9rem;
    }

	
	.mgr:nth-child(n+7) {
        display: none;
    }
	
	.post-content-area .movie-grid .movie-card img {
        aspect-ratio: auto !important;
        height: auto !important;
    }

	
}

/* 手机（<= 600px） */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        margin-top: 10px;
    }

    main {
        padding: 10px 5px;
    }

    .carousel {
        height: 200px;
    }

    .sidebar {
        display: none;
    }
	/*
    .content {
        grid-template-columns: repeat(2, 1fr);  手机 2 列 
    }
	*/
	 .movie-grid {
        grid-template-columns: repeat(2, 1fr);
    }
	
	

    /* 相关文章区域（如果有）强制 2 列 */
    .related-posts .content {
        grid-template-columns: repeat(2, 1fr) !important;
    }
	

	
	.mgr:nth-child(n+7) {
        display: none;
    }
	
	.post-content-area .movie-grid .movie-card img {
        aspect-ratio: auto !important;
        height: auto !important;
    }

	

}



/* ======================
   Sidebar 样式
   ====================== */
/* ======================
   Sidebar 优化（全新专业版）
   ====================== */

.sidebar {
    flex: 1;
    background-color: #1f1f1f;
    padding: 18px;
    border-radius: 12px;
}

/* 标题 */
.sidebar-title {
    color: #ff4c4c;
    margin-bottom: 15px;
    font-size: 1.2rem;
    padding-left: 8px;
    border-left: 4px solid #ff4c4c;
}

/* ======================
   最新发布（左图右文）
   ====================== */

.sidebar-recent-list {
    list-style: none;
    margin: 0 0 25px 0;
    padding: 0;
}

.sidebar-recent-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    transition: 0.25s ease;
}

.sidebar-recent-item:hover {
    background: rgba(255,76,76,0.15);
}

/* 缩略图固定比例 16:10 */
.recent-thumb {
    width: 90px;
    aspect-ratio: 16 / 10;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 6px;
}

.recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    display: block;
}

/* 右侧文字 */
.recent-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.recent-title {
    font-size: 0.95rem;
    line-height: 1.3;
    color: #fff;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;    /* 两行省略 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: 0.2s;
}

.sidebar-recent-item:hover .recent-title {
    color: #ff4c4c;
}

.recent-date {
    font-size: 0.8rem;
    color: #b4b4b4;
}

/* ======================
   分类（两列小卡片）
   ====================== */

.sidebar-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, 1fr);
}

.sidebar-category-item {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    transition: 0.25s;
}

.sidebar-category-item:hover {
    background: rgba(255,76,76,0.18);
    box-shadow: 0 0 8px rgba(255,76,76,0.35);
}

.sidebar-category-link {
    display: block;
    padding: 10px 0;
    text-align: center;
    color: #fff;
    font-size: 0.95rem;
    transition: color 0.25s;
}

.sidebar-category-item:hover .sidebar-category-link {
    color: #ff4c4c;
}

/* 移动端隐藏 sidebar */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
}


/* =======================
   post.php 专用样式
   ======================= */

/* post 主体布局统一 */
.post-content-area {
    grid-template-columns: 1fr !important;
	 flex: 3; /* 左边主体 */
}

/* 返回按钮 */
.btn-back {
    display: inline-block;
    padding: 6px 12px;
    background: #222;
    border: 1px solid #444;
    border-radius: 6px;
    color: #bbb;
    cursor: pointer;
    transition: .2s;
    margin-bottom: 10px;
}
.btn-back:hover {
    background: #333;
}

/* 视频容器 */
.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 800 / 538;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

/* 封面图 */
.video-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .6s ease;
}

/* 视频播放器 */
.video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
}

/* 提示条 */
.video-tips {
    display: inline-block;
    padding: 6px 12px;
    background: #222;
    border: 1px solid #444;
    border-radius: 6px;
    color: #bbb;
    margin-top: 10px;
    transition: .2s;
}
.video-tips:hover {
    background: #333;
}

.tips-alt {
    color: #ccc;
    text-decoration: underline;
    margin-left: 5px;
}

/* 标题 */
.post-title {
    font-size: 1.3rem;
    margin: 12px 0;
}

/* 元信息 */
.post-meta {
    color: #bbb;
    font-size: .9rem;
    line-height: 1.6;
}

/* 番号 */
.post-code {
    color: #bbb;
}

/* 演员 */
.post-actor {
    color: #ff0000;
    text-decoration: none;
}

/* 分类 */
.post-cat {
    color: #fff;
    margin-right: 8px;
}

/* 猜你喜欢 */




/* 载入转圈样式 */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.spinner {
    width: 45px;
    height: 45px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
