/*!
Theme Name: RiPro Lite
Theme URI: 
Author: Custom
Author URI: 
Description: 轻量级 WordPress 主题，专为无头 CMS 设计。仅包含首页资源展示和文章详情页功能。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ripro-lite
Tags: minimal, headless-cms, clean
*/

/* 基础重置和样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f4f5f8;
    background: linear-gradient(#3d7eff 0%, #F5F5F4 35%);
}

.ripro-dark {
    background: #232425;
}

.ripro-dark body {
    background: #232425;
}

/* 容器 - 统一对齐（导航栏、轮播图、资源展示都使用此样式） */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
}

/* 头部样式 - 镜面透明效果（与原版一致） */
.site-header {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    background-color: rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    transition: background-color 0.5s cubic-bezier(0.77, 0, 0.175, 1), 
                box-shadow 0.5s cubic-bezier(0.77, 0, 0.175, 1),
                -webkit-transform 0.6s cubic-bezier(0.77, 0, 0.175, 1),
                transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    z-index: 99;
}

.site-header.scrolled {
    background-color: rgba(255, 255, 255, 0.4);
    border-bottom-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.header-gap {
    height: 80px;
}

.site-header.scrolled + .header-gap {
    height: 80px;
}

/* 首次访问弹窗 */
.ripro-lite-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 120;
    padding: 20px;
}

.ripro-lite-modal-overlay.is-visible {
    display: flex;
}

.ripro-lite-modal-dialog {
    position: relative;
    max-width: 520px;
    width: 100%;
    border-radius: 18px;
    padding: 32px 28px 30px;
    background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    color: #1e1e1e;
}

.ripro-dark .ripro-lite-modal-dialog {
    background: linear-gradient(145deg, rgba(20,20,20,0.95), rgba(30,30,30,0.9));
    color: #f5f5f5;
}

.ripro-lite-modal-dialog h3 {
    margin-top: 0;
    font-size: 22px;
    text-align: center;
    margin-bottom: 16px;
}

.ripro-lite-modal-body {
    font-size: 15px;
    line-height: 1.8;
}

.ripro-lite-modal-body p {
    margin: 0 0 12px;
}

.ripro-lite-modal-body a {
    color: #0073aa;
    text-decoration: underline;
}

.ripro-lite-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: rgba(0, 0, 0, 0.08);
    color: #333;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.ripro-lite-modal-close:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.12);
}

.ripro-dark .ripro-lite-modal-close {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.ripro-dark .ripro-lite-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* .navbar 样式已移至 navbar.css */

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-link,
.logo-wrapper a {
    text-decoration: none;
    font-size: 26px;
    font-weight: 700;
    color: #333;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.logo-link:hover,
.logo-wrapper a:hover {
    color: #0073aa;
}

.logo-wrapper img,
.site-logo {
    max-height: 50px;
    width: auto;
    display: block;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.logo-link::after {
    content: "";
    position: absolute;
    top: -80%;
    left: -80%;
    width: 160%;
    height: 160%;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0) 47%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0) 53%);
    transform: translate(-120%, -120%) rotate(20deg);
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: screen;
}

.logo-link::after {
    animation: logo-gleam 3s linear infinite;
}

@keyframes logo-gleam {
    0% {
        transform: translate(-100%, -100%) rotate(20deg);
        opacity: 0;
    }
    10% {
        opacity: 0.85;
    }
    50% {
        transform: translate(50%, 50%) rotate(20deg);
        opacity: 0.3;
    }
    100% {
        transform: translate(140%, 140%) rotate(20deg);
        opacity: 0;
    }
}

.logo-text {
    font-size: 26px;
    font-weight: 700;
    color: #333;
}

body.dark-mode .logo-text {
    color: #fff;
}

.nav-menu {
    flex: 1;
    display: flex !important;
    justify-content: center;
    min-width: 0;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 40px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
    position: relative;
    padding: 5px 0;
}

.nav-menu a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #0073aa;
    transition: width 0.3s;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a {
    color: #0073aa;
}

.nav-menu a:hover:after,
.nav-menu .current-menu-item > a:after {
    width: 100%;
}

/* 导航栏右侧操作按钮 */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
    color: #333;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

