/* ==================== 政策汇编电子书 - 书本仿真风格 ==================== */

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

/* ==================== 基础样式 ==================== */
html, body {
    height: 100%;
    font-family: 'Georgia', 'Noto Serif SC', 'Songti SC', serif;
    background: linear-gradient(135deg, #E8D5B5 0%, #D4C4A8 50%, #C8B898 100%);
    color: #3D2914;
    line-height: 1.6;
}

/* ==================== 主容器 ==================== */
#app {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

/* ==================== 书本容器 ==================== */
.book-container {
    display: flex;
    max-width: 900px;
    width: 100%;
    min-height: 600px;
    max-height: 90vh;
    position: relative;
}

/* ==================== 书脊装饰 ==================== */
.book-spine {
    width: 24px;
    background: linear-gradient(
        90deg,
        #8B4513 0%,
        #A0522D 20%,
        #CD853F 40%,
        #A0522D 60%,
        #8B4513 100%
    );
    border-radius: 4px 0 0 4px;
    box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

/* ==================== 书本主体 ==================== */
.book-body {
    flex: 1;
    background: #F5E6D3;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 2px solid #8B4513;
    border-left: none;
    border-radius: 0 4px 4px 0;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* ==================== 装饰边框 ==================== */
.book-border-top,
.book-border-bottom {
    height: 16px;
    background: linear-gradient(
        90deg,
        #8B4513 0%,
        #A0522D 25%,
        #8B4513 50%,
        #A0522D 75%,
        #8B4513 100%
    );
    flex-shrink: 0;
}

/* ==================== 内容区域 ==================== */
.book-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #FFFEF5;
    margin: 4px;
    border-radius: 4px;
    min-height: 300px;
}

/* 滚动条样式 */
.book-content::-webkit-scrollbar {
    width: 8px;
}

.book-content::-webkit-scrollbar-track {
    background: #E8D5B5;
    border-radius: 4px;
}

.book-content::-webkit-scrollbar-thumb {
    background: #A0522D;
    border-radius: 4px;
}

/* ==================== 右侧阴影 ==================== */
.book-shadow {
    width: 12px;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0.05) 50%,
        transparent 100%
    );
    flex-shrink: 0;
}

/* ==================== 页面视图 ==================== */
.page-view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page-view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 页面头部 ==================== */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #E8D5B5;
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid #A0522D;
    color: #A0522D;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: #A0522D;
    color: white;
}

/* ==================== 首页样式 ==================== */
#home-view .page-header {
    display: block;
    text-align: center;
}

.book-title {
    font-size: 2.2rem;
    color: #5C3D2E;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.75rem;
    letter-spacing: 0.1em;
}

.title-decoration {
    width: 120px;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        #8B6914 20%,
        #A0522D 50%,
        #8B6914 80%,
        transparent 100%
    );
    margin: 0 auto 0.75rem;
}

.book-subtitle {
    color: #6B4423;
    font-size: 1rem;
    font-style: italic;
}

/* ==================== 分类卡片网格 ==================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    min-height: 100px;
}

.category-card {
    display: flex;
    align-items: center;
    background: #FFFEF5;
    border: 1px solid #8B4513;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.08);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #A0522D;
}

.card-icon {
    font-size: 2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.card-content {
    flex: 1;
}

.card-title {
    font-size: 1.1rem;
    color: #5C3D2E;
    margin-bottom: 4px;
    font-weight: bold;
}

.card-desc {
    font-size: 0.85rem;
    color: #6B4423;
    line-height: 1.4;
}

.card-count {
    font-size: 0.8rem;
    color: #8B6914;
    margin-top: 6px;
    font-family: 'Noto Serif SC', 'Songti SC', 'Microsoft YaHei', sans-serif;
}

.card-arrow {
    font-size: 1.5rem;
    color: #A0522D;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.category-card:hover .card-arrow {
    opacity: 1;
}

/* ==================== 政策列表页 ==================== */
.category-title {
    font-size: 1.3rem;
    color: #5C3D2E;
    line-height: 1.3rem;
    flex: 1;
    min-width: 0;
    word-break: break-all;
    overflow-wrap: break-word;
}

.policy-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.level-filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: #FFFEF5;
    border: 1px solid #A0522D;
    color: #A0522D;
    padding: 0.4rem 0.9rem;
    border-radius: 16px;
    cursor: pointer;
    font-family: 'Noto Serif SC', 'Songti SC', 'Microsoft YaHei', sans-serif;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(160, 82, 45, 0.1);
}

