/**
 * 样音详情页样式 - 专业音频平台风格
 * 左右分栏布局 - 2026重设计版 V2
 */

/* ===== 容器布局 ===== */
.sound-detail-container {
    max-width: 1300px;
    width: 100%;
    min-height: calc(100vh - 160px);
    margin: 0 auto;
    padding: 23px 23px 80px;
    box-sizing: border-box;
    overflow: visible;
}

/*
 * 左右分栏：左侧 1fr 随容器变宽自适应；右侧固定 696px（两列 340px 卡片 + 间距），避免右侧栏内留白。
 */
.sound-detail-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 696px;
    gap: 24px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
    overflow: visible !important;
}


/* ===== 左侧：样音详情 ===== */
.sound-detail-left {
    background: transparent;
    padding: 0;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* 左侧标题栏：与右侧 .recommend-header 同高、同对齐，保证两栏标题等高 */
.detail-left-header {
    display: flex;
    align-items: center;
    min-height: 38px; /* 与右侧 .recommend-header 一致 */
    margin-bottom: 20px;
    box-sizing: border-box;
}

.detail-page-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin: 0;
    line-height: 1.3;
    box-sizing: border-box;
}

/* ===== 标题区域 - 隐藏（播放器卡片已有标题） ===== */
.detail-header {
    display: none;
}

.detail-title {
    display: none;
}

/* ===== 样音卡片包装器 - 主视觉区域 ===== */
.sample-card-wrapper {
    margin-bottom: 32px;
    min-height: 180px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

/* 主卡片外观与全站 components/sample_card.css 一致，此处不再覆盖边框/圆角/阴影/悬停 */

/* ===== 样音档案信息 - 现代卡片布局 ===== */
.detail-info-section {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.section-title {
    font-size: 15px;
    font-weight: 600;
    color: #999;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.section-title::before {
    display: none;
}

/* 档案信息网格 - 卡片式横向布局 */
.info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* 单个信息项 - 独立卡片 */
.info-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
    background: #f7f8fa;
    border-radius: 12px;
    border: none;
    transition: all 0.2s ease;
    gap: 6px;
    min-width: 120px;
    flex: 1;
    max-width: 200px;
}

.info-item:hover {
    background: #f0f2f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.info-label {
    font-size: 11px;
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 15px;
    color: #1a1a1a;
    font-weight: 600;
    line-height: 1.3;
}

.info-value a {
    color: #1a73e8;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 15px;
}

.info-value a:hover {
    color: #1557b0;
}

/* ===== 右侧：推荐样音（与网格第二列同宽 696px，无右侧留白） ===== */
.sound-detail-right {
    width: 100%;
    min-width: 0;
    position: relative;
}

/* 🔧 隐藏右侧区域可能出现的滚动条 */
.sound-detail-right,
.sound-detail-right > .recommend-header,
.sound-detail-right > .recommend-list {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
.sound-detail-right::-webkit-scrollbar,
.sound-detail-right > .recommend-header::-webkit-scrollbar,
.sound-detail-right > .recommend-list::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
    width: 0;
    height: 0;
}

.recommend-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px; /* 与左侧 .detail-left-header 一致，保证两栏标题等高 */
    margin-bottom: 20px;
}

.recommend-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin: 0;
}

.change-batch-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.change-batch-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #111;
}

.change-batch-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.change-batch-btn:hover svg {
    transform: rotate(180deg);
}

/* 换一批按钮加载状态 - 柔和动画 */
.change-batch-btn.is-loading {
    pointer-events: none;
    opacity: 0.8;
}

