
/* ============================================
 * 谦汐盒子 - 详情页样式
 * 基于 Bootstrap 5，用于美化各类型详情页
 * ============================================ */

/* 详情页头部横幅 */
.detail-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.detail-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.detail-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.detail-hero .hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    font-size: 1.75rem;
    color: #fff;
    flex-shrink: 0;
}

.detail-hero h1 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.detail-hero .text-muted-hero {
    color: rgba(255,255,255,0.85) !important;
}

.detail-hero .badge {
    background: rgba(255,255,255,0.2) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
}

/* 卡片悬浮效果 */
.detail-card {
    border: 0;
    border-radius: 0.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    overflow: hidden;
}

.detail-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.detail-card .card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 1rem 1.25rem;
    border-radius: 0 !important;
}

.detail-card .card-header h5,
.detail-card .card-header h6 {
    margin-bottom: 0;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-card .card-header h5 i,
.detail-card .card-header h6 i {
    font-size: 0.9rem;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

.detail-card .card-header .icon-primary {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

.detail-card .card-header .icon-success {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.detail-card .card-header .icon-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.detail-card .card-header .icon-info {
    background: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

.detail-card .card-header .icon-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* 价格卡片 */
.price-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
}

.price-card .price-free {
    font-size: 2rem;
    font-weight: 700;
    color: #198754;
}

.price-card .price-paid {
    font-size: 2rem;
    font-weight: 700;
    color: #0d6efd;
}

/* 统计信息 */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item .stat-label {
    color: #6c757d;
    font-size: 0.875rem;
}

.stat-item .stat-value {
    font-weight: 600;
    color: #212529;
}

/* 信息网格 */
.info-grid-item {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.info-grid-item:hover {
    background: #e9ecef;
}

.info-grid-item .info-label {
    color: #6c757d;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.info-grid-item .info-value {
    font-weight: 600;
    color: #212529;
    font-size: 0.95rem;
}

/* 相关工具列表 */
.related-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    text-decoration: none !important;
    color: inherit;
    border-radius: 0.5rem;
    margin: 0.25rem;
}

.related-item:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateX(4px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.related-item:last-child {
    border-bottom: none;
}

.related-item .related-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
    color: #0d6efd;
    flex-shrink: 0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.related-item:hover .related-icon {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.15) 0%, rgba(13, 110, 253, 0.1) 100%);
}

.related-item .related-info {
    flex: 1;
    min-width: 0;
    margin-left: 1rem;
}

.related-item .related-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.related-item .related-desc {
    font-size: 0.8rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
}

.related-item .related-arrow {
    font-size: 0.85rem;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.related-item:hover .related-arrow {
    opacity: 1;
    color: #0d6efd;
    transform: translateX(4px);
}

/* 代码块美化 */
.code-block {
    background: #1e1e2e;
    border-radius: 0.75rem;
    padding: 1.25rem;
    overflow-x: auto;
    position: relative;
}

.code-block code {
    color: #a6e3a1;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.code-block .copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.7);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.code-block .copy-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* 下载按钮 */
.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    color: #fff;
}

/* 链接展示框 */
.url-display {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e9ecef;
    word-break: break-all;
}

.url-display a {
    color: #0d6efd;
    font-size: 0.875rem;
}

/* API Tab 样式 */
.api-tabs .nav-link {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.api-tabs .nav-link:hover {
    color: #0d6efd;
    border-bottom-color: rgba(13, 110, 253, 0.3);
}

.api-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background: transparent;
}

/* 参数表格 */
.param-table th {
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
    background: #f8f9fa;
    border-bottom-width: 1px;
}

.param-table td {
    font-size: 0.875rem;
    vertical-align: middle;
}

/* 目录列表 */
.toc-list .list-group-item {
    border: none;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: #495057;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.toc-list .list-group-item:hover {
    background: #f8f9fa;
    border-left-color: #0d6efd;
    color: #0d6efd;
}

/* Key 提示 */
.key-hint {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: #856404;
}

/* 宽窄切换过渡 */
/* 手机端始终100%宽度 */
@media (max-width: 767.98px) {
    .container,
    .container-fluid,
    .detail-layout {
        max-width: 100% !important;
    }
}

/* 桌面端 - 窄屏模式（默认）70%宽度 */
@media (min-width: 768px) {
    body:not(.layout-wide) .container,
    body:not(.layout-wide) .container-fluid {
        max-width: 70% !important;
        transition: max-width 0.3s ease;
    }
    body:not(.layout-wide) .detail-layout {
        max-width: 70% !important;
        transition: max-width 0.3s ease;
    }
}

/* 工具内容区域不受宽窄切换影响 */
.tool-content-wrapper .container,
.tool-content-wrapper .container-fluid {
    max-width: 100% !important;
}

/* 桌面端 - 宽屏模式 98%宽度 */
@media (min-width: 768px) {
    .layout-wide .container,
    .layout-wide .container-fluid {
        max-width: 98% !important;
    }
    .layout-wide .detail-layout {
        max-width: 98% !important;
    }
}

/* 工具内容区域宽屏也不受影响 */
.layout-wide .tool-content-wrapper .container,
.layout-wide .tool-content-wrapper .container-fluid {
    max-width: 100% !important;
}

/* 面包屑美化 */
.detail-breadcrumb {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.detail-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-breadcrumb .breadcrumb-item {
    display: flex;
    align-items: center;
}

.detail-breadcrumb .breadcrumb-item::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    margin: 0 0.75rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.detail-breadcrumb .breadcrumb-item:first-child::before {
    display: none;
}

.detail-breadcrumb .breadcrumb-item a {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.detail-breadcrumb .breadcrumb-item a:hover {
    color: #667eea;
    transform: translateY(-1px);
}

.detail-breadcrumb .breadcrumb-item a i {
    font-size: 0.75rem;
}

.detail-breadcrumb .breadcrumb-item.active {
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 600;
}

.detail-breadcrumb .breadcrumb-item:last-child::before {
    background: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.4);
}

.detail-breadcrumb:hover .breadcrumb-item::before {
    background: #94a3b8;
}

/* 页面进入动画 */
@keyframes detailFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-animate {
    animation: detailFadeIn 0.5s ease forwards;
}

.detail-animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.detail-animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
.detail-animate-delay-3 { animation-delay: 0.3s; opacity: 0; }
.detail-animate-delay-4 { animation-delay: 0.4s; opacity: 0; }

/* 响应式调整 */
@media (max-width: 768px) {
    .detail-hero {
        padding: 1.25rem;
        border-radius: 0.75rem;
    }

    .detail-hero .hero-icon {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }

    .detail-hero h1 {
        font-size: 1.25rem;
    }

    .price-card .price-free,
    .price-card .price-paid {
        font-size: 1.5rem;
    }
}

/* ---------------- 扩展间距工具类（Bootstrap 5 默认间距只到第5级，以下为补充） ---------------- */
.mt-6 {
    margin-top: 2.5rem !important;
}
.mb-6 {
    margin-bottom: 1.0rem !important;
}
.py-12 {
    padding-top: 5rem !important;
    padding-bottom: 5rem !important;
}
@media (min-width: 768px) {
    .px-md-6 {
        padding-right: 2.5rem !important;
        padding-left: 2.5rem !important;
    }
}