<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/bg_color">

    <LinearLayout
        android:id="@+id/topContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center_vertical"
        android:paddingTop="8dp"
        android:paddingBottom="8dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent">

        <!-- 使用 CardView 包裹 TabLayout 以添加阴影 -->
        <androidx.cardview.widget.CardView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:layout_marginStart="16dp"
            android:layout_marginEnd="8dp"
            app:cardElevation="4dp"
            app:cardCornerRadius="20dp"
            app:cardUseCompatPadding="true"
            app:cardBackgroundColor="@color/bg_color">

            <com.google.android.material.tabs.TabLayout
                android:id="@+id/categoryTabLayout"
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:background="@color/bg_color"
                app:tabIndicatorHeight="0dp"
                app:tabMode="scrollable" />

        </androidx.cardview.widget.CardView>

        <!-- See All 按钮固定宽度 -->
        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/seeAllButton"
            android:layout_width="wrap_content"
            android:layout_height="32dp"
            android:layout_marginEnd="16dp"
            android:paddingStart="12dp"
            android:paddingEnd="12dp"
            android:background="@drawable/piubn">

            <TextView
                android:id="@+id/tvSeeAll"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/See_All"
                android:textSize="16sp"
                android:textColor="@color/black"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintBottom_toBottomOf="parent"/>

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/oikmjbn"
                android:layout_marginStart="4dp"
                app:layout_constraintStart_toEndOf="@id/tvSeeAll"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintBottom_toBottomOf="parent"/>
        </androidx.constraintlayout.widget.ConstraintLayout>
    </LinearLayout>

    <!-- 分类内容 ViewPager2 -->
    <androidx.viewpager2.widget.ViewPager2
        android:id="@+id/categoryViewPager"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:paddingStart="@dimen/recycler_padding"
        android:paddingEnd="@dimen/recycler_padding"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/topContainer" />

</androidx.constraintlayout.widget.ConstraintLayout>