/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    width: 100%;
    margin: 0;
    padding: 20px;
    max-width: none;
}

/* 页面头部 */
.page-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.header-icon {
    font-size: 2em;
    color: #667eea;
}

.page-header h1 {
    color: #2c3e50;
    font-size: 2.2em;
    font-weight: 600;
    margin: 0;
}

.header-right .btn-outline {
    background: transparent;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.header-right .btn-outline:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* 统计概览 */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* 备用表邮箱分布特殊样式 */
#backupEmailStats {
    font-size: 0.8em !important;
    line-height: 1.2 !important;
    word-break: break-word;
    white-space: normal;
    max-height: 3.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    cursor: help;
    transition: all 0.3s ease;
}

#backupEmailStats:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* 备用表统计卡片特殊样式 */
.stat-card:has(#backupEmailStats) {
    min-height: 120px;
}

.stat-card:has(#backupEmailStats) .stat-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 工具提示样式增强 */
#backupEmailStats[title] {
    position: relative;
}

#backupEmailStats[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: pre-line;
    z-index: 1000;
    max-width: 300px;
    word-wrap: break-word;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    margin-bottom: 8px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-icon.active {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

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

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

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2.2em;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9em;
    margin-top: 5px;
    font-weight: 500;
}

/* 全宽度统计卡片样式 */
.stat-card.full-width {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.stat-card.full-width .stat-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.stat-card.full-width .stat-label {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: #495057;
    min-width: 120px;
}

.stat-card.full-width .stat-number {
    font-size: 0.9em;
    font-weight: 500;
    color: #6c757d;
    line-height: 1.4;
    word-break: break-word;
    white-space: normal;
}

/* 区域样式 */
.add-token-section,
.tokens-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    padding: 0;
}

.section-actions {
    display: flex;
    gap: 10px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.add-mode-toggle {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px;
}

.add-mode-toggle .btn {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.add-mode-toggle .btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
}

.add-mode-toggle .btn-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.toggle-help {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.3s ease;
}

.toggle-help:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #839496 0%, #6d7a7b 100%);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #4e9a2a 0%, #96d4bd 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e08e0b 0%, #d35400 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d62c1a 0%, #a93226 100%);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
}

/* 表单样式 */
.add-token-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.token-input-field {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 120px;
    background: #f8f9fa;
}

.token-input-field:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    background: white;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* 帮助面板 */
.help-panel {
    margin: 20px 30px 30px;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.help-header {
    background: #e9ecef;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #495057;
}

.help-content {
    padding: 20px;
}

.json-example {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    margin-bottom: 15px;
}

.help-notes {
    color: #6c757d;
    font-size: 14px;
}

.help-notes p {
    margin-bottom: 8px;
}

/* 卡片样式 */
.sso-token-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.sso-token-section > h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 0;
    padding: 20px;
    border-bottom: none;
}

.sso-token-section > * {
    padding: 0 20px;
}

.sso-token-section > h2 {
    padding: 20px;
}

.sso-token-section > .generate-form,
.sso-token-section > .sso-token-list,
.sso-token-section > .request-logs,
.sso-token-section > button,
.sso-token-section > .form-group {
    padding: 20px;
}

