:root {
    --primary: #2563eb;
    --secondary: #1e40af;
    --dark: #0f172a;
    --light: #f1f5f9;
    --accent: #f59e0b;
    --gray: #64748b;
    --light-gray: #cbd5e1;
    --sidebar-bg: #0f0c29;
    --sidebar-active: rgba(37, 99, 235, 0.2);
    --content-bg: #f0f2f5;
    --card-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--content-bg);
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 360px;
    background: linear-gradient(135deg, var(--dark), #1e293b);
    color: white;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    color: var(--primary);
}

.logo i {
    color: var(--accent);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    /* 修改点：背景透明 + 添加白色边框 */
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3); /* 半透明白色边框 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    background-size: cover;
    background-position: center;
    /* 修改点：文字颜色改为白色确保可读性 */
    color: white;
}

/* 模型卡片中的作者头像也需要修改 */
.author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    /* 修改点：背景透明 + 添加边框 */
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1); /* 主内容区用浅色边框 */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--dark); /* 使用深色文字 */
    font-weight: bold;
}

/* 如果VIP状态也需要更新 */
.user-details p {
    background-color: #ff9800;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
}

.user-details h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.user-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 25px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-value {
    font-weight: bold;
    color: var(--accent);
}

.sidebar-menu {
    padding: 0 20px;
}

.menu-group {
    margin-bottom: 25px;
}

.menu-group-title {
    font-size: 14px;
    color: var(--light-gray);
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: rgba(255, 255, 255, 0.8);
}

.menu-item:hover {
    background: var(--sidebar-active);
    color: white;
}

.menu-item.active {
    background: var(--sidebar-active);
    color: white;
    font-weight: 500;
    border-left: 3px solid var(--primary);
}

.menu-item i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.menu-item .badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 添加居中容器样式 */
.api-center-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    gap: 30px;
}

/* 调整卡片宽度 */
.api-center-container .tabs-container,
.api-center-container .api-card {
    width: 100%;
    max-width: 1200px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

/* 标签页容器 */
.tabs-container {
    margin-bottom: 25px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.tabs-header {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0 15px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs-header::-webkit-scrollbar {
    display: none;
}

.tab-button {
    padding: 12px 20px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.tab-button:hover {
    color: #0d6efd;
}

.tab-button.active {
    color: #0d6efd;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #0d6efd;
}

.tab-content {
    display: none;
    padding: 0;
}

.tab-content.active {
    display: block;
}

/* 代码块样式增强 */
.api-demo-section {
    padding: 20px;
}

.api-demo-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 6px 6px 0 0;
}

.code-lang {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
}

.copy-btn {
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background-color: #dee2e6;
}

.api-demo-code {
    margin: 0;
    padding: 15px;
    background-color: #2d2d2d;
    color: #f8f8f2;
    border-radius: 0 0 6px 6px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
    font-family: 'Consolas', 'Monaco', monospace;
}

.code-keyword {
    color: #cc99cd;
}

.code-string {
    color: #7ec699;
}

.code-comment {
    color: #999999;
}

.code-param {
    color: #f8c555;
}

.code-url {
    color: #67cdcc;
}

.code-function {
    color: #f08d49;
}

/* 修改API卡片容器为垂直布局 */
.api-cards-container {
    display: flex;
    flex-direction: column; /* 改为垂直排列 */
    gap: 30px;
    margin-top: 30px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.api-card {
    width: 100%; /* 每个卡片占据整行 */
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.api-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background-color: #f8f9fa;
}

.card-header h3 {
    margin: 0;
    font-size: 1.4rem;
    text-align: center;
    color: var(--primary);
}

.card-content {
    padding: 20px;
}

.api-card p.info {
    text-align: center;
    margin: 10px 0 20px;
    color: #666;
    font-size: 0.95rem;
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}

.pricing-table th, .pricing-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.pricing-table th {
    background-color: #f1f5ff;
    font-weight: 600;
    color: var(--dark);
}

.pricing-table tr:last-child td {
    border-bottom: none;
}

.pricing-table tr:hover {
    background-color: #f8f9ff;
}

.sub-plans-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
    justify-content: center;
}

.sub-plan {
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    background: white;
}

.sub-plan:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.sub-plan.popular {
    border: 1px solid var(--primary);
    transform: scale(1.03);
}

.sub-plan.popular:hover {
    transform: scale(1.05) translateY(-8px);
}

.sub-plan h4 {
    margin-top: 0;
    font-size: 1.3rem;
    color: var(--dark);
    margin-bottom: 15px;
}

.sub-plan .price {
    font-size: 1.8rem;
    font-weight: bold;
    margin: 15px 0;
    color: var(--secondary);
}

.sub-plan .price small {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--gray);
    display: block;
}

.sub-plan .popular-tag {
    background: var(--primary);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: inline-block;
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600;
}

.sub-plan ul {
    list-style-type: none;
    padding: 0;
    text-align: left;
    margin: 20px 0;
}

.sub-plan ul li {
    padding: 8px 0;
    border-bottom: 1px dashed #f0f0f0;
    display: flex;
    align-items: flex-start;
}

.sub-plan ul li:before {
    content: "✓";
    color: var(--primary);
    margin-right: 8px;
    font-weight: bold;
}

.btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    margin-top: 10px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
}

.btn:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}







