@CHARSET "UTF-8";
/* ============================================================
   ChemCMS 前台产品展示 - 公共样式
   适用模板: chem/list.html, chem/search.html, chem/product.html
   依赖: Bootstrap 3
   ============================================================ */

/* ---------- 产品卡片网格（列表页 / 搜索页共用） ----------
   桌面端 chem-grid 不再负 margin 外溢，避免卡片左侧越界被切；
   卡片间距由 chem-grid-item 的 padding: 0 8px 自然形成 */
.chem-grid {
    margin: 0;
}

.chem-grid-item {
    padding: 0 8px;
    margin-bottom: 16px;
}

.chem-card {
    display: block;
    height: 100%;
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    color: #333;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.chem-card:hover,
.chem-card:focus {
    border-color: #337ab7;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .10);
    transform: translateY(-2px);
    text-decoration: none;
    color: #333;
}

/* 结构图区域：固定高度，图片按比例缩放居中，避免不同尺寸图撑破布局 */
.chem-card-thumb {
    height: 150px;
    padding: 10px;
    background: #fafbfc;
    border-bottom: 1px solid #f0f0f0;
    text-align: center;
    overflow: hidden;
}

.chem-card-thumb img {
    max-width: 100%;
    max-height: 130px;
    width: auto;
    height: auto;
    display: inline-block;
    vertical-align: middle;
}

.chem-card-body {
    padding: 10px 12px 12px;
}

/* 产品名：最多两行，超出省略 */
.chem-card-name {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    color: #222;
}

.chem-card-name-en {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.3;
    color: #8a9099;
    height: 1.3em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.chem-card-cas {
    font-size: 12px;
    color: #6b7280;
    font-family: Consolas, Monaco, "Courier New", monospace;
}

.chem-card-cas b {
    color: #8a9099;
    font-weight: normal;
    font-family: inherit;
}

/* ---------- 结果统计条 ---------- */
.chem-result-bar {
    margin: 0 0 14px;
    padding: 8px 12px;
    background: #f6f8fa;
    border: 1px solid #eef1f4;
    border-radius: 4px;
    font-size: 13px;
    color: #5b6673;
}

.chem-result-bar strong {
    color: #d9534f;
    font-size: 15px;
    padding: 0 2px;
}

/* ---------- 空状态 ---------- */
.chem-empty {
    padding: 60px 20px;
    text-align: center;
    color: #8a9099;
    background: #fff;
    border: 1px dashed #dfe3e8;
    border-radius: 4px;
}

.chem-empty .fa {
    font-size: 42px;
    color: #d6dbe0;
    margin-bottom: 14px;
}

.chem-empty p {
    margin: 0;
    font-size: 14px;
}

.chem-empty .hint {
    margin-top: 8px;
    font-size: 13px;
    color: #a8b0b8;
}

/* ---------- 侧边栏分类导航 ---------- */
.chem-side-box {
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 4px;
    margin-bottom: 16px;
}

.chem-side-box .headtitle {
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.chem-side-box .headtitle h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.chem-cat-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.chem-cat-list li a {
    display: block;
    padding: 7px 14px;
    color: #5b6673;
    font-size: 13px;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.chem-cat-list li a:hover {
    background: #f6f8fa;
    color: #337ab7;
    text-decoration: none;
}

.chem-cat-list li a.active {
    border-left-color: #337ab7;
    background: #f0f7fc;
    color: #337ab7;
    font-weight: 600;
}

.chem-cat-list .badge {
    background: #eef1f4;
    color: #8a9099;
    font-weight: normal;
    font-size: 11px;
}

/* ---------- 侧栏分类树（层级折叠/展开） ---------- */
.chem-cat-tree {
    /* 列表项允许子元素溢出也能正确显示过渡 */
    overflow: hidden;
}

.chem-cat-tree .chem-cat-row {
    display: flex;
    align-items: stretch;
    position: relative;
    margin: 1px 6px;
    border-radius: 4px;
    transition: background-color .15s ease;
}

.chem-cat-tree .chem-cat-row:hover {
    background: #f6f8fa;
}

.chem-cat-tree li.current > .chem-cat-row {
    background: #f0f7fc;
}

.chem-cat-tree .chem-cat-row a {
    flex: 1;
    min-width: 0;
    /* 去掉 a 标签的左 border，避免和 toggle 视觉冲突 */
    border-left: 0;
}

.chem-cat-tree .chem-cat-row a:hover {
    background: transparent;
}

/* 箭头按钮：更大、更醒目 */
.chem-cat-tree .chem-cat-toggle,
.chem-cat-tree .chem-cat-toggle-placeholder {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    align-self: center;
    margin-left: 4px;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    color: #b6bcc4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    border-radius: 4px;
    transition: background-color .15s ease, color .15s ease;
}

.chem-cat-tree .chem-cat-toggle:hover {
    background: #eef1f4;
    color: #1e9fd8;
}

.chem-cat-tree .chem-cat-toggle:focus {
    background: #eef1f4;
    color: #1e9fd8;
}

.chem-cat-tree .chem-cat-toggle:active {
    background: #d8e9f3;
}

.chem-cat-tree .chem-cat-toggle i {
    font-size: 14px;
    line-height: 1;
    transition: transform .2s ease;
    transform: rotate(-90deg);
}

/* 展开状态：箭头朝下 + 按钮高亮 */
.chem-cat-tree .chem-cat-node.open > .chem-cat-row .chem-cat-toggle {
    background: rgba(30, 159, 216, .10);
    color: #1e9fd8;
}

.chem-cat-tree .chem-cat-node.open > .chem-cat-row .chem-cat-toggle i {
    transform: rotate(0deg);
}

/* 子分类列表：默认折叠 + 平滑动画 */
.chem-cat-tree .chem-cat-children {
    list-style: none;
    margin: 0;
    padding: 0 0 2px;
    /* 折叠 */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .25s ease, opacity .2s ease;
}

.chem-cat-tree .chem-cat-node.open > .chem-cat-children {
    max-height: 1200px; /* 足够大, 子分类一般不到 50 条 */
    opacity: 1;
}

.chem-cat-tree .chem-cat-children li a {
    padding-left: 44px;
    font-size: 12px;
}

/* 子分类 hover：左边小竖线提示层级 */
.chem-cat-tree .chem-cat-children li a {
    position: relative;
}

.chem-cat-tree .chem-cat-children li a::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 0;
    background: #1e9fd8;
    transition: height .15s ease;
}

.chem-cat-tree .chem-cat-children li a:hover::before,
.chem-cat-tree .chem-cat-children li a.active::before {
    height: 14px;
}

/* ---------- 详情页：产品概要 ---------- */
.chem-detail-head {
    padding: 16px;
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 4px;
}

.chem-detail-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 600;
    color: #222;
    line-height: 1.35;
}

.chem-detail-subtitle {
    margin: 0 0 10px;
    font-size: 13px;
    color: #8a9099;
}

.chem-detail-meta {
    font-size: 12px;
    color: #a8b0b8;
}

.chem-detail-figure {
    padding: 10px;
    background: #fafbfc;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 12px;
}

.chem-detail-figure img {
    max-width: 100%;
    height: auto;
}

/* 属性表 */
.chem-props {
    width: 100%;
    font-size: 13px;
}

.chem-props tr td {
    padding: 7px 8px;
    border-bottom: 1px dashed #f0f0f0;
    vertical-align: top;
    word-break: break-all;
}

.chem-props tr:last-child td {
    border-bottom: none;
}

.chem-props td.prop-label {
    width: 88px;
    color: #8a9099;
    white-space: nowrap;
}

.chem-props td.prop-value {
    color: #333;
}

/* ---------- 规格表 ---------- */
.chem-spec-table thead th {
    background: #f6f8fa;
    color: #5b6673;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.chem-spec-table tbody td {
    font-size: 13px;
    vertical-align: middle;
}

.chem-price {
    color: #d9534f;
    font-weight: 600;
    white-space: nowrap;
}

.chem-price-empty {
    color: #a8b0b8;
    font-size: 12px;
}

.chem-badge-stock {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: #e8f5e9;
    color: #2e7d32;
}

.chem-badge-lead {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: #fff8e1;
    color: #f57c00;
}

/* ---------- 富文本内容区 ---------- */
.chem-content {
    padding: 14px 0;
    line-height: 1.8;
    font-size: 14px;
    color: #444;
    word-wrap: break-word;
}

.chem-content img {
    max-width: 100%;
    height: auto !important;
}

/* ---------- 响应式微调 ---------- */
@media (max-width: 767px) {
    .chem-card-thumb {
        height: 120px;
    }

    .chem-card-thumb img {
        max-height: 100px;
    }

    .chem-detail-title {
        font-size: 18px;
    }

    .chem-grid {
        margin: 0 -5px;
    }

    .chem-grid-item {
        padding: 0 5px;
        margin-bottom: 10px;
    }
}
