

    /* --- 新增: 图片自适应规则 --- */
    img {
        display: block; /* 移除图片底部可能存在的空白间隙 */
        max-width: 100%; /* 关键规则：图片的最大宽度不能超过其容器的宽度 */
        height: auto;   /* 关键规则：高度自动调整，以保持图片的原始宽高比 */
    }


    .nav-links {
        display: flex;
        gap: 1.5rem;
        margin-left: auto;
    }
    .nav-links a {
        text-decoration: none;
        color: #333;
        font-weight: 500;
        transition: color 0.3s ease;
    }

    .nav-links a:hover {
        color: #3498db;
    }


    /* --- 主内容区域布局 (宽屏) --- */
    .main-content-wrapper {
        display: flex;
        gap: 2rem;
        max-width: 1600px;
        margin: 0 auto;
        padding: 2rem;
        flex-grow: 1;
        width: 100%;
    }

    /* 左侧书籍详情容器 - 占据剩余3/4宽度 */
    .book-detail-section {
        flex: 3;
        width: 75%;
    }

    /* --- 右侧分类侧边栏 - 固定1/4宽度 --- */
    .category-sidebar {
        width: 25%;
        min-width: 280px;
        max-width: 400px;
        background-color: #fff;
        border-radius: 12px;
        padding: 1.5rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        align-self: flex-start;
        position: sticky;
        top: 100px;
        height: fit-content;
    }

    .category-title {
        font-size: 1.3rem;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid #eee;
    }

    .category-list {
        display: flex;
        flex-wrap: wrap;
        gap: 0.7rem;
    }

    /* --- 分类按钮样式为流式排列 --- */
    .category-btn {
        padding: 0.5rem 1rem;
        background-color: #ecf0f1;
        border: none;
        border-radius: 20px;
        color: #7f8c8d;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.2s ease;
        white-space: nowrap; /* 防止文字换行 */
        text-align: center;
    }

    .category-btn:hover,
    .category-btn.active {
        background-color: #3498db;
        color: #fff;
    }

    .book-detail-container {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 2.5rem;
        background-color: #fff;
        border-radius: 16px;
        padding: 2.5rem;
        box-shadow: 0 5px 20px rgba(0,0,0,0.05);
        margin-bottom: 3rem;
    }

    .book-detail-cover {
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        height: 450px;
    }

    .book-detail-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }

    .book-detail-cover:hover img {
        transform: scale(1.03);
    }
    /* --- 面包屑导航样式 --- */
    .breadcrumb ol {
      list-style: none; /* 隐藏有序列表的数字序号 */
      margin: 0;        /* 清除默认外边距 */
      padding: 0;       /* 清除默认内边距 */
      display: flex;    /* 让li横向排列（核心：一行显示） */
      align-items: center; /* 垂直居中，视觉更整齐 */
      flex-wrap: nowrap; /* 强制不换行（即使内容过长也不折行） */
    }

    /* 控制每个li的样式：横向排列、无换行 */
    .breadcrumb li {
      display: inline-flex; /* 行内弹性布局，兼容flex的同时不换行 */
      align-items: center;
      /* white-space: nowrap;  禁止li内部文字换行 */
    }

    /* 分隔符样式（可选：调整间距，避免紧贴文字） */
    .breadcrumb .separator {
      margin: 0 8px; /* 分隔符左右留间距，视觉更舒适 */
      color: #666;   /* 分隔符颜色（可选） */
    }

    /* 当前页样式（可选：区分当前项） */
    .breadcrumb li.current {
      color: #333;
      font-weight: normal; /* 可选：加粗突出当前项 */
    }

    /* 链接样式（可选：统一面包屑链接样式） */
    .breadcrumb a {
      color: #0066cc;
      text-decoration: none;
    }
    .breadcrumb a:hover {
      text-decoration: underline;
    }

    .breadcrumb li.current {
        color: #34495e;
        font-weight: 500;
    }

    .book-detail-info h1 {
        font-size: 2.2rem;
        color: #2c3e50;
        margin-bottom: 0.5rem;
    }

    .book-detail-author {
        font-size: 1.3rem;
        color: #7f8c8d;
        margin-bottom: 1.5rem;
        font-weight: 500;
    }

    .book-detail-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid #eee;
    }

    .meta-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .meta-item .label {
        font-size: 0.9rem;
        color: #95a5a6;
    }
    .meta-item .value {
        font-weight: 600;
        color: #34495e;
    }

    .book-detail-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.7rem;
        margin-bottom: 2rem;
    }

    .book-detail-tag {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 0.4rem 0.9rem;
        border-radius: 20px;
        font-size: 0.9rem;
        color: #fff;
        font-weight: 500;
    }

    /* --- 操作按钮组样式 --- */
    .action-buttons {
        display: flex;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .action-btn {
        padding: 0.8rem 1.5rem;
        border: none;
        border-radius: 8px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        flex: 1;
    }

    .read-btn {
        background-color: #3498db;
        color: #fff;
    }

    .read-btn:hover {
        background-color: #2980b9;
        transform: translateY(-2px);
    }

    .download-btn {
        background-color: #2ecc71;
        color: #fff;
    }

    .download-btn:hover {
        background-color: #27ae60;
        transform: translateY(-2px);
    }

    /* --- 模态对话框样式 --- */
    .modal {
        display: none; /* 默认隐藏 */
        position: fixed;
        z-index: 2000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    }

    .modal.active {
        display: block;
    }

    .read-modal-content {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%); /* 实现完美居中 */
        background-color: #fff;
        padding: 2rem;
        border-radius: 12px;
        width: 90%;
        max-width: 400px;
        box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
        text-align: center;
    }

    .modal-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        font-size: 1.5rem;
        font-weight: bold;
        color: #7f8c8d;
        cursor: pointer;
        transition: color 0.2s ease;
    }

    .modal-close:hover {
        color: #e74c3c;
    }

    .modal-qrcode {
        width: 180px;
        height: 180px;
        margin: 1rem auto;
        background-color: #ecf0f1;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #95a5a6;
        font-size: 0.9rem;
    }

    .modal-qrcode img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .modal-text {
        margin-bottom: 1.5rem;
        color: #34495e;
        font-size: 1rem;
    }

    .modal-countdown {
        margin-bottom: 1.5rem;
        color: #e74c3c;
        font-weight: 600;
        font-size: 1.1rem;
    }

    .modal-download-qr-btn {
        display: block;
        width: 100%;
        padding: 0.7rem;
        background-color: #f1c40f;
        color: #34495e;
        border: none;
        border-radius: 6px;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 1.5rem;
        transition: background-color 0.2s ease;
    }


    .modal-download-qr-btn:hover {
        background-color: #f39c12;
    }

    .modal-input {
        width: 100%;
        padding: 0.8rem;
        border: 1px solid #ddd;
        border-radius: 6px;
        margin-bottom: 1rem;
        font-size: 1rem;
        text-align: center;
    }

    .modal-submit-btn {
        width: 100%;
        padding: 0.8rem;
        background-color: #3498db;
        color: #fff;
        border: none;
        border-radius: 6px;
        font-weight: 600;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .modal-submit-btn:hover {
        background-color: #2980b9;
    }

    /* --- 可展开文本样式 --- */
    .book-detail-description {
        color: #34495e;
        line-height: 1.8;
        text-align: justify;
        font-size: 1.05rem;
        position: relative; /* 为渐变遮罩层定位 */
    }
    .book-detail-description p {
        margin-bottom: 1rem;
    }

    .expandable-text1 {
        max-height: 780px; /* 大约300字的高度 */
        overflow-y: auto;
    }

    .read-more-btn {
        display: block;
        margin-top: 1rem;
        color: #3498db;
        font-weight: 600;
        cursor: pointer;
        text-align: center;
        padding: 0.5rem;
        border-radius: 8px;
        transition: background-color 0.2s ease;
    }

    .read-more-btn:hover {
        background-color: #f0f7ff;
    }

    /* --- 相关推荐区域 --- */
    .related-books-section h2 {
        font-size: 1.8rem;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 1.5rem;
        border-bottom: 2px solid #3498db;
        padding-bottom: 0.5rem;
        display: inline-block;
    }

    .related-books-container {
        display: grid;
        /* 将最小宽度从 280px 改为 187px (约为 280 * 2/3) */
        grid-template-columns: repeat(auto-fit, minmax(187px, 1fr));
        gap: 1.5rem;
        width: 100%;
    }

    .book-card {
        background-color: #fff;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        transition: all 0.3s ease;
        cursor: pointer;
        position: relative;
        height: 100%;
        display: flex;
        flex-direction: column;
        border: 1px solid #eee;
        text-decoration: none;
    }

    .book-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        border-color: #3498db;
    }

    .book-cover {
        height: 200px;
        overflow: hidden;
        position: relative;
    }

    .book-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.5s ease;
    }

    .book-card:hover .book-cover img {
        transform: scale(1.08);
    }

    .book-info {
        padding: 1.2rem;
        flex-grow: 1;
        display: flex;
        flex-direction: column;
    }

    .book-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 0.5rem;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .book-author {
        color: #7f8c8d;
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }

    .book-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.85rem;
        color: #95a5a6;
        margin-top: auto;
    }

    .book-rating {
        display: flex;
        align-items: center;
        gap: 0.3rem;
    }

    .rating-star {
        color: #f1c40f;
        font-size: 1rem;
    }

    .publish-year {
        background-color: #ecf0f1;
        padding: 0.2rem 0.6rem;
        border-radius: 10px;
        font-size: 0.8rem;
    }

    /* --- 页脚样式 --- */
    .main-footer {
        text-align: center;
        padding: 2rem;
        background-color: #fff;
        color: #7f8c8d;
        font-size: 0.9rem;
        border-top: 1px solid #eee;
        margin-top: auto;
    }

    .main-footer a {
        color: #3498db;
        text-decoration: none;
        font-weight: 500;
    }

    .main-footer a:hover {
        text-decoration: underline;
    }

    /* --- 悬浮联系按钮样式 --- */
    .floating-contact-btn {
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 60px;
        height: 60px;
        background-color: #3498db;
        color: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        text-decoration: none;
        box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
        z-index: 9999;
        transition: all 0.3s ease;
    }

    .floating-contact-btn:hover {
        background-color: #2980b9;
        transform: translateY(-3px);
        box-shadow: 0 6px 20px rgba(52, 152, 219, 0.6);
    }

    /* --- 响应式设计 --- */
    @media (max-width: 1200px) {
        .main-content-wrapper {
            gap: 1.2rem;
        }
        .category-sidebar {
            min-width: 250px;
        }
    }

    @media (max-width: 992px) {
        .main-content-wrapper {
            flex-direction: column;
        }
        .book-detail-section,
        .category-sidebar {
            width: 100%;
            max-width: none;
            flex: none;
        }
        .category-sidebar {
            position: static;
            margin-top: 2rem;
        }
        .book-detail-container {
            grid-template-columns: 1fr;
            gap: 2rem;
        }
        .book-detail-cover {
            max-width: 300px;
            margin-left: auto; /* 优化：使封面居中 */
            margin-right: auto;
        }
    }

    @media (max-width: 768px) {
        .main-header {
            padding: 1rem;
        }
        .nav-links {
            display: none;
            flex-direction: column;
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            background-color: #fff;
            box-shadow: 0 5px 10px rgba(0,0,0,0.1);
            padding: 1rem;
            gap: 1rem;
            margin-left: 0;
            z-index: 999;
        }
        .nav-links.active {
            display: flex;
        }
        .menu-toggle {
            display: flex;
        }
        .search-container {
            order: 1;
            margin: 0;
            max-width: none;
        }
        .main-content-wrapper {
            padding: 1rem 0.5rem; /* 优化：减小手机端左右内边距 */
        }
        .book-detail-container {
            padding: 1.5rem;
        }
        .book-detail-info h1 {
            font-size: 1.8rem;
        }
        .action-buttons {
            flex-direction: column;
        }
    }

    @media (max-width: 480px) {
        .related-books-container,
        .book-container {
            grid-template-columns: 1fr;
        }
    }