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

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

/* 通用组件样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.section {
    background: white;
    margin-bottom: 30px;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.section h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

.section h3 {
    color: #555;
    font-size: 1.5rem;
    margin: 30px 0 15px 0;
    padding-left: 15px;
    border-left: 4px solid #667eea;
}

.section h4 {
    color: #666;
    font-size: 1.2rem;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.section h5 {
    color: #777;
    font-size: 1.1rem;
    margin: 15px 0 10px 0;
    font-weight: 600;
}

/* 接口端点样式 */
.endpoint {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #28a745;
}

.endpoint .method {
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-weight: bold;
    margin-right: 10px;
    font-size: 0.9rem;
}

.endpoint .method.app {
    background: #667eea;
    color: white;
}

.endpoint .url {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #333;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

tr:hover {
    background-color: #f8f9fa;
}

/* 代码块样式 */
.code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    overflow-x: hidden;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 语法高亮 */
.json {
    color: #68d391;
}

.string {
    color: #f6e05e;
}

.number {
    color: #90cdf4;
}

.boolean {
    color: #fbb6ce;
}

/* 状态徽章 */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-200 { background: #d4edda; color: #155724; }
.status-400 { background: #f8d7da; color: #721c24; }
.status-401 { background: #fff3cd; color: #856404; }
.status-404 { background: #d1ecf1; color: #0c5460; }
.status-500 { background: #f5c6cb; color: #721c24; }
.status-503 { background: #e2e3e5; color: #383d41; }

/* 高亮框 */
.highlight {
    background: linear-gradient(120deg, #a8edea 0%, #fed6e3 100%);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 5px solid #667eea;
}

/* 注意框 */
.note {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.note-title {
    font-weight: bold;
    color: #856404;
    margin-bottom: 10px;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #667eea;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    opacity: 0.8;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    opacity: 1;
    transform: translateY(-3px);
}

/* 面包屑导航 */
.breadcrumb {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 10px;
    color: #ccc;
}

/* 二级导航样式 */
.nav-submenu {
    display: none;
    background: #f8f9fa;
    margin: 5px 0;
    border-radius: 5px;
}

.nav-submenu.active {
    display: block;
}

.nav-submenu .nav-item {
    padding: 8px 40px;
    font-size: 0.9rem;
    border-left: none;
    color: #666;
}

.nav-submenu .nav-item:hover,
.nav-submenu .nav-item.active {
    background-color: #e9ecef;
    color: #667eea;
}

.nav-item.has-submenu {
    position: relative;
}

.nav-item.has-submenu::after {
    content: "▼";
    position: absolute;
    right: 20px;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.nav-item.has-submenu.open::after {
    transform: rotate(180deg);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .section {
        padding: 20px;
    }
    
    .section h2 {
        font-size: 1.5rem;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 8px 10px;
    }
    
    .code-block {
        padding: 15px;
        font-size: 0.9rem;
    }
}