/**
 * Product Detail Page Styles
 * 产品详情页专用样式
 */

/* ========================================
   1. Product Header
   ======================================== */
.product-header {
    max-width: 800px;
    margin: 0 auto;
}

.product-title {
    font-size: 2.5rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

/* ========================================
   2. Product Showcase
   ======================================== */
.product-showcase {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.product-showcase img {
    max-width: 100%;
    max-height: 450px;
    object-fit: contain;
    border-radius: var(--radius-lg);
}

/* ========================================
   3. Highlights Grid
   ======================================== */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    max-width: 1000px;
    margin: 0 auto;
}

.highlight-item {
    text-align: center;
    padding: var(--spacing-md);
}

.highlight-item h3 {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-xs);
}

.highlight-item p {
    font-size: 1rem;
    color: var(--color-text);
}

/* ========================================
   4. Subsection Title
   ======================================== */
.subsection-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
}

/* ========================================
   5. Detail Sections
   ======================================== */
.detail-sections {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.detail-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.detail-section.in-view {
    opacity: 1;
    transform: translateY(0);
}

.detail-section h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
}

/* ========================================
   6. Section Image Container
   ======================================== */
.section-image-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
}

.section-image-container img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
}

/* ========================================
   7. Hotspot Anchor（热点锚点 - 负责定位）
   ======================================== */
