﻿/* 主容器样式 */
.user-center-container {
    padding: 20px;
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 页面头部 */
.page-header {
    margin-bottom: 30px;
}

    .page-header h2 {
        margin: 0 0 10px 0;
        color: #333;
        font-size: 28px;
        font-weight: 600;
    }

    .page-header p {
        margin: 0;
        color: #666;
        font-size: 14px;
    }

/* 统计卡片区域 */
.statistics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    }

    .stat-card.active {
        background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    }

    .stat-card.frozen {
        background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    }

    .stat-card.cancelled {
        background: linear-gradient(135deg, #757f9a 0%, #d7dde8 100%);
    }

.stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* 筛选区域 */
.filter-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.filter-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

    .filter-row:last-child {
        margin-bottom: 0;
    }

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .filter-item label {
        font-size: 12px;
        color: #666;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .filter-item input,
    .filter-item select {
        padding: 8px 12px;
        border: 1px solid #ddd;
        border-radius: 6px;
        font-size: 14px;
        transition: all 0.3s ease;
        background: white;
    }

        .filter-item input:focus,
        .filter-item select:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

    .filter-item span {
        margin: 0 5px;
        color: #666;
    }

/* 按钮样式 */
.btn-search,
.btn-reset {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-search {
    background: #667eea;
    color: white;
}

    .btn-search:hover {
        background: #5a67d8;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    }

.btn-reset {
    background: #6c757d;
    color: white;
}

    .btn-reset:hover {
        background: #5a6268;
        transform: translateY(-1px);
    }

/* 用户表格 */
.user-list {
    overflow-x: auto;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

    .user-table thead {
        background: #f8f9fa;
        border-bottom: 2px solid #e9ecef;
    }

    .user-table th {
        padding: 15px 12px;
        text-align: left;
        font-weight: 600;
        color: #495057;
        white-space: nowrap;
    }

    .user-table td {
        padding: 12px;
        text-align: left;
        border-bottom: 1px solid #e9ecef;
        color: #666;
    }

    .user-table tbody tr:hover {
        background: #f8f9fa;
        transition: background 0.2s ease;
    }

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-frozen {
    background: #fff3cd;
    color: #856404;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

/* 操作按钮 */
.btn-icon {
    padding: 6px 10px;
    margin: 0 2px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

    .btn-icon:hover {
        background: #e9ecef;
        transform: scale(1.05);
    }

    .btn-icon:active {
        transform: scale(0.95);
    }

/* 分页控件 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 14px;
}

    .page-btn:hover:not(:disabled) {
        background: #667eea;
        color: white;
        border-color: #667eea;
        transform: translateY(-1px);
    }

    .page-btn:disabled {
        cursor: not-allowed;
        opacity: 0.5;
    }

.page-current {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    font-weight: 500;
}

.pagination-controls select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

    .modal-header h3 {
        margin: 0;
        color: #333;
        font-size: 20px;
    }

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

    .modal-close:hover {
        color: #333;
    }

.modal-body {
    padding: 20px;
}

/* 新增/编辑表单栅格 */
.modal-form {
    max-width: 720px;
    width: 90%;
    overflow: hidden;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}

.form-item {
    display: flex;
    flex-direction: column;
}

    .form-item label {
        font-size: 13px;
        color: #555;
        margin-bottom: 6px;
        font-weight: 500;
    }

    .form-item input,
    .form-item select {
        padding: 8px 10px;
        border: 1px solid #d0d0d0;
        border-radius: 6px;
        font-size: 14px;
        background: #fff;
        transition: border-color 0.15s, box-shadow 0.15s;
    }

        .form-item input:focus,
        .form-item select:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
        }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
    background: #fafbfc;
    border-radius: 0 0 12px 12px;
}

.btn-cancel,
.btn-save {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn-cancel {
    background: #e0e0e0;
    color: #333;
}

    .btn-cancel:hover {
        background: #d0d0d0;
    }

.btn-save {
    background: #28a745;
    color: white;
}

    .btn-save:hover {
        background: #218838;
        transform: translateY(-1px);
    }

.btn-add {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: #28a745;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

    .btn-add:hover {
        background: #218838;
        transform: translateY(-1px);
    }

/* ========== 编辑用户弹窗美化 ========== */

/* 渐变头部 */
.modal-header-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom: none;
    padding: 18px 24px;
}

    .modal-header-gradient h3 {
        color: #fff !important;
        font-size: 18px;
    }

.modal-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-icon {
    font-size: 20px;
    line-height: 1;
}

    .modal-header-gradient .modal-close {
        color: rgba(255, 255, 255, 0.9);
    }

        .modal-header-gradient .modal-close:hover {
            color: #fff;
            background: rgba(255, 255, 255, 0.15);
        }

/* 用户摘要卡（头像 + 名称 + chip） */
.user-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    background: #f7f8fc;
    border-bottom: 1px solid #ececf5;
}

.user-summary-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

    .user-summary-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.user-summary-info {
    flex: 1;
    min-width: 0;
}

.user-summary-name {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Chip 标签 */
.chip {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    line-height: 18px;
    border-radius: 10px;
    background: #eef0f7;
    color: #555;
    white-space: nowrap;
}

.chip-id {
    background: #e3e7ff;
    color: #4a5cd6;
}

.chip-status-正常 {
    background: #e6f7ec;
    color: #1f8a3a;
}

.chip-status-冻结 {
    background: #fff4e0;
    color: #b36b00;
}

.chip-status-删除 {
    background: #fde8e8;
    color: #b32a2a;
}

/* 表单分组 */
.form-section {
    margin-bottom: 18px;
    padding: 16px 18px;
    background: #fbfbfd;
    border: 1px solid #ececf5;
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

    .form-section:hover {
        border-color: #d8ddef;
    }

    .form-section:last-child {
        margin-bottom: 0;
    }

.form-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #4a5cd6;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
    position: relative;
    padding-left: 10px;
}

    .form-section-title::before {
        content: "";
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 12px;
        background: linear-gradient(180deg, #667eea, #764ba2);
        border-radius: 2px;
    }

/* 表单项增强 */
.form-item-full {
    grid-column: 1 / -1;
}

.label-tip {
    margin-left: 6px;
    font-size: 11px;
    color: #b32a2a;
    background: #fde8e8;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: normal;
}

.required-mark {
    color: #e74c3c;
    margin-left: 2px;
}

.form-item.required label {
    color: #333;
}

/* 只读输入框 */
.form-item input[disabled],
.form-item input[readonly] {
    background: #f3f4f9;
    color: #6b7280;
    cursor: not-allowed;
    border-style: dashed;
}

/* 保存按钮图标 */
.btn-save .btn-icon-save {
    margin-right: 4px;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

/* 弹窗内容滚动区 */
.modal-form .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* 响应式：小屏单列 */
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .user-summary {
        padding: 14px 16px;
    }

    .user-summary-avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

    .detail-row:last-child {
        border-bottom: none;
    }

.detail-label {
    width: 120px;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.detail-value {
    flex: 1;
    color: #333;
    font-size: 14px;
}

.personality-badge-large {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* 空数据样式 */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .user-center-container {
        padding: 15px;
    }

    .statistics-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .stat-value {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .statistics-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-item {
        width: 100%;
    }

        .filter-item input,
        .filter-item select {
            width: 100%;
        }

    .pagination {
        flex-direction: column;
        align-items: center;
    }

    .pagination-controls {
        justify-content: center;
    }

    .user-table {
        font-size: 12px;
    }

        .user-table th,
        .user-table td {
            padding: 8px;
        }

    .detail-row {
        flex-direction: column;
    }

    .detail-label {
        width: 100%;
        margin-bottom: 5px;
    }

    .detail-value {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .statistics-cards {
        grid-template-columns: 1fr;
    }

    .page-header h2 {
        font-size: 24px;
    }

    .btn-icon {
        padding: 4px 6px;
        font-size: 14px;
    }
}

/* 滚动条样式 */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

    .modal-content::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

.user-list::-webkit-scrollbar {
    height: 8px;
}

.user-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.user-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

    .user-list::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

/* 工具类 */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.cursor-pointer {
    cursor: pointer;
}
