:root {
    --primary-color: #4DB6AC; /* 主题青色 */
    --bg-color: #F8F9FA;
    --text-main: #333;
    --text-sub: #888;
    --border-color: #E0E0E0;
    --card-bg: #FFFFFF;
}

/* 基础响应式设置 */
html {
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f0f2f5;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-main);
    overflow-x: hidden; /* 防止侧边栏溢出导致页面抖动 */
}

a {
    color: inherit; /* 继承父元素字体颜色 */
    text-decoration: none; /* 去掉下划线 */
}
/* PC端限制宽度 */
.app-wrapper {
    max-width: 500px;
    margin: 0 auto;
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    position: relative;
}

/* 顶部标题栏 */
.app-header {
    background: #fff;
    padding: 1rem 0;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    letter-spacing: 2px;
}

/* 搜索区域 */
.search-container {
    padding: 1rem;
    display: flex;
    gap: 0.8rem;
    background: #fff;
}

.search-bar {
    flex: 1;
    background: #F1F3F4;
    border: 1px solid transparent;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s;
}

    .search-bar:focus {
        border-color: var(--primary-color);
        background: #fff;
    }

.search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(77, 182, 172, 0.2);
}

/* 分类导航 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    padding: 1rem;
    background: #fff;
    margin-bottom: 0.5rem;
}

.nav-item {
    text-align: center;
    font-size: 0.85rem;
    color: #555;
    text-decoration: none;
    padding: 0.4rem 0;
    border-radius: 4px;
    transition: background 0.2s;
    cursor: pointer;
}

    .nav-item:active {
        background: #e8f5f3;
    }

/* 侧边栏系统样式 */
.sidebar-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 100;
    backdrop-filter: blur(2px);
}

.sidebar {
    position: fixed;
    top: 0;
    right: -80%; /* 默认隐藏 */
    width: 75%;
    max-width: 400px;
    height: 100%;
    background: #fff;
    z-index: 101;
    transition: right 0.3s cubic-bezier(0, 0, 0.2, 1);
    /* 整体滚动关键设置 */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

    .sidebar.active {
        right: 0;
    }

.sidebar-mask.active {
    display: block;
}

.sidebar-header {
    padding: 1.2rem 1rem;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-color);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 5;
}

.category-content {
    padding-bottom: 3rem;
}

/* 一级分类：仅展示名称 */
.level-1-name {
    padding: 1.2rem 1rem 0.5rem;
    font-size: 0.85rem;
    color: #999;
    font-weight: bold;
    letter-spacing: 1px;
}

/* 二级分类：网格 */
.level-2-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 0.6rem 1rem;
}

.level-2-link {
    background: #F5F7F9;
    padding: 0.8rem;
    text-align: center;
    font-size: 0.9rem;
    color: #444;
    text-decoration: none;
    border-radius: 4px;
}

/* 模块标题 */
.section-header {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    background: var(--bg-color);
}

    .section-header::before {
        content: "";
        width: 4px;
        height: 1.1rem;
        background: var(--primary-color);
        margin-right: 0.6rem;
        border-radius: 2px;
    }

/* 书籍列表卡片 */
.book-list {
    background: #fff;
    padding: 0 1rem;
}

.book-card {
    display: flex;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f1f1;
}

    .book-card:last-child {
        border-bottom: none;
    }

.book-cover {
    width: 4.5rem;
    height: 6rem;
    background: linear-gradient(135deg, #a7ffeb 0%, #4db6ac 100%);
    border-radius: 4px;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.8);
    font-size: 0.7rem;
    flex-shrink: 0;
    box-shadow: 2px 4px 8px rgba(0,0,0,0.1);
}

.book-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #222;
}

.book-meta {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-bottom: 0.2rem;
}

.book-status {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* 纯文字列表 (推荐) */
.text-list {
    background: #fff;
    padding: 0.5rem 1rem;
}

.text-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f9f9f9;
    font-size: 0.9rem;
}

    .text-row .title-wrap {
        color: #444;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 75%;
    }

    .text-row .tag {
        color: var(--primary-color);
        margin-right: 0.3rem;
    }

    .text-row .count {
        color: #bbb;
        font-size: 0.8rem;
    }

/* 底部留白 */
.footer-padding {
    height: 2rem;
    background: var(--bg-color);
}
