/* style.css - 工程文档库公共样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

:root {
    --primary-color: #2c80ff;
    --secondary-color: #1a6fe0;
    --accent-color: #ff7e30;
    --light-bg: #f8fafc;
    --dark-text: #333;
    --light-text: #666;
    --border-color: #eaeaea;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
    background: #f5f7fa;
    color: var(--dark-text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部导航 */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 10px;
    font-size: 26px;
}

nav {
    display: flex;
}

nav a {
    margin-left: 25px;
    color: var(--light-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

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

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.user-actions {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    margin-right: 20px;
}

.search-box input {
    padding: 8px 15px 8px 35px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 200px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    width: 250px;
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(44, 128, 255, 0.1);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-text);
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    margin: 30px 0;
    gap: 30px;
}

/* 左侧边栏 */
.sidebar {
    flex: 0 0 280px;
}

.sidebar-widget {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 25px;
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--dark-text);
    display: flex;
    align-items: center;
}

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

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--light-bg);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--light-text);
    transition: all 0.3s;
    text-decoration: none;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
}

.news-list {
    list-style: none;
}

.news-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.news-item a {
    color: var(--dark-text);
    text-decoration: none;
    transition: color 0.3s;
    display: block;
}

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

.news-date {
    font-size: 12px;
    color: var(--light-text);
    margin-top: 5px;
}

/* 右侧内容 */
.content {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 30px;
    position: relative;
    overflow: hidden;
}

.content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
}

/* 页脚 */
footer {
    background: white;
    padding: 40px 0 20px;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.footer-column {
    flex: 1;
    padding: 0 15px;
}

.footer-column h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--dark-text);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--light-text);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 14px;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--light-text);
    font-size: 14px;
}

/* 首页特定样式 */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
    border-radius: 12px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,192C672,181,768,139,864,138.7C960,139,1056,181,1152,197.3C1248,213,1344,203,1392,197.3L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: center bottom;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.hero-search input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.hero-search i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--light-text);
    font-size: 18px;
}

.categories-section {
    margin: 50px 0;
}

.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
    color: var(--dark-text);
    font-weight: 700;
}

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

.category-card {
    background: white;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.category-icon {
    width: 70px;
    height: 70px;
    background: var(--light-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary-color);
    font-size: 28px;
}

.category-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--dark-text);
    font-weight: 600;
}

.category-count {
    font-size: 14px;
    color: var(--light-text);
}

.featured-docs {
    margin: 60px 0;
}

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

.doc-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.doc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.doc-card-img {
    height: 160px;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 40px;
}

.doc-card-content {
    padding: 20px;
}

.doc-card-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--dark-text);
    font-weight: 600;
}

.doc-card-title a {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--dark-text);
    font-weight: 600;
	text-decoration: none;
}

.related-card-title a {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--dark-text);
    font-weight: 600;
	text-decoration: none;
}



.doc-card-meta {
    font-size: 13px;
    color: var(--light-text);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.doc-card-meta i {
    margin-right: 5px;
}

.doc-card-desc {
    font-size: 14px;
    color: var(--light-text);
    margin-bottom: 15px;
    line-height: 1.5;
}

.doc-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.doc-card-actions {
    display: flex;
    gap: 10px;
}

.doc-card-btn {
    padding: 6px 12px;
    background: var(--light-bg);
    color: var(--light-text);
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s;
}

.doc-card-btn.primary {
    background: var(--primary-color);
    color: white;
}

.doc-card-btn:hover {
    background: var(--secondary-color);
    color: white;
}

/* 详情页特定样式 */
.doc-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--dark-text);
    line-height: 1.3;
}

.doc-meta {
    color: var(--light-text);
    font-size: 14px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

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

.doc-desc {
    margin-bottom: 30px;
    line-height: 1.7;
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.download-section {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--light-bg) 0%, #e8f1ff 100%);
    border-radius: 8px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(44, 128, 255, 0.3);
    position: relative;
    z-index: 1;
    border: none;
    cursor: pointer;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(44, 128, 255, 0.4);
}

.download-btn i {
    margin-right: 10px;
    font-size: 18px;
}

.doc-info {
    margin-top: 15px;
    font-size: 14px;
    color: var(--light-text);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.doc-info span {
    display: flex;
    align-items: center;
    background: white;
    padding: 6px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.doc-info i {
    margin-right: 6px;
    color: var(--primary-color);
}

.doc-features {
    margin-top: 40px;
}

.features-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--dark-text);
    font-weight: 700;
}

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

.feature-card {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.feature-card i {
    font-size: 22px;
    color: var(--accent-color);
    margin-bottom: 12px;
}

.feature-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--dark-text);
}

.feature-card p {
    color: var(--light-text);
    font-size: 13px;
    line-height: 1.5;
}

.related-docs {
    margin-top: 40px;
}

.related-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--dark-text);
    font-weight: 700;
}

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

.related-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.related-card-img {
    height: 140px;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 36px;
}

.related-card-content {
    padding: 15px;
}

.related-card-title {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--dark-text);
    font-weight: 600;
}

.related-card-meta {
    font-size: 12px;
    color: var(--light-text);
    margin-bottom: 10px;
}

.related-card-desc {
    font-size: 13px;
    color: var(--light-text);
    line-height: 1.5;
}

/* 列表页特定样式 */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--light-text);
}

.breadcrumb a {
    color: var(--light-text);
    text-decoration: none;
}

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

.breadcrumb span {
    margin: 0 5px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.list-title {
    font-size: 24px;
    color: var(--dark-text);
    font-weight: 700;
}

.list-actions {
    display: flex;
    gap: 15px;
}

.list-sort {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.list-view {
    display: flex;
    gap: 5px;
}

.view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--light-text);
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 10px;
}

.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--light-text);
    text-decoration: none;
    transition: all 0.3s;
}

.pagination a.active, .pagination a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        display: none; /* 移动端隐藏侧边栏 */
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    nav {
        order: 3;
        width: 100%;
        margin-top: 15px;
        justify-content: center;
    }
    
    nav a {
        margin: 0 10px;
    }
    
    .user-actions {
        margin-left: auto;
    }
    
    .hero-title {
        font-size: 32px;
    }
    
    .categories-grid, .docs-grid, .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-column {
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    .search-box input {
        width: 150px;
    }
    
    .search-box input:focus {
        width: 180px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 28px;
    }
    
    .categories-grid, .docs-grid, .related-grid {
        grid-template-columns: 1fr;
    }
    
    .list-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* 移动端侧边栏切换按钮 */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 99;
    cursor: pointer;
}

@media (max-width: 992px) {
    .mobile-sidebar-toggle {
        display: flex;
    }
    
    .sidebar.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        background: white;
        z-index: 100;
        padding: 20px;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.active + .content {
        margin-left: 280px;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    
    .sidebar.active ~ .sidebar-overlay {
        display: block;
    }
}