/* Token项目样式 */
.sso-token-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.sso-token-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.sso-token-header {
    background: white;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.sso-token-header strong {
    font-family: 'Courier New', monospace;
    background: #f1f3f4;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.sso-token-info {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f4;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #6c757d;
    min-width: 80px;
}

/* 状态样式 */
.status-active {
    background: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-expired {
    background: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* 配额信息样式 */
.quota-info {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 15px;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    height: 8px;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #28a745 60%, #ffc107 80%, #dc3545 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* 日志样式 */
.log-item {
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    padding: 12px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.log-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.log-success {
    border-left: 4px solid #28a745;
    background: linear-gradient(90deg, #d4edda 0%, #ffffff 10%);
}

.log-error {
    border-left: 4px solid #dc3545;
    background: linear-gradient(90deg, #f8d7da 0%, #ffffff 10%);
}

.log-item div {
    margin-bottom: 4px;
}

.log-item div:last-child {
    margin-bottom: 0;
}

.log-item strong {
    color: #495057;
    min-width: 60px;
    display: inline-block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .generate-form {
        grid-template-columns: 1fr;
    }
    
    .sso-token-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .sso-token-info {
        grid-template-columns: 1fr;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    h1 {
        font-size: 2em;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #495057;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
}

/* Token显示和复制功能样式 */
.token-display {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.token-text {
    font-family: 'Courier New', monospace;
    background: #f1f3f4;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    word-break: break-all;
}

.token-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.copy-btn {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.copy-btn:hover {
    background-color: #138496;
}

.toggle-btn {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* 生成Token模态框样式 */
.generated-tokens-list {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
}

.generated-token-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.token-display-full {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.token-input {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    word-break: break-all;
}

.token-details {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 6px;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

/* 模态框增强样式 */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 1000;
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 1000;
    border-top: 1px solid #dee2e6;
}

/* 批量生成表单样式 */
.form-group input[type="number"] {
    max-width: 120px;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .token-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .token-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .token-display-full {
        flex-direction: column;
        align-items: stretch;
    }
    
    .token-input {
        font-size: 11px;
    }
    
    .generated-token-item {
        padding: 10px;
    }
    
    .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
}

/* 动画效果 */
.copy-btn.copied {
    background-color: #28a745 !important;
    transform: scale(0.95);
}

.token-text.revealed {
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
}

/* 下载按钮样式 */
.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* 滚动条样式 */
.generated-tokens-list::-webkit-scrollbar {
    width: 8px;
}

.generated-tokens-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.generated-tokens-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.generated-tokens-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
/* 批量添加相关样式 */
.bulk-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.bulk-info .info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #495057;
}

.bulk-info .info-item i {
    width: 16px;
    text-align: center;
}

/* Token表格样式 */
.token-list {
    padding: 10px;
}

.token-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
    overflow: auto;
    width: 100%;
}

.token-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.4;
}

.token-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.token-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    height: 45px;
}

.token-table th:last-child {
    border-right: none;
}

.token-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.token-table tbody tr:hover {
    background-color: #f8f9fa;
}

.token-table tbody tr:last-child {
    border-bottom: none;
}

.token-table td {
    padding: 8px 6px;
    vertical-align: middle;
    border-right: 1px solid #f1f3f4;
    height: 45px;
    font-size: 14px;
}

.token-table td:last-child {
    border-right: none;
}

.token-id-cell {
    max-width: 150px;
}

.token-id-text {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    background: #f8f9fa;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    display: inline-block;
    word-break: break-all;
    line-height: 1.2;
}

.token-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-block;
}

.usage-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    display: inline-block;
}

.status-used {
    background: #fff3cd;
    color: #856404;
}

.status-available {
    background: #d4edda;
    color: #155724;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.provider-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

.number-cell {
    text-align: center;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.time-cell {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-cell {
    width: 140px;
    padding: 6px 8px !important;
}

.stats-container {
    font-size: 10px;
    line-height: 1.2;
}

.stats-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.stats-row:last-child {
    margin-bottom: 0;
}

.stats-label {
    color: #6c757d;
    font-weight: 500;
    min-width: 28px;
}

.stats-value {
    font-weight: 600;
    color: #495057;
}

.stats-value.success {
    color: #28a745;
}

.stats-value.failure {
    color: #dc3545;
}

.stats-value.rate {
    color: #007bff;
}

.actions-cell {
    width: 200px;
    position: relative;
}

.token-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

.btn-xs {
    padding: 2px 4px;
    font-size: 8px;
    border-radius: 3px;
    min-width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.delete-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #d62c1a 0%, #a93226 100%);
    transform: translateY(-1px);
}

/* 测试结果在表格中的样式 */
.test-result {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
    padding: 10px;
    font-size: 10px;
}

/* 空状态优化 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 4em;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: #495057;
    font-size: 1.5em;
}

.empty-state p {
    font-size: 1.1em;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .token-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .token-meta {
        justify-content: center;
    }
    
    .token-info-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 1.8em;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
}

/* 测试结果样式 */
.test-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
}

.test-loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 10px;
}

.test-success {
    border-left: 4px solid #28a745;
    background: linear-gradient(90deg, #d4edda 0%, #f8f9fa 20%);
}

.test-failure {
    border-left: 4px solid #dc3545;
    background: linear-gradient(90deg, #f8d7da 0%, #f8f9fa 20%);
}

.test-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.test-status i {
    font-size: 16px;
}

.test-success .test-status {
    color: #155724;
}

.test-failure .test-status {
    color: #721c24;
}

.test-details {
    display: grid;
    gap: 8px;
}

.test-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 13px;
}

.test-detail-item:last-child {
    border-bottom: none;
}

.test-label {
    font-weight: 600;
    color: #495057;
    min-width: 80px;
    flex-shrink: 0;
}

.test-value {
    color: #6c757d;
    text-align: right;
    word-break: break-word;
    max-width: 200px;
}

.test-value.success {
    color: #28a745;
    font-weight: 600;
}

.test-value.error {
    color: #dc3545;
    font-weight: 600;
}

/* 测试结果紧凑样式 */
.test-result {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    background: #f8f9fa;
    font-size: 11px;
}

.test-loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 8px;
}

.test-success {
    border-left: 3px solid #28a745;
    background: linear-gradient(90deg, #d4edda 0%, #f8f9fa 20%);
}

.test-failure {
    border-left: 3px solid #dc3545;
    background: linear-gradient(90deg, #f8d7da 0%, #f8f9fa 20%);
}

.test-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
}

.test-status i {
    font-size: 14px;
}

.test-details {
    display: grid;
    gap: 4px;
}

.test-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 11px;
}

.test-detail-item:last-child {
    border-bottom: none;
}

.test-label {
    font-weight: 600;
    color: #495057;
    min-width: 60px;
    flex-shrink: 0;
}

.test-value {
    color: #6c757d;
    text-align: right;
    word-break: break-word;
    max-width: 150px;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .add-mode-toggle {
        flex-direction: column;
        gap: 2px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .token-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        padding: 10px 12px;
    }
    
    .token-meta {
        justify-content: center;
    }
    
    .token-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .token-body {
        padding: 12px;
    }
    
    .page-header h1 {
        font-size: 1.6em;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .test-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .test-value {
        text-align: left;
        max-width: 100%;
    }
    
    .token-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .token-actions .btn {
        flex: 1;
        min-width: 60px;
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .bulk-info {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

/* 分页样式 */
.pagination-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.pagination-info {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-controls label {
    color: #495057;
    font-weight: 500;
    margin-right: 8px;
}

.pagination-controls select {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-controls select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 10px;
}

.page-btn {
    min-width: 36px;
    height: 32px;
    padding: 6px 8px;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.page-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.page-ellipsis {
    padding: 6px 8px;
    color: #6c757d;
    font-size: 13px;
    user-select: none;
}

/* 表头分页控件样式 */
.section-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-actions .pagination-controls {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    gap: 8px;
}

.section-actions .pagination-controls label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    margin-right: 6px;
}

.section-actions .pagination-controls select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #495057;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
}

.section-actions .pagination-controls select:focus {
    background: white;
    border-color: rgba(255, 255, 255, 0.8);
}

/* 响应式分页 */
@media (max-width: 768px) {
    .pagination-section {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .pagination-info {
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-numbers {
        margin: 0;
        justify-content: center;
    }
    
    .section-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .section-actions .pagination-controls {
        justify-content: center;
    }
}

/* 使用限制样式 */
.usage-limits-cell {
    min-width: 200px;
    padding: 8px;
}

.usage-limits-container {
    font-size: 12px;
    line-height: 1.4;
}

.usage-reset-time {
    color: #666;
    font-size: 11px;
    margin-bottom: 6px;
    padding: 2px 4px;
    background: #f8f9fa;
    border-radius: 3px;
    text-align: center;
}

.usage-breakdown {
    margin-bottom: 4px;
    padding: 4px 6px;
    border-radius: 4px;
    background: #f8f9fa;
    border-left: 3px solid #28a745;
}

.usage-breakdown.over-limit {
    background: #fff5f5;
    border-left-color: #dc3545;
}

.resource-type {
    font-weight: 600;
    color: #495057;
    font-size: 11px;
    margin-bottom: 2px;
}

.usage-info {
    display: flex;
    align-items: center;
    gap: 2px;
}

.usage-current {
    font-weight: 600;
    color: #007bff;
}

.usage-breakdown.over-limit .usage-current {
    color: #dc3545;
}

.usage-separator {
    color: #6c757d;
}

.usage-limit {
    color: #6c757d;
}

.usage-percent {
    color: #28a745;
    font-size: 10px;
    margin-left: 4px;
}

.usage-breakdown.over-limit .usage-percent {
    color: #dc3545;
}

.trial-status {
    font-size: 10px;
    color: #17a2b8;
    font-weight: 500;
    margin-top: 2px;
}

.usage-limits-none {
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
}

/* 搜索控件样式 */
.search-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
}

.search-controls input[type="text"] {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #495057;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 4px;
    width: 200px;
    transition: all 0.3s ease;
}

.search-controls input[type="text"]:focus {
    outline: none;
    background: white;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.search-controls input[type="text"]::placeholder {
    color: #6c757d;
}

/* 时间信息单元格样式 */
.time-info-cell {
    min-width: 180px;
    padding: 6px 8px !important;
}

.time-info-container {
    font-size: 10px;
    line-height: 1.2;
}

.time-info-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.time-info-row:last-child {
    margin-bottom: 0;
}

.time-label {
    color: #6c757d;
    font-weight: 500;
    min-width: 28px;
    flex-shrink: 0;
}

.time-value {
    font-weight: 600;
    color: #495057;
    font-size: 9px;
    word-break: break-word;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .search-controls {
        flex-direction: column;
        gap: 4px;
        align-items: stretch;
    }
    
    .search-controls input[type="text"] {
        width: 100%;
    }
    
    .time-info-container {
        font-size: 9px;
    }
    
    .time-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .time-value {
        font-size: 8px;
    }
}

/* 统计概览响应式优化 */
@media (max-width: 1200px) {
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .stats-overview {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-number {
        font-size: 1.8em;
    }
    
    .stat-label {
        font-size: 0.8em;
    }
}

/* API测试结果区域样式 */
.api-test-result {
    margin: 20px 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.api-test-result .test-loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 15px;
}

.api-test-result .test-success {
    border-left: 4px solid #28a745;
    background: linear-gradient(90deg, #d4edda 0%, #f8f9fa 20%);
    padding: 15px;
    border-radius: 8px;
}

.api-test-result .test-failure {
    border-left: 4px solid #dc3545;
    background: linear-gradient(90deg, #f8d7da 0%, #f8f9fa 20%);
    padding: 15px;
    border-radius: 8px;
}

.api-test-result .test-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.api-test-result .test-status i {
    font-size: 18px;
}

.api-test-result .test-success .test-status {
    color: #155724;
}

.api-test-result .test-failure .test-status {
    color: #721c24;
}

.api-test-result .test-details {
    display: grid;
    gap: 10px;
}

.api-test-result .test-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 14px;
}

.api-test-result .test-detail-item:last-child {
    border-bottom: none;
}

.api-test-result .test-label {
    font-weight: 600;
    color: #495057;
    min-width: 100px;
    flex-shrink: 0;
}

.api-test-result .test-value {
    color: #6c757d;
    text-align: right;
    word-break: break-word;
    max-width: 300px;
}

.api-test-result .test-value.success {
    color: #28a745;
    font-weight: 600;
}

.api-test-result .test-value.error {
    color: #dc3545;
    font-weight: 600;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .api-test-result {
        margin: 15px 20px;
        padding: 15px;
    }
    
    .api-test-result .test-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .api-test-result .test-value {
        text-align: left;
        max-width: 100%;
    }
}