/**
 * 下载链接样式
 * 
 * @package YingShiZhuTi
 * @since 1.0.0
 */

/* 下载链接包装器 - 独立区域，类似评论区 */
.download-links-wrapper {
    margin: 30px 0;
    padding: 0;
    clear: both;
}

/* 单页：让下载区与右侧侧边栏顶部对齐（上方间距由元数据卡片的 margin-bottom 提供） */
.single .download-links-wrapper {
    margin-top: 0;
}

/* 下载链接区域 */
.yingshizhuti-download-links-section {
    background: var(--card-background, #fff);
    border: 1px solid var(--light-gray, #e0e0e0);
    /* 与评论区保持一致的“卡片容器”内边距 */
    border-radius: 0;
    padding: 5px 24px;
    box-shadow: none;
}

.download-section-title {
    /* 对齐评论区标题视觉 */
    font-family: var(--font-family-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color, #333);
    margin: 16px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color, #2c3e50);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.download-section-title .download-icon {
    font-size: 1.2em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-color, #2c3e50);
    color: #fff;
    border-radius: 6px;
}

/* 下载链接组 */
.download-links-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

/* 集数组 */
.download-episode-group {
    margin-bottom: 30px;
}

.download-episode-group:last-child {
    margin-bottom: 0;
}

.download-episode-group .episode-title {
    font-size: 1em;
    font-weight: 600;
    margin: 0 0 12px 0;
    padding: 6px 12px;
    background: var(--primary-color, #2c3e50);
    color: #fff;
    border-radius: 4px;
    display: inline-block;
}

/* 下载链接卡片 */
.download-link-card {
    background: #fff;
    border: 1px solid var(--light-gray, #e0e0e0);
    border-radius: 0;
    padding: 14px 16px;
    transition: none;
    box-shadow: none;
    position: relative;
    overflow: visible;
}

.download-link-card:hover {
    box-shadow: none;
    transform: none;
    border-color: var(--light-gray, #e0e0e0);
}

.download-link-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--light-gray, #f0f0f0);
}

.drive-icon {
    font-size: 1.4em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.02);
}

.drive-name {
    font-weight: 600;
    font-size: 1.05em;
    color: var(--text-color, #333);
    flex: 1;
}

.link-name {
    font-size: 0.9em;
    color: #666;
    background: var(--light-gray, #f5f5f5);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
}

.download-link-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 操作区：并排两个按钮（下载 + 复制提取码） */
.download-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 下载按钮 */
.download-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    color: #fff !important;
    text-decoration: none;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.95em;
    transition: none;
    border: none;
    cursor: pointer;
    box-shadow: none;
    position: relative;
    overflow: visible;
    flex: 1;
}

.download-link-button:hover {
    opacity: 0.95;
    transform: none;
    box-shadow: none;
}

.download-link-button:active {
    transform: translateY(0);
}

.download-link-button .download-icon-small {
    font-size: 16px;
    line-height: 1;
    display: inline-block;
}

/* 提取码 */
.extract-code {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0;
    font-size: 0.9em;
    border: 1px solid var(--light-gray, #dee2e6);
}

.extract-label {
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.extract-value {
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-weight: bold;
    font-size: 1em;
    color: var(--primary-color, #2c3e50);
    letter-spacing: 1px;
    flex: 1;
    text-align: left;
}

.copy-extract-code {
    background: transparent;
    border: 1px solid var(--light-gray, #dee2e6);
    color: var(--text-color, #333);
    padding: 10px 12px;
    border-radius: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    font-weight: 600;
    transition: none;
    white-space: nowrap;
}

.copy-extract-code:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--light-gray, #dee2e6);
    transform: none;
    box-shadow: none;
}

.copy-extract-code:active {
    transform: translateY(0);
}

.copy-extract-code .copy-icon {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
}

/* 备注信息 */
.download-notes {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.02);
    border-left: 3px solid var(--primary-color, #2196f3);
    border-radius: 0;
    font-size: 0.9em;
    color: var(--dark-gray, #666);
    margin-top: 5px;
}

.download-notes .info-icon {
    font-size: 18px;
    line-height: 1;
    color: var(--primary-color, #2196f3);
    margin-top: 2px;
    display: inline-block;
    flex-shrink: 0;
}

/* 暗色模式 */
[data-theme="dark"] .yingshizhuti-download-links-section {
    background: var(--card-background, #2a2a2a);
    border-color: #444;
}

[data-theme="dark"] .download-link-card {
    background: #333;
    border-color: #444;
}

[data-theme="dark"] .download-link-card:hover {
    box-shadow: none;
    border-color: #444;
}

[data-theme="dark"] .extract-code {
    background: rgba(255, 255, 255, 0.06);
    border-color: #444;
}

[data-theme="dark"] .download-notes {
    background: rgba(255, 255, 255, 0.06);
    border-left-color: #3f51b5;
    color: #cfcfcf;
}

[data-theme="dark"] .download-episode-group .episode-title {
    background: #2c3e50;
}

[data-theme="dark"] .drive-icon {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .copy-extract-code {
    border-color: #444;
    color: #eee;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .yingshizhuti-download-links-section {
        padding: 10px 20px; /* 与评论区移动端一致 */
    }
    
    .download-link-card {
        padding: 15px;
    }
    
    .download-actions {
        flex-wrap: wrap;
    }
    
    .download-link-button { flex: 1 1 220px; }
    
    .extract-code {
        flex-wrap: wrap;
    }
    
    .download-section-title { margin: 10px 0 16px 0; }
}

/* 下载区域只在主内容列显示，不横跨侧边栏 */
@media (min-width: 769px) {
    .download-links-wrapper {
        /* 下载区域保持在主内容列，不横跨 */
        grid-column: 1;
        clear: both;
    }
    
    /* 评论区也只在主内容列 */
    #comments.comments-container {
        grid-column: 1;
    }
}
