/* ==================== API 文档页面样式 ==================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

.doc-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.doc-sidebar {
    width: 250px;
    position: sticky;
    top: 100px;
    flex-shrink: 0;
}

.doc-main {
    flex: 1;
    min-width: 0;
}

/* ==================== 头部样式 ==================== */
.doc-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.doc-header h1 {
    font-size: 3em;
    margin-bottom: 15px;
    font-weight: 700;
}

.doc-header p {
    font-size: 1.3em;
    opacity: 0.95;
}

/* ==================== 侧边栏导航 ==================== */
.doc-sidebar-nav {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.doc-sidebar-nav h3 {
    color: #667eea;
    font-size: 1.2em;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

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

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

.doc-sidebar-nav a {
    color: #6b7280;
    text-decoration: none;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
    display: block;
    font-size: 0.95em;
}

.doc-sidebar-nav a:hover {
    background: #eff6ff;
    color: #667eea;
    transform: translateX(5px);
}

.doc-sidebar-nav a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* ==================== 内容区块 ==================== */
.doc-section {
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.doc-section h2 {
    color: #667eea;
    font-size: 2.2em;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.doc-section h3 {
    color: #764ba2;
    font-size: 1.6em;
    margin: 30px 0 20px 0;
}

.doc-section h4 {
    color: #555;
    font-size: 1.3em;
    margin: 25px 0 15px 0;
}

/* ==================== 徽章样式 ==================== */
.badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-right: 10px;
}

.badge-post {
    background: #10b981;
    color: white;
}

.badge-get {
    background: #3b82f6;
    color: white;
}

.badge-success {
    background: #10b981;
    color: white;
}

.badge-error {
    background: #ef4444;
    color: white;
}

.badge-warning {
    background: #f59e0b;
    color: white;
}

/* ==================== 代码块样式 ==================== */
.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 25px;
    border-radius: 10px;
    overflow-x: auto;
    margin: 20px 0;
    position: relative;
    font-family: 'Courier New', 'Consolas', monospace;
}

.code-block pre {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.6;
}

.code-block .copy-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #475569;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.code-block .copy-btn:hover {
    background: #64748b;
    transform: translateY(-2px);
}

/* ==================== 表格样式 ==================== */
.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
}

table td {
    padding: 15px;
    border-bottom: 1px solid #e5e7eb;
}

table tr:hover {
    background: #f9fafb;
}

table code {
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #667eea;
}

/* ==================== 信息框样式 ==================== */
.info-box {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    padding: 20px 25px;
    margin: 20px 0;
    border-radius: 8px;
}

.success-box {
    background: #f0fdf4;
    border-left: 4px solid #10b981;
    padding: 20px 25px;
    margin: 20px 0;
    border-radius: 8px;
}

.warning-box {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    padding: 20px 25px;
    margin: 20px 0;
    border-radius: 8px;
}

.error-box {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 20px 25px;
    margin: 20px 0;
    border-radius: 8px;
}

/* ==================== 标签页样式 ==================== */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.tab {
    padding: 12px 25px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1em;
    color: #6b7280;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab:hover {
    color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== 接口端点样式 ==================== */
.endpoint {
    background: #f9fafb;
    padding: 25px;
    border-radius: 10px;
    margin: 25px 0;
    border: 2px solid #e5e7eb;
}

.endpoint-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.endpoint-url {
    font-family: 'Courier New', monospace;
    font-size: 1.15em;
    color: #1e293b;
    margin-left: 10px;
}

/* ==================== 价格搜索框 ==================== */
.pricing-search {
    position: relative;
    margin: 25px 0;
}

.pricing-search input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s;
}

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

.pricing-search .search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    color: #9ca3af;
}

/* ==================== 价格表格样式 ==================== */
.pricing-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.pricing-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pricing-table th {
    color: white;
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
}