.filter-btn.active {
    background: #A0522D;
    color: white;
    border-color: #A0522D;
}

.level-tag {
    display: inline-block;
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    font-weight: normal;
    font-family: 'Noto Serif SC', 'Songti SC', 'Microsoft YaHei', sans-serif;
}

.level-national {
    background: #8B4513;
    color: white;
}

.level-regional {
    background: #2E7D32;
    color: white;
}

.level-city {
    background: #1565C0;
    color: white;
}

.policy-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    background: #FFFEF5;
    border: 1px solid #E8D5B5;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.policy-item:hover {
    background: #FFFEF5;
    border-color: #A0522D;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

.policy-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #A0522D;
    margin-right: 1rem;
    min-width: 36px;
    font-family: 'Arial', 'Helvetica Neue', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

.policy-content {
    flex: 1;
}

.policy-title {
    font-size: 1rem;
    color: #5C3D2E;
    margin-bottom: 4px;
    font-weight: bold;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
    overflow-wrap: break-word;
    font-family: 'Noto Serif SC', 'Songti SC', 'Microsoft YaHei', sans-serif;
}

.policy-summary {
    font-size: 0.85rem;
    color: #6B4423;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Georgia', 'Noto Serif SC', 'Songti SC', serif;
}

.policy-arrow {
    font-size: 1.2rem;
    color: #A0522D;
    opacity: 0;
    transition: opacity 0.2s ease;
    align-self: center;
}

.policy-item:hover .policy-arrow {
    opacity: 1;
}

/* ==================== 空状态样式 ==================== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6B4423;
}

.empty-state p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.empty-state .empty-hint {
    font-size: 0.85rem;
    color: #8B6914;
    font-style: italic;
}

/* ==================== 政策详情页 ==================== */
.policy-detail-title {
    font-size: 1.1rem;
    color: #5C3D2E;
    padding-top: 0.75rem;
    line-height: 1.6;
    word-break: break-all;
    overflow-wrap: break-word;
    text-align: left;
    flex: 1;
    min-width: 0;
    font-family: SimHei, 黑体, "Noto Sans SC", sans-serif;
}

.policy-detail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 详情页底部导航 */
.detail-bottom-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 0 0.8rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e8ddd0;
}

