/* 管理员后台样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0f0f1e;
    color: #fff;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.admin-sidebar {
    width: 260px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-logo {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-logo h2 {
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s;
    font-size: 15px;
}

.nav-item:hover {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
}

.nav-item.active {
    background: rgba(0, 212, 255, 0.15);
    color: #00d4ff;
    font-weight: 500;
}

.nav-item .icon {
    font-size: 18px;
}

/* 主内容区 */
.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 0;
}

.admin-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h1 {
    font-size: 28px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-email {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.logout-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Section */
.admin-section {
    padding: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 48px;
}

.stat-info {
    flex: 1;
}

.stat-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-value {
    color: white;
    font-size: 32px;
    font-weight: 600;
}

.refresh-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.refresh-btn {
    padding: 10px 20px;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #00d4ff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.refresh-btn:hover {
    background: rgba(0, 212, 255, 0.3);
}

/* 用户筛选 */
.user-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.user-filters input,
.user-filters select {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 14px;
}

.user-filters input {
    flex: 1;
}

.user-filters input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* 用户表格 */
.users-table-container {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 15px;
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th {
    background: rgba(0, 212, 255, 0.1);
    color: #00d4ff;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.users-table td {
    padding: 15px;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

.users-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.loading-cell,
.error-cell,
.empty-cell {
    text-align: center;
    padding: 40px !important;
    color: rgba(255, 255, 255, 0.5);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-badge.active {
    background: rgba(0, 255, 127, 0.2);
    color: #00ff7f;
}

.status-badge.disabled {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

/* 按钮 */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 5px;
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: rgba(0, 212, 255, 0.3);
}

.btn-danger {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.3);
}

.btn-success {
    background: rgba(0, 255, 127, 0.2);
    color: #00ff7f;
}

.btn-success:hover {
    background: rgba(0, 255, 127, 0.3);
}

.primary-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 表单 */
.config-form {
    max-width: 800px;
}

.form-section {
    background: rgba(255, 255, 255, 0.02);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.form-section h3 {
    color: #00d4ff;
    margin-bottom: 20px;
    font-size: 18px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.form-control:focus {
    outline: none;
    border-color: #00d4ff;
    background: rgba(255, 255, 255, 0.08);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 用户详情 */
.user-detail-content {}

.info-section {
    margin-bottom: 30px;
}

.info-section h3 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 18px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.info-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: 10px;
}

.info-item label {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-bottom: 5px;
}

.info-item div {
    color: white;
    font-size: 14px;
}

.user-id {
    font-family: monospace;
    font-size: 12px !important;
    word-break: break-all;
}

.quick-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-quick {
    padding: 8px 16px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #00d4ff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-quick:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
}

.api-keys-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-key-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.key-icon {
    font-size: 24px;
}

.key-info {
    flex: 1;
}

.key-name {
    color: white;
    font-weight: 500;
    margin-bottom: 5px;
}

.key-meta {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.usage-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.usage-stats .stat-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.usage-stats label {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-bottom: 8px;
}

.usage-stats .stat-value {
    color: #00d4ff;
    font-size: 24px;
    font-weight: 600;
}

/* 响应式 */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 220px;
    }

    .admin-main {
        margin-left: 220px;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-section {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .usage-stats {
        grid-template-columns: 1fr;
    }
}