/* ==================== 基础样式重置 ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ==================== 变量定义 - 科技风格 ==================== */
:root {
    /* 主色调 - 科技蓝 */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    
    /* 科技感配色 */
    --tech-cyan: #06b6d4;
    --tech-purple: #8b5cf6;
    --tech-green: #10b981;
    
    /* 文字颜色 */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* 背景色 - 轻微灰度增加层次 */
    --bg-white: #ffffff;
    --bg-gray: #f8fafc;
    --bg-tech: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    --border-color: #e2e8f0;
    
    /* 阴影 - 更柔和的科技感 */
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
    --shadow-tech: 0 0 0 1px rgba(37, 99, 235, 0.1), 0 4px 12px rgba(37, 99, 235, 0.15);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* ==================== 布局容器 ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-wrapper {
    display: flex;
    gap: 24px;
    padding: 24px 0;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar-right {
    width: 320px;
    flex-shrink: 0;
}

/* ==================== 顶部导航栏 - 科技感 ==================== */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(226, 232, 240, 0.8), var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    /* border-bottom: 1px solid transparent; */
}

/* 导航栏底部科技线条 */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--primary-color) 50%, transparent 100%);
    opacity: 0.3;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo img {
    height: 60px;
    width: auto;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-item {
    font-size: 16px;
    color: var(--text-secondary);
    position: relative;
    padding: 4px 0;
    transition: all 0.3s ease;
}

.nav-item:hover {
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* 导航项悬停效果 */
.nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: -1;
}

.nav-item:hover::before {
    width: 40px;
    height: 40px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
    width: 240px;
}

.search-input {
    width: 100%;
    height: 38px;
    padding: 0 40px 0 16px;
    border: 1px solid var(--border-color);
    border-radius: 19px;
    font-size: 14px;
    background: var(--bg-gray);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: var(--bg-white);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* ==================== 内容卡片 - 科技感 ==================== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-tech);
    border-color: rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-more {
    font-size: 13px;
    color: var(--text-muted);
}

.card-more:hover {
    color: var(--primary-color);
}

.card-body {
    padding: 20px;
}

/* ==================== 文章列表 ==================== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.article-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-thumb {
    width: 200px;
    height: 130px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-item:hover .article-thumb img {
    transform: scale(1.05);
}

.article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.article-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-title:hover {
    color: var(--primary-color);
}

.article-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: auto;
    font-size: 13px;
    color: var(--text-muted);
}

.article-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.article-tag {
    padding: 2px 8px;
    background: rgba(0, 102, 255, 0.08);
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

/* ==================== 特色文章（大图） ==================== */
.featured-section {
    margin-bottom: 24px;
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.featured-item {
    position: relative;
    height: 280px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.featured-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 20px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
}

.featured-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.featured-meta {
    font-size: 13px;
    opacity: 0.8;
}

/* ==================== 侧边栏组件 ==================== */
.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.hot-list {
    display: flex;
    flex-direction: column;
}

.hot-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.hot-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.hot-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.hot-rank.top {
    color: #fff;
    background: #ff4d4f;
}

.hot-content {
    flex: 1;
    min-width: 0;
}

.hot-title {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-title:hover {
    color: var(--primary-color);
}

.hot-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-item {
    padding: 6px 14px;
    background: var(--bg-gray);
    color: var(--text-secondary);
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: var(--primary-color);
    color: #fff;
}

/* ==================== 文章详情页 ==================== */
.article-detail {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 40px;
}

.article-detail-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.article-detail-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 20px;
}

.article-detail-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.article-detail-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-detail-content p {
    margin-bottom: 20px;
}

.article-detail-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 40px 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.article-detail-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 16px;
}

.article-detail-content img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 24px 0;
}

.article-detail-content a {
    color: var(--primary-color);
}

.article-detail-content blockquote {
    padding: 16px 20px;
    background: var(--bg-gray);
    border-left: 4px solid var(--primary-color);
    margin: 24px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-detail-content ul,
.article-detail-content ol {
    margin: 20px 0;
    padding-left: 28px;
}

.article-detail-content li {
    margin-bottom: 8px;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.pagination a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .current {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .disabled,
.pagination span:not(.current) {
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ThinkPHP分页样式适配 */
.pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pages a,
.pages span {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.pages a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.pages .current {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== 页脚 ==================== */
.footer {
    background: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.footer-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    font-size: 14px;
    color: var(--text-secondary);
}

.footer-link:hover {
    color: var(--primary-color);
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== 左侧边栏导航 ==================== */
.sidebar-left {
    width: 200px;
    flex-shrink: 0;
}

.menu-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.menu-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.menu-section ul {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-section li a {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.menu-section li a:hover,
.menu-section li.active a {
    color: var(--primary-color);
    background: rgba(0, 102, 255, 0.08);
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 1024px) {
    .sidebar-right,
    .sidebar-left {
        display: none;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== 移动端导航菜单 ==================== */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: var(--bg-gray);
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-white);
    z-index: 2000;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-nav-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.mobile-nav-close:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
}

.mobile-nav-menu {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-item {
    display: block;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-color);
}

.mobile-nav-item.active {
    font-weight: 500;
}

/* 移动端遮罩层 */
.mobile-nav::before {
    content: '';
    position: fixed;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.mobile-nav.active::before {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-inner {
        height: 56px;
    }
    
    .nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    /* 桌面端搜索框隐藏 */
    #desktopSearchBox {
        display: none;
    }
    
    /* 移动端搜索框显示 */
    .mobile-search-box {
        display: flex !important;
    }
    
    .search-box {
        display: none;
    }
    
    .main-wrapper {
        padding: 16px 0;
    }
    
    .article-item {
        flex-direction: column;
        gap: 16px;
    }
    
    .article-thumb {
        width: 100%;
        height: 180px;
    }
    
    .article-title {
        font-size: 16px;
    }
    
    .article-summary {
        font-size: 13px;
    }
    
    .featured-item {
        height: 200px;
    }
    
    .article-detail {
        padding: 24px;
    }
    
    .article-detail-title {
        font-size: 24px;
    }
    
    .article-detail-content {
        font-size: 15px;
    }
    
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    
    /* AI工具板块移动端适配 */
    .tools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    /* AI提示词板块移动端适配 */
    .prompts-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    /* AI知识百科移动端适配 */
    .wiki-list {
        gap: 12px !important;
    }
    
    .wiki-card img {
        width: 60px !important;
        height: 45px !important;
    }
    
    /* 轮播移动端适配 */
    .carousel-container {
        height: 220px !important;
    }
    
    .carousel-slide {
        height: 220px !important;
    }
    
    .carousel-prev,
    .carousel-next {
        width: 36px !important;
        height: 36px !important;
        font-size: 16px !important;
    }
    
    /* 查看更多按钮移动端适配 */
    .main-content > div:last-child a {
        padding: 10px 24px !important;
        font-size: 14px !important;
    }
}

@media (max-width: 480px) {
    .search-box {
        display: none;
    }
    
    .article-detail {
        padding: 20px;
    }
    
    .article-detail-title {
        font-size: 20px;
    }
    
    .footer-inner {
        grid-template-columns: 1fr;
    }
    
    /* 超小屏幕AI工具单列 */
    .tools-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* 超小屏幕轮播高度 */
    .carousel-container,
    .carousel-slide {
        height: 180px !important;
    }
    
    /* 返回顶部按钮位置调整 */
    .back-to-top {
        right: 16px !important;
        bottom: 16px !important;
        width: 44px !important;
        height: 44px !important;
    }
}
