/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 顶部导航栏 */
.api-header {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo h1 {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #007bff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome-text {
    font-size: 14px;
    color: #6c757d;
}

.login-btn,
.register-btn,
.logout-btn,
.console-btn {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-btn {
    background-color: transparent;
    color: #007bff;
    border: 1px solid #007bff;
}

.login-btn:hover {
    background-color: #007bff;
    color: white;
}

.register-btn {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
}

.register-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.logout-btn {
    background-color: #f8f9fa;
    color: #dc3545;
    border: 1px solid #e9ecef;
}

.logout-btn:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.console-btn {
    background-color: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.console-btn:hover {
    background-color: #218838;
    border-color: #218838;
}

/* 主内容区域 */
.api-main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* 介绍部分 */
.intro-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 60px 40px;
    margin-bottom: 40px;
    text-align: center;
    color: white;
}

.intro-content h2 {
    font-size: 36px;
    margin-bottom: 15px;
    font-weight: 600;
}

.intro-content p {
    font-size: 18px;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.intro-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.explore-btn,
.guide-btn {
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.explore-btn {
    background-color: white;
    color: #667eea;
    border: 2px solid white;
}

.explore-btn:hover {
    background-color: transparent;
    color: white;
}

.guide-btn {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.guide-btn:hover {
    background-color: white;
    color: #667eea;
}

/* 章节标题 */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.section-header p {
    font-size: 16px;
    color: #6c757d;
    max-width: 800px;
    margin: 0 auto;
}

/* API类别列表样式 */
.api-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.api-category-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.api-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.category-icon {
    font-size: 32px;
}

.category-header h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.category-description {
    color: #666;
    margin-bottom: 24px;
    line-height: 1.6;
}

.api-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.api-item {
    background: white;
    padding: 20px;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.api-item:hover {
    transform: translateX(4px);
}

.api-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.api-method {
    padding: 4px 12px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
}

.api-method-small {
    padding: 2px 8px;
    font-size: 12px;
    min-width: 45px;
}

.api-method-get {
    background: #61affe;
}

.api-method-post {
    background: #49cc90;
}

.api-method-put {
    background: #fca130;
}

.api-method-delete {
    background: #f93e3e;
}

.api-method-patch {
    background: #50e3c2;
}

.api-item-header h4 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.api-item-description {
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
}

.api-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.api-endpoint {
    font-family: monospace;
    font-size: 14px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

.api-endpoint-full {
    font-family: monospace;
    font-size: 14px;
    color: #666;
    background: #e9ecef;
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
}

.view-detail-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.view-detail-btn:hover {
    background: #0056b3;
}

/* 接口文件展示样式 */
.api-endpoints {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-top: 48px;
}

.api-endpoint-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.api-endpoint-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.endpoint-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}

.endpoint-icon {
    font-size: 32px;
    margin-top: 4px;
}

.endpoint-title-section {
    flex: 1;
}

.endpoint-title-section h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.endpoint-description {
    color: #666;
    margin-bottom: 24px;
    line-height: 1.6;
}

.operations-container {
    background: white;
    border-radius: 6px;
    padding: 20px;
}

.operations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.operations-header h4 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.methods-display {
    display: flex;
    gap: 8px;
}

.operations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.operation-item {
    padding: 12px;
    border-radius: 4px;
    background: #f8f9fa;
}

.operation-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.operation-header h5 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.operation-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* 接口底部样式 */
.endpoint-footer {
    text-align: center;
    margin-top: 16px;
}

/* 使用步骤 */
.usage-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.usage-step {
    background-color: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    transition: transform 0.3s ease;
}

.usage-step:hover {
    transform: translateY(-5px);
}

.step-number {
    width: 40px;
    height: 40px;
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}

.step-content p {
    color: #6c757d;
    font-size: 14px;
}

/* 页脚 */
.api-footer {
    background-color: #2c3e50;
    color: #adb5bd;
    padding: 30px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .main-nav ul {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .api-main-content {
        padding: 20px 15px;
    }
    
    .intro-section {
        padding: 40px 20px;
        margin-bottom: 30px;
    }
    
    .intro-content h2 {
        font-size: 28px;
    }
    
    .intro-content p {
        font-size: 16px;
    }
    
    .intro-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .section-header h2 {
        font-size: 24px;
    }
    
    .api-category-card {
        padding: 20px;
    }
    
    .category-header h3 {
        font-size: 20px;
    }
    
    .usage-step {
        padding: 20px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .header-content {
        padding: 10px 15px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .main-nav ul {
        gap: 15px;
    }
    
    .header-actions {
        gap: 10px;
    }
    
    .login-btn,
    .register-btn,
    .logout-btn,
    .console-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .api-item-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}