/* ================================================================
 * 天域主题 - 下载按钮通用样式文件
 * 
 * 功能：为付费盒子和独立下载页面提供统一的下载样式
 * 适用：tianyu-zibpay-download.php 中的所有函数
 * 
 * 文件结构：
 * 1. 下载区域容器
 * 2. 剩余次数提示样式
 * 3. 下载限制说明样式  
 * 4. 下载卡片样式
 * 5. 平台头部样式
 * 6. 按钮区域样式
 * 7. 权限提示样式
 * 8. 响应式布局
 * 
 * @author Tianyu Theme
 * @version 3.0.0
 * ================================================================ */

/* ----------------------------------------------------------------
 * 1. 下载区域容器
 * ---------------------------------------------------------------- */
.download-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    flex: 1 1 100%; /* 在tianyu-actions容器中占满宽度 */
}

/* 在tianyu-actions容器内时不需要额外margin */
.tianyu-actions .download-section {
    margin: 0;
}

/* ----------------------------------------------------------------
 * 2. 剩余次数提示样式（与独立下载页面保持一致）
 * ---------------------------------------------------------------- */
.resource-notice {
    background: rgba(255, 84, 115, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 84, 115, 0.2);
    border-radius: 8px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-notice:hover {
    background: rgba(255, 84, 115, 0.15);
    border-color: rgba(255, 84, 115, 0.3);
}

.resource-notice .notice-icon {
    width: 8px;
    height: 8px;
    background: #ff5473;
    border-radius: 50%;
    flex-shrink: 0;
}

.resource-notice .notice-text {
    font-size: 14px;
    color: #ff5473;
    line-height: 1.4;
    margin: 0;
}

/* ----------------------------------------------------------------
 * 3. 下载限制说明样式
 * ---------------------------------------------------------------- */
.tianyu-download-limit-info {
    background: rgba(116, 185, 255, 0.1);
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(116, 185, 255, 0.3);
}

.limit-info-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.limit-info-title {
    font-weight: bold;
    color: #0984e3;
    font-size: 1.05em;
    flex-shrink: 0;
}

.limit-info-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.limit-badge {
    color: #2d3436;
    background: rgba(255, 255, 255, 0.8);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(116, 185, 255, 0.3);
    white-space: nowrap;
    font-size: 12px;
}

/* ----------------------------------------------------------------
 * 4. 下载卡片（第一行：图标+标题，第二行：按钮）
 * ---------------------------------------------------------------- */
.download-section .download-card {
    background: #F1F4F9;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px #e2e8f0;
    transition: all 0.3s ease;
}

.download-section .download-card:hover {
    background: #F8FAFF;
    box-shadow: inset 0 0 0 1px #3285FF;
}

/* 暗色模式 */
.dark-theme .download-section .download-card {
    background: var(--body-bg-color);
    box-shadow: inset 0 0 0 1px var(--main-bg-color);
}

/* ----------------------------------------------------------------
 * 5. 平台头部（图标 + 标题）
 * ---------------------------------------------------------------- */
.download-section .platform-header {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

/* 5.1 图标容器 */
.download-section .download-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.download-section .download-icon svg {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

/* 暗色模式 */
.dark-theme .download-section .download-icon {
    background: rgba(255, 255, 255, 0.1);
}

/* 5.2 平台名称 */
.download-section .platform-name {
    font-size: 18px;
    font-weight: 600;
    color: #666;
    flex: 1;
    min-width: 0;
}

/* 暗色模式 */
.dark-theme .download-section .platform-name {
    color: var(--body-color);
}

/* ----------------------------------------------------------------
 * 6. 按钮区域（下载按钮 + 复制按钮/信息徽章）
 * ---------------------------------------------------------------- */
.download-section .button-group {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
}

/* 6.1 通用按钮样式 */
.download-section .download-btn,
.download-section .copy-btn,
.download-section .download-info-badge {
    flex: 1;
    padding: 5px 10px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 暗色模式 */
.dark-theme .download-section .download-btn,
.dark-theme .download-section .copy-btn,
.dark-theme .download-section .download-info-badge {
    border-color: var(--muted-border-color);
}

/* 6.2 下载按钮 */
.download-section .download-btn {
    background: white;
    color: #666;
}

.download-section .download-btn:hover {
    background: #3285FF;
    color: white;
    border-color: #3285FF;
}

/* 暗色模式 */
.dark-theme .download-section .download-btn {
    background: #1A202D;
    color: var(--body-color);
}

.dark-theme .download-section .download-btn:hover {
    background: var(--theme-color);
    color: white;
    border-color: var(--theme-color);
}

/* 6.3 复制按钮 */
.download-section .copy-btn {
    background: #F8FAFC;
    color: #999;
}

.download-section .copy-btn:hover {
    background: white;
    color: var(--body-color);
}

/* 暗色模式 */
.dark-theme .download-section .copy-btn {
    background: var(--main-bg-color);
    color: var(--muted-color);
}

.dark-theme .download-section .copy-btn:hover {
    background: #1A202D;
    color: var(--body-color);
}

/* 6.4 信息徽章（不可点击） */
.download-section .download-info-badge {
    background: #F8FAFC;
    color: #999;
    padding: 10px 16px;
    cursor: default;
}

/* 暗色模式 */
.dark-theme .download-section .download-info-badge {
    background: var(--main-bg-color);
    color: var(--muted-color);
}

/* ----------------------------------------------------------------
 * 7. 剩余次数提示（跨3列显示在顶部）
 * ---------------------------------------------------------------- */
.download-section .download-limit-notice {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 84, 115, 0.1);
    border: 1px solid rgba(255, 84, 115, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.download-section .download-limit-notice:hover {
    background: rgba(255, 84, 115, 0.15);
    border-color: rgba(255, 84, 115, 0.3);
}

/* 7.1 圆点图标 */
.download-section .download-limit-notice .notice-icon {
    width: 8px;
    height: 8px;
    background: #ff5473;
    border-radius: 50%;
    flex-shrink: 0;
}

/* 7.2 提示文字 */
.download-section .download-limit-notice .notice-text {
    flex: 1;
    font-size: 14px;
    color: #ff5473;
    line-height: 1.4;
    margin: 0;
}

/* 暗色模式 */
.dark-theme .download-section .download-limit-notice {
    background: rgba(255, 84, 115, 0.15);
    border-color: rgba(255, 84, 115, 0.25);
}

.dark-theme .download-section .download-limit-notice:hover {
    background: rgba(255, 84, 115, 0.2);
    border-color: rgba(255, 84, 115, 0.35);
}

/* ----------------------------------------------------------------
 * 8. 权限提示（超限/无权限时显示）
 * ---------------------------------------------------------------- */
.download-section .permission-notice {
    grid-column: 1 / -1;
    padding: 20px;
    background: var(--muted-border-color);
    border: 1px dashed var(--muted-color);
    border-radius: 8px;
    text-align: center;
}

/* 无权限样式 */
.download-section .permission-notice.no-access {
    background: rgba(244, 67, 54, 0.05);
    border-color: #F44336;
}

.download-section .permission-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.download-section .permission-text {
    font-size: 14px;
    color: #D32F2F;
    font-weight: 500;
    margin: 0;
}

/* ----------------------------------------------------------------
 * 9. 响应式布局
 * ---------------------------------------------------------------- */
/* 平板：2列 */
@media (max-width: 1024px) {
    .download-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 移动端：1列 */
@media (max-width: 640px) {
    .download-section {
        grid-template-columns: 1fr;
    }
}