body.dark-mode .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.theme-icon {
    position: absolute;
    transition: opacity 0.3s, transform 0.3s;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.moon-icon {
    opacity: 0;
    transform: rotate(90deg);
}

body.dark-mode .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

body.dark-mode .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* 暗色模式样式 */
/* 暗色模式样式 - 使用 ripro-dark 类名（与原版保持一致） */
body.ripro-dark {
    background-color: #232425;
    color: #eee;
}

body.ripro-dark .section-title {
    color: #fff;
    border-bottom-color: #FFC107;
}

body.ripro-dark .post-item {
    background: #171819;
    border: 1px solid #171819;
}

body.ripro-dark .post-item:hover {
    box-shadow: 0 34px 20px -24px rgb(0, 0, 0);
}

body.ripro-dark .post-title a {
    color: #eee;
}

body.ripro-dark .post-title a:hover {
    color: #FFC107;
}

body.ripro-dark .post-excerpt {
    color: #b0b0b0;
}

body.ripro-dark .post-meta {
    color: #888;
}

body.ripro-dark .article-header {
    background: #1d1e1f;
}

body.ripro-dark .article-title {
    color: #fff;
}

body.ripro-dark .article-meta {
    color: #b0b0b0;
}

body.ripro-dark .article-content {
    background: #171819;
    color: #eee;
}

body.ripro-dark .no-posts {
    background: #171819;
    color: #eee;
}

body.ripro-dark .site-footer {
    background-color: #191616;
    border-top: 1px solid #232425;
}

/* 轮播图样式 */
/* 轮播图区域 - 现在包裹在容器内，宽度由容器控制 */
.hero-slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    margin-bottom: 50px;
    border-radius: 8px;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.slide-item.active {
    opacity: 1;
    z-index: 2;
}

.slide-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    color: #fff;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 60px 20px;
    z-index: 2;
    box-sizing: border-box;
}

.slide-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.slide-excerpt {
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 20px;
    max-width: 100%;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.slide-btn {
    display: inline-block;
    padding: 12px 30px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s;
}

.slide-link:hover .slide-btn {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

/* 原版没有左右箭头按钮，已移除 */

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid rgba(255,255,255,0.6);
}

.slider-dot.active {
    background: rgba(255,255,255,0.9);
    transform: scale(1.2);
}

/* 主要内容区域 */
.site-main {
    padding: 40px 0;
}

.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 文章列表网格 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.post-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

body.dark-mode .post-item {
    background: #2a2a2a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.dark-mode .post-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.post-thumbnail--placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
}

@media (min-width: 992px) {
    .post-thumbnail {
        height: 230px;
    }
}

@media (min-width: 1280px) {
    .post-thumbnail {
        height: 260px;
    }
}

.post-item a .post-thumbnail {
    transition: opacity 0.3s;
}

.post-item:hover a .post-thumbnail {
    opacity: 0.9;
}

.post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 120px;
}

.post-resource-type {
    margin-top: auto;
    padding-top: 12px;
}

.resource-type-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #448aff;
    background: linear-gradient(135deg, rgba(68, 138, 255, 0.1) 0%, rgba(24, 206, 242, 0.1) 100%);
    border: 1px solid rgba(68, 138, 255, 0.2);
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.post-item:hover .resource-type-badge {
    background: linear-gradient(135deg, rgba(68, 138, 255, 0.15) 0%, rgba(24, 206, 242, 0.15) 100%);
    border-color: rgba(68, 138, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(68, 138, 255, 0.2);
}

body.ripro-dark .resource-type-badge {
    color: #5ba3ff;
    background: linear-gradient(135deg, rgba(91, 163, 255, 0.15) 0%, rgba(24, 206, 242, 0.15) 100%);
    border-color: rgba(91, 163, 255, 0.3);
}

body.ripro-dark .post-item:hover .resource-type-badge {
    background: linear-gradient(135deg, rgba(91, 163, 255, 0.2) 0%, rgba(24, 206, 242, 0.2) 100%);
    border-color: rgba(91, 163, 255, 0.4);
    box-shadow: 0 2px 6px rgba(91, 163, 255, 0.3);
}

.load-more-wrap {
    margin-top: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.load-more-btn {
    min-width: 180px;
    height: 46px;
    border-radius: 999px;
    border: 0;
    background: linear-gradient(125deg, #18cef2 0%, #448aff 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.load-more-btn:hover {
    transform: translateY(-1px);
}

.load-more-btn.loading,
.load-more-btn.is-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.load-more-status {
    font-size: 14px;
    color: #666;
}

.post-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.post-title a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.post-title a:hover {
    color: #0073aa;
}

.post-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 12px;
    color: #999;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 文章详情页 */
.article-header {
    background: #fff;
    padding: 40px 0;
    margin-bottom: 30px;
}

body.dark-mode .article-header {
    background: #2a2a2a;
}

.article-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #333;
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
}

.article-content {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body.dark-mode .article-content {
    background: #2a2a2a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 20px 0;
}

.article-content h2,
.article-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #333;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}

.pagination a:hover {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.pagination .current {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* 页脚 */
.site-footer {
    background-color: #ffffff;
    color: #333;
    padding: 40px 0;
    margin-top: 60px;
    text-align: center;
}

.site-footer p {
    margin: 10px 0;
}

.ripro-dark .site-footer,
body.dark-mode .site-footer {
    background-color: #1a1a1a;
    border-top: 1px solid #333;
    color: #fff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-slider {
        height: 400px;
    }
    
    .slide-title {
        font-size: 28px;
    }
    
    .slide-excerpt {
        font-size: 16px;
    }
    
    /* 原版没有左右箭头按钮，已移除 */
    
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .navbar {
        justify-content: flex-start;
    }
    
    .article-content {
        padding: 20px;
    }
    
    .article-title {
        font-size: 24px;
    }
}

/* 空状态 */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
}

.no-posts h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #666;
}

.no-posts p {
    color: #999;
}

