/* 用户管理页面专用样式 */
.user-management-page {
    background: #f5f7fa;
    min-height: 100vh;
}

/* 顶部导航栏 */
.um-header {
    background: white;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.um-header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.um-back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #5f6368;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.um-back-link:hover {
    color: #1a73e8;
}

.um-back-link svg {
    width: 20px;
    height: 20px;
}

.um-title {
    margin: 0;
    font-size: 24px;
    color: #202124;
    font-weight: 600;
}

.um-refresh-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.um-refresh-btn:hover {
    background: #1557b0;
}

.um-refresh-btn svg {
    width: 18px;
    height: 18px;
}

/* Loading状态 */
.um-refresh-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.um-refresh-btn.loading .loading-spinner-icon {
    animation: spin 1s linear infinite;
}

.um-action-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.um-action-btn.loading .loading-spinner-icon {
    animation: spin 1s linear infinite;
}

/* 主内容区 */
.um-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
    overflow-y: auto;
    height: calc(100vh - 72px);
}

/* 隐藏滚动条但保留滚动功能 */
.um-main::-webkit-scrollbar {
    display: none;
}

.um-main {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* 统计概览卡片 */
.um-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
    grid-auto-rows: auto;
}

.um-stat-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.um-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.um-stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.um-stat-icon svg {
    width: 28px;
    height: 28px;
}

.um-stat-icon-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.um-stat-icon-green {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.um-stat-icon-purple {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.um-stat-content {
    flex: 1;
}

.um-stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #202124;
    margin-bottom: 4px;
}

.um-stat-label {
    font-size: 14px;
    color: #5f6368;
}

/* 概览Token详细信息 */
.um-overview-token-details {
    grid-column: span 3;
    display: flex;
    justify-content: space-around;
    gap: 24px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4ff 100%);
    border-radius: 12px;
    margin-top: -8px;
}

.um-overview-detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.um-overview-detail-label {
    font-size: 13px;
    color: #5f6368;
}

.um-overview-detail-value {
    font-size: 18px;
    font-weight: bold;
    color: #1a73e8;
}

/* 用户列表区域 */
.um-users-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.um-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.um-section-header h2 {
    margin: 0;
    font-size: 20px;
    color: #202124;
}

.um-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dadce0;
    transition: all 0.2s;
}

.um-search-box:focus-within {
    border-color: #1a73e8;
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.um-search-box svg {
    width: 18px;
    height: 18px;
    color: #5f6368;
}

.um-search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: #202124;
    width: 200px;
}

/* 用户网格 */
.um-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 20px;
    padding-bottom: 20px;
}

/* 用户卡片 */
.um-user-card {
    background: white;
    border: 2px solid #e8eaed;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.um-user-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
}

.um-user-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.um-user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
}

.um-user-info {
    flex: 1;
    min-width: 0;
}

.um-user-name {
    font-size: 18px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.um-user-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #5f6368;
}

.um-user-role {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.um-role-admin {
    background: #fef3c7;
    color: #d97706;
}

.um-role-user {
    background: #e0e7ff;
    color: #4f46e5;
}

.um-user-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.um-status-active {
    background: #d1fae5;
    color: #059669;
}

.um-status-inactive {
    background: #fee2e2;
    color: #dc2626;
}

/* 统计数据 */
.um-user-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.um-stat-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.um-stat-item-value {
    font-size: 20px;
    font-weight: bold;
    color: #1a73e8;
    margin-bottom: 4px;
}

.um-stat-item-label {
    font-size: 12px;
    color: #5f6368;
}

/* 详细统计信息 */
.um-stat-detail {
    grid-column: span 2;
    background: #f0f7ff;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-around;
    gap: 12px;
}

.um-stat-detail-label {
    font-size: 11px;
    color: #1a73e8;
    text-align: center;
    flex: 1;
}

/* Token使用进度条 */
.um-token-progress {
    margin-bottom: 16px;
}

.um-progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.um-progress-label {
    color: #5f6368;
}

.um-progress-value {
    color: #202124;
    font-weight: 500;
}

.um-progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.um-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

/* 操作按钮 */
.um-user-actions {
    display: flex;
    gap: 8px;
}

.um-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background: white;
    color: #5f6368;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.um-action-btn:hover {
    background: #f8f9fa;
    border-color: #1a73e8;
    color: #1a73e8;
}

.um-action-btn svg {
    width: 16px;
    height: 16px;
}

/* 空状态 */
.um-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #5f6368;
}

