/* ============================================================
   详情页样式 - 产品详情/新闻详情 (原创)
   ============================================================ */

/* ---------- 产品详情布局 ---------- */
.detail-wrap {
    padding: 40px 0 70px;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

/* 产品图廊 */
.gallery .gallery-main {
    width: 100%;
    height: 460px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f7f6;
    margin-bottom: 14px;
    position: relative;
}

.gallery .gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

.gallery .gallery-main .gm-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    z-index: 2;
    transition: var(--transition);
}

.gallery .gallery-main .gm-arrow:hover {
    background: var(--theme-color);
}

.gallery .gallery-main .gm-prev { left: 14px; }
.gallery .gallery-main .gm-next { right: 14px; }

.gallery-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gallery-thumbs .gt-item {
    width: 80px;
    height: 80px;
    border: 2px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    background: #fff;
}

.gallery-thumbs .gt-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbs .gt-item.active,
.gallery-thumbs .gt-item:hover {
    border-color: var(--theme-color);
}

/* 产品信息 */
.pd-info .pd-cat {
    font-size: calc(var(--font-ratio) * 13px);
    color: var(--theme-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.pd-info .pd-title {
    font-size: calc(var(--font-ratio) * 28px);
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    line-height: 1.3;
}

.pd-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 18px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 22px;
}

.pd-price .price-label {
    font-size: calc(var(--font-ratio) * 14px);
    color: var(--text-mute);
}

.pd-price .price-value {
    font-size: calc(var(--font-ratio) * 30px);
    font-weight: 700;
    color: var(--theme-color);
}

.pd-price .price-currency {
    font-size: calc(var(--font-ratio) * 18px);
    color: var(--theme-color);
    font-weight: 600;
}

.pd-params {
    margin-bottom: 24px;
}

.pd-params .param-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
    font-size: calc(var(--font-ratio) * 14px);
}

.pd-params .param-row .param-name {
    width: 120px;
    color: var(--text-mute);
    flex-shrink: 0;
}

.pd-params .param-row .param-val {
    color: var(--text-main);
    font-weight: 500;
}

.pd-quantity {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.pd-quantity .qty-label {
    font-size: calc(var(--font-ratio) * 14px);
    color: var(--text-sub);
}

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.qty-control button {
    width: 38px;
    height: 38px;
    font-size: 18px;
    color: var(--text-sub);
    background: #f5f7f6;
    transition: var(--transition);
}

.qty-control button:hover {
    background: var(--theme-color);
    color: #fff;
}

.qty-control input {
    width: 56px;
    height: 38px;
    text-align: center;
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    font-size: 15px;
}

.pd-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* ---------- 详情 Tab 区 ---------- */
.detail-tabs {
    margin-top: 20px;
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 30px;
}

.tab-nav button {
    padding: 14px 30px;
    font-size: calc(var(--font-ratio) * 16px);
    font-weight: 600;
    color: var(--text-sub);
    position: relative;
    transition: var(--transition);
}

.tab-nav button::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--theme-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tab-nav button.active {
    color: var(--theme-color);
}

.tab-nav button.active::after {
    transform: scaleX(1);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-panel.active {
    display: block;
}

.tab-content {
    font-size: calc(var(--font-ratio) * 15px);
    line-height: 1.9;
    color: var(--text-sub);
}

.tab-content p {
    margin-bottom: 16px;
}

.tab-content h3 {
    font-size: calc(var(--font-ratio) * 20px);
    color: var(--text-main);
    margin: 24px 0 12px;
    font-weight: 700;
}

.tab-content ul {
    margin: 12px 0 16px 18px;
}

.tab-content ul li {
    list-style: disc;
    margin-bottom: 8px;
}

/* 参数表 (网格) */
.spec-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.spec-item {
    padding: 20px 22px;
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.spec-item:nth-child(3n) {
    border-right: none;
}

.spec-item .spec-name {
    font-size: calc(var(--font-ratio) * 13px);
    color: var(--text-mute);
    margin-bottom: 6px;
}

.spec-item .spec-val {
    font-size: calc(var(--font-ratio) * 15px);
    color: var(--text-main);
    font-weight: 600;
}

/* ---------- 上下页导航 ---------- */
.prev-next {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 40px 0;
    padding-top: 30px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
}

.pn-item {
    flex: 1;
    min-width: 240px;
    padding: 18px 22px;
    background: var(--bg-light);
    border-radius: 6px;
    transition: var(--transition);
}

.pn-item:hover {
    background: var(--theme-color-light);
}

.pn-item .pn-label {
    font-size: calc(var(--font-ratio) * 12px);
    color: var(--text-mute);
    margin-bottom: 4px;
}

.pn-item .pn-title {
    font-size: calc(var(--font-ratio) * 15px);
    color: var(--text-main);
    font-weight: 600;
}

.pn-item:hover .pn-title {
    color: var(--theme-color);
}

.pn-item.next {
    text-align: right;
}

/* ---------- 新闻详情 ---------- */
.news-detail-wrap {
    padding: 40px 0 70px;
}

.news-detail {
    max-width: 860px;
    margin: 0 auto;
}

.news-detail .nd-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
    color: var(--text-mute);
    font-size: calc(var(--font-ratio) * 13px);
}

.news-detail .nd-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.news-detail .nd-meta img {
    width: 15px;
    height: 15px;
    filter: brightness(0) opacity(0.5);
}

.news-detail .nd-title {
    font-size: calc(var(--font-ratio) * 30px);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    margin-bottom: 20px;
}

.news-detail .nd-banner {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
}

.news-detail .nd-content {
    font-size: calc(var(--font-ratio) * 16px);
    line-height: 2;
    color: var(--text-sub);
}

.news-detail .nd-content p {
    margin-bottom: 20px;
}

.news-detail .nd-content h3 {
    font-size: calc(var(--font-ratio) * 22px);
    color: var(--text-main);
    margin: 28px 0 14px;
    font-weight: 700;
}

.news-detail .nd-content blockquote {
    border-left: 4px solid var(--theme-color);
    padding: 14px 22px;
    background: var(--theme-color-light);
    border-radius: 0 6px 6px 0;
    margin: 22px 0;
    color: var(--text-main);
    font-style: italic;
}

/* ---------- 响应式 ---------- */
@media screen and (max-width: 992px) {
    .product-detail { grid-template-columns: 1fr; gap: 30px; }
    .spec-grid { grid-template-columns: repeat(2, 1fr); }
    .spec-item:nth-child(3n) { border-right: 1px solid #eee; }
    .spec-item:nth-child(2n) { border-right: none; }
}

@media screen and (max-width: 768px) {
    .gallery .gallery-main { height: 320px; }
    .pd-info .pd-title { font-size: 22px; }
    .pd-price .price-value { font-size: 24px; }
    .spec-grid { grid-template-columns: 1fr; }
    .spec-item { border-right: none !important; }
    .tab-nav { overflow-x: auto; }
    .tab-nav button { padding: 12px 18px; white-space: nowrap; font-size: 14px; }
    .prev-next { flex-direction: column; }
    .pn-item.next { text-align: left; }
    .news-detail .nd-title { font-size: 22px; }
    .news-detail .nd-banner { height: 240px; }
    .news-detail .nd-content { font-size: 15px; }
}
