/**
 * 海滴智链用户手册主题样式
 * 整理日期: 2025-04-23
 */

/* ---------- 1. 基础变量与全局设置 ---------- */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --background-color: #f8f9fa;
    --border-color: #dee2e6;
    --text-color: #333;
    --light-text: #6c757d;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --hover-transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* ---------- 2. 布局组件 ---------- */

/* 2.1 页眉/导航 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Logo相关样式 */
.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
}

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

.logo {
    display: flex;
    align-items: center;
}

.logo span {
    margin: 0 10px;
    color: #8f9295;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--hover-transition);
}

.logo a:hover {
    color: #0056b3;
    text-decoration: none;
}

/* 导航样式 */
.main-nav a {
    color: var(--text-color);
    font-weight: 500;
    text-decoration: none;
    transition: var(--hover-transition);
    position: relative;
    padding: 0.5rem 0;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.main-nav a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--hover-transition);
}

.main-nav a:hover::after {
    width: 100%;
}

.main-nav a.active::after {
    width: 100%;
    background-color: var(--primary-color);
}

/* 导航结构 */
.top-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.right-controls {
    display: flex;
    align-items: center;
}

.search-row {
    width: 100%;
    margin: 10px 0;
}

/* 搜索框 */
.header-search {
    position: relative;
    margin: 0;
    width: 100%;
}

.search-form {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

.search-input {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 40px 8px 15px;
    width: 100%;
    font-size: 14px;
    transition: var(--hover-transition);
    background-color: #f5f8fa;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
    background-color: #fff;
}

.search-btn {
    position: absolute;
    right: 0px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    transition: var(--hover-transition);
    padding: 0;
}

.search-btn:hover {
    background-color: #0062cc;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
    transform: translateY(-50%) scale(1.05);
}

/* 2.2 公告栏 */
.announcement-bar {
    background-color: #e8f4ff;
    border-bottom: 1px solid #c2e0ff;
    padding: 12px 0;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.announcement-wrapper {
    display: flex;
    align-items: center;
    height: 40px;
}

.announcement-icon {
    margin-right: 15px;
    flex-shrink: 0;
    font-size: 22px;
    color: #0056b3;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 123, 255, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.announcement-scroll {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.no-notices {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    color: #6c757d;
    font-size: 1rem;
    padding: 0.5rem 0;
    position: relative;
}

.no-notices span {
    position: relative;
    padding-left: 28px;
}

.no-notices span::before {
    content: '🔔';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
}

/* 公告动画 */
.announcement-flip {
    position: relative;
    height: 100%;
    width: 100%;
}

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

.flip-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transform: translateY(20px) rotateX(-90deg);
    transition: transform 0.8s ease, opacity 0.5s ease, visibility 0s 0.5s;
}

.flip-item.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) rotateX(0);
    transition: transform 0.8s ease, opacity 0.5s ease;
}

.flip-item a {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 10px;
    transition: var(--hover-transition);
    pointer-events: auto;
    cursor: pointer;
    position: relative;
}

