/* 全局样式重置 */
html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: "Roboto", "SF Pro SC", "SF Pro Display", "SF Pro Icons", "PingFang SC", BlinkMacSystemFont, -apple-system, "Segoe UI", "Microsoft Yahei", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    background-color: #fafbfc;
}

a {
    -webkit-transition: all 0.35s;
    -moz-transition: all 0.35s;
    transition: all 0.35s;
    color: #3498db;
    text-decoration: none;
}

a:hover,
a:focus {
    color: #2980b9;
    text-decoration: none;
}

hr {
    max-width: 100px;
    margin: 25px auto 0;
    border-width: 1px;
    border-color: rgba(85, 85, 85, 0.1);
}

hr.light {
    border-color: white;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    letter-spacing: 1px;
    color: #555;
    margin-bottom: 15px;
}

p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: #888;
}

/* 容器样式 */
.container {
    width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.header {
    background-color: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

/* Logo样式 */
.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.logo a:hover {
    color: #007bff;
}

/* 主导航样式 */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0 15px;
}

.nav-link {
    color: #888;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s;
    padding: 5px 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #3498db;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #3498db;
}

/* 右侧功能区样式 */
.header-right {
    display: flex;
    align-items: center;
}

.language-switcher {
    margin-right: 20px;
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: 1px solid #e9ecef;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.dropdown-toggle:hover {
    background-color: #f8f9fa;
}

.dropdown-toggle i {
    margin-right: 5px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 160px;
    padding: 5px 0;
    margin: 2px 0 0;
    font-size: 14px;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.175);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 8px 20px;
    clear: both;
    font-weight: 400;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s;
}

.dropdown-menu li a:hover {
    background-color: #f8f9fa;
}

.search-btn {
    margin-right: 20px;
}

.btn-search {
    background: none;
    border: 1px solid #e9ecef;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
}

.btn-search:hover {
    background-color: #f8f9fa;
    color: #007bff;
}

/* 登录注册样式 */
.auth-links {
    display: flex;
    align-items: center;
}

.login-link,
.register-link {
    color: #666;
    text-decoration: none;
    padding: 8px 15px;
    margin-left: 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.login-link:hover {
    color: #007bff;
}

.register-link {
    background-color: #3498db;
    color: #fff;
    border: 1px solid #3498db;
}

.register-link:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 10px;
}

/* 移动端菜单 */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: #fff;
    z-index: 1100;
    box-shadow: -2px 0 8px rgba(0,0,0,0.08);
    transition: right 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-menu.show {
    right: 0;
}

/* 移动端菜单头部 */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f5f7fa;
}

.mobile-menu-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #555;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #555;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
}

.mobile-menu-close:hover {
    color: #3498db;
}

.mobile-nav-list {
    list-style: none;
    padding: 20px;
    flex: 1;
}

.mobile-nav-item {
    margin-bottom: 10px;
}

.mobile-nav-link {
    display: block;
    padding: 12px;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.mobile-nav-link:hover {
    background-color: #f5f7fa;
}

.mobile-nav-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 15px 0;
}

.mobile-lang {
    padding: 12px;
}

.mobile-lang a {
    margin: 0 10px;
    color: #888;
    text-decoration: none;
}

.mobile-lang a.active {
    color: #3498db;
    font-weight: bold;
}

/* 主内容区域样式 */
.main-container {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

.row {
    display: flex;
    margin: 0 -15px;
}

.col-md-8 {
    width: 66.66666667%;
    padding: 0 15px;
}

.col-md-4 {
    width: 33.33333333%;
    padding: 0 15px;
}

.main-content {
    padding-right: 30px;
}

/* 区块标题 */
.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #555;
    position: relative;
    padding-left: 10px;
    border-left: 3px solid #3498db;
}

.section-title i {
    margin-right: 10px;
    color: #3498db;
}

/* 轮播样式 */
.featured-carousel {
    position: relative;
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    height: 400px;
    box-sizing: border-box;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .featured-carousel {
        padding-left: 10px;
        padding-right: 10px;
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .carousel-caption {
        padding: 20px 20px;
    }
    
    /* 确保左右按钮不会超出页面 */
    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
        background-size: 20px;
    }
    
    .carousel-control-prev {
        left: 10px;
    }
    
    .carousel-control-next {
        right: 10px;
    }
}

