:host {
    --page-padding: 16px;
    --primary-color: #b64d24;
    --background-color: #f5f5f5;
}

// 头部样式
.brand-header {
    padding: 8px var(--page-padding);
    display: flex;
    justify-content: center;

    .brand-title {
        display: flex;
        justify-content: center;
        width: 100%;

        .title-container {
            display: flex;
            align-items: center;
            gap: 4px;
            font-family: 'Courier New', Courier, monospace;
            font-size: 16px;
            font-weight: 600;

            span {
                color: var(--primary-color);
            }

            img {
                height: 18px;
                width: 18px;
                margin-top: 2px;
            }
        }
    }
}

// 搜索栏部分
.search-section {
    padding: 8px var(--page-padding);
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;

    .custom-searchbar {
        flex: 1;
        --background: #f4f5f8;
        --border-radius: 8px;
        --box-shadow: none;
        --placeholder-color: #666;
        margin: 0;
        padding: 0;
    }

    .action-buttons {
        display: flex;
        align-items: center;
        gap: 8px;

        .icon-button {
            --padding-start: 8px;
            --padding-end: 8px;
            margin: 0;

            ion-icon {
                font-size: 24px;
                color: var(--primary-color);
            }
        }

        .sign-in-button {
            display: flex;
            align-items: center;
            gap: 4px;
            --padding-start: 8px;
            --padding-end: 8px;
            margin: 0;

            ion-icon {
                font-size: 20px;
                color: var(--primary-color);
            }

            span {
                color: var(--primary-color);
                font-size: 14px;
            }
        }
    }
}

// 顶部导航栏
.top-nav-section {
    padding: 4px var(--page-padding);
    background: white;
    margin-bottom: var(--section-gap);

    ion-segment {
        --background: transparent;

        ion-segment-button {
            --color: #666;
            --color-checked: var(--primary-color);
            --indicator-color: transparent; // 移除选中指示器
            --indicator-height: 0; // 移除指示器高度
            --padding-top: 4px;
            --padding-bottom: 4px;
            min-width: 70px;
            min-height: 32px;
            font-size: 13px;
            text-transform: none;
            transition: none; // 移除过渡动画

            &::part(indicator) {
                display: none; // 彻底隐藏指示器
            }

            &::part(native) {
                padding: 0;
                margin: 0;
            }

            ion-label {
                margin: 0;
                padding: 0;
            }
        }
    }
}

// 轮播图部分
.banner-section {
    padding: 16px var(--page-padding);
    background: white;

    .banner-container {
        position: relative;
        border-radius: 12px;
        overflow: hidden;
        height: 160px;
        user-select: none;
        touch-action: pan-y pinch-zoom;

        .banner-img-container {
            display: flex;
            height: 100%;
            transition: transform 0.3s ease-in-out;

            img {
                min-width: 100%;
                height: 160px;
                object-fit: cover;
                pointer-events: none;
            }
        }

        .banner-indicators {
            position: absolute;
            bottom: 12px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 8px;
            z-index: 2;

            .indicator {
                width: 6px;
                height: 6px;
                border-radius: 50%;
                background: rgba(255, 255, 255, 0.5);
                transition: all 0.3s;
                cursor: pointer;

                &.active {
                    width: 18px;
                    border-radius: 3px;
                    background: white;
                }
            }
        }

        .banner-arrows {
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            transform: translateY(-50%);
            display: flex;
            justify-content: space-between;
            padding: 0 16px;
            pointer-events: none;

            .arrow-btn {
                width: 32px;
                height: 32px;
                border-radius: 50%;
                background: rgba(0, 0, 0, 0.3);
                border: none;
                color: white;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                pointer-events: auto;
                transition: all 0.3s;

                &:hover {
                    background: rgba(0, 0, 0, 0.5);
                }

                ion-icon {
                    font-size: 20px;
                }
            }
        }
    }
}

// 功能导航区
.features-grid {
    padding: 16px var(--page-padding);
    background: white;

    .features-row {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
        margin-bottom: 20px;

        &:last-child {
            margin-bottom: 0;
        }
    }

    .feature-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 12px 8px;
        border-radius: 8px;
        transition: all 0.3s;

        &:active {
            background: rgba(182, 77, 36, 0.1);
        }

        ion-icon {
            font-size: 24px;
            color: var(--primary-color);
        }

        span {
            font-size: 12px;
            color: #333;
        }
    }
}

// 最近在学部分
.recent-learning {
    padding: 16px var(--page-padding);
    background: white;
    margin-top: 8px;

    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;

        h2 {
            margin: 0;
            font-size: 18px;
            font-weight: 600;
            color: #333;
        }

        .view-all {
            display: flex;
            align-items: center;
            gap: 4px;
            color: #666;
            font-size: 14px;

            ion-icon {
                font-size: 16px;
            }
        }
    }

    .learning-cards {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        overflow-x: auto;
        padding-bottom: 8px;

        .learning-card {
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            transition: all 0.3s;

            &:hover {
                transform: translateY(-2px);
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            }

            img {
                width: 100%;
                height: 120px;
                object-fit: cover;
            }

            h3 {
                margin: 8px;
                font-size: 14px;
                font-weight: 500;
                color: #333;
                text-align: center;
            }
        }
    }
}

// 全局样式
ion-content {
    --background: var(--background-color);
}

ion-header {
    background: white;

    ion-toolbar {
        --background: transparent;
    }
}