/* ===== 全局样式 ===== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body { 
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ===== 主容器样式 ===== */
.container { 
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

/* ===== 头部样式 ===== */
.header { 
    background: linear-gradient(to right, #ce0000, #a80000);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* 左侧区域 */
.header-left {
    display: flex;
    flex: 1;
    min-width: 300px;
    align-items: center;
}

.logo-img { 
    width: 45px; 
    height: 45px; 
    margin-right: 20px;
    border: 1px solid #fff; 
    border-radius: 5px; 
}

.header-titles {
    display: flex;
    flex-direction: column;
}

.header-title { 
    font-size: 24px; 
    font-weight: bold; 
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.header-subtitle { 
    font-size: 12px; 
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

/* 右侧区域 */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 200px;
}

/* 导航按钮样式 */
.nav-btn {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-group {
    display: flex;
    gap: 10px;
}

/* ===== 主要内容区域样式 ===== */
.main-content { 
    padding: 25px;
}

/* ===== 信息区域样式 ===== */
.info-section { 
    margin: 0 auto 5px; /* 上下margin，左右auto居中 */
    padding: 10px 0; 
    text-align: center; /* 区域内所有元素默认居中 */
    max-width: 95%; /* 限制最大宽度，避免过宽 */
}

.section-title { 
    font-size: 24px; 
    font-weight: bold; /* 加粗 */
    color: #a00; /* 红色（匹配第2张图） */
    margin: 0 auto 5px; /* 上下margin，左右auto居中 */
    position: relative; 
    padding-bottom: 1px; /* 下划线空间 */
    text-align: center; /* 文字居中 */
    display: inline-block; /* 让下划线基于文字宽度 */
}

/* 标题下划线效果 */
.section-title::after { 
    content: ''; 
    position: absolute; 
    bottom: 0; 
    left: 50%; /* 从中间开始 */
    transform: translateX(-50%); /* 向左移自身50%，绝对居中 */
    width: 80%; /* 下划线长度 */
    height: 2px; /* 细线 */
    background: linear-gradient(to right, transparent, #a00, transparent); /* 渐变红线 */
}

/* ===== 分类导航样式 ===== */
.category-nav { 
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0 auto 25px;
    max-width: 920px;
}

.category-btn { 
    padding: 10px 15px;
    margin: 0 5px 10px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.category-btn:hover { 
    background: #e0e0e0;
}

/* ===== 文章内容样式 ===== */
        .article-container {
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
            padding: 30px;
            margin-top: 0px;
        }
        
        .article-title {
            font-size: 28px;
            color: #a00;
            text-align: center;
            margin-bottom: 30px;
            position: relative;
            padding-bottom: 15px;
        }
        
        .article-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 35%;
            width: 30%;
            height: 2px;
            background: linear-gradient(to right, transparent, #a00, transparent);
        }
        
        .article-content {
            line-height: 1.8;
            font-size: 16px;
        }
        
        .article-content h2 {
            font-size: 22px;
            color: #a00;
            margin: 25px 0 15px;
            padding-bottom: 5px;
            border-bottom: 1px solid #eee;
        }
        
        .article-content h3 {
            font-size: 18px;
            color: #333;
            margin: 20px 0 10px;
        }
        
        .article-content p {
            margin-bottom: 15px;
        }
        
        .article-content ul {
            margin: 15px 0;
            padding-left: 30px;
        }
        
        .article-content li {
            margin-bottom: 10px;
        }
        
        .article-content strong {
            color: #a00;
        }

/* 激活状态按钮样式 */
.category-btn.active { 
    background: #c20000;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(160, 0, 0, 0.3);
}

/* ===== 搜索区域样式 ===== */
.search-section { 
    margin: 5px 0 25px; 
    display: flex; 
    justify-content: center; 
}

.search-wrapper {
    display: flex;
    width: 80%;
    max-width: 700px;
}

.search-input { 
    flex: 1;
    padding: 12px 20px; 
    border: 2px solid #ddd; 
    border-radius: 4px 0 0 4px; 
    font-size: 16px; 
    outline: none;
}

.search-input:focus { 
    border-color: #a00;
    box-shadow: 0 0 0 2px rgba(160, 0, 0, 0.2);
}

.search-btn {
    padding: 12px 20px;
    background: #c20000;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    white-space: nowrap;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.search-btn:hover {
    background: #a80000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(160, 0, 0, 0.3);
}

.reset-btn {
    padding: 12px 20px;
    background: #666;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    white-space: nowrap;
    margin-left: 20px;
}

.reset-btn:hover {
    background: #444;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.buttons-wrapper {
    display: flex;
    margin-left: 20px;
}

/* ===== 广告位样式 ===== */
.ad-banner {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    padding: 0 10px;
}

.ad-item {
    flex: 1;
    min-width: 200px;
    max-width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.ad-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.ad-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: bold;
}

/* ===== 分页控件样式 ===== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0 10px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    gap: 5px;
}

.pagination-button {
    padding: 10px 20px;
    background-color: #c00000;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    font-size: 15px;
}

.pagination-button:hover {
    background-color: #a00000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pagination-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pagination-info {
    text-align: center;
    font-size: 16px;
    color: #555;
    margin: 0 15px;
}

.pagination-info strong {
    color: #c00000;
    font-size: 18px;
}

/* ===== 页脚样式 ===== */
.footer { 
    background: #333; 
    color: #aaa; 
    text-align: center; 
    padding: 15px; 
    font-size: 13px; 
    margin-top: 30px; 
}

.footerbuttom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    padding: 15px;
    color: #7f8c8d;
    font-size: 14px;
    border-top: 1px solid #d6dbdf;
    background-color: #ecf0f1;
    box-sizing: border-box; 
    z-index: 100; 
}

/* ===== 返回顶部按钮样式 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #a80000;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #8a0000;
    transform: translateY(-5px);
}

/* 修复：返回顶部按钮箭头显示 */
.back-to-top::before {
    content: '▲'; /* 使用向上箭头，而不是特殊字符 */
    font-size: 24px;
    font-weight: bold;
}

.back-to-top span {
    position: absolute;
    top: -25px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.back-to-top:hover span {
    opacity: 1;
}

/* ===== 案例卡片样式 (index.html) ===== */
.case-cards-container { 
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px 0; 
}

.case-card { 
    background: white; 
    border-radius: 8px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    overflow: hidden;
    position: relative;
    border-left: 1px solid #3498db;
}

.case-card:hover { 
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.case-card-inner { 
    padding: 20px; 
}

.case-item { 
    display: flex;
    margin-bottom: 12px;
    line-height: 1.6;
}

.case-label { 
    min-width: 80px;
    font-weight: bold;
    color: #a00;
}

.case-value {
    flex: 1;
}

.case-category-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    background-color: rgba(0, 102, 0, 0.9);
    color: white;
    font-weight: bold;
}

.law-link-btn {
    display: inline-block;
    padding: 12px 20px;
    background: #2980b9;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: bold;
    text-align: center;
    margin-top: 15px;
    border: none;
    cursor: pointer;
    width: 49.5%;
}

.law-link-btn:hover {
    background: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(160, 0, 0, 0.3);
}

/* ===== 法律卡片样式 (law_list.html) ===== */
.law-cards-container { 
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0; 
}

/* 修复1：确保法律卡片背景为白色 */
.law-card { 
    background: white !important; /* 强制白色背景，避免被覆盖 */
    border-radius: 8px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    overflow: hidden;
    position: relative;
    border: 1px solid #eee; /* 增加浅边框，让卡片更清晰 */
}

.law-card:hover { 
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.law-card-inner { 
    padding: 20px; 
}

/* 修复2：分类角标（标签）样式 - 仅角标着色 */
.law-card-category { 
    display: inline-block; 
    padding: 4px 12px; 
    color: white; 
    border-radius: 4px; 
    font-size: 13px; 
    font-weight: bold;
    margin-bottom: 12px;
    /* 移除渐变，使用纯色以确保颜色准确 */
}

/* 修复3：分类颜色精准匹配（根据您提供的正常图片） */
.category-law .law-card-category { 
    background: #c20000; /* 红色 - 法律 */
}

.category-regulation .law-card-category { 
    background: #1d5790; /* 蓝色 - 行政法规 */
}

.category-local .law-card-category { 
    background: #2e7d32; /* 绿色 - 地方性法规 */
}

.category-departmenta .law-card-category { 
    background: #5e35b1; /* 紫色 - 部门规章（匹配正常图片中的紫色标签） */
}

.category-government .law-card-category { 
    background: #f57c00; /* 橙色 - 地方政府规章 */
}

.category-normative .law-card-category {
    background: #757575; /* 灰色 - 规范性文件 */
}

.law-card-title { 
    font-size: 18px; 
    font-weight: bold; 
    color: #a00; 
    margin-bottom: 15px; 
    line-height: 1.4;
	text-align: left; /* 左对齐 */
    padding-left: 0; /* 无左边距 */
}

.law-card-info { 
    font-size: 14px; 
    color: #666; 
    margin-bottom: 8px; 
    display: flex;
	text-align: left; /* 左对齐 */
    display: block; /* 块级元素，每行一个 */
}

.law-card-info::before {
    content: attr(data-label);
    font-weight: bold;
    color: #555;
    min-width: 70px;
}

.law-card-footer {
    background: #f9f9f9;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* 修复4：底部按钮样式（红色，匹配正常图片） */
.btn-view {
    display: inline-block;
    padding: 8px 0;
    background: #c00000; /* 红色按钮 */
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
    width: 48%;
    text-align: center;
    box-sizing: border-box;
    font-size: 14px;
}

.btn-view:hover {
    background: #a00000; /* 深红色 hover */
}

/* ===== 文档预览样式 (law_preview.html & law_previewdoc.html) ===== */
.back-link { 
    display: inline-block; 
    margin-bottom: 15px; 
    color: #0066cc; 
    text-decoration: none; 
    font-size: 14px; 
}

.back-link:hover { 
    text-decoration: underline; 
}

/* 修复5：确保二维码和法律信息在同一行（桌面端） */
.info-section { 
    display: flex; 
    flex-direction: row; /* 强制行排列 */
    margin-bottom: 25px; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 25px; 
}

.document-info { 
    flex-grow: 1; 
}

/* 标题区域样式 */
.title-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* 分类角标样式 */
.category-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #c00000;
    color: white;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    margin-right: 12px;
    height: 28px;
    line-height: 20px;
}

.document-title {
    font-size: 22px;
    font-weight: bold;
    color: #a00;
    position: relative;
    padding-bottom: 10px;
}

.document-title::after { 
    content: ''; 
    position: absolute; 
    bottom:0; 
    left:0; 
    width: 100%; 
    height: 2px; 
    background: linear-gradient(to right, transparent, #a00, transparent); 
}

/* 行高和间距调整 */
.info-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 8px; 
}

.info-item { 
    margin-bottom: 4px;
    display: flex; 
    line-height: 1.4;
}

.info-label { 
    font-weight: bold; 
    width: 120px; 
    color: #555; 
    padding: 2px 0;
}

.info-value { 
    flex-grow: 1; 
    color: #333; 
    padding: 2px 0;
}

/* 二维码容器 */
.qrcode-container { 
    padding: 10px; 
    border: 1px solid #eee; 
    border-radius: 5px; 
    text-align: center; 
    width: 150px; 
    margin-right: 40px; 
    flex-shrink: 0; 
}

.qrcode-img { 
    width: 120px; 
    height: 120px; 
    object-fit: contain; 
    margin: 0 auto 10px; 
}

.qrcode-text { 
    font-size: 12px; 
    color: #666; 
}

/* 下载按钮 */
.download-section { 
    display: flex; 
    justify-content: flex-end; 
    margin-bottom: 20px; 
}

.download-btn { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    padding: 10px 20px; 
    font-size: 15px; 
    font-weight: bold; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    cursor: pointer; 
    transition: all 0.3s; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); 
    width: 150px; 
}

.download-btn + .download-btn { 
    margin-left: 12px; 
}

.download-btn.pdf { 
    background: linear-gradient(to right, #c00000, #a00000); 
}

.download-btn.word { 
    background: linear-gradient(to right, #1d5790, #0c355c); 
}

.download-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); 
}

/* PDF查看器容器 */
#pdf-viewer-container { 
    background: #fafafa; 
    border: 1px solid #eee; 
    border-radius: 5px; 
    padding: 15px; 
    min-height: 700px; 
    position: relative;
    overflow-y: auto; 
    max-height: 800px; 
}

.pdf-page {
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background: white;
    position: relative;
    text-align: center;
}

.pdf-page canvas {
    max-width: 100%;
    height: auto;
}

.page-info {
    position: absolute;
    bottom: 5px;
    right: 10px;
    background: rgba(0,0,0,0.5);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

/* Word文档查看器 */
#docx-viewer-container { 
    background: #fafafa; 
    border: 1px solid #eee; 
    border-radius: 5px; 
    padding: 25px; 
    min-height: 700px; 
    position: relative;
    overflow-y: auto; 
    max-height: 800px;
    line-height: 1.8;
}

.docx-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-radius: 5px;
}

.docx-content h1 {
    font-size: 24px;
    text-align: center;
    margin: 20px 0 30px;
    color: #a00;
    position: relative;
    padding-bottom: 15px;
}

.docx-content h1:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #a00;
}

.docx-content h2 {
    font-size: 20px;
    margin: 25px 0 15px;
    color: #c00000;
    padding-left: 10px;
    border-left: 4px solid #c00000;
}

.docx-content h3 {
    font-size: 18px;
    margin: 20px 0 10px;
    color: #1d5790;
}

.docx-content p {
    margin: 12px 0;
    text-indent: 2em;
}

.docx-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.docx-content th, .docx-content td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}

.docx-content th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.docx-content tr:nth-child(even) {
    background-color: #f9f9f9;
}

.docx-content ul, .docx-content ol {
    margin: 15px 0 15px 40px;
}

.docx-content li {
    margin: 8px 0;
}

.article-number {
    font-weight: bold;
    margin-right: 8px;
    color: #1d5790;
}

/* 状态提示样式 */
#download-status-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    border-radius: 5px;
    z-index: 1000;
    max-width: 350px;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#download-status-text {
    font-size: 14px;
    line-height: 1.5;
}

.status-info { color: #4fc3f7; }
.status-success { color: #69f0ae; }
.status-warning { color: #ffd54f; }
.status-error { color: #ff8a80; }

.close-status {
    position: absolute;
    top: 5px;
    right: 10px;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

#download-retry-btn {
    display: block;
    margin-top: 10px;
    padding: 6px 12px;
    background: #c00000;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.loading { 
    text-align: center; 
    padding: 40px; 
    font-size: 16px; 
    color: #666; 
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

.error { 
    color: #d32f2f; 
    text-align: center; 
    padding: 40px; 
    font-size: 16px; 
}

/* ===== 响应式设计 ===== */
@media (max-width: 960px) {
    /* 头部响应式 */
    .header {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        padding: 12px 15px;
        justify-content: space-between;
    }
    
    .header-left {
        flex-direction: row;
        align-items: center;
        text-align: left;
        margin-bottom: 0;
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
    }
    
    .logo-img {
        margin-right: 12px;
        margin-bottom: 0;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .header-titles {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    .header-title {
        font-size: 16px;
        margin-bottom: 2px;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .header-subtitle {
        font-size: 10px;
        margin-bottom: 0;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .header-right {
        flex-direction: row;
        align-items: center;
        flex-shrink: 0;
        margin-left: auto;
    }
    
    .btn-group {
        display: flex;
        gap: 8px;
        flex-shrink: 0;
    }
    
    .nav-btn {
        padding: 6px 12px;
        min-width: auto;
        font-size: 12px;
        white-space: nowrap;
    }
    
    /* 搜索区域响应式 */
    .search-wrapper { 
        width: 90%; 
        flex-direction: column;
    }
    
    .search-input { 
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .buttons-wrapper {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }
    
    .search-btn, .reset-btn {
        border-radius: 4px;
        flex: 1;
        margin: 0 5px;
    }
    
    .search-btn {
        margin-left: 0;
    }
    
    .reset-btn {
        margin-left: 0;
    }
    
    /* 分类导航响应式 */
    .category-nav { 
        justify-content: flex-start; 
        padding: 0 15px; 
    }
    
    .category-btn { 
        margin: 0 5px 10px 0; 
        padding: 10px 15px;
        font-size: 14px;
    }
    
    /* 返回顶部按钮响应式 */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    /* 案例卡片响应式 */
    .case-item {
        flex-direction: column;
    }
    
    .case-label {
        margin-bottom: 5px;
    }
    
    .law-link-btn {
        padding: 10px 12px;
        font-size: 13px;
        width: 48%;
        margin-right: 2%;
        margin-bottom: 5px;
    }
    
    .case-card-inner {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    /* 法律卡片响应式 */
    .law-cards-container { 
        grid-template-columns: 1fr; 
    }
    
    /* 修复6：在小屏幕上，二维码和法律信息变为上下排列 */
    .info-section { 
        flex-direction: column; 
    }
    
    .qrcode-container { 
        margin: 0 auto 15px; 
    }
    
    .info-grid { 
        grid-template-columns: 1fr; 
    }
    
    /* 下载按钮响应式 */
    .download-section { 
        flex-direction: column; 
        align-items: center; 
    }
    
    .download-btn + .download-btn { 
        margin-left: 0; 
        margin-top: 12px; 
    }
    
    /* 分页控件响应式 */
    .pagination-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .pagination-button {
        width: 100%;
        max-width: 300px;
    }
    
    /* PDF/Word查看器响应式 */
    #pdf-viewer-container, #docx-viewer-container { 
        min-height: 500px; 
        padding: 15px; 
    }
    
    .docx-content {
        padding: 10px;
    }
    
    .docx-content h1 {
        font-size: 22px;
    }
    
    .docx-content h2 {
        font-size: 18px;
    }
    
    .docx-content th, .docx-content td {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .docx-content ul, .docx-content ol {
        margin-left: 20px;
    }
    
    .title-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .category-badge { 
        margin-right: 0; 
        margin-bottom: 8px; 
    }
}

/* 针对更小屏幕的进一步优化 */
@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
    }
    
    .header-title {
        font-size: 14px;
    }
    
    .header-subtitle {
        font-size: 9px;
    }
    
    .logo-img {
        width: 35px;
        height: 35px;
        margin-right: 8px;
    }
    
    .btn-group {
        gap: 5px;
    }
    
    .nav-btn {
        padding: 5px 8px;
        font-size: 11px;
    }
    
    /* 隐藏手机端二维码的显示 */
    .qrcode-container {
        display: none !important;
    }
    
    .law-link-btn {
        padding: 8px 10px;
        font-size: 12px;
        width: 48%;
    }
}