.carousel-inner {
    position: relative;
    height: 100%;
}

.carousel-item {
    display: none;
    position: relative;
    height: 100%;
}

.carousel-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    z-index: 2;
}

.carousel-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
    color: white;
    transition: color 0.3s;
    text-align: left;
}

.carousel-title:hover {
    color: #3498db;
}

.carousel-excerpt {
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.carousel-meta {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.carousel-meta span {
    margin-right: 15px;
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 3;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s;
    display: block;
}

.carousel-indicator.active {
    background-color: white;
    border-color: white;
}

/* 轮播控制按钮 */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-control:hover {
    background-color: #3498db;
}

.carousel-control-prev {
    left: 20px;
    right: auto;
}

.carousel-control-next {
    right: 20px;
    left: auto;
}

/* 移动端标题截断样式 */
.truncate-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 推荐文章样式 */
.featured-posts {
    margin-bottom: 40px;
}

.featured-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
}

.featured-img {
    flex: 0 0 40%;
    overflow: hidden;
}

.featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.featured-content {
    flex: 0 0 60%;
    padding: 25px;
}

.category-label {
    display: inline-block;
    background-color: #3498db;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 10px;
}

.category-label a {
    color: #fff;
    text-decoration: none;
}

.featured-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.3;
}

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

.featured-title a:hover {
    color: #3498db;
}

.featured-desc {
    color: #888;
    margin-bottom: 20px;
    line-height: 1.6;
}

.featured-meta,
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #aaa;
}

.featured-meta span,
.post-meta span {
    display: flex;
    align-items: center;
}

.featured-meta i,
.post-meta i {
    margin-right: 5px;
}

