/* ============================================
   文档中心样式 - doc.css
   ============================================ */

/* 重置与基础 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 文档布局 */
.doc-layout {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.doc-sidebar {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #eef1f5;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.doc-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #eef1f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.doc-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-logo img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.doc-logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.doc-sidebar-close {
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    background: #f5f7fa;
    border-radius: 8px;
    cursor: pointer;
    color: #666;
    align-items: center;
    justify-content: center;
}

/* 侧边栏导航 */
.doc-nav {
    padding: 16px 0;
}

.doc-nav-section {
    margin-bottom: 8px;
}

.doc-nav-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #8891a4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
}

.doc-nav-title:hover {
    color: #00D4AA;
}

.doc-nav-toggle {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.doc-nav-title.collapsed .doc-nav-toggle {
    transform: rotate(-90deg);
}

.doc-nav-list {
    list-style: none;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.doc-nav-list.collapsed {
    max-height: 0 !important;
}

.doc-nav-item {
    display: block;
}

.doc-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 28px;
    font-size: 14px;
    color: #5a6378;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.doc-nav-link:hover {
    background: #f8fafc;
    color: #00D4AA;
}

.doc-nav-link.active {
    background: rgba(0, 212, 170, 0.08);
    color: #00D4AA;
    border-left-color: #00D4AA;
    font-weight: 500;
}

.doc-nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 主内容区 */
.doc-main {
    flex: 1;
    margin-left: 280px;
    min-width: 0;
}

/* 文档头部 */
.doc-header {
    background: #ffffff;
    padding: 40px;
    border-bottom: 1px solid #eef1f5;
}

.doc-header-top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.doc-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f7fa;
    border-radius: 10px;
    cursor: pointer;
    color: #5a6378;
    align-items: center;
    justify-content: center;
}

.doc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #8891a4;
}

.doc-breadcrumb a:hover {
    color: #00D4AA;
}

.doc-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.doc-desc {
    font-size: 15px;
    color: #8891a4;
}

/* 文档内容 */
.doc-content {
    padding: 40px;
    max-width: 900px;
}

.doc-section {
    margin-bottom: 48px;
}

.doc-section-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f5;
}

.doc-section-desc {
    font-size: 15px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.8;
}

.doc-h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 24px 0 12px;
}

.doc-h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 20px 0 10px;
}

.doc-p {
    font-size: 15px;
    color: #555;
    line-height: 1.8;
    margin-bottom: 12px;
}

.doc-list {
    list-style: none;
    margin-bottom: 16px;
}

.doc-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 15px;
    color: #555;
}

.doc-list-icon {
    width: 18px;
    height: 18px;
    color: #00D4AA;
    flex-shrink: 0;
    margin-top: 3px;
}

/* 代码块 */
.doc-code-block {
    background: #1e1e2e;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    overflow-x: auto;
}

.doc-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-code-lang {
    font-size: 12px;
    color: #8891a4;
    text-transform: uppercase;
}

.doc-code-copy {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: #8891a4;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.doc-code-copy:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.doc-code {
    font-family: "Fira Code", "Cascadia Code", Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #cdd6f4;
    white-space: pre;
}

.doc-inline-code {
    background: #f5f7fa;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: "Fira Code", "Cascadia Code", Consolas, monospace;
    font-size: 13px;
    color: #00D4AA;
}

/* 提示框 */
.doc-alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin: 16px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.doc-alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.doc-alert-content {
    flex: 1;
}

.doc-alert-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.doc-alert-text {
    font-size: 14px;
    line-height: 1.6;
}

.doc-alert-info {
    background: rgba(0, 212, 170, 0.08);
    border: 1px solid rgba(0, 212, 170, 0.2);
}

.doc-alert-info .doc-alert-title {
    color: #00D4AA;
}

.doc-alert-info .doc-alert-text {
    color: #5a6378;
}

.doc-alert-warning {
    background: rgba(255, 181, 71, 0.08);
    border: 1px solid rgba(255, 181, 71, 0.2);
}

.doc-alert-warning .doc-alert-title {
    color: #FFB547;
}

.doc-alert-warning .doc-alert-text {
    color: #5a6378;
}

.doc-alert-danger {
    background: rgba(255, 107, 138, 0.08);
    border: 1px solid rgba(255, 107, 138, 0.2);
}

.doc-alert-danger .doc-alert-title {
    color: #FF6B8A;
}

.doc-alert-danger .doc-alert-text {
    color: #5a6378;
}

/* 表格 */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.doc-table th,
.doc-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eef1f5;
}

.doc-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #1a1a1a;
}

.doc-table td {
    color: #555;
}

.doc-table tr:hover td {
    background: #f8fafc;
}

.doc-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.doc-badge-required {
    background: rgba(255, 107, 138, 0.1);
    color: #FF6B8A;
}

.doc-badge-optional {
    background: rgba(107, 142, 255, 0.1);
    color: #6B8EFF;
}

/* 步骤 */
.doc-steps {
    margin: 20px 0;
}

.doc-step {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid #eef1f5;
}

.doc-step:last-child {
    border-bottom: none;
}

.doc-step-number {
    width: 32px;
    height: 32px;
    background: #00D4AA;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.doc-step-content {
    flex: 1;
}

.doc-step-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.doc-step-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
}

/* 遮罩层 */
.doc-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.doc-overlay.active {
    display: block;
}

/* 响应式 */
@media (max-width: 1024px) {
    .doc-sidebar {
        transform: translateX(-100%);
    }
    
    .doc-sidebar.open {
        transform: translateX(0);
    }
    
    .doc-main {
        margin-left: 0;
    }
    
    .doc-menu-btn {
        display: flex;
    }
    
    .doc-sidebar-close {
        display: flex;
    }
}

@media (max-width: 768px) {
    .doc-header {
        padding: 24px 20px;
    }
    
    .doc-content {
        padding: 24px 20px;
    }
    
    .doc-title {
        font-size: 24px;
    }
    
    .doc-section-title {
        font-size: 20px;
    }
    
    .doc-table {
        font-size: 13px;
    }
    
    .doc-table th,
    .doc-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .doc-header {
        padding: 20px 16px;
    }
    
    .doc-content {
        padding: 20px 16px;
    }
    
    .doc-title {
        font-size: 22px;
    }
    
    .doc-code-block {
        padding: 16px;
        border-radius: 8px;
    }
    
    .doc-code {
        font-size: 12px;
    }
}