.flip-item a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.notice-date {
    font-weight: 500;
    margin-right: 12px;
    white-space: nowrap;
    color: #0056b3;
    background-color: rgba(0, 123, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

.notice-title {
    font-weight: bold;
    margin-right: 15px;
    white-space: nowrap;
    color: #e41c23;
    background-color: rgba(228, 28, 35, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.notice-content {
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

/* 2.3 页脚 */


.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #333;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #555;
    text-decoration: none;
    transition: var(--hover-transition);
    display: inline-block;
    position: relative;
    padding-left: 1rem;
}

.footer-links a::before {
    content: '›';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.2rem;
    line-height: 1;
    transition: var(--hover-transition);
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.footer-links a:hover::before {
    color: var(--primary-color);
}

.footer-description {
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #eee;
    border-radius: 50%;
    color: #555;
    text-decoration: none;
    transition: var(--hover-transition);
}

.social-icon:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

.footer-contact {
    margin-bottom: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.contact-icon {
    min-width: 20px;
    margin-right: 0.75rem;
    color: var(--primary-color);
}

.contact-text {
    line-height: 1.4;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5e5;
}

.copyright {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.footer-bottom-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.footer-bottom-links a {
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--hover-transition);
}

.footer-bottom-links a:hover {
    color: var(--primary-color);
}

.separator {
    color: #ddd;
}

.footer-logo {
    margin-bottom: 1.25rem;
}

.footer-logo img {
    max-height: 40px;
    width: auto;
}

/* 页脚响应式 - 平板设备 */
@media (max-width: 991px) and (min-width: 768px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .footer-col:last-child {
        grid-column: span 2;
    }
    
    .footer-bottom-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .main-footer {
        padding: 2rem 0 1.5rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-col {
        text-align: center;
        padding: 0 15px;
    }
    
    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-links a {
        padding-left: 0;
    }
    
    .footer-links a::before {
        display: none;
    }
    
    .contact-item {
        justify-content: center;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .contact-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .footer-logo {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-bottom-links a {
        padding: 0.5rem 0;
    }
    
    .separator {
        display: none;
    }
    
    .copyright {
        padding: 0 15px;
    }
}

/* 添加超小屏幕适配 */
@media (max-width: 320px) {
    .footer-container {
        gap: 1rem;
    }
    
    .footer-title {
        font-size: 1.1rem;
    }
    
    .footer-social {
        gap: 0.5rem;
    }
}

/* ---------- 3. 组件 ---------- */

/* 3.1 按钮 */
.btn {
    display: inline-block;
    font-weight: 500;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: var(--hover-transition);
}

.btn:hover {
    background-color: #0062cc;
    border-color: #0062cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.15);
    text-decoration: none;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
    margin: 0 5px;
}

.btn-active {
    background-color: #0056b3;
    border-color: #004085;
    box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
    transform: translateY(-1px);
}

.btn-outline {
    color: #007bff;
    background-color: transparent;
    border-color: #007bff;
}

.btn-outline:hover {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-outline.btn-active {
    background-color: rgba(0, 123, 255, 0.1);
    color: #0056b3;
    border-color: #0056b3;
    font-weight: 600;
}

/* 3.2 表单元素 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

textarea.form-control {
    height: auto;
}

/* 3.3 警告框 */
.alert {
    position: relative;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

/* 3.4 移动菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    cursor: pointer;
    padding: 0;
    background: transparent;
    border: none;
    z-index: 1100;
}

.mobile-menu-toggle span {
    height: 3px;
    width: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(3px);
}

/* 移动导航底部登录按钮 */
.mobile-nav-footer {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid rgba(74, 144, 226, 0.2);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    bottom: 30px;
    left: 0;
}

.mobile-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4a90e2;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 10px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    width: 60%;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
}

.mobile-login-btn:hover {
    background-color: #3a80d2;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(74, 144, 226, 0.4);
}

.mobile-login-btn.logout-btn {
    background-color: #007bff;
    color: #ffffff;
    text-align: center;
    padding: 12px 20px;
}

.btn-text {
    font-size: 16px;
    text-align: center;
    color: #ffffff;
    font-weight: 500;
}

/* 3.5 内容列表 */
.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.post-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 1.75rem;
    transition: var(--hover-transition);
}

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

.post-title {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: var(--hover-transition);
}

.post-title a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.post-meta {
    margin-bottom: 1rem;
    color: var(--light-text);
    font-size: 0.875rem;
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.post-author, .post-date, .post-type {
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
}

.post-author::before {
    content: '👤';
    margin-right: 5px;
}

.post-date::before {
    content: '📅';
    margin-right: 5px;
}

.post-type::before {
    content: '📄';
    margin-right: 5px;
}

.post-excerpt {
    margin-bottom: 1.25rem;
    line-height: 1.6;
    color: #555;
}

.read-more {
    display: inline-block;
    font-weight: 500;
    color: var(--primary-color);
    transition: var(--hover-transition);
    position: relative;
    padding-right: 20px;
}

.read-more::after {
    content: '→';
    position: absolute;
    right: 0;
    transition: var(--hover-transition);
}

.read-more:hover {
    color: #0062cc;
    text-decoration: none;
    padding-right: 25px;
}

.read-more:hover::after {
    right: -5px;
}

/* 3.6 内容页 */
.post-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
}

.post-header {
    /* margin-bottom: 2rem; */
    padding-bottom: 1rem;
}

.post-content {
    margin-bottom: 2rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

.post-content p {
    margin-bottom: 1.25rem;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* 3.7 分页 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.page-link {
    display: inline-block;
    padding: 0.6rem 1rem;
    margin: 0 0.3rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--hover-transition);
    font-weight: 500;
}

.page-link:hover {
    background-color: #e8f4ff;
    border-color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-2px);
}

.page-link.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 3.8 页面标题区 */
.page-header {
    margin-bottom: 2.5rem;
    text-align: center;
    background-color: #e8f4ff;
    padding: 3rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.page-title {
    margin-bottom: 0.75rem;
    color: #0056b3;
    font-size: 2.25rem;
}

.page-subtitle {
    color: #555;
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.75rem;
}

.section-title {
    margin: 0;
    color: #0056b3;
    font-size: 1.75rem;
}

.section-link {
    color: var(--primary-color);
    font-weight: 500;
    transition: var(--hover-transition);
}

.section-link:hover {
    color: #0062cc;
    text-decoration: none;
    transform: translateX(5px);
}

/* 3.9 首页特殊样式 */
.home-banner {
    position: relative;
    background: linear-gradient(135deg, #1a73e8 0%, #0056b3 100%);
    color: #fff;
    padding: 3rem 0;
    margin-bottom: 3rem;
    border-radius: 10px;
    overflow: hidden;
}

.home-banner::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: url('../images/pattern.png');
    background-size: cover;
    opacity: 0.1;
    z-index: 1;
}

.home-banner-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.home-banner-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.home-banner-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.home-search {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.home-search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: none;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.home-search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--hover-transition);
}

.home-search-btn:hover {
    background-color: #0056b3;
}

.home-featured {
    margin-bottom: 4rem;
}

.home-section-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #333;
    position: relative;
    padding-bottom: 1rem;
}

.home-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* 3.10 分类列表 */
.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
    padding: 1.5rem;
    transition: var(--hover-transition);
    position: relative;
    overflow: hidden;
}

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

.category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-color);
}

.category-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.35rem;
}

.category-title a {
    color: #333;
    text-decoration: none;
    transition: var(--hover-transition);
}

.category-title a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.category-desc {
    color: #666;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.category-count {
    color: #888;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.category-count::before {
    content: '📑';
    margin-right: 5px;
}

/* 3.11 侧边栏分类 */
.sidebar-block {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.sidebar-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #0056b3;
    border-bottom: 2px solid #e8f4ff;
    padding-bottom: 0.5rem;
}

.sidebar-menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-item {
    margin-bottom: 0.75rem;
}

.sidebar-menu-link {
    display: block;
    padding: 0.5rem 0;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--hover-transition);
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
}

.sidebar-menu-link:hover {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.05);
    transform: translateX(3px);
    text-decoration: none;
}

.sidebar-menu-link.active {
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
    background-color: rgba(0, 123, 255, 0.1);
}

.sidebar-menu-count {
    float: right;
    background-color: #f1f1f1;
    color: #666;
    font-size: 0.8rem;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    margin-left: 5px;
}

/* 内容页布局 */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.main-content {
    grid-column: 1;
}

.content-sidebar {
    grid-column: 2;
}

@media (max-width: 991px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .main-content, .content-sidebar {
        grid-column: 1;
    }
    
    .content-sidebar {
        margin-top: 2rem;
    }
}

/* ---------- 4. 媒体查询 ---------- */

/* 桌面端布局 (≥ 768px) */
@media (min-width: 768px) {
    /* 网格布局 */
    
    .logo {
        grid-area: logo;
        margin-right: 0;
        padding-right: 10px;
        justify-self: start;
    }
    
    .main-nav {
        grid-area: nav;
        height: auto;
        padding: 0;
        position: static;
        visibility: visible;
        opacity: 1;
        transform: none;
        box-shadow: none;
        overflow: visible;
        background-color: transparent;
    }
    
    .nav-list {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        gap: 20px;
        padding-left: 0;
    }
    
    .search-row {
        grid-area: search;
        width: auto;
        margin: 0;
    }
    
    .top-nav-row {
        grid-area: user;
        margin: 0;
        justify-self: end;
        width: auto;
    }
    
    /* 隐藏移动端元素 */
    .mobile-menu-toggle, .menu-overlay {
        display: none;
    }
    
    .mobile-nav-footer, .mobile-nav-header {
        display: none;
    }
    
    /* 导航项样式 */
    .nav-item {
        opacity: 1;
        transform: none;
        width: auto;
        margin: 0;
    }
    
    .main-nav a {
        padding: 0.5rem 0.75rem;
        white-space: nowrap;
    }
    
    .main-nav a::after {
        bottom: -3px;
        height: 3px;
    }
    
    /* 用户导航样式 */
    .user-nav {
        display: flex;
        align-items: center;
    }
    
    .user-nav .username {
        margin-right: 10px;
    }
    
    .user-nav .btn {
        margin: 0 5px;
    }
}

/* 平板布局 (768px - 850px) */
@media (min-width: 768px) and (max-width: 850px) {
    .header-wrapper {
        grid-template-columns: auto 1fr auto;
        grid-template-areas: 
            "logo nav user"
            "empty search search";
        gap: 10px;
    }
    
    .search-row {
        grid-area: search;
        width: 100%;
        margin: 10px 0;
        justify-self: end;
    }
    
    .header-search {
        width: 250px;
        margin-left: auto;
    }
}

/* 移动端布局 (< 768px) */
@media (max-width: 767px) {
    .header {
        padding: 5px 0;
    }
    
    .header-wrapper {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        padding: 10px 15px !important;
        position: relative;
    }
    
    .container {
        padding-right: 0;
        padding-left: 0;
        position: relative;
    }
    
    /* 布局顺序 */
    .logo {
        order: 1;
        flex: 1;
        margin-right: auto;
        z-index: 2;
        max-width: 70%;
    }
    
    .top-nav-row {
        order: 2;
        width: auto;
        margin: 0 50px 0 0;
        padding: 0;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .search-row {
        order: 3;
        width: 100%;
        margin: 10px 0;
    }
    
    .main-nav {
        order: 4;
        width: 100%;
    }
    
    /* 移动菜单样式 */
    .mobile-menu-toggle {
        display: flex;
        position: absolute !important;
        top: 15px !important;
        right: 15px !important;
        z-index: 1100 !important;
    }

    /* 移动导航 */
    .main-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background-color: #fff;
        z-index: 999;
        padding: 80px 20px 20px;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
        opacity: 0;
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, visibility 0.2s ease;
        overflow-y: auto;
    }
    
    .main-nav.active {
        left: 0;
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
        background-color: #f3f3f3;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        position: relative;
        z-index: 3;
        gap: 8px;
    }
    
    .nav-item {
        margin: 5px 0;
        width: 100%;
        opacity: 0;
        transform: translateX(-20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        transition-delay: calc(var(--item-index, 0) * 0.05s);
    }
    
    /* .main-nav::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background-color: #fff;
        z-index: 2;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    } */
    
    /* 移动导航标题 */
    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 15px 15px;
        border-bottom: 1px solid rgba(74, 144, 226, 0.2);
        background-color: rgba(74, 144, 226, 0.08);
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 5;
    }
    
    .mobile-nav-title {
        color: #4a90e2;
        font-size: 20px;
        font-weight: 600;
        text-align: center;
    }
    
    /* Logo尺寸调整 */
    .logo-container img,
    .logo-img {
        max-height: 40px;
    }
    
    .logo a {
        font-size: 1.2rem;
    }
    
    /* 隐藏用户导航 */
    .user-nav {
        display: none !important;
    }
}

/* 特小屏幕 (< 320px) */
@media (max-width: 320px) {
    .logo-container img,
    .logo-img {
        max-height: 30px;
    }
    
    .logo a {
        font-size: 1rem;
    }
}

/* 响应式布局优化 */
@media (min-width: 992px) {
    .post-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .post-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .post-list {
        grid-template-columns: 1fr;
        width: 100%;
        padding: 0 15px;
    }
    
    .post-item {
        background-color: #fff;
        color: var(--text-color);
        z-index: 1;
        position: relative;
        display: block;
        visibility: visible;
    }
    
    .post-title {
        color: #333;
        font-size: 1.3rem;
    }
    
    .post-title a {
        color: #333;
    }
    
    .post-excerpt {
        color: #555;
        display: block;
        visibility: visible;
    }
    
    .post-list-container {
        width: 100%;
        display: block;
        visibility: visible;
        overflow: visible;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .post-container {
        padding: 1.5rem;
    }
}

/* 3.10 列表页样式 */
.list-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.list-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.list-subtitle {
    font-size: 1rem;
    color: #666;
}

.list-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.list-filter-label {
    margin-right: 0.75rem;
    font-weight: 500;
    color: #555;
}

.list-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.list-filter-option {
    padding: 0.35rem 0.75rem;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #555;
    cursor: pointer;
    transition: var(--hover-transition);
}

.list-filter-option:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.list-filter-option.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.list-sort {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.list-found {
    font-size: 0.875rem;
    color: #666;
}

.list-sort-options {
    display: flex;
    gap: 1rem;
}

.list-sort-option {
    font-size: 0.875rem;
    color: #555;
    cursor: pointer;
    transition: var(--hover-transition);
}

.list-sort-option:hover {
    color: var(--primary-color);
}

.list-sort-option.active {
    color: var(--primary-color);
    font-weight: 500;
}

/* 3.11 资源列表 */
.resource-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.resource-card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: var(--hover-transition);
}

.resource-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.resource-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

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

.resource-card:hover .resource-image img {
    transform: scale(1.05);
}

.resource-type {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 3px;
    z-index: 1;
}

.resource-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.resource-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.resource-title a {
    color: #333;
    text-decoration: none;
    transition: var(--hover-transition);
}

.resource-title a:hover {
    color: var(--primary-color);
}

.resource-excerpt {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
    flex-grow: 1;
}

.resource-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #888;
    margin-top: auto;
}

.resource-date {
    display: flex;
    align-items: center;
}

.resource-date i {
    margin-right: 0.25rem;
}

.resource-views {
    display: flex;
    align-items: center;
}

.resource-views i {
    margin-right: 0.25rem;
}

.list-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.page-item {
    margin: 0 0.25rem;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 5px;
    background-color: #fff;
    border: 1px solid #ddd;
    color: #333;
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--hover-transition);
}

.page-link:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.page-item.disabled .page-link {
    color: #aaa;
    pointer-events: none;
    cursor: default;
}

/* 3.12 响应式调整 */
@media (max-width: 767px) {
    .post-list {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .post-container {
        padding: 1.5rem;
    }
}

/* 3.13 详情页样式 */
.detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eee;
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.detail-meta-item {
    display: flex;
    align-items: center;
    margin-right: 1.5rem;
    margin-bottom: 0.5rem;
}

.detail-meta-item i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.detail-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #f0f7ff;
    border-radius: 20px;
    color: var(--primary-color);
    font-size: 0.875rem;
    margin-right: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #d0e3ff;
    transition: var(--hover-transition);
}

.detail-category:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.detail-content {
    margin-bottom: 3rem;
    line-height: 1.8;
    color: #333;
}

.detail-content h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
    color: #0056b3;
}

