/* ============================================================
 * 产品详情页样式 — Spray Dryer Theme
 * 来源：single-product.php 内联 <style> 提取
 * ============================================================ */

/* === 锚点选项卡导航 === */
#product-tabs-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255,255,255,0.97);
    border-bottom: 1px solid rgba(226,232,240,0.6);
    box-shadow: 0 1px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s;
}
#product-tabs-nav.is-pinned {
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.tab-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.25s, border-color 0.25s;
    outline: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.tab-btn:hover { color: #334155; }
.tab-btn:focus-visible { background: #f0f7ff; border-radius: 0.5rem 0.5rem 0 0; }
.tab-btn .tab-icon { font-size: 0.9rem; transition: color 0.25s; }
.tab-btn.active {
    color: #0057b8;
    border-bottom-color: #0057b8;
}
.tab-btn.active .tab-icon { color: #0057b8; }
/* 活跃指示器 - 底部光晕条 */
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 20%; right: 20%;
    height: 2px;
    background: linear-gradient(90deg, #0057b8, #3b82f6, #0057b8);
    border-radius: 2px;
}
@media (min-width: 768px) {
    .tab-btn { padding: 1rem 1.75rem; font-size: 0.9375rem; }
}

/* === 选项卡面板 === */
.tab-panel {
    display: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.tab-panel.is-visible {
    display: block;
    animation: tabFadeIn 0.45s ease both;
}
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

/* === 移动端标签栏横向滚动 === */
.tab-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.tab-scroll-container::-webkit-scrollbar { display: none; }
.tab-scroll-container::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
    pointer-events: none;
}

/* === FAQ 折叠动画 - 丝滑 grid 版（零 max-height 卡顿） === */
.faq-item .faq-content {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: grid-template-rows;
}
.faq-item .faq-content > div {
    overflow: hidden;
}
.faq-item .faq-content.faq-collapsed {
    grid-template-rows: 0fr;
}
.faq-item .faq-toggle {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.faq-item .faq-toggle i {
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.faq-item .faq-toggle i.rotate-180 {
    transform: rotate(180deg);
}


/* === 参数表格：outline 外框 + 单元格网格线 === */
.spec-table,
.content-extracted-tables table {
    border-collapse: collapse;
    outline: 1px solid #334155;
    background-color: #ffffff !important;
}
/* 只在相邻 cell 之间画网格线，外缘由 outline 接管 */
.spec-table th + th,
.spec-table th + td,
.spec-table td + th,
.spec-table td + td,
.content-extracted-tables th + th,
.content-extracted-tables th + td,
.content-extracted-tables td + th,
.content-extracted-tables td + td {
    border-left: 1px solid #475569 !important;
}
.spec-table tr + tr th,
.spec-table tr + tr td,
.content-extracted-tables tr + tr th,
.content-extracted-tables tr + tr td {
    border-top: 1px solid #475569 !important;
}
.spec-table thead th,
.content-extracted-tables thead th {
    background-color: #f1f5f9 !important;
}
/* 偶数行浅灰底色——恢复斑马纹 */
.spec-table tbody tr:nth-child(even) td,
.content-extracted-tables tbody tr:nth-child(even) td {
    background-color: #f8fafc !important;
}
/* 悬停高亮 */
.spec-table tbody tr:hover td,
.content-extracted-tables tbody tr:hover td {
    background-color: #e8f0fe !important;
}

/* === 参数表格全局抗锯齿（防止手机端文字模糊） === */
.spec-table,
.spec-table th,
.spec-table td {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === 手机端：所有表格宽度 100%，严格不超出屏幕 === */
@media (max-width: 640px) {
    .spec-table-wrap,
    .content-extracted-tables {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100vw;
    }
    .spec-table,
    .content-extracted-tables table {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .spec-table th,
    .spec-table td,
    .content-extracted-tables th,
    .content-extracted-tables td {
        white-space: normal !important;
        overflow-wrap: anywhere;
        word-break: break-word;
        padding: 8px 8px !important;
        font-size: 0.75rem;
        min-width: 0 !important;
    }
    .spec-table .spec-sr {
        width: 32px;
        min-width: 32px;
        text-align: center;
    }
    .spec-table .spec-key {
        width: 40%;
    }
}

/* ============================================================
 * 产品详情区域 — 表格美化
 * ============================================================ */
.product-detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.875rem;
    line-height: 1.6;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.product-detail-content thead {
    background: linear-gradient(135deg, #0057b8, #006edb);
}
.product-detail-content thead th {
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.product-detail-content tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.15s;
}
.product-detail-content tbody tr:nth-child(even) {
    background-color: #f8fafc;
}
.product-detail-content tbody tr:hover {
    background-color: #eff6ff;
}
.product-detail-content tbody td {
    padding: 0.7rem 1rem;
    color: #475569;
    vertical-align: top;
}
.product-detail-content tbody td:first-child {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    width: 25%;
    min-width: 100px;
}
.product-detail-content tbody td:not(:first-child) {
    color: #475569;
}
/* 移动端表格横向滚动 */
@media (max-width: 640px) {
    .product-detail-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .product-detail-content thead th,
    .product-detail-content tbody td {
        padding: 0.6rem 0.75rem;
    }
}
/* 普通段落样式增强 */
.product-detail-content p {
    margin-bottom: 1em;
    line-height: 1.75;
}
.product-detail-content h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 1.5em 0 0.75em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #e2e8f0;
}
.product-detail-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin: 1.25em 0 0.5em;
}
.product-detail-content ul, .product-detail-content ol {
    padding-left: 1.5em;
    margin: 0.75em 0;
}
.product-detail-content ul li, .product-detail-content ol li {
    margin-bottom: 0.35em;
}
.product-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1em 0;
}
.product-detail-content blockquote {
    border-left: 4px solid #0057b8;
    padding: 0.5em 1em;
    margin: 1em 0;
    background: #f0f7ff;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #334155;
}

/* 技术参数区 — 从正文提取的表格（与产品详情区一致的美化） */
.content-extracted-tables table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5em 0;
    font-size: 0.9rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.content-extracted-tables thead {
    background: linear-gradient(135deg, #0057b8, #006edb);
}
.content-extracted-tables thead th {
    color: #fff;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.content-extracted-tables tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.15s;
}
.content-extracted-tables tbody tr:nth-child(even) {
    background-color: #f8fafc;
}
.content-extracted-tables tbody tr:hover {
    background-color: #eff6ff;
}
.content-extracted-tables tbody td {
    padding: 0.75rem 1rem;
    color: #475569;
    vertical-align: top;
}
.content-extracted-tables tbody td:first-child {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    width: 25%;
    min-width: 100px;
}
.content-extracted-tables tbody td:not(:first-child) {
    color: #475569;
}
@media (max-width: 640px) {
    .content-extracted-tables table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .content-extracted-tables thead th,
    .content-extracted-tables tbody td {
        padding: 0.6rem 0.75rem;
    }
}