.bottom-nav-btn {
    padding: 0.55rem 1.5rem;
    font-size: 0.9rem;
    font-family: 'SimHei', '黑体', 'Noto Sans SC', sans-serif;
    color: #fff;
    background: linear-gradient(180deg, #8B6914, #7a5c10);
    border: 1px solid #6b4f0e;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.bottom-nav-btn:hover {
    background: linear-gradient(180deg, #9c7a1c, #8B6914);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.bottom-nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.bottom-nav-btn-catalog {
    background: linear-gradient(180deg, #5C3D2E, #4a2f23);
    border-color: #3d271d;
}

.bottom-nav-btn-catalog:hover {
    background: linear-gradient(180deg, #6e4a37, #5C3D2E);
}

/* ==================== 政策全文排版样式 ==================== */
.policy-fulltext {
    font-family: 'FangSong', '仿宋', '仿宋_GB2312', 'Noto Serif SC', serif;
    font-size: 0.95rem;
    line-height: 1.9;
    color: #1a1a1a;
    padding: 0.5rem 0;
}

.policy-fulltext p {
    margin: 0;
    padding: 0;
}

/* 文号 - 居中 */
.policy-fulltext .policy-doc-number {
    text-align: center;
    margin: 0.6em 0;
    font-size: 0.95rem;
}

/* 主送机关 - 顶格，左对齐 */
.policy-fulltext .policy-recipient {
    text-align: left;
    text-indent: 0;
    margin: 0.6em 0;
    line-height: 1.9;
    font-size: 0.95rem;
    text-align: justify;
}

/* 发文单位+日期 - 右对齐 */
.policy-fulltext .policy-department {
    text-align: right;
    margin: 0.6em 0;
    padding-right: 1em;
    font-size: 0.95rem;
    white-space: pre-line;
}

/* 政策名称 - 居中 */
.policy-fulltext .policy-name-center {
    text-align: center;
    margin: 1em 0 0.5em;
    font-size: 1.1rem;
    font-family: 'SimHei', '黑体', 'Noto Sans SC', sans-serif;
}

/* 居中的正文 */
.policy-fulltext .policy-body-center {
    text-align: center;
    margin: 0.5em 0;
    font-size: 0.95rem;
}

/* 右对齐的正文 */
.policy-fulltext .policy-body-right {
    text-align: right;
    margin: 0.5em 0;
    font-size: 0.95rem;
}

/* 正文段落 - 首行缩进2字符 */
.policy-fulltext .policy-body {
    text-indent: 2em;
    margin: 0.2em 0;
    line-height: 1.9;
    font-size: 0.95rem;
    text-align: justify;
     
}


/* 章标题 - 加粗 */
.policy-fulltext .policy-chapter {
    font-weight: bold;
    margin: 1em 0 0.3em;
    font-size: 1rem;
    font-family: 'SimHei', '黑体', 'Noto Sans SC', sans-serif;
    text-align: left;
    text-indent: 2em;
}

/* 节标题 - 加粗 */
.policy-fulltext .policy-section {
    font-weight: bold;
    margin: 0.8em 0 0.3em;
    font-size: 0.95rem;
    font-family: 'SimHei', '黑体', 'Noto Sans SC', sans-serif;
    text-align: left;
    text-indent: 2em;
}

/* 子节标题 - 首行缩进 */
.policy-fulltext .policy-subsection {
    text-indent: 2em;
    margin: 0.3em 0;
    font-size: 0.95rem;
    font-weight: bold;
}

/* 编号条目 - 首行缩进 */
.policy-fulltext .policy-numbered {
    text-indent: 2em;
    margin: 0.2em 0;
    font-size: 0.95rem;
    text-align: justify;
    font-weight: bold;
}

/* 附件标签 */
.policy-fulltext .policy-attachment {
    margin: 0.8em 0 0.3em;
    font-size: 0.95rem;
    font-weight: bold;
}

/* 加粗居中标题 */
.policy-fulltext .policy-bold-header {
    text-align: center;
    font-weight: bold;
    margin: 1em 0;
    font-size: 1rem;
    font-family: 'SimHei', '黑体', 'Noto Sans SC', sans-serif;
}

/* ==================== 政策附件表格 ==================== */
.policy-fulltext {
    overflow-x: auto;
}

.policy-fulltext .policy-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 0.8em 0;
    font-size: 0.88rem;
    line-height: 1.6;
    font-family: 'Noto Serif SC', 'SimSun', '宋体', serif;
}

.policy-fulltext .policy-table th,
.policy-fulltext .policy-table td {
    border: 1px solid #C8B08C;
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}

.policy-fulltext .policy-table th {
    background: #F5EBD8;
    font-weight: bold;
    text-align: center;
    font-family: 'SimHei', '黑体', 'Noto Sans SC', sans-serif;
    white-space: nowrap;
}

.policy-fulltext .policy-table tr:nth-child(even) td {
    background: #FCF9F1;
}

/* 窄屏表格字号收缩 */
@media (max-width: 480px) {
    .policy-fulltext .policy-table {
        font-size: 0.8rem;
    }

    .policy-fulltext .policy-table th,
    .policy-fulltext .policy-table td {
        padding: 4px 6px;
    }
}

/* ==================== 政策专栏表格（WPS 手册样式：仅外边框） ==================== */
.policy-fulltext .policy-column-box {
    width: 100%;
    border-collapse: collapse;
    border: 1.5px solid #333;
    margin: 1.2em 0;
    font-size: 0.95rem;
    line-height: 1.9;
    font-family: 'Noto Serif SC', 'SimSun', '宋体', serif;
}

.policy-fulltext .policy-column-box th {
    font-weight: bold;
    text-align: center;
    padding: 8px 10px;
    font-family: 'SimHei', '黑体', 'Noto Sans SC', sans-serif;
}

.policy-fulltext .policy-column-box td {
    padding: 8px 12px 10px;
}

.policy-fulltext .policy-column-box td p {
    text-indent: 0;
    margin: 0.35em 0;
    line-height: 1.9;
    text-align: justify;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .policy-fulltext {
        font-size: 0.9rem;
    }

    .policy-fulltext .policy-name-center {
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .policy-fulltext {
        font-size: 0.85rem;
        line-height: 1.8;
    }

    .policy-fulltext .policy-name-center {
        font-size: 1rem;
    }

    .policy-fulltext .policy-body {
        text-indent: 2em;
       
    }
}

.detail-summary {
    background: rgba(218, 165, 32, 0.1);
    border-left: 3px solid #8B6914;
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #3D2914;
}

.detail-field {
    background: rgba(255, 254, 245, 0.9);
    border: 1px solid #E8D5B5;
    border-radius: 4px;
    overflow: hidden;
}

.field-label {
    background: #A0522D;
    color: white;
    padding: 0.5rem 1rem;
    font-weight: bold;
    font-size: 0.9rem;
}

.field-value {
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.8;
    color: #3D2914;
}

/* ==================== 角落装饰 ==================== */
.corner-decoration {
    position: fixed;
    width: 60px;
    height: 60px;
    opacity: 0.15;
    pointer-events: none;
}

.corner-decoration::before,
.corner-decoration::after {
    content: '';
    position: absolute;
    background: #8B4513;
}

.corner-decoration.top-left {
    top: 20px;
    left: 20px;
}

.corner-decoration.top-left::before {
    width: 30px;
    height: 2px;
    top: 0;
    left: 0;
}

.corner-decoration.top-left::after {
    width: 2px;
    height: 30px;
    top: 0;
    left: 0;
}

.corner-decoration.top-right {
    top: 20px;
    right: 20px;
}

.corner-decoration.top-right::before {
    width: 30px;
    height: 2px;
    top: 0;
    right: 0;
}

.corner-decoration.top-right::after {
    width: 2px;
    height: 30px;
    top: 0;
    right: 0;
}

.corner-decoration.bottom-left {
    bottom: 20px;
    left: 20px;
}

.corner-decoration.bottom-left::before {
    width: 30px;
    height: 2px;
    bottom: 0;
    left: 0;
}

.corner-decoration.bottom-left::after {
    width: 2px;
    height: 30px;
    bottom: 0;
    left: 0;
}

.corner-decoration.bottom-right {
    bottom: 20px;
    right: 20px;
}

.corner-decoration.bottom-right::before {
    width: 30px;
    height: 2px;
    bottom: 0;
    right: 0;
}

.corner-decoration.bottom-right::after {
    width: 2px;
    height: 30px;
    bottom: 0;
    right: 0;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    #app {
        padding: 0.5rem;
    }
    
    .book-container {
        min-height: 100vh;
        max-height: none;
        height: 100%;
    }
    
    .book-spine {
        width: 12px;
    }
    
    .book-shadow {
        display: none;
    }
    
    .book-content {
        padding: 1rem;
    }
    
    .book-title {
        font-size: 1.8rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 0.75rem;
    }
    
    .card-icon {
        font-size: 1.5rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .back-btn {
        flex-shrink: 0;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .policy-detail-title {
        font-size: 1.1rem;
    }

    .bottom-nav-btn {
        flex: 1;
        padding: 0.55rem 0.5rem;
        font-size: 0.85rem;
    }

    .detail-bottom-nav {
        gap: 0.6rem;
    }
    
    .corner-decoration {
        display: none;
    }
}

@media (max-width: 480px) {
    .book-title {
        font-size: 1.5rem;
    }
    
    .book-subtitle {
        font-size: 0.85rem;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
    
    .policy-item {
        padding: 0.75rem;
    }
    
    .policy-number {
        font-size: 1rem;
        min-width: 28px;
    }
    
    .policy-title {
        font-size: 0.9rem;
    }
    
    .policy-summary {
        font-size: 0.8rem;
    }
    
    .detail-summary,
    .field-value {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    .field-label {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}

/* ==================== 版权声明 ==================== */
.copyright {
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #6B4423;
    border-top: 1px solid #E8D5B5;
}

.copyright-content {
    max-width: 900px;
    margin: 0 auto;
}

.copyright p {
    margin: 0.25rem 0;
}

/* ==================== 打印样式 ==================== */
@media print {
    body {
        background: white;
    }
    
    .book-container {
        box-shadow: none;
    }
    
    .book-spine,
    .book-shadow,
    .book-border-top,
    .book-border-bottom,
    .corner-decoration,
    .back-btn,
    .copyright {
        display: none;
    }
    
    .book-body {
        border: 1px solid #ccc;
    }
}