.change-batch-btn.is-loading svg {
    animation: btnSpin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

.recommend-list {
    display: grid;
    /* 与原先单列时侧栏 340px 同宽，两列固定 340px+gap+340px */
    grid-template-columns: repeat(2, 340px);
    gap: 16px;
    width: 100%;
    max-width: 100%;
    min-height: 400px; /* 保持固定最小高度，防止布局跳动 */
    position: relative;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    box-sizing: border-box;
}

/* 加载中占位占满整行，避免落在单格里 */
.recommend-list .recommend-loading {
    grid-column: 1 / -1;
}

/* 推荐列表淡出状态 - 更柔和 */
.recommend-list.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 推荐列表淡入动画 - 纯透明度渐变，更柔和 */
.recommend-list.fade-in {
    animation: recommendFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes recommendFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 推荐区样音卡与全站 sample_card 一致（不再单独写灰边/旧阴影） */

/* 加载状态 */
.recommend-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #999;
}

.loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid #eee;
    border-top-color: #111;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 响应式设计 ===== */
@media (max-width: 1100px) {
    .sound-detail-wrapper {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .sound-detail-left {
        max-width: none;
    }
    
    .sound-detail-right {
        position: static;
    }

    /* 窄屏恢复单列推荐，卡片仍占满推荐区宽度（等同原 340px 一栏时的阅读宽度） */
    .recommend-list {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .sound-detail-container {
        padding: 32px 16px;
    }
    
    /* 手机端标题居中 */
    .detail-left-header {
        display: flex;
        align-items: center;
        min-height: 38px;
        margin-bottom: 15px;
        box-sizing: border-box;
        justify-content: center;
    }
    
    .detail-page-title {
        text-align: center;
        font-size: 23px;
    }
    
    .section-title {
        font-size: 13px;
        margin-bottom: 14px;
    }
    
    /* 移动端两列 */
    .info-grid {
        gap: 10px;
    }
    
    .info-item {
        padding: 12px 14px;
        min-width: 100px;
        max-width: none;
        flex: 1 1 calc(50% - 5px);
    }
    
    .info-label {
        font-size: 10px;
    }
    
    .info-value {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .sound-detail-container {
        padding: 2px 12px;
    }
    
    .info-grid {
        gap: 8px;
    }
    
    .info-item {
        padding: 10px 12px;
        border-radius: 10px;
        flex: 1 1 calc(50% - 4px);
    }
    
    .info-item:hover {
        transform: none;
    }
}

/* =============================================================================
 * 暗黑模式：样音卡由 dark-mode-unified.css 中 .sound-detail-page .sample-card-item 统一
 * ============================================================================= */

html.dark-mode .detail-page-title,
body.dark-mode .detail-page-title,
html.dark-mode .recommend-title,
body.dark-mode .recommend-title {
    color: #f3f4f6 !important;
}

html.dark-mode .detail-info-section .section-title,
body.dark-mode .detail-info-section .section-title {
    color: #9ca3af !important;
}

html.dark-mode .detail-info-section .info-item,
body.dark-mode .detail-info-section .info-item {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: none !important;
}

html.dark-mode .detail-info-section .info-item:hover,
body.dark-mode .detail-info-section .info-item:hover {
    background: rgba(255, 255, 255, 0.04) !important;
    box-shadow: none !important;
}

html.dark-mode .detail-info-section .info-label,
body.dark-mode .detail-info-section .info-label {
    color: #9ca3af !important;
}

html.dark-mode .detail-info-section .info-value,
body.dark-mode .detail-info-section .info-value {
    color: #f9fafb !important;
}

html.dark-mode .detail-info-section .info-value a,
body.dark-mode .detail-info-section .info-value a {
    color: #93c5fd !important;
}

html.dark-mode .detail-info-section .info-value a:hover,
body.dark-mode .detail-info-section .info-value a:hover {
    color: #bfdbfe !important;
}

html.dark-mode .change-batch-btn,
body.dark-mode .change-batch-btn {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #e5e7eb !important;
}

html.dark-mode .change-batch-btn:hover,
body.dark-mode .change-batch-btn:hover {
    background: rgba(99, 102, 241, 0.12) !important;
    border-color: rgba(129, 140, 248, 0.45) !important;
    color: #f9fafb !important;
}

html.dark-mode .recommend-loading,
body.dark-mode .recommend-loading {
    color: #9ca3af !important;
}

html.dark-mode .recommend-loading p,
body.dark-mode .recommend-loading p {
    color: #9ca3af !important;
}

html.dark-mode .loading-spinner,
body.dark-mode .loading-spinner {
    border-color: rgba(255, 255, 255, 0.15);
    border-top-color: #e5e7eb;
}

/* ========================================
   样音详情页：内容叠在 Hero 渐变背景上
   ======================================== */
body.sound-detail-page .sound-detail-container {
    --sound-detail-overlap: 26px;
    position: relative;
    z-index: 2;
    margin-top: calc(-1 * var(--sound-detail-overlap));
    padding-top: 16px;
}

@media (max-width: 768px) {
    body.sound-detail-page .sound-detail-container {
        --sound-detail-overlap: 26px;
        padding: 12px 16px 32px;
    }
}

@media (max-width: 480px) {
    body.sound-detail-page .sound-detail-container {
        --sound-detail-overlap: 51px;
        padding: 8px 12px 24px;
    }
}

/* 样音详情页：内容与固定页脚间距 */
body.sound-detail-page > .Whole,
body.sound-detail-page .Whole {
    padding-bottom: calc(var(--content-footer-gap, 20px) + 32px) !important;
}

body.sound-detail-page .sound-detail-container {
    padding-bottom: 36px;
}

@media (max-width: 768px) {
    body.sound-detail-page > .Whole,
    body.sound-detail-page .Whole {
        padding-bottom: calc(var(--content-footer-gap, 20px) + 28px) !important;
    }

    body.sound-detail-page .sound-detail-container {
        padding-bottom: 28px;
    }
}