.um-empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.um-empty-state p {
    font-size: 16px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .um-header {
        padding: 12px 16px;
    }

    .um-header-left {
        gap: 12px;
    }

    .um-back-link {
        font-size: 13px;
    }

    .um-back-link svg {
        width: 18px;
        height: 18px;
    }

    .um-title {
        font-size: 20px;
    }

    .um-refresh-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .um-refresh-btn svg {
        width: 16px;
        height: 16px;
    }

    .um-main {
        padding: 16px;
        height: calc(100vh - 60px);
    }

    .um-stats-overview {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }

    .um-stat-card {
        padding: 16px;
        gap: 16px;
    }

    .um-stat-icon {
        width: 48px;
        height: 48px;
    }

    .um-stat-icon svg {
        width: 24px;
        height: 24px;
    }

    .um-stat-value {
        font-size: 28px;
    }

    .um-stat-label {
        font-size: 13px;
    }

    .um-users-section {
        padding: 16px;
    }

    .um-section-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .um-section-header h2 {
        font-size: 18px;
    }

    .um-search-box {
        padding: 6px 12px;
    }

    .um-search-box svg {
        width: 16px;
        height: 16px;
    }

    .um-search-box input {
        width: 100%;
        font-size: 14px;
    }

    .um-users-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .um-user-card {
        padding: 16px;
    }

    .um-user-header {
        gap: 12px;
        margin-bottom: 12px;
    }

    .um-user-avatar {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .um-user-name {
        font-size: 16px;
    }

    .um-user-meta {
        gap: 8px;
        font-size: 12px;
    }

    .um-user-role,
    .um-user-status {
        font-size: 11px;
        padding: 2px 6px;
    }

    .um-user-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 12px;
    }

    .um-stat-item {
        padding: 10px;
    }

    .um-stat-item-value {
        font-size: 18px;
    }

    .um-stat-item-label {
        font-size: 11px;
    }

    .um-stat-detail {
        grid-column: span 2;
        padding: 8px;
        gap: 8px;
    }

    .um-stat-detail-label {
        font-size: 10px;
    }

    .um-token-progress {
        margin-bottom: 12px;
    }

    .um-progress-header {
        font-size: 12px;
    }

    .um-progress-bar {
        height: 6px;
    }

    .um-user-actions {
        gap: 6px;
    }

    .um-action-btn {
        padding: 8px;
        font-size: 13px;
        gap: 4px;
    }

    .um-action-btn svg {
        width: 14px;
        height: 14px;
    }

    .um-empty-state {
        padding: 40px 16px;
    }

    .um-empty-state svg {
        width: 60px;
        height: 60px;
    }

    .um-empty-state p {
        font-size: 14px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .um-header {
        padding: 10px 12px;
    }

    .um-header-left {
        gap: 8px;
    }

    .um-back-link {
        font-size: 12px;
    }

    .um-back-link svg {
        width: 16px;
        height: 16px;
    }

    .um-title {
        font-size: 18px;
    }

    .um-refresh-btn span {
        display: none;
    }

    .um-refresh-btn {
        padding: 6px;
    }

    .um-refresh-btn svg {
        width: 18px;
        height: 18px;
    }

    .um-main {
        padding: 12px;
        height: calc(100vh - 52px);
    }

    .um-stats-overview {
        gap: 12px;
        margin-bottom: 16px;
    }

    .um-stat-card {
        padding: 14px;
        gap: 12px;
    }

    .um-stat-icon {
        width: 42px;
        height: 42px;
    }

    .um-stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .um-stat-value {
        font-size: 24px;
    }

    .um-stat-label {
        font-size: 12px;
    }

    .um-users-section {
        padding: 12px;
    }

    .um-section-header h2 {
        font-size: 16px;
    }

    .um-search-box {
        padding: 6px 10px;
    }

    .um-search-box input {
        font-size: 13px;
    }

    .um-user-card {
        padding: 12px;
    }

    .um-user-header {
        gap: 10px;
        margin-bottom: 10px;
    }

    .um-user-avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .um-user-info {
        min-width: 0;
    }

    .um-user-name {
        font-size: 15px;
        margin-bottom: 2px;
    }

    .um-user-meta {
        gap: 6px;
        font-size: 11px;
    }

    .um-user-role,
    .um-user-status {
        font-size: 10px;
        padding: 1px 5px;
    }

    .um-user-stats {
        gap: 6px;
        margin-bottom: 10px;
    }

    .um-stat-item {
        padding: 8px;
    }

    .um-stat-item-value {
        font-size: 16px;
    }

    .um-stat-item-label {
        font-size: 10px;
    }

    .um-stat-detail {
        padding: 6px;
        gap: 6px;
    }

    .um-stat-detail-label {
        font-size: 9px;
    }

    .um-token-progress {
        margin-bottom: 10px;
    }

    .um-progress-header {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .um-progress-bar {
        height: 5px;
    }

    .um-user-actions {
        gap: 5px;
    }

    .um-action-btn {
        padding: 7px;
        font-size: 12px;
        gap: 3px;
    }

    .um-action-btn svg {
        width: 13px;
        height: 13px;
    }

    .um-empty-state {
        padding: 30px 12px;
    }

    .um-empty-state svg {
        width: 50px;
        height: 50px;
        margin-bottom: 12px;
    }

    .um-empty-state p {
        font-size: 13px;
    }
}