/* 菜单遮罩 */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 最新文章样式 */
.latest-posts {
    margin-bottom: 40px;
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.post-thumbnail {
    flex: 0 0 25%;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.post-content {
    flex: 0 0 75%;
    padding: 20px;
}

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

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

.post-title a:hover {
    color: #3498db;
}

.post-excerpt {
    color: #888;
    margin-bottom: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 加载更多按钮 */
.load-more {
    text-align: center;
    margin-top: 30px;
}

.btn-loadmore {
    display: inline-block;
    background-color: #fff;
    color: #3498db;
    border: 1px solid #3498db;
    padding: 12px 30px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-loadmore:hover {
    background-color: #3498db;
    color: #fff;
}

/* 侧边栏样式 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.widget {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #555;
    position: relative;
    padding-left: 10px;
    border-left: 3px solid #3498db;
}

.widget-title i {
    margin-right: 10px;
    color: #3498db;
}

/* 搜索框样式 */
.search-form {
    position: relative;
}

.search-form input {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-form input:focus {
    outline: none;
    border-color: #3498db;
}

.search-form button {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 40px;
    background-color: #3498db;
    border: none;
    color: #fff;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-form button:hover {
    background-color: #2980b9;
}

/* 分类列表样式 */
.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: 10px;
}

.category-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    color: #888;
    text-decoration: none;
    background-color: #f5f7fa;
    border-radius: 4px;
    transition: all 0.3s;
}

.category-item a:hover {
    background-color: #e3e8ee;
    color: #3498db;
}

.category-count {
    background-color: #3498db;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* 标签云样式 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    display: inline-block;
    padding: 6px 15px;
    background-color: #f5f7fa;
    color: #888;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s;
}

.tag:hover {
    background-color: #3498db;
    color: #fff;
}

/* 关于博客样式 */
.about-content {
    color: #888;
    line-height: 1.6;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #f5f7fa;
    color: #888;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s;
}

.social-link:hover {
    background-color: #3498db;
    color: #fff;
    transform: translateY(-3px);
}

/* 页脚样式 */
.footer {
    background-color: #555;
    color: #fff;
    padding: 40px 0;
    margin-top: 50px;
}

.footer-inner {
    text-align: center;
}

.footer-nav {
    margin-bottom: 20px;
}

.footer-nav-list {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-nav-list li a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-nav-list li a:hover {
    color: #fff;
}

.copyright {
    font-size: 14px;
    color: #bbb;
    line-height: 1.8;
}

.copyright a {
    color: #e0e0e0;
    text-decoration: none;
}

.copyright a:hover {
    color: #fff;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background-color: #3498db;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #2980b9;
    transform: translateY(-3px);
}

/* 响应式设计 */
/* 大屏幕设备 */
@media (max-width: 1200px) {
    .container {
        width: 100%;
    }
    
    .nav-item {
        margin: 0 10px;
    }
    
    .featured-content {
        padding: 20px;
    }
}

/* 平板设备 */
@media (max-width: 992px) {
    /* 布局调整 */
    .row {
        flex-direction: column;
    }
    
    .col-md-8,
    .col-md-4 {
        width: 100%;
        padding: 0;
    }
    
    .main-content {
        padding-right: 0;
    }
    
    .sidebar {
        margin-top: 30px;
    }
    
    /* 文章布局 */
    .featured-item,
    .post-item {
        flex-direction: column;
    }
    
    .featured-img,
    .featured-content,
    .post-thumbnail,
    .post-content {
        flex: 0 0 100%;
    }
    
    .post-thumbnail {
        height: 200px;
    }
    
    /* 导航栏调整 */
    .logo a {
        font-size: 22px;
    }
    
    .nav-item {
        margin: 0 8px;
    }
    
    .nav-link {
        font-size: 15px;
    }
}

/* 移动设备 */
@media (max-width: 768px) {
    /* 导航栏 */
    .main-nav,
    .header-right .language-switcher,
    .header-right .search-btn,
    .header-right .auth-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .header-inner {
        padding: 15px 0;
    }
    
    .logo a {
        font-size: 20px;
    }
    
    /* 内容区域 */
    .main-container {
        padding: 20px 0;
    }
    
    .featured-content {
        padding: 20px;
    }
    
    /* 轮播容器适配 */
    .featured-carousel {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0;
        padding-right: 0;
        overflow: hidden;
        position: relative;
    }
    
    .carousel-inner {
        width: 100%;
        overflow: hidden;
    }
    
    .carousel-item {
        width: 100%;
        overflow: hidden;
    }
    
    .carousel-item img {
        width: 100%;
        height: auto;
        max-width: 100%;
        object-fit: cover;
    }
    
    /* 轮播控制按钮适配 */
    .carousel-control {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .carousel-control-prev {
        left: 10px;
    }
    
    .carousel-control-next {
        right: 10px;
    }
    
    /* 轮播内容区域适配 */
    .carousel-caption {
        padding: 15px 15px;
        left: 5%;
        right: 5%;
        width: 90%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .carousel-title {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .carousel-excerpt {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .featured-title {
        font-size: 20px;
    }
    
    .post-title {
        font-size: 17px;
    }
    
    /* 小部件调整 */
    .widget {
        padding: 15px;
    }
    
    .widget-title {
        font-size: 16px;
    }
    
    /* 页脚调整 */
    .footer {
        padding: 30px 0;
    }
    
    .footer-nav-list {
        gap: 15px;
    }
    
    /* 返回顶部按钮 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
    }
}

/* 小屏移动设备 */
@media (max-width: 480px) {
    /* 内容区域 */
    .featured-content,
    .post-content {
        padding: 15px;
    }
    
    /* 轮播容器小屏适配 */
    .featured-carousel {
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
        position: relative;
    }
    
    .carousel-item img {
        width: 100%;
        height: auto;
        max-width: 100%;
        object-fit: cover;
    }
    
    /* 轮播控制按钮小屏适配 */
    .carousel-control {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .carousel-control-prev {
        left: 5px;
    }
    
    .carousel-control-next {
        right: 5px;
    }
    
    /* 轮播内容区域小屏适配 */
    .carousel-caption {
        padding: 12px 12px;
        left: 3%;
        right: 3%;
        width: 94%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .carousel-title {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .carousel-excerpt {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .carousel-meta {
        font-size: 12px;
    }
    
    .featured-title {
        font-size: 18px;
    }
    
    .post-title {
        font-size: 16px;
    }
    
    .post-excerpt {
        -webkit-line-clamp: 2;
    }
    
    /* 页脚调整 */
    .footer-nav-list {
        gap: 10px;
        flex-direction: column;
    }
    
    .footer-nav-list li a {
        font-size: 14px;
    }
    
    .copyright {
        font-size: 12px;
    }
    
    /* 按钮调整 */
    .btn-loadmore {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    /* 标签云和社交链接 */
    .tag {
        font-size: 13px;
        padding: 5px 12px;
    }
    
    .social-link {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    /* 返回顶部按钮 */
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
    }
}

