/* 
 * independent-pages.css
 * 合并独立页面的CSS样式：book_detail, product_detail 等
 * 创建于：2026-04-12
 */

/* ========== 1. 基础样式重置 ========== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html, body {
    width: 100%;
    overflow-x: hidden; /* 禁止页面横向滚动 */
}

/* ========== 2. 全局鼠标状态规范化（已修复！） ========== */
/* 默认所有元素箭头 */
html, body, div, span, p, section, article, header, footer {
    cursor: default;
}
/* 超链接显示手型 */
a, a * {
    cursor: pointer !important;
}
/* 按钮显示手型 */
button, input[type="button"], input[type="submit"], .btn, .btn-nav-custom {
    cursor: pointer !important;
}
/* 标签、badge 显示手型 */
span.badge, .badge {
    cursor: pointer;
}
/* 带 onclick 的任意元素显示手型 */
*[onclick] {
    cursor: pointer;
}
/* 文本输入框、搜索框、文本域显示文本符号 */
input[type="text"], input[type="search"], textarea {
    cursor: text;
}

/* 卡片 */
.card {
    cursor: pointer;
}
.card * {
    cursor: default;
}

/* ========== 3. 面包屑导航样式（book_detail 专用） ========== */
/* ========== 新增：面包屑导航样式（支持换行） ========== */
.breadcrumb-nav {
    margin: 0 0 20px 0;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 0;          /* 消除inline元素间的默认空白 */
    letter-spacing: -1px;  /* 抵消文本自身空格的视觉效果 */
    /* 允许内部元素换行 */
    word-wrap: break-word;
}
/* 恢复子元素字号，重置字符间距 */
.breadcrumb-nav a,
.breadcrumb-nav span,
.breadcrumb-nav .current {
    font-size: 14px;
    letter-spacing: 0;     /* 恢复正常字符间距 */
    display: inline-block; /* 确保间距控制生效 */
    vertical-align: middle; /* 分隔符和文本垂直对齐 */
    /* 关键：允许文本换行 */
    white-space: normal;
    word-wrap: break-word;
}
.breadcrumb-nav a {
    color: #0d6efd;
    text-decoration: none;
    /* 可选：给省份/城市名称加最大宽度，避免单行过宽 */
    max-width: 150px;
}
.breadcrumb-nav a:hover {
    text-decoration: underline;
}
.breadcrumb-nav span {
    color: #6c757d;
    margin: 0 3px; /* 分隔符间距，紧凑且无多余空格 */
    /* 分隔符不单独换行 */
    white-space: nowrap;
}
.breadcrumb-nav .current {
    color: #212529;
    font-weight: 500;
    /* 书籍名称支持换行，不限制宽度（或按需加max-width） */
    max-width: 100%;
}

/* ========== 4. 书籍详情页面专用样式 ========== */
.book-header {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.book-cover {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    height: 219px !important;
    width: auto !important;     /* 宽度自动适配，保持图片比例 */
    object-fit: cover;          /* 裁剪图片填充容器，不拉伸变形 */
    display: inline-block;      /* 配合text-center居中，避免宽度占满 */
}
.detail-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.detail-label {
    font-weight: 600;
    color: #495057;
    min-width: 100px;
    display: inline-block;
}
.price-tag {
    font-size: 1.5rem;
    font-weight: bold;
    color: #dc3545;
}
.badge-keyword {
    margin-right: 5px;
    margin-bottom: 5px;
}
.nav-button {
    margin-bottom: 8px;
    width: 100%;
}

/* ========== 5. 商品详情页面专用样式 ========== */
/* 卡片样式 */
.card {
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.card-header {
    font-weight: 600;
    padding: 0.75rem 1.25rem;
}
.card-body {
    padding: 1.25rem;
}
/* 详情内容 */
.content-detail {
    line-height: 1.8;
}
/* 核心：图片适配规则 */
.content-detail img {
    /* 通用规则：保持原始比例 */
    height: auto !important; /* 高度自动，确保比例不变 */
    display: block !important; /* 块级显示，避免 inline 间隙 */
    margin: 0 0 1rem 0 !important; /* 左对齐，底部留间距 */
    /* 关键：小图保持原尺寸，大图等比例缩小 */
    max-width: 100% !important; /* 最大宽度不超过容器（大图缩小） */
    width: auto !important; /* 宽度自动（小图不被放大） */
}
/* 诚信服务模块 */
.custom-alert {
    font-size: 1.1rem;
}

/* ========== 6. 响应式设计 ========== */
/* 移动端适配（<768px） */
@media (max-width: 767.98px) {
    /* 容器边距调整 */
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    /* 按钮适配 */
    .btn-nav-custom {
        font-size: 14px;
        padding: 6px 12px;
        width: 100%;
    }
    /* 商品卡片布局：垂直堆叠 */
    .row.g-0 {
        flex-direction: column;
    }
    .col-md-3, .col-md-9 {
        width: 100% !important;
    }
    /* 商品主图：移动端自适应 */
    .col-md-3 img {
        max-height: none !important; /* 取消高度限制，完整显示 */
    }
    /* 详情图片：严格适配屏幕 */
    .content-detail img {
        max-width: calc(100% - 20px) !important; /* 减去左右10px边距 */
    }
    /* 诚信服务模块：块级显示 */
    .custom-alert {
        display: block !important;
        padding: 10px 15px !important;
        font-size: 1rem !important;
    }
    /* 导航按钮适配 */
    .nav-button {
        width: 100%;
        min-width: 100px;
    }
}

/* PC端适配（≥768px） */
@media (min-width: 768px) {
    .btn-nav-custom {
        min-width: 100px;
    }
    .custom-alert {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 10px 20px;
    }
    .nav-button {
        width: auto;
        margin: 5px;
        min-width: 100px;
    }
}