.pricing-table td {
    padding: 18px 15px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.pricing-table tr:hover {
    background: #f9fafb;
}

.pricing-table tr:last-child td {
    border-bottom: none;
}

.type-id {
    background: #eff6ff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.95em;
    color: #667eea;
    font-weight: 600;
}

.desc-cell {
    color: #6b7280;
    line-height: 1.5;
}

.price-tag {
    font-size: 1.3em;
    color: #10b981;
    font-weight: 700;
}

.view-examples-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
}

.view-examples-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

/* ==================== 模态框样式 ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.5em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8em;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #ef4444;
}

.modal-body {
    padding: 30px;
}

.example-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.example-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    padding: 10px;
    transition: all 0.3s;
}

.example-image:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

/* ==================== 行内示例图片样式 ==================== */
.example-images-inline {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
}

.example-thumbnail {
    width: 60px;
    height: 40px;
    object-fit: contain;
    border: 1.5px solid #e5e7eb;
    border-radius: 4px;
    background: #f9fafb;
    padding: 3px;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.example-thumbnail:hover {
    border-color: #667eea;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ==================== 图片放大模态框样式 ==================== */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.image-modal-content {
    background: white;
    border-radius: 15px;
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: scaleIn 0.3s;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.image-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid #e5e7eb;
}

.image-modal-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.3em;
}

.image-modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: #9ca3af;
    cursor: pointer;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-close:hover {
    color: #ef4444;
    background: #fee2e2;
}

.image-modal-body {
    padding: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 70vh;
}

.image-modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

/* ==================== FAQ 样式 ==================== */
.faq-list {
    margin: 20px 0;
}

.faq-item {
    margin-bottom: 25px;
}

.faq-item h3 {
    color: #1e293b;
    font-size: 1.2em;
    margin-bottom: 10px;
}

/* ==================== 特性卡片 ==================== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.feature-card {
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid;
}

.feature-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.feature-card p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95em;
}

.feature-card.green {
    background: #f0fdf4;
    border-color: #10b981;
}

.feature-card.blue {
    background: #eff6ff;
    border-color: #3b82f6;
}

.feature-card.yellow {
    background: #fef3c7;
    border-color: #f59e0b;
}

.feature-card.pink {
    background: #fce7f3;
    border-color: #ec4899;
}

/* ==================== 页脚样式 ==================== */
.doc-footer {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.doc-footer p {
    color: #6b7280;
    margin: 8px 0;
}

/* ==================== 查看产品按钮 ==================== */
.view-products-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.view-products-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1024px) {
    .doc-container {
        flex-direction: column;
    }

    .doc-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }

    .doc-sidebar-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .doc-sidebar-nav li {
        margin-bottom: 0;
    }

    .doc-sidebar-nav a {
        padding: 8px 15px;
    }
}

