/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    background: #f5f7fa;
}

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

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.8rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.8;
}

/* 主内容区 */
.main-content {
    display: flex;
    gap: 2rem;
    padding: 2rem 0;
    max-width: 1400px;
    margin: 0 auto;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    flex-shrink: 0;
}

.sidebar-sticky {
    position: sticky;
    top: 100px;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #667eea;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.sidebar-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sidebar-link:hover {
    background: #f0f2ff;
    color: #667eea;
}

/* 内容区 */
.content {
    flex: 1;
    min-width: 0;
}

.section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section h1 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.section h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.section h3 {
    color: #555;
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.1rem;
}

/* 介绍卡片 */
.intro-box {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 8px;
    padding: 2rem;
    margin-top: 1rem;
}

.intro-box p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #555;
}

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

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

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0.5rem;
}

/* 信息框 */
.info-box {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 1rem;
}

/* API卡片 */
.api-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-top: 1rem;
    overflow: hidden;
}

.api-card.highlight {
    border: 2px solid #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.api-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.method {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.method.get {
    background: #10b981;
    color: white;
}

.method.post {
    background: #3b82f6;
    color: white;
}

.endpoint {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: #333;
}

.api-body {
    padding: 1.5rem;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.table thead {
    background: #f8f9fa;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.table td {
    color: #666;
    font-size: 0.9rem;
}

/* 代码块 */
pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
}

code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* 按钮 */
.btn-test,
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-test:hover,
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

/* 在线调试工具 */
.playground {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
}

.playground-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
}

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

#api-select {
    flex: 1;
}

.playground-editor {
    margin-bottom: 1.5rem;
}

.editor-section {
    margin-bottom: 1rem;
}

.editor-section h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #555;
}

#request-body {
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.playground-response {
    margin-top: 1.5rem;
}

.response-status {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-weight: 500;
}

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

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

.response-body {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 6px;
    max-height: 500px;
    overflow-y: auto;
}

.response-body code {
    color: inherit;
}

/* 底部 */
.footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    margin: 0.5rem 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .sidebar-sticky {
        position: static;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .playground-controls {
        flex-direction: column;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
