/* ====== 全局变量与重置 ====== */
:root {
    --primary-color: #1E9FFF;
    --secondary-color: #2F4056;
    --light-bg: #f8f8f8;
    --border-color: #eee;
    --border-radius: 5px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
    --content-width: 1200px;
}

* {
    box-sizing: border-box;
}

body {
    background-color: #f2f3f5;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    padding-top: 56px; /* 为固定头部留出空间 */
}

/* ====== 布局容器 ====== */
.content-width {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    box-sizing: border-box;
}

.main-content {
    margin-top: 60px;
    padding: 30px 0;
    min-height: 600px;
}

.main-container {
    width: 100%;
    min-height: calc(100vh - 140px);
    box-sizing: border-box;
    margin-top: 10px; /* 与头部间距 */
}

/* ====== 固定顶部工具栏 ====== */
.header-top-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 56px;
    z-index: 1000;
    background-color: #2f4056;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 滚动时工具栏样式 */
.scrolled .header-top-toolbar {
    height: 63px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* ====== 页脚 ====== */
.footer-bg {
    background-color: #ffffff;
    color: #999;
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
}

.beian-logos {
    display: inline;
    width: 16px;
}

/* ====== Layui 导航样式覆盖 ====== */
.layui-nav {
    background: none !important;
}

.layui-nav .layui-nav-item > a {
    color: rgba(255, 255, 255, 0.9) !important;
}

.layui-nav .layui-nav-item > a:hover {
    color: white !important;
}

.layui-nav .layui-this > a {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.layui-logo {
    color: #fff !important;
    font-size: 24px !important;
    height: 40px !important;
    line-height: 50px !important;
}

.layui-btn-primary {
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

.layui-btn-primary:hover {
    background-color: rgba(30, 159, 255, 0.1) !important;
}

/* ====== 通用卡片面板 ====== */
.card-panel {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    padding: 20px;
}

.panel-title {
    font-size: 18px;
    font-weight: bold;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
}

.panel-title i {
    margin-right: 8px;
    color: var(--primary-color);
}

/* ====== 工具卡片网格 ====== */
.tools-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.tool-card {
    width: calc(33.333% - 20px);
    margin: 0 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    transition: var(--transition);
    background: white;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(30, 159, 255, 0.15);
    border-color: var(--primary-color);
}

/* 图标样式（用于独立图标卡片） */
.tool-icon {
    width: 60px;
    height: 60px;
    background: rgba(30, 159, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 28px;
    color: var(--primary-color);
}

/* 标题样式（支持纯文字或带链接） */
.tool-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.tool-title a {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.tool-title a i {
    font-size: 20px;
    color: var(--primary-color);
    margin-right: 8px;
    width: auto;
    background: none;
    height: auto;
    line-height: 1;
}

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

.tool-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 10px;
}

.btn-container {
    margin-top: auto;
    padding-top: 5px;
}

.hot-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #FF5722;
    color: white;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 8px;
    line-height: 1;
}

/* ====== 文档列表样式 ====== */
.doc-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.doc-item:last-child {
    border-bottom: none;
}

.doc-title {
    font-size: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.doc-title i {
    margin-right: 8px;
    color: #5FB878;
    font-size: 16px;
}

.doc-title a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

.doc-meta {
    font-size: 13px;
    color: #999;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 15px;
    margin-bottom: 10px;
}

.doc-meta span {
    display: inline-flex;
    align-items: center;
}

.doc-meta i {
    margin-right: 4px;
    font-size: 12px;
}

.doc-desc {
    color: #666;
    font-size: 14px;
    margin: 8px 0 12px;
    line-height: 1.6;
}

.doc-readmore {
    display: inline-block;
}

/* 热门文档列表（侧边栏） */
.hot-docs-list {
    margin-top: 5px;
}

.hot-doc-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.hot-doc-item:last-child {
    border-bottom: none;
}

.hot-doc-item a {
    color: #333;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: color 0.2s;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hot-doc-item a i {
    margin-right: 8px;
    color: #5FB878;
    font-size: 16px;
    width: 20px;
}

.hot-doc-item a:hover {
    color: var(--primary-color);
}

.hot-doc-views {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    margin-left: 10px;
}

.hot-doc-views i {
    margin-right: 3px;
    font-size: 11px;
}

/* ====== 分类导航（左侧菜单） ====== */
.category-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-nav li {
    border-bottom: 1px solid var(--border-color);
}

.category-nav li:last-child {
    border-bottom: none;
}

.category-nav a {
    display: block;
    padding: 12px 15px;
    color: #333;
    transition: 0.2s;
    text-decoration: none;
}

.category-nav a:hover {
    background: #f5f7fa;
    color: var(--primary-color);
    padding-left: 20px;
}

.category-nav i {
    margin-right: 8px;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.category-nav .layui-badge {
    float: right;
    background: #f0f0f0;
    color: #666;
}

/* ====== 特色卡片 ====== */
.feature-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
}

.feature-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* ====== 搜索区域 ====== */
.search-container {
    text-align: center;
    padding: 20px 0;
}

.search-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.search-header i {
    font-size: 24px;
    color: var(--primary-color);
    margin-right: 10px;
}

.search-header h3 {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.search-desc {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.search-box {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.search-tags {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.tag-label {
    font-size: 13px;
    color: #999;
    margin-right: 10px;
}

.search-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(30, 159, 255, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 12px;
    margin: 0 5px 5px 0;
    cursor: pointer;
    transition: all 0.3s;
}

.search-tag:hover {
    background: rgba(30, 159, 255, 0.2);
}

/* ====== 工具详情页专用样式 ====== */
.tool-detail-header {
    background: white;
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tool-content {
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    padding: 30px;
    margin-bottom: 20px;
}

.tool-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.result-box {
    background: #f8f8f8;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    margin-top: 20px;
}

.result-item {
    margin-bottom: 10px;
    display: flex;
}

.result-label {
    width: 150px;
    font-weight: bold;
}

.related-tools {
    background: white;
    border-radius: 5px;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05);
    padding: 20px;
}

.related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.related-item {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s;
}

.related-item:hover {
    border-color: var(--primary-color);
    background: rgba(30, 159, 255, 0.05);
}

/* ====== 响应式设计 ====== */
@media (max-width: 992px) {
    .tool-card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 768px) {
    .tool-card {
        width: calc(100% - 20px);
    }
    
    .content-width {
        padding: 0 10px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box .layui-input-inline {
        width: 100% !important;
        margin-bottom: 10px;
    }
    
    .search-tags {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tag-label {
        margin-bottom: 8px;
    }
    
    .doc-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .doc-meta span {
        margin-bottom: 5px;
    }
    
    .result-item {
        flex-direction: column;
    }
    
    .result-label {
        width: auto;
        margin-bottom: 5px;
    }
}