@charset "utf-8";

/*
 * ========================================
 * Main 主内容区域样式（独立命名空间）
 * ========================================
 * 文件路径：includes/components/main/main.css
 *
 * 【目的】
 * 提供 Main 主内容区域的框架级通用样式，使用 .site-main 命名空间隔离
 * 确保 Main 样式不受其他区域影响，也不影响其他区域
 * 本文件只包含框架级通用样式，页面特定样式应放在页面特定的 CSS 文件中
 *
 * 【使用说明】
 * 1. 在引用 base-styles.css 之后引用此文件
 * 2. 此文件应在 header.css 和 footer.css 之后引用
 * 3. 所有选择器都使用 .site-main 前缀，确保样式隔离
 * 4. 页面特定样式应放在对应的页面 CSS 文件中（如 assets/zh-cn/css/index.css）
 *
 * 【包含的通用样式】
 * - 页面区块容器（.page-section, .section）
 * - 区块标题样式（.section-title, .section-subtitle）
 * - 产品卡片基础样式（.product-card 等，不包含特定样式）
 * - 课程卡片基础样式（.course-card 等，不包含特定样式）
 * - 工具类（.text-center, .mb-4, .mt-4）
 *
 * 【注意事项】
 * - 使用 CSS 变量（--text-primary、--bg-primary 等）需要先引用 frontend-colors.css
 * - 所有样式都限定在 .site-main 命名空间内
 * - 首页特定样式已移至 assets/zh-cn/css/index.css
 * ========================================
 */

/* ====================================================================
 * Main 命名空间容器和基础样式
 * ==================================================================== */
/* 注意：Main 容器的基础样式（flex: 1, min-height: 0）已在 base-styles.css 中定义 */

/* ========== 页面内容区域样式 ========== */

/* Page Hero（首页轮播图） */
/* 注意：轮播图样式已移至 includes/components/hero/hero.css */
/* 如需使用轮播图，请引用 hero.css 文件 */

/* Page Content（主要内容区块） */
/* 主要内容容器，确保统一的间距和布局 */
/* 注意：.page-content 目前不需要额外样式，保留类名用于语义化 */

/* ====================================================================
 * Page Section - 页面区块容器（框架级通用样式）
 * ==================================================================== */

/* Page Section（页面区块） - 替代原来的 .section */
.site-main .page-section {
    padding: 4rem 0;
}

@media (max-width: 767.98px) {
    .site-main .page-section {
        padding: 3rem 0;
    }
}

/* 保持向后兼容：.section 仍然可用 */
.site-main .section {
    padding: 4rem 0;
}

/* ====================================================================
 * Section Styles - 区块标题样式（框架级通用样式）
 * ==================================================================== */

.site-main .section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.site-main .section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.125rem;
}

/* 响应式：区块标题 */
@media (max-width: 768px) {
    .site-main .section-title {
        font-size: 1.5rem;
    }
}

/* ====================================================================
 * Product Cards - 产品卡片基础样式（通用组件样式）
 * ====================================================================
 * 注意：产品卡片的基础样式是通用的，可在产品列表页等页面使用
 * 首页特定的样式（如 printer-1 等）已移至 assets/zh-cn/css/index.css
 * ==================================================================== */

.site-main .product-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: var(--text-primary);
    display: block;
    height: 100%;
}

.site-main .product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
    color: var(--text-primary);
}

.site-main .product-image {
    width: 100%;
    /* 使用 aspect-ratio 保持宽高比，避免容器宽度变化时被拉扁 */
    aspect-ratio: 4 / 3; /* 4:3 比例，适合产品图片展示 */
    min-height: 200px; /* 最小高度保证，兼容小屏幕 */
    max-height: 300px; /* 最大高度限制，避免过大 */
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-secondary);
    overflow: hidden; /* 确保内容不溢出 */
}

/* 如果将来在 .product-image 中使用真实图片，添加以下样式 */
.site-main .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持图片比例，覆盖整个区域 */
    object-position: center; /* 居中显示 */
    display: block;
}

.site-main .product-info {
    padding: 1.5rem;
}

.site-main .product-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.site-main .product-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* 标准属性，提升兼容性 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.site-main .product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ====================================================================
 * Course Cards - 课程卡片基础样式（通用组件样式）
 * ====================================================================
 * 注意：课程卡片的基础样式是通用的，可在课程列表页等页面使用
 * 首页特定的样式（如 course-1 等）已移至 assets/zh-cn/css/index.css
 * ==================================================================== */

.site-main .course-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s;
    text-decoration: none;
    color: var(--text-primary);
    display: block;
    height: 100%;
}

.site-main .course-card:hover {
    transform: translateY(-5px);
    text-decoration: none;
    color: var(--text-primary);
}

.site-main .course-image {
    width: 100%;
    /* 使用 aspect-ratio 保持宽高比，避免容器宽度变化时被拉扁 */
    aspect-ratio: 16 / 9; /* 16:9 比例，适合视频课程封面展示 */
    min-height: 180px; /* 最小高度保证 */
    max-height: 250px; /* 最大高度限制 */
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-white);
    overflow: hidden; /* 确保内容不溢出 */
}

/* 如果将来在 .course-image 中使用真实图片，添加以下样式 */
.site-main .course-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持图片比例，覆盖整个区域 */
    object-position: center; /* 居中显示 */
    display: block;
}

.site-main .course-info {
    padding: 1.5rem;
}

.site-main .course-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* 课程卡片描述：最多显示两行，超出省略；避免不同课程文案长短导致卡片高度差 */
.site-main .course-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.site-main .course-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.site-main .course-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ====================================================================
 * Utility Classes - 工具类（框架级通用样式）
 * ==================================================================== */

.site-main .text-center { text-align: center; }
.site-main .mb-4 { margin-bottom: 1.5rem; }
.site-main .mt-4 { margin-top: 1.5rem; }
