@page "/siteConfiguration/device"
@attribute [ReuseTabsPage(Title = "设备管理")]


<div class="equipment-management-container">
    <!-- 筛选条件 -->
    <div class="ant-card filter-section">
        <div class="ant-card-body">
            <div class="ant-form ant-form-horizontal">
                <div class="ant-row ant-row-top" style="row-gap: 16px;">
                    <!-- 站点BUID -->
                    <div class="ant-col ant-col-6">
                        <div class="ant-form-item">
                            <label class="ant-form-item-label">
                                <span>车牌号</span>
                            </label>
                            <div class="ant-form-item-control">
                                <div class="ant-form-item-control-input">
                                    <div class="ant-form-item-control-input-content">
                                        <input type="text"
                                               class="ant-input"
                                               placeholder="车牌号"
                                               @bind="License"
                                               @bind:event="oninput" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 站点名称 -->
                    <div class="ant-col ant-col-6">
                        <div class="ant-form-item">
                            <label class="ant-form-item-label">
                                <span>设备编号</span>
                            </label>
                            <div class="ant-form-item-control">
                                <div class="ant-form-item-control-input">
                                    <div class="ant-form-item-control-input-content">
                                        <input type="text"
                                               class="ant-input"
                                               placeholder="设备编号"
                                               @bind="deviceNo"
                                               @bind:event="oninput" />
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 操作按钮 -->
                    <div class="ant-col ant-col-12">
                        <div style="padding-top: 8px; text-align: right;">
                            <span class="ant-space" style="gap: 8px;">
                                <button type="button" class="ant-btn ant-btn-primary" @onclick="OnQuery">
                                    <span role="img" class="anticon anticon-search"></span>
                                    <span>查询</span>
                                </button>
                                <button type="button" class="ant-btn ant-btn-text" @onclick="OnNewDevice">
                                    <span role="img" class="anticon anticon-plus"></span>
                                    <span>新建设备</span>
                                </button>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 设备列表表格 -->
    <div class="ant-card table-section">
        <div class="ant-card-body">
            <div class="ant-spin-nested-loading">
                <div class="ant-spin-container">
                    <div class="ant-table-wrapper">
                        <div class="ant-table ant-table-bordered ant-table-middle">
                            <div class="ant-table-container">
                                <!-- 统一表头和数据表格的列宽 -->
                                <div class="ant-table-header">
                                    <table class="table-header-fixed">
                                        <colgroup>
                                            <col style="width: 120px;" />
                                            <col style="width: 120px;" />
                                            <col style="width: 100px;" />
                                            <col style="width: 100px;" />
                                            <col style="width: 140px;" />
                                            <col style="width: 150px;" />
                                            <col style="width: 130px;" />
                                        </colgroup>
                                        <thead class="ant-table-thead">
                                            <tr>
                                                <th class="ant-table-cell">设备编号</th>
                                                <th class="ant-table-cell">车牌号</th>
                                                <th class="ant-table-cell">油品名称</th>
                                                <th class="ant-table-cell">罐容量</th>
                                                <th class="ant-table-cell">当前容量</th>
                                                <th class="ant-table-cell">最后更新时间</th>
                                                <th class="ant-table-cell">操作</th>
                                            </tr>
                                        </thead>
                                    </table>
                                </div>

                                <!-- 表格内容 -->
                                <div class="ant-table-body">
                                    <table class="table-body-fixed">
                                        <colgroup>
                                            <col style="width: 120px;" />
                                            <col style="width: 120px;" />
                                            <col style="width: 100px;" />
                                            <col style="width: 100px;" />
                                            <col style="width: 140px;" />
                                            <col style="width: 150px;" />
                                            <col style="width: 130px;" />
                                        </colgroup>
                                        <tbody class="ant-table-tbody">
                                            @if (_loading)
                                            {
                                                <tr>
                                                    <td colspan="7" class="ant-table-cell" style="text-align: center; padding: 40px;">
                                                        <div class="ant-spin ant-spin-spinning">
                                                            <span class="ant-spin-dot ant-spin-dot-spin">
                                                                <i class="ant-spin-dot-item"></i>
                                                                <i class="ant-spin-dot-item"></i>
                                                                <i class="ant-spin-dot-item"></i>
                                                                <i class="ant-spin-dot-item"></i>
                                                            </span>
                                                        </div>
                                                    </td>
                                                </tr>
                                            }
                                            else if (_deviceList.Count == 0)
                                            {
                                                <tr>
                                                    <td colspan="6" class="ant-table-cell" style="text-align: center; padding: 40px; color: #999;">
                                                        暂无数据
                                                    </td>
                                                </tr>
                                            }
                                            else
                                            {
                                                @foreach (var device in _deviceList)
                                                {
                                                    <tr class="ant-table-row">
                                                        <td class="ant-table-cell">
                                                            <span style="font-weight: 500;">@device.DeviceId</span>
                                                        </td>
                                                        <td class="ant-table-cell">@device.LicencePlate</td>
                                                        <td class="ant-table-cell">@device.OilProductName</td>
                                                        <td class="ant-table-cell">@FormatNumber(device.TankCapacity)</td>
                                                        <td class="ant-table-cell">
                                                            <div class="capacity-cell">
                                                                <span>@FormatNumber(device.CurrentCapacity)</span>
                                                                <div class="capacity-progress">
                                                                    <div class="progress-bar" style="width: @(GetCapacityPercent(device))%; background: @GetProgressColor(GetCapacityPercent(device));"></div>
                                                                </div>
                                                            </div>
                                                        </td>
                                                        <td class="ant-table-cell">@FormatDateTime(device.LastUpdatedTime)</td>
                                                        <td class="ant-table-cell">
                                                            <div class="action-buttons">
                                                                <button type="button" class="ant-btn ant-btn-link ant-btn-sm" @onclick="@(() => OnEditDevice(device))">
                                                                    <span role="img" class="anticon anticon-edit"></span>
                                                                    <span>编辑</span>
                                                                </button>
                                                                <button type="button" class="ant-btn ant-btn-link ant-btn-sm ant-btn-dangerous" @onclick="@(() => OnDeleteDevice(device))">
                                                                    <span role="img" class="anticon anticon-delete"></span>
                                                                    <span>删除</span>
                                                                </button>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                }
                                            }
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- 分页 -->
                    @if (_totalCount > 0)
                    {
                        <div style="margin-top: 16px; text-align: right;">
                            <div class="ant-pagination ant-pagination-total-text">
                                共 @_totalCount 条记录
                            </div>
                            <div class="ant-pagination ant-pagination-simple">
                                <div class="ant-pagination-prev">
                                    <button type="button" class="ant-pagination-item-link" @onclick="@(() => OnPageChange(_currentPage - 1))" disabled="@(_currentPage <= 1)">
                                        <span role="img" class="anticon anticon-left"></span>
                                    </button>
                                </div>
                                <div class="ant-pagination-simple-pager">
                                    <input type="text"
                                           class="ant-pagination-simple-pager-input"
                                           value="@_currentPage"
                                           @onchange="@((ChangeEventArgs e) => OnPageInputChange(e))" />
                                    <span class="ant-pagination-slash">/</span>
                                    <span class="ant-pagination-simple-pager-text">@GetTotalPages()</span>
                                </div>
                                <div class="ant-pagination-next">
                                    <button type="button" class="ant-pagination-item-link" @onclick="@(() => OnPageChange(_currentPage + 1))" disabled="@(_currentPage >= GetTotalPages())">
                                        <span role="img" class="anticon anticon-right"></span>
                                    </button>
                                </div>
                                <div class="ant-pagination-options" style="margin-left: 8px;">
                                    <select class="ant-select ant-select-sm" @onchange="@((ChangeEventArgs e) => OnPageSizeChange(e))">
                                        <option value="10">10 条/页</option>
                                        <option value="20" selected>20 条/页</option>
                                        <option value="50">50 条/页</option>
                                        <option value="100">100 条/页</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    }
                </div>
            </div>
        </div>
    </div>

    <!-- 新建设备对话框 - 简化版 -->
    @if (_showNewDeviceDialog)
    {
        <div class="ant-modal-root">
            <div class="ant-modal-mask" style="z-index: 1000;" @onclick="@(() => _showNewDeviceDialog = false)"></div>
            <div class="ant-modal-wrap ant-modal-centered" style="z-index: 1000;">
                <div class="ant-modal modal-simple-size">
                    <div class="ant-modal-content">
                        <div class="ant-modal-header">
                            <div class="ant-modal-title">新建设备</div>
                            <button type="button" class="ant-modal-close" @onclick="@(() => _showNewDeviceDialog = false)">
                                <span role="img" class="anticon anticon-close"></span>
                            </button>
                        </div>
                        <div class="ant-modal-body">
                            <!-- 简化版编辑设备表单 -->
                            <div class="ant-form ant-form-vertical">
                                <!-- 设备编号 -->
                                <div class="ant-form-item">
                                    <label class="ant-form-item-label">
                                        <span class="ant-form-item-required">设备编号</span>
                                    </label>
                                    <div class="ant-form-item-control">
                                        <div class="ant-form-item-control-input">
                                            <div class="ant-form-item-control-input-content">
                                                <input type="text"
                                                       class="ant-input"
                                                       placeholder="请输入设备编号"
                                                       @bind="_deviceModel.DeviceId"
                                                       @bind:event="oninput" />
                                            </div>
                                        </div>
                                        <div class="ant-form-item-explain">设备的唯一标识符</div>
                                    </div>
                                </div>

                                <!-- 油品名称 -->
                                <div class="ant-form-item">
                                    <label class="ant-form-item-label">
                                        <span class="ant-form-item-required">油品名称</span>
                                    </label>
                                    <div class="ant-form-item-control">
                                        <div class="ant-form-item-control-input">
                                            <div class="ant-form-item-control-input-content">
                                                <select class="ant-select" @onchange="@((ChangeEventArgs e) => OnOilProductChange(e))">
                                                    <option value="">请选择油品</option>
                                                    @foreach (var option in _oilProductOptions)
                                                    {
                                                        <option value="@option.Value" selected="@(_deviceModel.OilProductName == option.Value)">@option.Label</option>
                                                    }
                                                </select>
                                            </div>
                                        </div>
                                        <div class="ant-form-item-explain">选择设备监控的油品类型</div>
                                    </div>
                                </div>

                                <!-- 罐容量 -->
                                <div class="ant-form-item">
                                    <label class="ant-form-item-label">
                                        <span class="ant-form-item-required">罐容量(L)</span>
                                    </label>
                                    <div class="ant-form-item-control">
                                        <div class="ant-form-item-control-input">
                                            <div class="ant-form-item-control-input-content">
                                                <div class="ant-input-number">
                                                    <input type="number"
                                                           class="ant-input-number-input"
                                                           placeholder="请输入罐容量"
                                                           @bind="_deviceModel.TankCapacity"
                                                           @bind:event="oninput"
                                                           min="0"
                                                           step="100" />
                                                    <div class="ant-input-number-suffix">L</div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="ant-form-item-explain">油罐的最大容量</div>
                                    </div>
                                </div>

                                <!-- 车牌号 -->
                                <div class="ant-form-item">
                                    <label class="ant-form-item-label">
                                        <span class="ant-form-item-required">车牌号</span>
                                    </label>
                                    <div class="ant-form-item-control">
                                        <div class="ant-form-item-control-input">
                                            <div class="ant-form-item-control-input-content">
                                                <input type="text"
                                                       class="ant-input"
                                                       placeholder="请输入车牌号"
                                                       @bind="_deviceModel.LicencePlate" />
                                            </div>
                                        </div>
                                        <div class="ant-form-item-explain">设备关联的车牌号码</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="ant-modal-footer">
                            <button type="button" class="ant-btn ant-btn-default" @onclick="@(() => _showNewDeviceDialog = false)">
                                <span>取消</span>
                            </button>
                            <button type="button" class="ant-btn ant-btn-primary" @onclick="OnSaveDevice">
                                <span>保存设备</span>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    }
