/**
 * Windsurf 管理后台样式
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f5f7fa;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

/* 标签页导航 */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #f0f0f0;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card h2 {
    color: #555;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2 .badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    background: #667eea;
    color: white;
}

/* 表单 */
.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.form-group {
    margin-bottom: 15px;
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'SF Mono', 'Menlo', monospace;
}

/* 按钮 */
button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

button:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-success { background: #28a745; }
.btn-success:hover { background: #218838; }

.btn-danger { background: #dc3545; }
.btn-danger:hover { background: #c82333; }

.btn-warning { background: #ffc107; color: #333; }
.btn-warning:hover { background: #e0a800; }

.btn-secondary { background: #6c757d; }
.btn-secondary:hover { background: #5a6268; }

.btn-info { background: #17a2b8; }
.btn-info:hover { background: #138496; }

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    margin: 2px;
}

/* 结果提示 */
.result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 4px;
    display: none;
}

.result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* 列表容器 */
.list-container {
    max-height: 500px;
    overflow-y: auto;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
}

/* 状态样式 */
.status-unused { color: #6c757d; font-weight: 600; }
.status-active, .status-available { color: #28a745; font-weight: 600; }
.status-expired { color: #dc3545; font-weight: 600; }
.status-assigned { color: #17a2b8; font-weight: 600; }
.status-disabled { color: #dc3545; font-weight: 600; }

/* 统计卡片 */
.stats-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 120px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card .number {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

.stat-card .label {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.stat-card.success .number { color: #28a745; }
.stat-card.warning .number { color: #ffc107; }
.stat-card.danger .number { color: #dc3545; }
.stat-card.info .number { color: #17a2b8; }

/* Token池槽位 */
.pool-slot {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s;
}

.pool-slot.active {
    background: #d4edda;
    border-color: #28a745;
    border-style: solid;
}

.pool-slot.empty {
    background: #fff3cd;
    border-color: #ffc107;
}

.pool-slot .email {
    font-size: 12px;
    color: #333;
    word-break: break-all;
    margin-bottom: 5px;
}

.pool-slot .name {
    font-size: 11px;
    color: #666;
}

.pool-slot .status {
    font-size: 11px;
    margin-top: 5px;
    color: #28a745;
    font-weight: 600;
}

/* 工具类 */
code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 操作栏 */
.action-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* 复选框 */
.checkbox-cell {
    width: 40px;
    text-align: center;
}

.checkbox-cell input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 批量操作栏 */
.batch-actions {
    display: none;
    padding: 10px 15px;
    background: #e9ecef;
    border-radius: 4px;
    margin-bottom: 15px;
    align-items: center;
    gap: 10px;
}

.batch-actions.show {
    display: flex;
}

.batch-actions span {
    font-weight: 600;
    color: #495057;
}

/* 弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.export-content {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-box .form-group {
    margin-bottom: 20px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.login-error {
    color: #dc3545;
    text-align: center;
    margin-top: 15px;
    display: none;
}

.login-error.show {
    display: block;
}