@media (max-width: 768px) {
    /* 防止横向滚动 */
    html {
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    section {
        overflow-x: hidden !important;
    }

    h1, h2, h3, h4, h5, h6, p {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .container {
        padding: 0 15px;
    }

    .doc-container {
        padding: 10px;
        overflow-x: hidden;
    }

    .doc-main {
        width: 100%;
        overflow-x: hidden;
    }

    .doc-header h1 {
        font-size: 2em;
    }

    .doc-header p {
        font-size: 1.1em;
    }

    .doc-section {
        padding: 20px 15px;
        overflow-x: hidden;
    }

    .doc-section h2 {
        font-size: 1.6em;
    }

    .code-block {
        padding: 15px;
        font-size: 0.85em;
        overflow-x: auto;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    /* 表格响应式 */
    .table-wrapper,
    .pricing-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -15px;
        padding: 0 15px;
    }

    table {
        font-size: 0.85em;
        min-width: 600px;
    }

    table th,
    table td {
        padding: 8px 6px;
    }

    /* 缩略图在移动端更小 */
    .example-thumbnail {
        width: 45px;
        height: 30px;
    }

    /* 移动端菜单按钮 */
    .mobile-menu-btn {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        background: rgba(102, 126, 234, 0.1) !important;
        border: 1px solid rgba(102, 126, 234, 0.3) !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        padding: 0.5rem !important;
        margin: 0 !important;
        width: auto !important;
        height: auto !important;
        z-index: 1000 !important;
        transition: all 0.3s ease !important;
    }

    .mobile-menu-btn:active {
        background: rgba(102, 126, 234, 0.2) !important;
        transform: scale(0.95) !important;
    }

    .mobile-menu-btn span {
        width: 22px !important;
        height: 3px !important;
        background: #667eea !important;
        border-radius: 2px !important;
        transition: all 0.3s !important;
        display: block !important;
    }

    /* 隐藏桌面端菜单 */
    .nav-menu {
        display: none !important;
    }

    .nav-buttons {
        display: none !important;
    }

    .doc-sidebar-nav ul {
        flex-direction: column;
    }

    /* 信息框 */
    .info-box,
    .warning-box,
    .success-box {
        padding: 15px;
        font-size: 0.9em;
    }

    /* 移动端导航菜单 */
    .mobile-nav {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: linear-gradient(180deg, rgba(102, 126, 234, 0.98) 0%, rgba(118, 75, 162, 0.98) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: -4px 0 30px rgba(102, 126, 234, 0.3);
        border-left: 1px solid rgba(255, 255, 255, 0.2);
        padding: 2rem 1.5rem;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
    }

    .mobile-nav.active {
        right: 0;
        display: block;
    }

    .mobile-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .mobile-nav-header .logo-text {
        color: white !important;
        font-weight: 600 !important;
    }

    .mobile-nav-close {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        font-size: 1.25rem;
        cursor: pointer;
        padding: 0.375rem 0.625rem;
        color: white;
        transition: all 0.3s ease;
        line-height: 1;
    }

    .mobile-nav-close:active {
        background: rgba(255, 255, 255, 0.25);
        transform: scale(0.95);
    }

    .mobile-nav ul {
        list-style: none;
        padding: 0;
        margin: 0 0 2rem 0;
    }

    .mobile-nav ul li {
        margin-bottom: 0.375rem;
    }

    .mobile-nav ul li a {
        display: block;
        padding: 0.875rem 1rem;
        color: rgba(255, 255, 255, 0.9);
        text-decoration: none;
        border-radius: 10px;
        transition: all 0.25s ease;
        font-weight: 500;
        font-size: 0.9375rem;
    }

    .mobile-nav ul li a:hover,
    .mobile-nav ul li a.active {
        background: rgba(255, 255, 255, 0.2);
        color: white;
        transform: translateX(-2px);
    }

    .mobile-nav-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .mobile-nav-buttons a {
        display: block;
        padding: 0.875rem 1rem;
        text-align: center;
        border-radius: 10px;
        text-decoration: none;
        transition: all 0.25s ease;
        font-weight: 600;
        font-size: 0.9375rem;
    }

    .mobile-nav-buttons .btn-outline {
        background: rgba(255, 255, 255, 0.15);
        border: 1.5px solid rgba(255, 255, 255, 0.4);
        color: white;
    }

    .mobile-nav-buttons .btn-outline:active {
        background: rgba(255, 255, 255, 0.25);
        transform: scale(0.98);
    }

    .mobile-nav-buttons .btn-primary {
        background: white;
        color: #667eea;
        border: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .mobile-nav-buttons .btn-primary:active {
        opacity: 0.95;
        transform: scale(0.98);
    }

    /* 遮罩层 */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .mobile-overlay.active {
        display: block;
    }
}

/* ==================== 代码语法高亮 ==================== */
.keyword {
    color: #c678dd;
}

.string {
    color: #98c379;
}

.number {
    color: #d19a66;
}

.comment {
    color: #5c6370;
    font-style: italic;
}

/* ==================== 加载动画 ==================== */
.loading {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