/* 修复后的FAQ部分 */
        .faq-section {
            background: white;
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
            padding: 30px;
            margin-top: 20px;
            flex: 1;
        }
        
        .faq-header {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 25px;
            color: #4e75ff;
            border-bottom: 2px solid #4e75ff;
            padding-bottom: 10px;
            display: inline-block;
        }
        
        .faq-container {
            display: grid;
            gap: 20px;
        }
        
        .faq-item {
            background: #fafafa;
            border-radius: 10px;
            overflow: hidden;
            transition: all 0.3s ease;
            border: 1px solid #eaecef;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.03);
            position: relative;
            z-index: 1; /* 确保悬停时不会超出容器 */
        }
        
        /* 修复问题：移除位置变换 */
        .faq-item:hover {
            /* 原效果： transform: translateY(-10px); */
            /* 新效果：只加深阴影和添加颜色强调 */
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
            border-left: 4px solid #4e75ff;
        }
        
        .faq-question {
            padding: 18px 20px;
            font-weight: 600;
            font-size: 16px;
            color: #1a1f36;
            display: flex;
            cursor: pointer;
            align-items: center;
        }
        
        .faq-question i {
            margin-right: 10px;
            color: #4e75ff;
        }
        
        .faq-answer {
            padding: 0 20px 20px 20px;
            color: #555;
            border-top: 1px solid #eee;
            margin-top: 0;
            display: none;
        }
        
        .faq-expand-icon {
            margin-left: auto;
            transition: transform 0.3s ease;
        }
        
        .faq-item.expanded .faq-expand-icon {
            transform: rotate(180deg);
        }
        
        .faq-item.expanded .faq-answer {
            display: block;
        }
        
        .footer-section {
            margin-top: 60px;
        }














.footer-title {
    font-size: 14px;
    margin-bottom: 15px;
    color: var(--light-gray);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* 顶部工具栏 */
.topbar {
    background-color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--light);
    border-radius: 30px;
    padding: 10px 15px;
    width: 600px;
}

.search-bar input {
    border: none;
    background: transparent;
    padding: 0 10px;
    font-size: 14px;
    width: 100%;
    outline: none;
}

.search-bar i {
    color: var(--gray);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light);
    cursor: pointer;
    transition: all 0.3s;
}

.action-icon:hover {
    background: var(--light-gray);
}

/* 内容区域 */
.content {
    padding: 30px;
    flex: 1;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    position: relative;
    padding-bottom: 10px;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

/* 移动端元素 */
.mobile-menu-toggle {
    display: none;
    padding: 15px;
    text-align: center;
    color: white;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-menu-toggle i {
    font-size: 20px;
}

/* 移动端统计信息 */
.mobile-stats {
    display: none;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin: 0 10px 15px; /* 修复：顶部0, 左右10px, 底部15px */
    flex-wrap: wrap;
}

.mobile-stat-item {
    text-align: center;
    padding: 8px;
    font-size: 13px;
}

.mobile-stat-item div:first-child {
    color: var(--light-gray);
    margin-bottom: 5px;
}

.mobile-stat-item div:last-child {
    font-weight: bold;
    color: var(--accent);
}


.json-code {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.4;
    tab-size: 4;
    white-space: pre-wrap;
}

.code-number {
    color: #bd93f9; /* 数字值颜色-紫色 */
}

@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
    }
    
    .search-bar {
        width: 400px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 70px;
        overflow: visible;
    }
    
    .sidebar-header, .user-info, .user-details, .stat-name, 
    .menu-group-title, .menu-item span, .sidebar-footer {
        display: none;
    }
    
    .menu-item {
        padding: 15px;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .menu-item i {
        margin: 0;
        font-size: 20px;
    }
    
    .avatar {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .model-card {
        min-height: 250px;
    }

    /* 隐藏桌面端用户信息和统计信息 */
    .user-info, 
    .user-stats,
    .sidebar-footer {
        display: none;
    }
    
    /* 在移动端调整订阅计划内部布局 */
    .sub-plans-container {
        flex-direction: column;
        align-items: center;
    }
    
    .sub-plan {
        width: 100%;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .pricing-table {
        display: block;
        overflow-x: auto;
    }
    
    .section-title {
        font-size: 24px;
    }

    /* 显示移动端元素 */
    .mobile-menu-toggle,
    .mobile-stats {
        display: block;
    }

    .mobile-stats {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .mobile-stat-item {
        flex: 1;
        min-width: 45%;
        margin: 5px;
    }

    .model-card {
        min-height: 250px;
    }
    
    .tabs-header {
        padding: 0 10px;
    }
    
    .tab-button {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .api-demo-code {
        font-size: 12px;
        padding: 10px;
    }

    body {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 10px;
    }
    
    .sidebar-header {
        display: flex;
        align-items: center;
        padding: 10px;
    }
    
    .logo {
        margin: 0;
    }
    
    .user-info {
        display: none;
    }
    
    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        padding: 10px 0;
    }
    
    .menu-group {
        display: flex;
        margin: 0;
    }
    
    .menu-item {
        margin: 0 5px;
        white-space: nowrap;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    .topbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .content {
        padding: 20px;
    }
    
    .api-center-container {
        gap: 20px;
    }
}

/* 提示信息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* 禁用按钮的样式 */
.btn:disabled,
.btn[disabled] {
    background-color: #cccccc !important; /* 灰色背景 */
    color: #666666 !important; /* 灰色文字 */
    cursor: not-allowed !important; /* 禁用鼠标指针 */
    opacity: 0.7 !important; /* 半透明效果 */
    box-shadow: none !important; /* 移除阴影 */
}

/* 移除禁用按钮的悬停效果 */
.btn:disabled:hover,
.btn[disabled]:hover {
    background-color: #cccccc !important;
    transform: none !important;
}