/* Gemini Balance 管理界面样式 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 登录界面 */
.login-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    z-index: 9999 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.login-container[style*="display: none"] {
    display: none !important;
}

.login-container:not([style*="display: none"]) {
    display: flex !important;
}

.login-card {
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 15px !important;
    padding: 40px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(10px) !important;
    max-width: 400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    position: relative !important;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.login-header p {
    color: #666;
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 500;
    color: #333;
}

.input-group input {
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.login-error {
    color: #dc3545;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* 管理界面容器 */
.admin-container {
    display: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 导航 */
.nav {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

/* 登出按钮 */
.logout-btn {
    background: rgba(220, 53, 69, 0.8) !important;
    margin-left: auto;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.9) !important;
}

/* 卡片 */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.card h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

/* 标签页内容 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 状态网格 */
.status-grid, .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.status-item, .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    text-align: center;
}

.status-label, .stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.status-value, .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* 快速操作 */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 密钥管理 */
.key-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.key-actions input {
    flex: 1;
    min-width: 300px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.keys-list {
    max-height: 400px;
    overflow-y: auto;
}

.key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.key-info {
    flex: 1;
}

.key-id {
    font-weight: bold;
    color: #333;
}

.key-value {
    font-family: monospace;
    color: #666;
    margin: 5px 0;
}

.key-status {
    font-size: 0.9rem;
    padding: 2px 8px;
    border-radius: 4px;
    color: white;
}

.key-status.healthy {
    background: #28a745;
}

.key-status.unhealthy {
    background: #dc3545;
}

.key-status.unknown {
    background: #ffc107;
    color: #333;
}

/* 配置表单 */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-form label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.config-form input,
.config-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.config-form input[type="checkbox"] {
    width: auto;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.message.show {
    transform: translateX(0);
}

.message.success {
    background: #28a745;
}

.message.error {
    background: #dc3545;
}

.message.info {
    background: #17a2b8;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .nav {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .status-grid, .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .key-actions {
        flex-direction: column;
    }
    
    .key-actions input {
        min-width: auto;
    }
    
    .key-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}