/* ===== 布局：上两块并排，下方列表占满 ===== */
#tab-user h2 {
    margin: 12px 0 20px;
    font: 600 20px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, Arial, "PingFang SC", "Microsoft YaHei";
    color: #1f2937;
}

#tab-user .user-grid {
    display: grid;
    gap: 20px;
    align-items: start;
    grid-template-columns: repeat(2, minmax(280px, 1fr)); /* 顶部两列 */
    grid-template-areas:
    "create filter"
    "list   list"; /* 列表独占一整行 */
}

/* 绑定区域 */
#tab-user #create-user-section {
    grid-area: create;
}

#tab-user #filter-users-section {
    grid-area: filter;
}

#tab-user #filtered-users {
    grid-area: list;
}

/* 响应式：平板两列、手机一列 */
@media (max-width: 900px) {
    #tab-user .user-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
      "create"
      "filter"
      "list";
    }
}

/* ===== 卡片面板（创建/筛选） ===== */
#tab-user .panel {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

#tab-user .panel h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #111827;
}

/* 表单字段 */
#tab-user .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

#tab-user .field label {
    font-size: 13px;
    color: #374151;
}

#tab-user .field input,
#tab-user .field select {
    height: 36px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

#tab-user .field input:focus,
#tab-user .field select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}

/* 按钮 */
#tab-user .btn {
    display: inline-block;
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #111827;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .02s;
}

#tab-user .btn:hover {
    background: #e5e7eb;
}

#tab-user .btn {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

#tab-user .btn.primary:hover {
    background: #1d4ed8;
}

/* 提示信息 */
#tab-user .message {
    margin-top: 8px;
    font-size: 13px;
    color: #065f46; /* 失败时可在 JS 中改为红色 */
}

/* ===== 用户列表：横向卡片网格 ===== */
#tab-user .user-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); /* 多列铺满 */
}

#tab-user .user-list li {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    display: grid;
    gap: 8px;
    align-content: start;
    min-height: 72px;
}

/* 可选：列表项内左右对齐的行（如果以后加操作按钮） */
#tab-user .user-list li .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* 让整个 section 在宽屏时不显拥挤 */
#tab-user {
    padding: 12px 16px;
}

/* 背景对比度（可选） */
body {
    background: #f6f7f9;
}

/*下面添加用户列表的样式*/
/* 容器 */
.user-list {
    list-style: none;
    margin: 16px 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

/* 每一行用户卡片 */
.user-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.user-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
    border-color: #d1d5db;
}

/* 行内布局 */
.user-item .row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* 名称与元信息 */
.user-item .name {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
}

/* 行布局：名称在左，meta 居中，按钮在右 */
.user-item .row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 名称占据左侧空间，把 meta 挤到中间，按钮在最右 */
.user-item .name {
    font-weight: 600;
    color: #111827;
}

.user-item .name {
    flex: 1 1 auto;
}

/* 元信息：更淡的灰、紧凑一些 */
.user-item .meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

/* 状态徽章（根据 data-status 自动文案与配色） */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.6;
    border: 1px solid transparent;
}

/* 正常 */
.status-badge[data-status="true"] {
    color: #065f46; /* 深绿字 */
    background: rgba(16, 185, 129, .10); /* 浅绿底 */
    border-color: rgba(16, 185, 129, .35);
}

.status-badge[data-status="true"]::before {
    content: "正常";
}

/* 封禁中 */
.status-badge[data-status="false"] {
    color: #7f1d1d; /* 深红字 */
    background: rgba(239, 68, 68, .10); /* 浅红底 */
    border-color: rgba(239, 68, 68, .35);
}

.status-badge[data-status="false"]::before {
    content: "封禁中";
}

/* 按钮风格：danger=封禁(红)，success=解封(绿) */
.btn.ban-btn {
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform .02s, background .2s, border-color .2s;
    white-space: nowrap;
}

.btn.ban-btn:active {
    transform: translateY(1px);
}

.btn.ban-btn.danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

.btn.ban-btn.danger:hover {
    background: #dc2626;
}

.btn.ban-btn.success {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.btn.ban-btn.success:hover {
    background: #059669;
}


/* 按钮基础样式 */
.btn {
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #111827;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .06s ease;
}

.btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn:active {
    transform: translateY(1px);
}

/* 危险动作按钮（封禁） */
.btn.danger {
    border-color: #fecaca;
    background: #fee2e2;
    color: #991b1b;
}

.btn.danger:hover {
    background: #fecaca;
    border-color: #fca5a5;
}

/* 禁用状态 */
.btn:disabled,
.btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

/* 面板区域（可选：让左右面板更精致些） */
.panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

/* 响应式优化 */
@media (max-width: 640px) {
    .user-item .meta {
        margin-left: 0;
        width: 100%;
        order: 3; /* 小屏把 meta 放到最后一行 */
    }
}
