:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --border-color: #ddd;
    --sidebar-width: 250px;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: var(--light-color);
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--dark-color);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 0;
    z-index: 100;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar h2 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.sidebar p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: block;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 10px 20px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background-color: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--primary-color);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px;
    max-width: 1000px;
}

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 首页特定样式 */
.welcome-section {
    margin: 30px 0;
}

.welcome-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.welcome-card h2 {
    margin-bottom: 15px;
    font-size: 2rem;
    font-weight: 300;
}

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

.feature-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.feature-card h3 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 15px;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn:hover {
    background-color: var(--secondary-color);
}

.quick-links {
    margin: 40px 0;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.link-list {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.link-item {
    background-color: var(--light-color);
    padding: 15px 25px;
    border-radius: 5px;
    text-decoration: none;
    color: var(--dark-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    font-weight: 500;
}

.link-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: white;
}

/* 文档通用样式 */
h1 {
    color: var(--dark-color);
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    margin-bottom: 30px;
    font-weight: 300;
}

h2 {
    color: var(--secondary-color);
    margin-top: 35px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 400;
}

h3 {
    color: var(--dark-color);
    margin: 20px 0 10px;
    font-weight: 500;
}

h4 {
    color: var(--dark-color);
    margin: 15px 0 8px;
    font-weight: 500;
}

.endpoint {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 5px solid var(--primary-color);
}

.json {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    margin: 12px 0;
    white-space: pre-wrap;
    border: 1px solid #e9ecef;
    line-height: 1.4;
}

.json pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.json-key {
    color: #92278f;
    font-weight: bold;
}

.json-string {
    color: #3ab54a;
}

.json-number {
    color: #25aae2;
}

.json-boolean {
    color: #f1592a;
}

.json-null {
    color: #f1592a;
}

.method {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.url {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: bold;
    color: var(--dark-color);
    font-size: 0.9rem;
}

.note {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
}

.note strong {
    color: #856404;
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    background: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.param-table th, .param-table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

.param-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--dark-color);
}

.param-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: #6c757d;
    font-size: 0.9rem;
}

/* AIE页面特定样式 */
.architecture-diagram {
    margin: 20px 0;
}

.arch-layer {
    background: white;
    padding: 20px;
    margin: 10px 0;
    border-left: 4px solid var(--success-color);
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.arch-layer h4 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* 列表样式 */
ul, ol {
    margin: 10px 0;
    padding-left: 20px;
}

li {
    margin: 5px 0;
    line-height: 1.5;
}

/* 链接样式 */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    body {
        flex-direction: column;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .link-list {
        flex-direction: column;
    }
    
    .param-table {
        display: block;
        overflow-x: auto;
    }
    
    .welcome-card {
        padding: 25px;
    }
    
    .welcome-card h2 {
        font-size: 1.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .json {
        font-size: 0.8rem;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 10px;
    }
    
    .endpoint {
        padding: 15px;
        margin: 15px 0;
    }
    
    .feature-card {
        padding: 15px;
    }
    
    .welcome-card {
        padding: 20px;
    }
    
    .param-table th, .param-table td {
        padding: 8px;
        font-size: 0.9rem;
    }
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

.json::-webkit-scrollbar {
    height: 6px;
}

.json::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 3px;
}

.json::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 3px;
}

.json::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* 打印样式 */
@media print {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .btn, .link-item {
        display: none;
    }
    
    .endpoint {
        break-inside: avoid;
    }
}

/* ===== JSON显示修复 ===== */
.json {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    margin: 12px 0;
    white-space: pre;
    border: 1px solid #e9ecef;
    line-height: 1.4;
    color: #333;
    position: relative;
}

.json pre {
    margin: 0;
    white-space: pre;
    overflow-x: auto;
    color: #333;
    font-family: inherit;
}

/* 确保所有字符都显示 */
.json pre::selection {
    background-color: #b3d4fc;
}

/* 强制显示双引号 */
.json pre:before,
.json pre:after {
    display: none;
}

/* 如果JSON内容被错误解析，使用通用选择器 */
.json * {
    color: inherit;
    font-family: inherit;
}

/* 简单的语法高亮（如果使用JavaScript高亮的话） */
.json-string { color: #3ab54a; }
.json-number { color: #25aae2; }
.json-boolean { color: #f1592a; }
.json-null { color: #f1592a; }
.json-key { 
    color: #92278f;
    font-weight: bold;
}

/* 确保滚动条可见 */
.json::-webkit-scrollbar {
    height: 8px;
}

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

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

.json::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}