</div>

<style>
    /* 容器样式 */
    .equipment-management-container {
        padding: 16px;
        background-color: #f5f7fa;
        min-height: 100vh;
        box-sizing: border-box;
    }

    /* Ant Design样式模拟 */
    .ant-card {
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
        transition: box-shadow 0.3s ease;
    }

        .ant-card:hover {
            box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
        }

    .filter-section {
        margin-bottom: 16px;
    }

    .table-section {
        margin-top: 16px;
    }

    .ant-card-body {
        padding: 20px;
    }

    /* 表格样式优化 */
    .ant-table-container {
        border: 1px solid #f0f0f0;
        border-radius: 8px;
        overflow: hidden;
    }

    .table-header-fixed,
    .table-body-fixed {
        table-layout: fixed;
        width: 100%;
        border-collapse: collapse;
    }

    .ant-table-header table,
    .ant-table-body table {
        width: 100%;
    }

    .ant-table-thead > tr > th {
        color: rgba(0, 0, 0, 0.85);
        font-weight: 600;
        text-align: left;
        background: #fafafa;
        border-bottom: 1px solid #f0f0f0;
        transition: background 0.3s ease;
        padding: 12px 8px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ant-table-tbody > tr > td {
        border-bottom: 1px solid #f0f0f0;
        padding: 12px 8px;
        transition: all 0.3s ease;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 容量单元格样式 */
    .capacity-cell {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .capacity-progress {
        flex-shrink: 0;
        width: 60px;
        background: #f5f5f5;
        border-radius: 100px;
        height: 8px;
        overflow: hidden;
    }

    .progress-bar {
        height: 100%;
        border-radius: 100px;
        transition: width 0.3s ease, background 0.3s ease;
    }

    /* 操作按钮样式 */
    .action-buttons {
        display: flex;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .ant-table-tbody > tr:hover {
        background: #fafafa;
    }

        .ant-table-tbody > tr:hover > td {
            background: #fafafa;
        }

    /* 加载样式 */
    .ant-spin-nested-loading {
        position: relative;
    }

    .ant-spin-container {
        position: relative;
        transition: opacity 0.3s;
    }

    .ant-spin {
        position: absolute;
        display: none;
        color: #1890ff;
        text-align: center;
        vertical-align: middle;
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);
    }

    .ant-spin-spinning {
        position: static;
        display: inline-block;
        opacity: 1;
    }

    .ant-spin-dot {
        position: relative;
        display: inline-block;
        font-size: 20px;
        width: 1em;
        height: 1em;
    }

    .ant-spin-dot-item {
        position: absolute;
        display: block;
        width: 9px;
        height: 9px;
        background-color: #1890ff;
        border-radius: 100%;
        transform: scale(0.75);
        transform-origin: 50% 50%;
        opacity: 0.3;
        animation: antSpinMove 1s infinite linear alternate;
    }

        .ant-spin-dot-item:nth-child(1) {
            top: 0;
            left: 0;
        }

        .ant-spin-dot-item:nth-child(2) {
            top: 0;
            right: 0;
            animation-delay: 0.4s;
        }

        .ant-spin-dot-item:nth-child(3) {
            right: 0;
            bottom: 0;
            animation-delay: 0.8s;
        }

        .ant-spin-dot-item:nth-child(4) {
            bottom: 0;
            left: 0;
            animation-delay: 1.2s;
        }

    @@keyframes antSpinMove {
        to {
            opacity: 1;
        }
    }

    /* 分页样式 */
    .ant-pagination {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        color: rgba(0, 0, 0, 0.85);
        font-size: 14px;
        line-height: 1.5715;
        list-style: none;
    }

    .ant-pagination-total-text {
        display: inline-block;
        height: 32px;
        margin-right: 8px;
        line-height: 30px;
        vertical-align: middle;
    }

    .ant-pagination-simple {
        display: inline-block;
        vertical-align: middle;
    }

    .ant-pagination-prev,
    .ant-pagination-next {
        display: inline-block;
        vertical-align: middle;
    }

    .ant-pagination-item-link {
        display: block;
        width: 36px;
        height: 36px;
        padding: 0;
        color: rgba(0, 0, 0, 0.85);
        text-align: center;
        background-color: #fff;
        border: 1px solid #d9d9d9;
        border-radius: 6px;
        outline: none;
        cursor: pointer;
        user-select: none;
        transition: all 0.3s;
    }

        .ant-pagination-item-link:hover {
            color: #1677ff;
            border-color: #1677ff;
            transform: translateY(-1px);
        }

        .ant-pagination-item-link:disabled {
            color: rgba(0, 0, 0, 0.25);
            background-color: #f5f5f5;
            border-color: #d9d9d9;
            cursor: not-allowed;
        }

    .ant-pagination-simple-pager {
        display: inline-block;
        height: 36px;
        margin: 0 12px;
        vertical-align: middle;
    }

    .ant-pagination-simple-pager-input {
        width: 60px;
        height: 36px;
        margin-right: 8px;
        text-align: center;
        background-color: #fff;
        border: 1px solid #d9d9d9;
        border-radius: 6px;
        outline: none;
        transition: all 0.3s;
    }

        .ant-pagination-simple-pager-input:focus {
            border-color: #1677ff;
            box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
        }

    .ant-pagination-slash {
        margin: 0 8px;
    }

    .ant-pagination-options {
        display: inline-block;
        vertical-align: middle;
        margin-left: 12px;
    }

    /* ====================== 模态框样式优化 ====================== */
    .ant-modal-root {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;
        overflow: auto;
        outline: 0;
    }

    .ant-modal-mask {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1000;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(2px);
        animation: fadeIn 0.2s ease-out;
    }

    @@keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    .ant-modal-wrap {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        overflow: auto;
        outline: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        animation: modalSlideIn 0.3s ease-out;
    }

    @@keyframes modalSlideIn {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .ant-modal-centered {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ant-modal {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        color: rgba(0, 0, 0, 0.85);
        font-size: 14px;
        line-height: 1.5715;
        list-style: none;
        position: relative;
        width: auto;
        max-width: calc(100vw - 32px);
    }

    .modal-simple-size {
        width: 500px;
        max-width: 90vw;
    }

    .ant-modal-content {
        position: relative;
        background-color: #fff;
        background-clip: padding-box;
        border: 0;
        border-radius: 12px;
        box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
        pointer-events: auto;
        overflow: hidden;
    }

    .ant-modal-header {
        padding: 20px 24px;
        color: rgba(0, 0, 0, 0.85);
        background: #fff;
        border-bottom: 1px solid #f0f0f0;
        border-radius: 12px 12px 0 0;
        position: relative;
    }

    .ant-modal-title {
        margin: 0;
        color: rgba(0, 0, 0, 0.85);
        font-weight: 600;
        font-size: 18px;
        line-height: 1.5;
    }

    .ant-modal-close {
        position: absolute;
        top: 20px;
        right: 20px;
        z-index: 10;
        padding: 0;
        color: rgba(0, 0, 0, 0.45);
        font-weight: 600;
        line-height: 1;
        text-decoration: none;
        background: transparent;
        border: 0;
        outline: 0;
        cursor: pointer;
        transition: all 0.3s;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .ant-modal-close:hover {
            color: rgba(0, 0, 0, 0.75);
            background-color: rgba(0, 0, 0, 0.06);
        }

    .ant-modal-body {
        padding: 24px;
        font-size: 14px;
        line-height: 1.5715;
        word-wrap: break-word;
    }

    .ant-modal-footer {
        padding: 16px 24px;
        text-align: right;
        background: transparent;
        border-top: 1px solid #f0f0f0;
        border-radius: 0 0 12px 12px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
    }

    /* 表单样式 */
    .ant-form {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        font-size: 14px;
        font-variant: tabular-nums;
        line-height: 1.5715;
        list-style: none;
    }

    .ant-form-vertical .ant-form-item {
        margin-bottom: 24px;
    }

    .ant-form-item {
        margin-bottom: 0;
        transition: all 0.3s ease;
    }

        .ant-form-item:hover {
            transform: translateY(-1px);
        }

    .ant-form-item-label {
        line-height: 1.5;
        margin-bottom: 8px;
    }

        .ant-form-item-label > label {
            color: rgba(0, 0, 0, 0.85);
            font-size: 14px;
            font-weight: 500;
        }

    .ant-form-item-required::before {
        display: inline-block;
        margin-right: 4px;
        color: #ff4d4f;
        font-size: 14px;
        line-height: 1;
        content: '*';
    }

    .ant-form-item-control-input {
        min-height: 36px;
    }

    .ant-form-item-explain {
        color: rgba(0, 0, 0, 0.45);
        font-size: 12px;
        line-height: 1.5;
        margin-top: 4px;
        min-height: 18px;
    }

    .ant-input {
        box-sizing: border-box;
        margin: 0;
        font-variant: tabular-nums;
        list-style: none;
        font-feature-settings: 'tnum';
        position: relative;
        display: inline-block;
        width: 100%;
        min-width: 0;
        padding: 8px 12px;
        color: rgba(0, 0, 0, 0.85);
        font-size: 14px;
        line-height: 1.5715;
        background-color: #fff;
        background-image: none;
        border: 1px solid #d9d9d9;
        border-radius: 6px;
        transition: all 0.3s;
    }

        .ant-input:focus {
            border-color: #4096ff;
            box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
            outline: 0;
        }

        .ant-input:hover {
            border-color: #4096ff;
        }

    .ant-select {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        color: rgba(0, 0, 0, 0.85);
        font-size: 14px;
        line-height: 1.5715;
        list-style: none;
        position: relative;
        display: inline-block;
        cursor: pointer;
        width: 100%;
    }

        .ant-select select {
            width: 100%;
            height: 36px;
            padding: 0 11px;
            border: 1px solid #d9d9d9;
            border-radius: 6px;
            background-color: #fff;
            transition: all 0.3s;
        }

            .ant-select select:focus {
                border-color: #4096ff;
                box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
                outline: 0;
            }

            .ant-select select:hover {
                border-color: #4096ff;
            }

    /* 数字输入框样式 */
    .ant-input-number {
        position: relative;
        width: 100%;
    }

    .ant-input-number-input {
        width: 100%;
        padding-right: 30px;
        box-sizing: border-box;
    }

    .ant-input-number-suffix {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: rgba(0, 0, 0, 0.45);
        font-size: 14px;
    }

    /* 按钮样式 */
    .ant-btn {
        line-height: 1.5715;
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-weight: 400;
        white-space: nowrap;
        text-align: center;
        background-image: none;
        border: 1px solid transparent;
        box-shadow: 0 2px 0 rgba(0, 0, 0, 0.015);
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
        user-select: none;
        touch-action: manipulation;
        height: 36px;
        padding: 6px 15px;
        font-size: 14px;
        border-radius: 6px;
    }

    .ant-btn-primary {
        color: #fff;
        background-color: #1677ff;
        border-color: #1677ff;
        text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12);
        box-shadow: 0 2px 0 rgba(5, 145, 255, 0.1);
    }

        .ant-btn-primary:hover {
            color: #fff;
            background-color: #4096ff;
            border-color: #4096ff;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(5, 145, 255, 0.2);
        }

    .ant-btn-default {
        color: rgba(0, 0, 0, 0.85);
        background-color: #fff;
        border-color: #d9d9d9;
    }

        .ant-btn-default:hover {
            color: #1677ff;
            border-color: #1677ff;
            background-color: #fff;
        }

    .ant-btn-text {
        color: #1677ff;
        background-color: transparent;
        border-color: transparent;
        box-shadow: none;
    }

        .ant-btn-text:hover {
            color: #4096ff;
            background-color: rgba(0, 0, 0, 0.06);
            border-color: transparent;
        }

    .ant-btn-link {
        color: #1677ff;
        background-color: transparent;
        border-color: transparent;
        box-shadow: none;
        padding: 0;
        height: auto;
    }

        .ant-btn-link:hover {
            color: #4096ff;
            background-color: transparent;
            border-color: transparent;
        }

    .ant-btn-sm {
        height: 28px;
        padding: 0 11px;
        font-size: 13px;
        border-radius: 4px;
    }

    .ant-btn-dangerous {
        color: #ff4d4f;
        background-color: transparent;
        border-color: transparent;
        box-shadow: none;
    }

        .ant-btn-dangerous:hover {
            color: #ff7875;
            background-color: rgba(255, 77, 79, 0.06);
            border-color: transparent;
        }

    /* 图标样式 */
    .anticon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: inherit;
        font-style: normal;
        line-height: 0;
        text-align: center;
        text-transform: none;
        vertical-align: -0.125em;
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .anticon-search::before {
        content: "🔍";
    }

    .anticon-plus::before {
        content: "+";
        font-weight: bold;
    }

    .anticon-edit::before {
        content: "✏️";
    }

    .anticon-delete::before {
        content: "🗑️";
    }

    .anticon-close::before {
        content: "✕";
        font-size: 16px;
    }

    .anticon-left::before {
        content: "←";
    }

    .anticon-right::before {
        content: "→";
    }

    /* 间距样式 */
    .ant-space {
        display: inline-flex;
        gap: 8px;
    }

    /* 响应式设计 */
    @@media (max-width: 768px) {
        .equipment-management-container {
            padding: 12px;
        }

        .ant-card-body {
            padding: 16px;
        }

        .ant-col {
            width: 100% !important;
        }

        .modal-simple-size {
            width: 95vw !important;
            margin: 0 auto;
        }

        .ant-modal-header {
            padding: 16px;
        }

        .ant-modal-body {
            padding: 16px;
        }

        .ant-modal-footer {
            padding: 12px 16px;
            flex-direction: column;
            gap: 8px;
        }

            .ant-modal-footer button {
                width: 100%;
            }

        .ant-form-vertical .ant-form-item {
            margin-bottom: 20px;
        }

        .ant-table-thead > tr > th,
        .ant-table-tbody > tr > td {
            padding: 10px 6px;
            font-size: 13px;
        }

        .capacity-cell {
            flex-direction: column;
            align-items: flex-start;
            gap: 4px;
        }

        .capacity-progress {
            width: 100%;
        }

        .action-buttons {
            flex-direction: column;
            gap: 4px;
        }
    }

    @@media (max-width: 480px) {
        .ant-btn {
            height: 40px;
            font-size: 15px;
        }

        .ant-table-thead > tr > th,
        .ant-table-tbody > tr > td {
            font-size: 12px;
        }
    }

    /* 小屏幕适配 */
    @@media (max-width: 576px) {
        .ant-table-wrapper {
            overflow-x: auto;
        }

        .ant-table {
            min-width: 600px;
        }

        .filter-section .ant-row {
            flex-direction: column;
        }

        .filter-section .ant-col {
            width: 100%;
        }

        .filter-section .ant-col-12 {
            text-align: left;
            margin-top: 8px;
        }
    }
</style>
