/* style.css - 简洁Hero整合版 */

:root {
    --primary-color: #0066ff;
    --primary-dark: #0052cc;
    --text-dark: #333333;
    --text-gray: #666666;
    --text-light: #999999;
    --bg-light: #ffffff;
    --bg-off-white: #f8f9fa;
    --border-color: #eaeaea;
    --header-height: 70px;
    --container-width: 1200px;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-family);
    color: var(--text-dark);
//    background-color: var(--bg-light);
background-color: #f4f6f8;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }

/* === Header 样式 === */
.site-header {
    background: var(--bg-light);
    height: var(--header-height);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner { display: flex; justify-content: space-between; align-items: center; height: 100%; }

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex; align-items: center; z-index: 102;
}

/* 导航与下拉菜单 */
.main-nav ul { display: flex; list-style: none; gap: 2rem; align-items: center; }
.main-nav a { font-weight: 500; font-size: 0.95rem; color: var(--text-dark); display: block; padding: 10px 0; }
.main-nav a:hover { color: var(--primary-color); }

.has-dropdown { position: relative; padding-right: 12px; }
.has-dropdown .arrow { font-size: 0.7rem; position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--text-light); transition: transform 0.3s; }

.dropdown-menu {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px);
    background: #fff; min-width: 180px; box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 6px; padding: 10px 0; opacity: 0; visibility: hidden;
    transition: all 0.3s ease; display: block !important;
}
.dropdown-menu a { padding: 8px 20px; font-size: 0.9rem; white-space: nowrap; color: var(--text-gray); }
.dropdown-menu a:hover { background: var(--bg-off-white); color: var(--primary-color); }

@media (min-width: 993px) {
    .has-dropdown:hover .arrow { transform: translateY(-50%) rotate(180deg); color: var(--primary-color); }
    .has-dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
}

/* 头部右侧 */
.header-actions { display: flex; align-items: center; gap: 1rem; }
.search-bar input {
    padding: 0.5rem 1rem; border: 1px solid var(--border-color); border-radius: 4px;
    font-size: 0.9rem; outline: none; background: var(--bg-off-white); transition: border-color 0.3s;
}
.search-bar input:focus { border-color: var(--primary-color); }
.btn-login { padding: 0.5rem 1.2rem; background-color: var(--primary-color); color: white; border-radius: 4px; font-size: 0.9rem; font-weight: 500; }
.btn-login:hover { opacity: 0.9; }

.mobile-menu-toggle { display: none; background: none; border: none; cursor: pointer; z-index: 102; padding: 5px; }
.mobile-menu-toggle .bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--text-dark); transition: all 0.3s ease-in-out; }

/* === 主体内容区域 === */
main {
    flex: 1;
    width: 100%;
    padding: 0;
}

main > .container {
    padding-top: 40px;
    padding-bottom: 40px;
}

/* === 首页 Hero 区域样式 (简洁版) === */
.hero-section {
    background: transparent; /* 去除蓝色背景 */
    color: var(--text-dark); /* 文字颜色改回深色 */
    padding: 40px 0 20px;    /* 调整内边距 */
    text-align: center;
    position: relative;
    z-index: 1;
    margin-bottom: 30px;     /* 移除负边距，改为正向间距 */
}
/* 隐藏旧标题样式，防止冲突 */
.hero-title, .hero-subtitle { display: none; }

.hero-search { position: relative; max-width: 600px; margin: 0 auto; }
.hero-search input {
    width: 100%; padding: 18px 50px 18px 25px; border-radius: 50px; 
    border: 1px solid var(--border-color); /* 增加边框 */
    font-size: 1.1rem; 
    background: var(--bg-light);
    box-shadow: 0 5px 20px rgba(0,0,0,0.08); /* 调整阴影使其更柔和 */
    outline: none; transition: all 0.2s;
}
.hero-search input:focus { 
    transform: scale(1.01); 
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(0,102,255,0.15); /* 聚焦时淡淡的蓝色光晕 */
}
.hero-search .search-icon { position: absolute; right: 25px; top: 50%; transform: translateY(-50%); color: #999; pointer-events: none; }

/* === 首页工具列表样式 === */
.tools-wrapper { position: relative; z-index: 10; padding-bottom: 60px; }
.tool-category { margin-bottom: 50px; }
.category-title { font-size: 1.4rem; margin-bottom: 25px; color: var(--text-dark); font-weight: 700; display: flex; align-items: center; gap: 10px; }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }

.tool-card {
    background: #fff; border-radius: 12px; padding: 25px; display: flex; align-items: flex-start; gap: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); border: 1px solid transparent; transition: all 0.3s ease;
    text-decoration: none; color: inherit; position: relative; overflow: hidden;
}
.tool-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,102,255,0.1); border-color: rgba(0,102,255,0.2); }
.tool-card .icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; flex-shrink: 0; }
.tool-card .info { flex: 1; }
.tool-card h3 { font-size: 1.1rem; margin-bottom: 6px; color: var(--text-dark); font-weight: 600; }
.tool-card p { font-size: 0.85rem; color: var(--text-gray); line-height: 1.5; margin: 0; }

