<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#F5F5F5"> <!-- 浅灰色背景 -->

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="16dp">

        <!-- 顶部标题卡片 -->
        <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="12dp"
            app:cardElevation="4dp"
            android:layout_marginBottom="16dp">

            <TextView
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:gravity="center"
                android:text="轮胎质检"
                android:textSize="20sp"
                android:textStyle="bold"
                android:background="?attr/colorPrimary"
                android:textColor="@android:color/white" />
        </com.google.android.material.card.MaterialCardView>

        <!-- EPC 输入项 -->
        <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="8dp"
            app:cardElevation="2dp"
            android:layout_marginBottom="8dp">

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/epc_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                android:layout_margin="8dp"
                android:enabled="false">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/epc_display"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="12dp"
                    android:text="等待扫描..."
                    android:textSize="16sp"
                    android:textColor="@android:color/black"
                    android:background="@null"
                    android:enabled="false"
                    android:focusable="false"
                    android:cursorVisible="false" />/>

            </com.google.android.material.textfield.TextInputLayout>
        </com.google.android.material.card.MaterialCardView>

        <!-- 胎号 & 自编号 (并排显示) -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginBottom="8dp">

            <com.google.android.material.card.MaterialCardView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                app:cardCornerRadius="8dp"
                app:cardElevation="2dp"
                android:layout_marginEnd="4dp">

                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/th_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                    android:layout_margin="8dp">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/th"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:hint="轮胎编号"
                        android:textSize="16sp"
                        android:enabled="false"
                        android:focusable="false"
                        android:cursorVisible="false" />
                </com.google.android.material.textfield.TextInputLayout>
            </com.google.android.material.card.MaterialCardView>

            <com.google.android.material.card.MaterialCardView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                app:cardCornerRadius="8dp"
                app:cardElevation="2dp"
                android:layout_marginStart="4dp">

                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/zbh_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                    android:layout_margin="8dp">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/zbh"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:hint="自编号"
                        android:textSize="16sp"
                        android:enabled="false"
                        android:focusable="false"
                        android:cursorVisible="false" />
                </com.google.android.material.textfield.TextInputLayout>
            </com.google.android.material.card.MaterialCardView>
        </LinearLayout>

        <!-- 花纹深度 & 里程 (并排显示) -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginBottom="8dp">

            <com.google.android.material.card.MaterialCardView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                app:cardCornerRadius="8dp"
                app:cardElevation="2dp"
                android:layout_marginEnd="4dp">

                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/patternDepth_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                    android:layout_margin="8dp">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/patternDepth"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:hint="花纹深度(毫米)"
                        android:inputType="numberDecimal"
                        android:textSize="16sp" />
                    <!-- 单位直接写在 Hint 或通过辅助文本显示 -->
                </com.google.android.material.textfield.TextInputLayout>
            </com.google.android.material.card.MaterialCardView>

            <com.google.android.material.card.MaterialCardView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                app:cardCornerRadius="8dp"
                app:cardElevation="2dp"
                android:layout_marginStart="4dp">

                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/mileage_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                    android:layout_margin="8dp">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/mileage"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:hint="当前里程(公里)"
                        android:inputType="number"
                        android:textSize="16sp" />
                </com.google.android.material.textfield.TextInputLayout>
            </com.google.android.material.card.MaterialCardView>
        </LinearLayout>

        <!-- 检查结果 (下拉选择) -->
        <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="8dp"
            app:cardElevation="2dp"
            android:layout_marginBottom="8dp">

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/result_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                android:layout_margin="8dp">

                <Spinner
                    android:id="@+id/result"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
            </com.google.android.material.textfield.TextInputLayout>
        </com.google.android.material.card.MaterialCardView>

        <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="8dp"
            app:cardElevation="2dp"
            android:layout_marginBottom="8dp">

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/check_type_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                android:layout_margin="8dp">

                <Spinner
                    android:id="@+id/check_type_spinner"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />
            </com.google.android.material.textfield.TextInputLayout>
        </com.google.android.material.card.MaterialCardView>

        <!-- 处理意见 (多行文本) -->
        <com.google.android.material.card.MaterialCardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:cardCornerRadius="8dp"
            app:cardElevation="2dp"
            android:layout_marginBottom="8dp">

            <com.google.android.material.textfield.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                android:layout_margin="8dp"
                app:boxStrokeColor="?attr/colorPrimary">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/tyrecon"
                    android:layout_width="match_parent"
                    android:layout_height="120dp"
                    android:gravity="top|start"
                    android:hint="详细处理意见..."
                    android:inputType="textMultiLine"
                    android:maxLines="5"
                    android:textSize="16sp" />
            </com.google.android.material.textfield.TextInputLayout>
        </com.google.android.material.card.MaterialCardView>

        <!-- 操作按钮 -->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="24dp"
            android:gravity="center">

            <Button
                android:id="@+id/wc"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_margin="8dp"
                android:text="保存并完成"
                style="@style/Widget.MaterialComponents.Button.OutlinedButton" />

            <Button
                android:id="@+id/fh"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_margin="8dp"
                android:text="返回重填"
                style="@style/Widget.MaterialComponents.Button.TextButton" />
        </LinearLayout>

    </LinearLayout>
</ScrollView>