/* 自定义样式 - 减少 Header 和文章间距 */

/* 1. 减少 header 和内容之间的间距 */
.layout {
    padding: 20px 15px !important;
}

@media screen and (max-width: 768px) {
    .layout {
        padding: 15px 5px !important;
    }
}

/* 2. 减少文章内容区域的顶部内边距 */
.layout > div:first-child:not(.nc) {
    padding: 30px 40px !important;
}

@media screen and (max-width: 768px) {
    .layout > div:first-child:not(.nc) {
        padding: 24px 14px !important;
    }
}

/* 3. 减少页面 header 高度 */
#page-header.not-home-page {
    height: 300px !important;
}

@media screen and (max-width: 768px) {
    #page-header.not-home-page {
        height: 220px !important;
    }
}

/* 4. 减少文章页 header 高度 */
#page-header.post-bg {
    height: 300px !important;
}

@media screen and (max-width: 768px) {
    #page-header.post-bg {
        height: 280px !important;
    }
}

/* 5. 调整文章标题位置 */
#post-info {
    bottom: 20px !important;
}

/* 6. 调整页面标题位置 */
#page-site-info {
    top: 150px !important;
}

@media screen and (max-width: 768px) {
    #page-site-info {
        top: 110px !important;
    }
}

/* 7. 减少文章页面的 margin-bottom（如果有 not-top-img 的情况） */
#page-header.not-top-img {
    margin-bottom: 5px !important;
}

/* ========================================
   整体宽度调整
   ======================================== */

/* 8. 防止浏览器缩放时内容变窄 - 宽度 100vw-50px，始终居中 */
.layout {
    width: calc(100vw - 50px) !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 9. 移动端保持响应式 */
@media screen and (max-width: 768px) {
    .layout {
        width: calc(100vw - 10px) !important;
    }
}

/* ========================================
   工具首页样式
   ======================================== */

#tools-home-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* Hero Section */
.tools-hero {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    margin-bottom: 30px;
}

.hero-title {
    font-size: 2em;
    margin: 0 0 10px 0;
    font-weight: 600;
    color: #24292e;
}

.hero-subtitle {
    font-size: 1em;
    margin: 0 0 20px 0;
    color: #586069;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 16px;
    color: #586069;
}

.feature-item i {
    font-size: 1.1em;
    color: #0366d6;
}

/* Category Section */
.tools-categories {
    padding: 0 20px;
}

.category-section {
    margin-bottom: 35px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e1e4e8;
}

.category-header i {
    font-size: 1.4em;
    color: #0366d6;
}

.category-header h2 {
    margin: 0;
    font-size: 1.3em;
    color: #24292e;
    font-weight: 600;
}

.category-header p {
    margin: 0;
    margin-left: auto;
    color: #6a737d;
    font-size: 0.85em;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.tool-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tool-card:hover {
    border-color: #0366d6;
    box-shadow: 0 2px 8px rgba(3, 102, 214, 0.1);
}

.tool-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    color: #0366d6;
    font-size: 1.2em;
}

.tool-info h3 {
    margin: 0 0 4px 0;
    font-size: 0.95em;
    color: #24292e;
    font-weight: 600;
}

.tool-info p {
    margin: 0;
    font-size: 0.8em;
    color: #6a737d;
    line-height: 1.4;
}

/* Footer */
.tools-footer {
    text-align: center;
    padding: 25px 20px;
    margin-top: 40px;
    background: #f6f8fa;
    border-top: 1px solid #e1e4e8;
    border-radius: 6px;
}

.footer-info p {
    margin: 8px 0;
    color: #6a737d;
    font-size: 0.85em;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .hero-title {
        font-size: 1.6em;
    }
    
    .hero-subtitle {
        font-size: 0.95em;
    }
    
    .hero-features {
        gap: 12px;
    }
    
    .feature-item {
        font-size: 0.85em;
        padding: 5px 12px;
    }
    
    .category-header {
        flex-wrap: wrap;
    }
    
    .category-header h2 {
        font-size: 1.15em;
    }
    
    .category-header p {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
        font-size: 0.8em;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media screen and (max-width: 480px) {
    .tools-hero {
        padding: 20px 15px;
    }
    
    .hero-title {
        font-size: 1.4em;
    }
    
    .tool-card {
        padding: 12px 14px;
    }
    
    .tool-icon {
        width: 34px;
        height: 34px;
        font-size: 1.1em;
    }
    
    .tool-info h3 {
        font-size: 0.9em;
    }
    
    .tool-info p {
        font-size: 0.75em;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .tools-hero {
    background: #161b22;
    border-color: #30363d;
}

[data-theme="dark"] .hero-title {
    color: #c9d1d9;
}

[data-theme="dark"] .hero-subtitle {
    color: #8b949e;
}

[data-theme="dark"] .feature-item {
    background: #0d1117;
    border-color: #30363d;
    color: #8b949e;
}

[data-theme="dark"] .feature-item i {
    color: #58a6ff;
}

[data-theme="dark"] .category-header {
    border-bottom-color: #30363d;
}

[data-theme="dark"] .category-header i {
    color: #58a6ff;
}

[data-theme="dark"] .category-header h2 {
    color: #c9d1d9;
}

[data-theme="dark"] .category-header p {
    color: #8b949e;
}

[data-theme="dark"] .tool-card {
    background: #0d1117;
    border-color: #30363d;
}

[data-theme="dark"] .tool-card:hover {
    border-color: #58a6ff;
    box-shadow: 0 2px 8px rgba(88, 166, 255, 0.1);
}

[data-theme="dark"] .tool-icon {
    background: #161b22;
    border-color: #30363d;
    color: #58a6ff;
}

[data-theme="dark"] .tool-info h3 {
    color: #c9d1d9;
}

[data-theme="dark"] .tool-info p {
    color: #8b949e;
}

[data-theme="dark"] .tools-footer {
    background: #161b22;
    border-top-color: #30363d;
}

[data-theme="dark"] .footer-info p {
    color: #8b949e;
}