/* Footer */
.site-footer { background-color: var(--bg-off-white); padding: 60px 0 30px; color: var(--text-gray); font-size: 0.9rem; border-top: 1px solid var(--border-color); margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 3rem; margin-bottom: 40px; }
.footer-col h4 { color: var(--text-dark); margin-bottom: 1.2rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.8rem; }
.footer-bottom { text-align: center; padding-top: 30px; border-top: 1px solid var(--border-color); color: var(--text-light); font-size: 0.85rem; }

/* 响应式调整与修复 */
@media (max-width: 992px) {
    /* 1. 汉堡菜单按钮 */
    .mobile-menu-toggle { 
        display: block; 
        z-index: 1200;
        position: relative;
    }

    /* 2. 侧边栏主体 */
    .main-nav { 
        position: fixed; top: 0; right: 0; left: auto; bottom: 0;
        width: 280px; max-width: 80%; height: 100vh; 
        background: #fff; padding-top: 80px; 
        flex-direction: column; align-items: flex-start; 
        transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
        z-index: 1100; overflow-y: auto; box-shadow: -5px 0 20px rgba(0,0,0,0.1);
    }
    .main-nav.active { transform: translateX(0); }

    /* 3. 菜单项样式 */
    .main-nav ul { flex-direction: column; width: 100%; gap: 0; padding: 0 20px; }
    .main-nav > ul > li { width: 100%; border-bottom: 1px solid var(--border-color); }
    .main-nav > ul > li > a { 
        padding: 15px 0; font-size: 1.05rem; 
        display: flex; align-items: center; justify-content: space-between; /* 垂直居中+两端对齐 */
        color: var(--text-dark);
    }

    /* 4. 下拉菜单修复 */
    .has-dropdown { position: relative; }
    .has-dropdown .arrow { 
        position: static !important; transform: none !important; margin-left: auto; margin-top: 0; font-size: 0.8rem; 
    }
    .has-dropdown.active > a .arrow { transform: rotate(180deg) !important; }
    
    .dropdown-menu { 
        position: static; display: none !important; width: 100%; transform: none; box-shadow: none; 
        background-color: #f9f9f9; padding-left: 10px; opacity: 1; visibility: visible; margin-top: 0; border-radius: 4px;
    }
    .has-dropdown.active .dropdown-menu { display: block !important; }

    /* 5. 底部操作栏 */
    .header-actions { 
        position: fixed; bottom: 0; right: 0; width: 280px; max-width: 80%; background: #fff; z-index: 1101; 
        flex-direction: column; padding: 20px; border-top: 1px solid #eee;
        transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .header-actions.active { transform: translateX(0); display: flex; }

    .search-bar { width: 100%; margin-bottom: 10px; } 
    .search-bar input, .btn-login { width: 100%; }
    
    /* 首页 Hero 适配 */
    .hero-section { padding: 30px 0 20px; }
    .tools-grid { grid-template-columns: 1fr; gap: 15px; }
}

/* =========================================
   Forum Styles (论坛专属样式)
   ========================================= */

/* --- 1. 默认桌面端布局 (Desktop) --- */

/* 头部：标题和按钮左右对齐 */
.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* 栅格布局：左侧内容 3份，右侧侧边栏 1份 */
.forum-grid {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 20px;
}

/* 帖子列表项 */
.thread-item {
    padding: 15px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}
.thread-avatar {
    width: 40px;
    height: 40px;
    background: #f6f8fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #57606a;
    flex-shrink: 0;
}
.thread-title {
    margin: 0 0 5px 0;
    font-size: 16px;
}
.thread-meta {
    font-size: 12px;
    color: #57606a;
}
.thread-stats {
    text-align: right;
    font-size: 12px;
    color: #57606a;
    min-width: 60px;
}

/* 侧边栏 */
.sidebar-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-box li a {
    display: block;
    padding: 8px 0;
    color: #57606a;
    text-decoration: none;
}
.sidebar-box li a.active {
    color: #0969da;
    font-weight: bold;
}

/* 帖子内容页 (防止内容溢出) */
.forum-content {
    font-size: 16px;
    line-height: 1.6;
    color: #24292f;
    word-wrap: break-word;
    overflow-wrap: anywhere; /* 关键：防止长网址撑破 */
}
.forum-content img {
    max-width: 100%;
    height: auto;
}

/* --- 2. 平板与移动端适配 (Max-Width: 992px) --- */
@media (max-width: 992px) {
    /* 强制改为单栏布局 */
    .forum-grid {
        display: flex;
        flex-direction: column;
    }

    /* 侧边栏沉底 */
    .sidebar {
        order: 2;
        margin-top: 20px;
    }

    /* 帖子列表在上方 */
    .thread-list {
        order: 1;
    }

    /* 头部改为垂直排列 */
    .forum-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .forum-header .btn-login {
        width: 100%; /* 按钮全宽，方便手指点击 */
        text-align: center;
    }

    /* 调整帖子列表间距 */
    .thread-item {
        padding: 12px;
        gap: 10px;
    }
    .thread-avatar {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .thread-title {
        font-size: 15px;
    }

    /* 详情页内边距缩小 */
    .gh-card {
        padding: 15px !important;
    }
}

/* 博客文章内容链接样式修复 */
.blog-content a {
    color: var(--primary-color, #0066ff) !important; /* 使用主题色，或者默认蓝色 */
    text-decoration: underline; /* 增加下划线 */
    font-weight: 500;
}

.blog-content a:hover {
    text-decoration: none; /* 鼠标悬停时去掉下划线 */
    opacity: 0.8;
}