.detail-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.detail-content h4 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #444;
}

.detail-content p {
    margin-bottom: 1.25rem;
}

.detail-content ul,
.detail-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.25rem;
}

.detail-content li {
    margin-bottom: 0.5rem;
}

.detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1.5rem 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.detail-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background-color: #f8f9fa;
    font-style: italic;
    color: #555;
    border-radius: 0 5px 5px 0;
}

.detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.detail-content th,
.detail-content td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

.detail-content th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.detail-content code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    color: #d63384;
}

.detail-content pre {
    background-color: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.detail-content pre code {
    background-color: transparent;
    padding: 0;
    color: #333;
    font-size: 0.9rem;
    line-height: 1.5;
}

.detail-footnote {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    font-size: 0.875rem;
    color: #666;
}

/* 详情页目录导航 */
.toc-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: sticky;
    top: 80px;
}

.toc-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e8f4ff;
    color: #0056b3;
}

.toc-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 0.5rem;
    padding-left: 0;
}

.toc-link {
    display: flex;
    align-items: center;
    color: #555;
    padding: 0.5rem 0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--hover-transition);
    position: relative;
    padding-left: 1rem;
}

.toc-link::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
    line-height: 1;
    transition: var(--hover-transition);
}

.toc-link:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

.toc-link.active {
    color: var(--primary-color);
    font-weight: 500;
}

.toc-sublevel {
    list-style-type: none;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.toc-sublevel .toc-link {
    font-size: 0.85rem;
}

.toc-sublevel .toc-link::before {
    content: '-';
    font-size: 1rem;
}

/* 相关资源区块 */
.related-resources {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.related-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #333;
    position: relative;
    padding-bottom: 0.75rem;
}

.related-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.related-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
    transition: var(--hover-transition);
}

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

.related-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.related-item-title a {
    color: #333;
    text-decoration: none;
    transition: var(--hover-transition);
}

.related-item-title a:hover {
    color: var(--primary-color);
}

.related-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #777;
}

/* 3.14 响应式调整 */
@media (max-width: 767px) {
    .detail-title {
        font-size: 1.5rem;
    }
    
    .detail-content h2 {
        font-size: 1.5rem;
    }
    
    .detail-content h3 {
        font-size: 1.3rem;
    }
    
    .toc-container {
        position: static;
        margin-bottom: 2rem;
    }
    
    .related-list {
        grid-template-columns: 1fr;
    }
} 