.hotspot-anchor {
    position: absolute;
    z-index: 10;
    /* 使用 transform 使热点圆点中心对齐到坐标点 */
    transform: translate(-50%, -50%);
    /* 初始隐藏，scroll into view 时显示 */
    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Scroll into view 时显示 */
.detail-section.in-view .hotspot-anchor {
    opacity: 1;
}

/* 动画延迟 */
.detail-section.in-view .hotspot-anchor:nth-child(2) { transition-delay: 0.3s; }
.detail-section.in-view .hotspot-anchor:nth-child(3) { transition-delay: 0.5s; }
.detail-section.in-view .hotspot-anchor:nth-child(4) { transition-delay: 0.7s; }
.detail-section.in-view .hotspot-anchor:nth-child(5) { transition-delay: 0.9s; }

/* ========================================
   8. Hotspot Dot（热点圆点）
   ======================================== */
.hotspot-dot {
    display: block;
    width: 14px;
    height: 14px;
    background: var(--color-primary);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ========================================
   9. Hotspot Label（热点标签 - 负责展开方向）
   ======================================== */
.hotspot-label {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* 引导线 */
.hotspot-line {
    width: 40px;
    height: 2px;
    background: var(--color-primary);
    flex-shrink: 0;
}

/* 热点文字 */
.hotspot-text {
    background: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

/* ========================================
   10. Direction Support（8 个方向支持 - 拼音缩写）
   方向命名：z=左, y=右, s=上, x=下
   45度组合：zs/sz=左上, ys/sy=右上, zx/xz=左下, yx/xy=右下
   ======================================== */

/* 向右展开（默认）→ y=右 */
.hotspot-label,
.hotspot-label.y {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 4px;
    flex-direction: row;
}

/* 向左展开 ← z=左 */
.hotspot-label.z {
    right: 100%;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 4px;
    flex-direction: row-reverse;
}

/* 向下展开 ↓ x=下 */
.hotspot-label.x {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    flex-direction: column;
}
.hotspot-label.x .hotspot-line {
    width: 2px;
    height: 30px;
}

/* 向上展开 ↑ s=上 */
.hotspot-label.s {
    bottom: 100%;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 4px;
    flex-direction: column-reverse;
}
.hotspot-label.s .hotspot-line {
    width: 2px;
    height: 30px;
}

/* 右上展开 ↗ ys/sy=右上 */
.hotspot-label.ys,
.hotspot-label.sy {
    left: 100%;
    bottom: 100%;
    top: auto;
    transform: none;
    margin-left: 4px;
    margin-bottom: -4px;
    flex-direction: row;
}
.hotspot-label.ys .hotspot-line,
.hotspot-label.sy .hotspot-line {
    width: 28px;
    height: 2px;
    transform: rotate(-30deg);
    transform-origin: left center;
}

/* 右下展开 ↘ yx/xy=右下 */
.hotspot-label.yx,
.hotspot-label.xy {
    left: 100%;
    top: 100%;
    transform: none;
    margin-left: 4px;
    margin-top: -4px;
    flex-direction: row;
}
.hotspot-label.yx .hotspot-line,
.hotspot-label.xy .hotspot-line {
    width: 28px;
    height: 2px;
    transform: rotate(30deg);
    transform-origin: left center;
}

/* 左上展开 ↖ zs/sz=左上 */
.hotspot-label.zs,
.hotspot-label.sz {
    right: 100%;
    left: auto;
    bottom: 100%;
    top: auto;
    transform: none;
    margin-right: 4px;
    margin-bottom: -4px;
    flex-direction: row-reverse;
}
.hotspot-label.zs .hotspot-line,
.hotspot-label.sz .hotspot-line {
    width: 28px;
    height: 2px;
    transform: rotate(30deg);
    transform-origin: right center;
}

/* 左下展开 ↙ zx/xz=左下 */
.hotspot-label.zx,
.hotspot-label.xz {
    right: 100%;
    left: auto;
    top: 100%;
    transform: none;
    margin-right: 4px;
    margin-top: -4px;
    flex-direction: row-reverse;
}
.hotspot-label.zx .hotspot-line,
.hotspot-label.xz .hotspot-line {
    width: 28px;
    height: 2px;
    transform: rotate(-30deg);
    transform-origin: right center;
}

/* ========================================
   11. Compatibility Cards
   ======================================== */
.compatibility-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition-base);
}

.compatibility-card:hover {
    transform: translateY(-4px);
}

.compatibility-card img {
    width: 100%;
    max-width: 120px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    margin-bottom: var(--spacing-xs);
    border-radius: var(--radius-md);
    background: white;
}

.compatibility-card span {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
}

/* ========================================
   12. Responsive
   ======================================== */
@media (max-width: 768px) {
    .product-title {
        font-size: 1.75rem;
    }
    
    .product-showcase {
        padding: var(--spacing-sm);
    }
    
    .product-showcase img {
        max-height: 300px;
    }
    
    .detail-sections {
        gap: var(--spacing-lg);
    }
    
    .detail-section h2 {
        font-size: 1.25rem;
    }
    
    .highlights-grid {
        grid-template-columns: 1fr;
    }
    
    /* 热点缩小 */
    .hotspot-dot {
        width: 10px;
        height: 10px;
        border-width: 2px;
    }
    
    .hotspot-line {
        width: 15px;
    }
    
    .hotspot-text {
        padding: 4px 8px;
        font-size: 8.5px;
        /* 移除 max-width 限制，保持单行显示 */
        white-space: nowrap;
    }
    
    .hotspot-label {
        gap: 3px;
    }
    
    /* 斜向引导线缩短 */
    .hotspot-label.ys .hotspot-line,
    .hotspot-label.sy .hotspot-line,
    .hotspot-label.yx .hotspot-line,
    .hotspot-label.xy .hotspot-line,
    .hotspot-label.zs .hotspot-line,
    .hotspot-label.sz .hotspot-line,
    .hotspot-label.zx .hotspot-line,
    .hotspot-label.xz .hotspot-line {
        width: 12px;
    }
    
    /* 垂直方向引导线缩短 */
    .hotspot-label.s .hotspot-line,
    .hotspot-label.x .hotspot-line {
        height: 15px;
    }
}

/* 中等屏幕 */
@media (max-width: 1024px) and (min-width: 769px) {
    .hotspot-line {
        width: 25px;
    }
    
    .hotspot-text {
        padding: 6px 10px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .hotspot-dot {
        width: 12px;
        height: 12px;
    }
}

/* 带警告内容的 tagline */
.hotspot-text .warning {
    color: var(--color-warning);
    font-weight: var(--font-weight-semibold);
    font-size:0.9em;
}