<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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="@drawable/subtle_gradient_bg"
    tools:context="com.wall.dream.wallpapers.View.ViewMain">

    <!-- 分类页面标题栏 -->
    <LinearLayout
        android:id="@+id/category_title_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center_vertical"
        android:background="@color/color_0"
        android:paddingStart="24dp"
        android:paddingEnd="24dp"
        android:paddingTop="16dp"
        android:paddingBottom="28dp"
        android:layout_alignParentTop="true">

        <!-- 分类图标 -->
        <ImageView
            android:layout_width="28dp"
            android:layout_height="28dp"
            android:src="@drawable/category_grid_miaf"
            android:layout_marginEnd="12dp"
            app:tint="@color/soft_white"
            android:contentDescription="@string/category_icon" />

        <!-- 标题文字 -->
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:orientation="vertical">

            <com.wall.dream.wallpapers.GJ.MyTextGJ
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/categories"
                android:textColor="@color/white"
                android:textSize="24sp"
                android:textStyle="bold"
                android:letterSpacing="0.02"
                app:apply_font="true" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="2dp"
                android:text="@string/browse_all_wallpaper_categories"
                android:textColor="@color/white"
                android:textSize="12sp"
                android:alpha="0.8" />

        </LinearLayout>

        <!-- 装饰线条 -->
        <View
            android:layout_width="3dp"
            android:layout_height="24dp"
            android:background="@drawable/category_bar"
            android:alpha="0.6" />

    </LinearLayout>

    <!-- 分类卡片列表 - 宽卡片布局优化版 -->
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/class_recycler"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/category_title_bar"
        android:clipToPadding="false"
        android:paddingStart="8dp"
        android:paddingEnd="8dp"
        android:paddingTop="8dp"
        android:paddingBottom="100dp"
        android:overScrollMode="never"
        android:scrollbars="none" />

    <!-- 优化加载指示器 -->
    <LinearLayout
        android:id="@+id/loading_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:orientation="vertical"
        android:gravity="center"
        android:visibility="gone">

        <ProgressBar
            android:id="@+id/loading_pb"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:indeterminateTint="@color/forest_green" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="12dp"
            android:text="@string/loading"
            android:textColor="@color/white"
            android:textSize="14sp" />

    </LinearLayout>

    <!-- 空状态提示 -->
    <LinearLayout
        android:id="@+id/empty_layout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:orientation="vertical"
        android:gravity="center"
        android:visibility="gone"
        android:padding="32dp">

        <ImageView
            android:layout_width="80dp"
            android:layout_height="80dp"
            android:src="@mipmap/im_placeholder"
            android:alpha="0.5"
            android:contentDescription="@string/empty_state" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:text="@string/no_wallpapers"
            android:textColor="@color/white"
            android:textSize="16sp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:text="@string/please_try_again_later"
            android:textColor="@color/white"
            android:textSize="12sp"
            android:alpha="0.8" />

    </LinearLayout>


</RelativeLayout>