/* CSS变量 */
:root {
    --primary-color: #059669;
    --secondary-color: #10b981;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* 容器 */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.header h1 i {
    margin-right: 0.5rem;
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-badge i {
    color: var(--success-color);
    animation: pulse 2s infinite;
}

.status-badge.error i {
    color: var(--danger-color);
}
.logout-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.logout-btn:active {
    transform: translateY(0);
}

.logout-btn i {
    font-size: 14px;
}

/* 高亮说明样式 */
.highlight-note {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #fbbf24;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    color: #92400e;
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
}

.highlight-note i {
    color: #f59e0b;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.highlight-note span {
    flex: 1;
    text-align: center;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    border-right: 3px solid var(--primary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.section h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

.stat-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    background: var(--bg-tertiary);
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* 表单样式 */
.config-panel {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.config-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.optional-tag, .form-group label .optional-mark {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 0.25rem;
    opacity: 0.8;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

/* 密码输入框样式 */
.password-input-group {
    position: relative;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-control {
    padding-right: 3rem;
}

.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"] {
    flex: 1;
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--text-secondary);
    transition: var(--transition);
    z-index: 1;
    width: auto;
    flex-shrink: 0;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.password-toggle i {
    font-size: 1rem;
    width: 1rem;
    text-align: center;
}

/* 模态框中的密码输入框样式 */
.config-item .password-input-wrapper {
    position: relative;
    width: 100%;
}

.config-item .password-input-wrapper input {
    width: 100%;
    padding-right: 2.5rem;
    box-sizing: border-box;
}

.config-item .password-toggle {
    position: absolute;
    right: 0.5rem;
    padding: 0.25rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
    width: auto;
    height: auto;
    line-height: 1;
}

.config-item .password-toggle:hover {
    color: var(--primary-color);
}

/* 文件上传输入框样式 */
.file-input-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-input-group .form-control {
    flex: 1;
    padding-right: 0.75rem;
}

.file-input-group .btn-outline {
    height: 38px;
    width: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.file-input-group .btn-outline:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 兼容旧的 class 名 */
.upload-btn {
    /* 移除之前的 position: absolute 等样式，改为 inline-flex 配合父级 flex 布局 */
    display: inline-flex;
}

.upload-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.upload-btn i {
    font-size: 0.875rem;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

/* 提供商配置组 */
.provider-config {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1rem;
    background: var(--bg-secondary);
}

/* 高级配置区域 */
.advanced-config-section {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    background: var(--bg-secondary);
}

.advanced-config-section h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.advanced-config-section h3 i {
    color: var(--primary-color);
}

.config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

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

/* 复选框样式 */
.form-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .config-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    padding: 8px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: var(--bg-tertiary);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary i {
    font-size: 14px;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.btn-danger {
    background: var(--danger-color);
    color: white;
}

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

/* 提供商列表 */
.providers-container {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.providers-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.provider-item {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: var(--transition);
}

.provider-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.provider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.provider-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.provider-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.provider-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Path Routing Examples Panel */
.routing-examples-panel {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.routing-examples-panel h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.routing-examples-panel h3 i {
    color: var(--primary-color);
}

.routing-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.routing-examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.routing-example-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.routing-example-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.routing-card-header {
    background: var(--bg-primary);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.routing-card-header i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.routing-card-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.provider-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.provider-badge.official {
    background: #dbeafe;
    color: #1e40af;
}

.provider-badge.oauth {
    background: #d1fae5;
    color: #065f46;
}

.provider-badge.responses {
    background: #fef3c7;
    color: #92400e;
}

.routing-card-content {
    padding: 1.5rem;
}

/* 协议标签样式 */
.protocol-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.protocol-tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    position: relative;
}

.protocol-tab:hover {
    color: var(--primary-color);
    background: var(--bg-tertiary);
}

.protocol-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--bg-secondary);
}

/* 协议内容区域 */
.protocol-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.endpoint-info {
    margin-bottom: 1rem;
}

.endpoint-info label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.endpoint-path {
    display: inline-block;
    background: var(--bg-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    position: relative;
    padding-right: 2.5rem;
}

.copy-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: var(--transition);
}

.copy-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

.usage-example {
    margin-top: 1rem;
}

.usage-example label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.usage-example pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
}

.usage-example code {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}

.routing-tips {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.routing-tips h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.routing-tips h4 i {
    color: var(--warning-color);
}

.routing-tips ul {
    margin: 0;
    padding-left: 1.5rem;
}

.routing-tips li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.routing-tips code {
    background: var(--bg-primary);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--primary-color);
}

/* System Info Panel in Dashboard */
.system-info-panel {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    margin-top: 1.5rem;
}

.system-info-panel h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item .info-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.info-item .info-label i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.info-item .info-value {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    padding-left: 1.5rem;
}

.status-healthy {
    background: #d1fae5;
    color: #065f46;
}

.status-unhealthy {
    background: #fee2e2;
    color: #991b1b;
}

.provider-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.provider-stat {
    display: flex;
    flex-direction: column;
}

.provider-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.provider-stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 日志 */
.logs-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logs-container {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 0.5rem;
    height: 800px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    box-shadow: var(--shadow-md);
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
}

.log-time {
    color: #858585;
}

.log-level-info {
    color: #4ec9b0;
}

.log-level-error {
    color: #f48771;
}

.log-level-warn {
    color: #dcdcaa;
}

/* 系统信息 */
.system-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.info-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.info-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

/* 通知 */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 300px;
    animation: slideIn 0.3s ease;
    pointer-events: auto;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* OAuth刷新切换开关 */
.oauth-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* 系统提示区域 */
.system-prompt-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.pool-section .form-text {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-style: italic;
}

/* 提供商类型显示 */
.provider-type-text {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.provider-type-text:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

/* 模态框样式 */
.provider-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.provider-modal-content {
    background: white;
    border-radius: 16px;
    width: 95%;
    max-width: 1200px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.provider-modal-header {
    padding: 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.provider-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6c757d;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e9ecef;
    color: #495057;
    transform: rotate(90deg);
}

.provider-modal-body {
    padding: 24px;
    max-height: calc(85vh - 80px);
    overflow-y: auto;
}

.provider-summary {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.provider-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
}

.provider-summary-item .label {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.provider-summary-item .value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.provider-summary-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.provider-actions {
    margin-bottom: 24px;
}

.provider-item-detail {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.provider-item-detail:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.provider-item-header {
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.provider-item-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
}

.provider-info {
    flex: 1;
}

.provider-name {
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 15px;
}

.provider-meta {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

.provider-health-meta {
    font-size: 12px;
    color: #8b95a5;
    margin-top: 4px;
    line-height: 1.4;
}

.provider-health-meta i {
    margin-right: 4px;
    opacity: 0.7;
}

.provider-error-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 1px solid #feb2b2;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.provider-error-info i {
    color: #e53e3e;
    flex-shrink: 0;
    margin-top: 2px;
}

.provider-error-info .error-label {
    color: #c53030;
    font-weight: 600;
    white-space: nowrap;
}

.provider-error-info .error-message {
    color: #742a2a;
    word-break: break-word;
    max-height: 60px;
    overflow-y: auto;
}

.provider-actions-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-edit {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.btn-edit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.btn-delete {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-quick-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.btn-quick-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #047857 0%, var(--primary-color) 100%);
}

.btn-quick-link i {
    font-size: 10px;
}

.btn-batch-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    font-weight: 500;
}

.btn-batch-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #047857 0%, var(--primary-color) 100%);
}

.btn-batch-link i {
    font-size: 11px;
}

.btn-delete:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn-save {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-cancel {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-cancel:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.provider-item-content {
    padding: 20px;
    display: none;
    border-top: 1px solid #e9ecef;
    background: white;
}

.provider-item-content.expanded {
    display: block;
}

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item label {
    font-size: 13px;
    color: #495057;
    margin-bottom: 8px;
    font-weight: 500;
}

.config-item input, .config-item textarea, .config-item select {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.config-item input:focus, .config-item textarea:focus, .config-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.config-item input[readonly], .config-item select[disabled] {
    background: #f8f9fa;
    color: #6c757d;
}

/* 模态框中的文件上传输入框样式 */
.config-item .file-input-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-item .file-input-group input {
    flex: 1;
    padding-right: 0.75rem;
    box-sizing: border-box;
}

.add-provider-form {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
}

.add-provider-form h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 13px;
    color: #495057;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input, .form-group select {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* 无提供商提示 */
.no-providers {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.no-providers p {
    margin: 0;
    font-size: 1rem;
}

/* 无配置文件提示 */
.no-configs {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.no-configs p {
    margin: 0;
    font-size: 1rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .oauth-refresh-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .provider-modal-content {
        width: 98%;
        max-height: 95vh;
    }

    .provider-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .provider-summary-actions {
        margin-left: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* 健康状态高亮样式 */
.provider-item-detail.unhealthy {
    border: 2px solid var(--warning-color);
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
    animation: pulseWarning 2s infinite;
}

.provider-item-detail.unhealthy:hover {
    border-color: var(--warning-color);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
    transform: translateY(-2px);
}

.provider-item-detail.unhealthy .provider-item-header {
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.provider-item-detail.healthy {
    border: 1px solid #e9ecef;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.provider-item-detail.healthy:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.provider-item-detail.healthy .provider-item-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.health-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.provider-item-detail.unhealthy .health-status {
    color: #92400e;
    background: rgba(245, 158, 11, 0.1);
}

.provider-item-detail.healthy .health-status {
    color: #065f46;
    background: rgba(16, 185, 129, 0.1);
}

.text-success {
    color: var(--success-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

@keyframes pulseWarning {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
    }
    50% {
        box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    }
}

/* 异常状态的特殊标识 */
.provider-item-detail.unhealthy::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, var(--warning-color) 0%, #f59e0b 100%);
    border-radius: 0 2px 2px 0;
    z-index: 1;
}

.provider-item-detail.unhealthy {
    position: relative;
}

/* 配置管理页面样式 */
.upload-config-panel {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
}

.config-search-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.search-controls {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-group .form-control {
    flex: 1;
    padding-right: 3rem;
}

.search-input-group .btn {
    position: absolute;
    right: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-input-group .btn:hover {
    background: #047857;
    transform: translateY(-1px);
}

.config-list-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.config-list-header {
    background: var(--bg-tertiary);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-list-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.config-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.config-stats span {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.status-used {
    background: #d1fae5;
    color: #065f46;
}

.status-unused {
    background: #fef3c7;
    color: #92400e;
}

.status-invalid {
    background: #fee2e2;
    color: #991b1b;
}

.config-list {
    overflow-y: auto;
}

.config-item-manager {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.config-item-manager:hover {
    background: var(--bg-secondary);
}

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

.config-item-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.config-item-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.config-item-path {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin: 0 0.5rem;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.config-item-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.config-item-type {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.config-item-size {
    font-family: 'Courier New', monospace;
}

.config-item-modified {
    font-family: 'Courier New', monospace;
}

.config-item-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.config-item-manager.used .config-item-status {
    background: #d1fae5;
    color: #065f46;
}

.config-item-manager.unused .config-item-status {
    background: #fef3c7;
    color: #92400e;
}

.config-item-manager.invalid .config-item-status {
    background: #fee2e2;
    color: #991b1b;
}

.config-item-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: none;
}

.config-item-manager.expanded .config-item-details {
    display: block;
}

.config-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.config-detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.config-detail-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.config-detail-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.config-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.btn-small {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-view {
    background: var(--primary-color);
    color: white;
}

.btn-view:hover {
    background: #047857;
}

.btn-delete-small {
    background: var(--danger-color);
    color: white;
}

.btn-delete-small:hover {
    background: #ef4444;
}

.config-item-manager.expanded {
    background: var(--bg-secondary);
}

.config-item-manager.expanded:hover {
    background: #e5e7eb;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .config-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .config-stats {
        flex-wrap: wrap;
    }

    .config-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .config-item-path {
        max-width: 100%;
        margin: 0;
    }

    .config-item-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .config-details-grid {
        grid-template-columns: 1fr;
    }

    .config-item-actions {
        flex-wrap: wrap;
    }
}

/* 配置查看模态框样式 */
.config-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.config-view-modal.show {
    opacity: 1;
    visibility: visible;
}

.config-modal-content {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.config-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.config-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.config-modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.config-file-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
}

.file-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.file-info-item .info-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.file-info-item .info-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.config-content {
    margin-top: 1rem;
}

.config-content label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.config-content-display {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.config-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--bg-secondary);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .config-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .config-file-info {
        grid-template-columns: 1fr;
    }
    
    .config-modal-footer {
        flex-direction: column;
    }
}

/* 关联信息显示样式 */
.config-usage-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin: 1rem 0;
    padding: 1rem;
    border-left: 4px solid var(--primary-color);
}

.usage-info-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.usage-info-header i {
    color: var(--primary-color);
    font-size: 0.875rem;
}

.usage-info-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.usage-details-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.usage-detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    transition: var(--transition);
}

.usage-detail-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-tertiary);
}

.usage-detail-item i {
    color: var(--primary-color);
    font-size: 0.875rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.usage-detail-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--primary-color);
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.usage-detail-location {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    word-break: break-all;
    flex: 1;
}

/* 针对不同使用类型的特殊样式 */
.config-item-manager.used .config-usage-info {
    border-left-color: var(--success-color);
}

.config-item-manager.used .config-usage-info .usage-info-header i {
    color: var(--success-color);
}

.config-item-manager.used .usage-detail-item i {
    color: var(--success-color);
}

.config-item-manager.used .usage-detail-type {
    background: var(--success-color);
}

/* 提供商池关联的特殊样式 */
.usage-detail-item[data-usage-type="provider_pool"] {
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border-color: #0ea5e9;
}

.usage-detail-item[data-usage-type="provider_pool"] i {
    color: #0ea5e9;
}

.usage-detail-item[data-usage-type="provider_pool"] .usage-detail-type {
    background: #0ea5e9;
}

/* 主要配置关联的特殊样式 */
.usage-detail-item[data-usage-type="main_config"] {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-color: var(--success-color);
}

.usage-detail-item[data-usage-type="main_config"] i {
    color: var(--success-color);
}

.usage-detail-item[data-usage-type="main_config"] .usage-detail-type {
    background: var(--success-color);
}

/* 多种用途的特殊样式 */
.usage-detail-item[data-usage-type="multiple"] {
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
    border-color: var(--warning-color);
}

.usage-detail-item[data-usage-type="multiple"] i {
    color: var(--warning-color);
}

.usage-detail-item[data-usage-type="multiple"] .usage-detail-type {
    background: var(--warning-color);
}

/* 删除确认模态框样式 */
.delete-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.delete-confirm-modal.show {
    opacity: 1;
    visibility: visible;
}

.delete-modal-content {
    background: var(--bg-primary);
    border-radius: 0.75rem;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
    border: 2px solid transparent;
}

.delete-confirm-modal.used .delete-modal-content {
    border-color: var(--danger-color);
    box-shadow: 0 25px 80px rgba(239, 68, 68, 0.3);
}

.delete-confirm-modal.unused .delete-modal-content {
    border-color: var(--warning-color);
    box-shadow: 0 25px 80px rgba(245, 158, 11, 0.2);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.delete-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
}

.delete-confirm-modal.used .delete-modal-header {
    background: linear-gradient(135deg, #fee2e2 0%, #ffffff 100%);
    border-bottom-color: #fecaca;
}

.delete-confirm-modal.unused .delete-modal-header {
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
    border-bottom-color: #fed7aa;
}

.delete-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.delete-confirm-modal.used .delete-modal-header h3 {
    color: #ef4444;
}

.delete-confirm-modal.unused .delete-modal-header h3 {
    color: #d97706;
}

.delete-modal-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
    max-height: calc(85vh - 160px);
}

.delete-warning {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid;
}

.delete-warning.warning-used {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    border-color: #fca5a5;
    color: #ef4444;
}

.delete-warning.warning-unused {
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 100%);
    border-color: #fed7aa;
    color: #d97706;
}

.warning-icon {
    font-size: 1.5rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.warning-content h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.warning-content p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.config-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

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

.config-info-item .info-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.config-info-item .info-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

.config-info-item .info-value.status-used {
    color: var(--success-color);
    background: #d1fae5;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.config-info-item .info-value.status-unused {
    color: var(--warning-color);
    background: #fef3c7;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.usage-alert {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
    border: 1px solid #fca5a5;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.alert-icon {
    font-size: 1.25rem;
    color: #ef4444;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.alert-content h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ef4444;
}

.alert-content p {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: #7f1d1d;
    line-height: 1.5;
}

.alert-content ul {
    margin: 0 0 0.75rem 1.5rem;
    padding: 0;
    font-size: 0.875rem;
    color: #7f1d1d;
}

.alert-content li {
    margin-bottom: 0.25rem;
}

.alert-content strong {
    color: #ef4444;
    font-weight: 600;
}

.delete-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--bg-secondary);
}

.delete-confirm-modal.used .delete-modal-footer {
    background: linear-gradient(135deg, #fee2e2 0%, #f9fafb 100%);
    border-top-color: #fecaca;
}

.delete-confirm-modal.unused .delete-modal-footer {
    background: linear-gradient(135deg, #fef3c7 0%, #f9fafb 100%);
    border-top-color: #fed7aa;
}

.btn-cancel-delete {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-cancel-delete:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.btn-confirm-delete {
    position: relative;
    overflow: hidden;
}

.delete-confirm-modal.used .btn-confirm-delete {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    animation: pulseDanger 2s infinite;
}

.delete-confirm-modal.unused .btn-confirm-delete {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.3);
}

.delete-confirm-modal.used .btn-confirm-delete:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.delete-confirm-modal.unused .btn-confirm-delete:hover {
    background: linear-gradient(135deg, #b45309 0%, #92400e 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4);
}

@keyframes pulseDanger {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 4px 15px rgba(239, 68, 68, 0.7);
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .usage-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .usage-detail-type {
        align-self: flex-start;
    }
    
    .usage-detail-location {
        align-self: stretch;
    }
    
    .delete-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .delete-modal-body {
        padding: 1.5rem;
    }
    
    .delete-modal-header,
    .delete-modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .config-info {
        padding: 1rem;
    }
    
    .config-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .config-info-item .info-value {
        max-width: 100%;
        text-align: left;
    }
    
    .delete-modal-footer {
        flex-direction: column;
    }
    
    .delete-warning,
    .usage-alert {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* 禁用提供商状态样式 */
.provider-item-detail.disabled {
    opacity: 0.6;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #dee2e6;
    position: relative;
}

.provider-item-detail.disabled::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border-radius: 0 2px 2px 0;
    z-index: 1;
}

.provider-item-detail.disabled:hover {
    opacity: 0.8;
    border-color: #adb5bd;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.15);
    transform: none;
}

.provider-item-detail.disabled .provider-item-header {
    background: linear-gradient(135deg, #f1f3f4 0%, #ffffff 100%);
}

.provider-item-detail.disabled .provider-name {
    color: #6c757d;
    text-decoration: line-through;
}

.provider-item-detail.disabled .provider-meta {
    color: #9ca3af;
}

.disabled-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.provider-item-detail.disabled .disabled-status {
    color: #6c757d;
    background: rgba(108, 117, 125, 0.1);
}

.provider-item-detail:not(.disabled) .disabled-status {
    color: #059669;
    background: rgba(16, 185, 129, 0.1);
}

/* 禁用/启用按钮特殊样式 */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.btn-warning:active {
    transform: translateY(0);
}

/* 健康检测按钮样式 */
.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-info:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-info:active {
    transform: translateY(0);
}

/* 提供商状态指示器 */
.provider-status .disabled-indicator {
    position: relative;
}

.provider-status .disabled-indicator::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #6c757d;
    border: 2px solid white;
    border-radius: 50%;
}

.provider-status .enabled-indicator::after {
    background: var(--success-color);
}

/* 禁用状态下的交互效果 */
.provider-item-detail.disabled .provider-actions-group .btn-edit,
.provider-item-detail.disabled .provider-actions-group .btn-delete {
    opacity: 0.5;
    pointer-events: none;
}

.provider-item-detail.disabled .provider-actions-group .btn-toggle {
    opacity: 1;
}

/* 统计信息中的禁用状态显示 */
.provider-stat .disabled-count {
    color: #6c757d;
    font-style: italic;
}

.provider-stat .enabled-count {
    color: var(--success-color);
    font-weight: 600;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .provider-item-detail.disabled {
        opacity: 0.5;
    }
    
    .disabled-status {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    .provider-actions-group {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .btn-small {
        font-size: 0.7rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Dashboard Top Row Layout */
.dashboard-top-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: stretch;
    justify-content: flex-start;
}

.dashboard-top-row .stats-grid {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-top-row .stats-grid .stat-card {
    flex: 1;
    height: 100%;
}

.dashboard-top-row .dashboard-contact {
    flex: 1;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.dashboard-top-row .dashboard-contact .contact-grid {
    margin-top: 0;
    height: 100%;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.dashboard-top-row .dashboard-contact .contact-card {
    padding: 1.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dashboard-top-row .dashboard-contact .qr-container {
    margin: 0.75rem 0;
}

.dashboard-top-row .dashboard-contact .qr-code {
    width: 100px;
    height: 100px;
}

.dashboard-top-row .dashboard-contact .contact-card h3 {
    font-size: 1rem;
}

.dashboard-top-row .dashboard-contact .qr-description {
    font-size: 0.75rem;
}

/* Contact and Sponsor Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.contact-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.contact-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.contact-card h3 i {
    color: var(--primary-color);
}

.qr-container {
    margin: 1.5rem 0;
    display: flex;
    justify-content: center;
}

.qr-code {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border: 4px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: white;
    transition: var(--transition);
}

.qr-code:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.clickable-qr {
    cursor: zoom-in;
}

/* Image Zoom Overlay */
.image-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-zoom-overlay.show {
    display: flex;
    opacity: 1;
}

.image-zoom-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 0.5rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.image-zoom-overlay.show img {
    transform: scale(1);
}

.qr-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .dashboard-top-row {
        flex-direction: column;
    }
    
    .dashboard-top-row .stats-grid {
        flex: none;
    }
    
    .dashboard-top-row .dashboard-contact .qr-code {
        width: 160px;
        height: 160px;
    }
}

@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .contact-card {
        padding: 1.5rem;
    }
    
    .qr-code {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 480px) {
    .qr-code {
        width: 150px;
        height: 150px;
    }
    
    .contact-card {
        padding: 1rem;
    }

/* Contact section styling for dashboard */
.contact-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.contact-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-section h3 i {
    color: var(--primary-color);
}

}


/* 不支持的模型选择器样式 */
.not-supported-models-section {
    grid-column: 1 / -1;
    margin-top: 16px;
}

.not-supported-models-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
}

.not-supported-models-section .help-text {
    font-size: 12px;
    font-weight: normal;
    color: #6c757d;
    margin-left: 4px;
}

.not-supported-models-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    min-height: 100px;
}

.models-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6c757d;
    padding: 20px;
}

.models-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.model-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-checkbox-label:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.model-checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.model-checkbox-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.model-checkbox-label .model-name {
    font-size: 13px;
    color: #495057;
    user-select: none;
}

.model-checkbox-label input[type="checkbox"]:checked + .model-name {
    color: #dc3545;
    font-weight: 500;
}

.no-models,
.error-message {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-size: 14px;
}

.error-message {
    color: #dc3545;
}

/* 编辑模式下的样式 */
.provider-item-detail.editing .model-checkbox-label {
    cursor: pointer;
}

.provider-item-detail.editing .model-checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.provider-item-detail.editing .model-checkbox-label input[type="checkbox"]:not(:disabled) {
    cursor: pointer;
}

/* 全宽配置项 */
.form-grid.full-width {
    grid-column: 1 / -1;
}

/* 授权按钮样式 - 与健康状态样式类似 */
.generate-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: #e0f2fe;
    color: #0369a1;
    border: none;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.generate-auth-btn:hover {
    background: #bae6fd;
    color: #075985;
    transform: translateY(-1px);
}

.generate-auth-btn:active {
    transform: translateY(0);
}

.generate-auth-btn i {
    font-size: 0.75rem;
}

/* 授权模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: 0.75rem;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 i {
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: #e9ecef;
    color: #495057;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.modal-cancel {
    padding: 0.75rem 1.5rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.modal-cancel:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.open-auth-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.open-auth-btn:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

.open-auth-btn:active {
    transform: translateY(0);
}

.open-auth-btn i {
    font-size: 0.875rem;
}

/* 授权信息样式 */
.auth-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-info p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.auth-instructions {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.auth-instructions h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.auth-instructions ol {
    margin: 0 0 1rem 1.5rem;
    padding: 0;
}

.auth-instructions li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.auth-note {
    margin: 1rem 0 0 0;
    padding: 0.75rem;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #92400e;
}

.auth-url-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-url-section label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.auth-url-container {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-url-input {
    flex: 1;
    padding: 0.75rem;
    padding-right: 3rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.auth-url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.auth-url-container .copy-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.auth-url-container .copy-btn:hover {
    background: #047857;
}

.open-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .auth-instructions {
        padding: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .generate-auth-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}


/* ==================== 分页控件样式 ==================== */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-container.top {
    margin-top: 0;
}

.pagination-container.bottom {
    margin-bottom: 0;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

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

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn.nav-btn {
    background: var(--bg-secondary);
}

.page-ellipsis {
    padding: 0 8px;
    color: var(--text-secondary);
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.page-jump-input {
    width: 60px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-size: 0.875rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.page-jump-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* 移除数字输入框的上下箭头 */
.page-jump-input::-webkit-outer-spin-button,
.page-jump-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.page-jump-input[type=number] {
    -moz-appearance: textfield;
}

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

/* ==================== 用量查询页面样式 ==================== */
.usage-panel {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.usage-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.usage-last-update {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.usage-loading,
.usage-error,
.usage-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.usage-error {
    color: var(--danger-color);
    background: #fef2f2;
    border-radius: 0.5rem;
    border: 1px solid #fee2e2;
}

.usage-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    opacity: 0.5;
}

/* 提供商分组样式 */
.usage-provider-group {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.usage-group-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.usage-group-header:hover {
    background: var(--bg-tertiary);
}

.usage-group-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.usage-group-title .toggle-icon {
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    width: 1rem;
}

.usage-provider-group:not(.collapsed) .toggle-icon {
    transform: rotate(90deg);
}

.usage-group-title .provider-icon {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.usage-group-title .provider-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.usage-group-title .instance-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.usage-group-title .success-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.usage-group-title .success-count.all-success {
    color: var(--success-color);
}

.usage-group-content {
    padding: 1rem;
    display: block;
}

.usage-provider-group.collapsed .usage-group-content {
    display: none;
}

/* 用量卡片网格 - 一排四个 */
.usage-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 1400px) {
    .usage-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .usage-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .usage-cards-grid {
        grid-template-columns: 1fr;
    }
}

.stat-success { color: var(--success-color); }
.stat-error { color: var(--danger-color); }
.stat-total { color: var(--text-secondary); }

/* 实例卡片 */
.usage-instance-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.usage-instance-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.usage-instance-card.error {
    border-color: #fca5a5;
}

.usage-instance-card.success {
    border-left: 3px solid var(--success-color);
}

.usage-instance-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to right, var(--bg-tertiary), var(--bg-secondary));
}

.instance-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.instance-provider-type {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.7rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.instance-provider-type i {
    font-size: 0.75rem;
}

.instance-status-badges {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.instance-name {
    margin-bottom: 0.375rem;
}

.instance-name-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 用户信息整合到卡片头部 */
.instance-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.375rem;
    border-top: 1px dashed var(--border-color);
    margin-top: 0.375rem;
}

.user-email {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-email i {
    font-size: 0.65rem;
    color: var(--primary-color);
}

.user-subscription {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 9999px;
    font-weight: 500;
}

.status-success { color: var(--success-color); }
.status-error { color: var(--danger-color); }

.badge {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
}

.badge-healthy {
    background: #d1fae5;
    color: #065f46;
}

.badge-unhealthy {
    background: #fee2e2;
    color: #991b1b;
}

.badge-disabled {
    background: #f3f4f6;
    color: #6b7280;
}

.usage-instance-content {
    padding: 0.75rem;
    flex: 1;
}

.usage-error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--danger-color);
    padding: 0.75rem;
    background: #fef2f2;
    border-radius: 0.375rem;
    font-size: 0.75rem;
}

/* 用量详情 - 紧凑布局 */
.usage-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.usage-section {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.usage-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.usage-section h4 i {
    color: var(--primary-color);
    font-size: 0.75rem;
}

/* 信息网格 - 紧凑 */
.usage-section .info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.usage-section .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--border-color);
}

.usage-section .info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.usage-section .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.usage-section .value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subscription-title {
    color: var(--primary-color);
}

/* 总用量样式 */
.total-usage {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.total-usage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.total-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.total-label i {
    color: var(--primary-color);
}

.total-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: monospace;
}

.total-percent {
    text-align: right;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* 重置时间紧凑样式 */
.reset-info-compact {
    background: var(--bg-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.reset-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.reset-info-row:first-child {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.375rem;
    margin-bottom: 0.25rem;
}

.reset-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.reset-label i {
    font-size: 0.65rem;
    color: var(--primary-color);
}

.reset-value {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
}

.reset-days {
    color: var(--primary-color);
    font-weight: 700;
}

/* 过期时间行样式 */
.expiration-row {
    border-top: 1px dashed var(--border-color);
    padding-top: 0.375rem;
    margin-top: 0.25rem;
}

.expiring-soon {
    color: var(--danger-color) !important;
    font-weight: 700;
}

/* 用量明细 - 紧凑版 */
.usage-breakdown-compact {
    background: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.breakdown-item-compact {
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.breakdown-item-compact:last-child {
    margin-bottom: 0;
}

.breakdown-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
    font-size: 0.7rem;
}

.breakdown-header-compact .breakdown-name {
    font-weight: 600;
    color: var(--text-primary);
}

.breakdown-header-compact .breakdown-usage {
    color: var(--text-secondary);
    font-family: monospace;
}

.progress-bar-small {
    height: 0.25rem;
    background: var(--bg-tertiary);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.375rem;
}

.progress-bar-small .progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.progress-bar-small.normal .progress-fill { background: var(--success-color); }
.progress-bar-small.warning .progress-fill { background: var(--warning-color); }
.progress-bar-small.danger .progress-fill { background: var(--danger-color); }

/* 额外用量信息（免费试用、奖励） */
.extra-usage-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6rem;
    padding: 0.375rem;
    border-radius: 0.25rem;
    margin-top: 0.375rem;
}

.extra-usage-info.free-trial {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #dbeafe;
}

.extra-usage-info.bonus {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fef3c7;
}

.extra-usage-info .extra-label {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.extra-usage-info .extra-label i {
    font-size: 0.55rem;
}

.extra-usage-info .extra-value {
    font-family: monospace;
    font-weight: 600;
}

.extra-usage-info .extra-expires {
    margin-left: auto;
    opacity: 0.8;
    font-size: 0.55rem;
}

.breakdown-item {
    margin-bottom: 0.75rem;
    background: var(--bg-primary);
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

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

.breakdown-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.breakdown-name {
    color: var(--text-primary);
}

.breakdown-usage {
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.7rem;
}

.progress-bar {
    height: 0.375rem;
    background: var(--bg-tertiary);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.progress-bar.normal .progress-fill { background: var(--success-color); }
.progress-bar.warning .progress-fill { background: var(--warning-color); }
.progress-bar.danger .progress-fill { background: var(--danger-color); }

/* 免费试用和奖励信息 - 紧凑 */
.free-trial-info,
.bonus-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.65rem;
    padding: 0.375rem;
    background: var(--bg-tertiary);
    border-radius: 0.25rem;
    margin-top: 0.375rem;
}

.free-trial-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #dbeafe;
}

.bonus-item {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fef3c7;
}

.free-trial-info .label,
.bonus-item .bonus-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.free-trial-info .value,
.bonus-item .bonus-usage {
    font-family: monospace;
    font-weight: 600;
}

.free-trial-info .expires,
.bonus-item .bonus-expires {
    margin-left: auto;
    color: currentColor;
    opacity: 0.8;
    font-size: 0.6rem;
}

.bonuses-info {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* 用量卡片响应式调整 */
@media (max-width: 768px) {
    .usage-instance-header {
        padding: 0.5rem 0.75rem;
    }
    
    .instance-name-text {
        max-width: 120px;
    }
    
    .usage-instance-content {
        padding: 0.5rem;
    }
}

/* ==================== 语言切换器样式 ==================== */
.language-switcher {
    position: relative;
    display: inline-block;
}

.language-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.language-btn:hover {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.language-btn i {
    font-size: 1rem;
}

.current-lang {
    font-weight: 600;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.language-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: var(--transition);
    position: relative;
}

.language-option:first-child {
    border-radius: 0.5rem 0.5rem 0 0;
}

.language-option:last-child {
    border-radius: 0 0 0.5rem 0.5rem;
}

.language-option:hover {
    background: var(--bg-secondary);
}

.language-option i {
    font-size: 0.875rem;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.language-option.active i {
    opacity: 1;
}

.language-option span {
    flex: 1;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .language-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .language-btn .current-lang {
        display: none;
    }
    
    .language-dropdown {
        right: auto;
        left: 0;
    }
}
