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

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.error {
    background: #ef4444;
}

.status-dot.checking {
    background: #f59e0b;
}

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

.status-text {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-style: italic;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 区块样式 */
.api-section,
.auth-section,
.test-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

/* API 端点样式 */
.api-endpoints {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.api-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.api-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.api-label {
    font-weight: 500;
    color: #374151;
}

.api-endpoint {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 13px;
    color: #1f2937;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
}

.api-endpoint:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* 认证配置样式 */
.auth-config {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

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

.form-group label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.auth-format {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 12px;
    color: #4b5563;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    word-break: break-all;
    line-height: 1.4;
}

/* 按钮样式 */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: #6366f1;
    color: white;
}

.btn-primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #10b981;
    color: white;
}

.btn-secondary:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

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

.test-result h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #374151;
}

.test-result pre {
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 12px;
    background: white;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 底部样式 */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.footer .version {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.footer .links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer .links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer .links a:hover {
    color: white;
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 300px;
    font-size: 14px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

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

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

/* 加载指示器样式 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-text {
    color: white;
    font-size: 16px;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }

    .api-section,
    .auth-section,
    .test-section {
        padding: 20px;
    }

    .section-title {
        font-size: 18px;
    }

    .api-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .api-endpoint {
        align-self: flex-end;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    }

    .api-section,
    .auth-section,
    .test-section {
        background: rgba(31, 41, 55, 0.95);
    }

    .section-title {
        color: #f9fafb;
    }

    .api-item {
        background: #374151;
        border-color: #4b5563;
    }

    .api-item:hover {
        background: #4b5563;
    }

    .api-label {
        color: #d1d5db;
    }

    .api-endpoint {
        background: #1f2937;
        color: #f9fafb;
        border-color: #4b5563;
    }

    .form-group label {
        color: #d1d5db;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .auth-format {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }

    .test-result {
        background: #374151;
        border-color: #4b5563;
    }

    .test-result h3 {
        color: #f9fafb;
    }

    .test-result pre {
        background: #1f2937;
        border-color: #4b5563;
        color: #f9fafb;
    }
}