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

/* Banner */
.doc-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 80px 0;
    text-align: center;
    color: white;
    position: relative;
}

.doc-banner h2 {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 15px;
}

.doc-banner p {
    font-size: 18px;
    opacity: 0.9;
}

/* Banner 语言切换器 */
.banner-lang-switcher {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 10;
}

.banner-lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(10px);
}

.banner-lang-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    transform: scale(1.05);
}

.banner-lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    min-width: 140px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
    overflow: hidden;
}

.banner-lang-switcher:hover .banner-lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.banner-lang-dropdown .lang-option {
    display: block;
    padding: 10px 16px;
    color: #555;
    font-size: 13px;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
}

.banner-lang-dropdown .lang-option:last-child {
    border-bottom: none;
}

.banner-lang-dropdown .lang-option:hover {
    background: #f8f9ff;
    color: #667eea;
    padding-left: 20px;
}

/* 主内容区 */
.doc-main {
    background: #f8f9fa;
    min-height: calc(100vh - 70px - 300px);
    padding: 40px 0;
}

.doc-wrapper {
    display: flex;
    gap: 30px;
}

/* 左侧导航 */
.doc-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.doc-nav {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    position: sticky;
    top: 90px;
}

.doc-nav li {
    margin: 0;
}

.doc-nav a {
    display: block;
    padding: 15px 25px;
    color: #555;
    font-size: 14px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.doc-nav a:hover {
    background: #f8f9ff;
    color: #667eea;
    border-left-color: #667eea;
    padding-left: 30px;
}

.doc-nav li.active a {
    background: #f8f9ff;
    color: #667eea;
    border-left-color: #667eea;
    font-weight: 600;
}

/* 右侧内容 */
.doc-content {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 40px;
}

.doc-section {
    margin-bottom: 50px;
    scroll-margin-top: 90px;
}

.doc-section:last-child {
    margin-bottom: 0;
}

.doc-section h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.doc-section h4 {
    font-size: 18px;
    color: #555;
    margin: 30px 0 15px;
}

.doc-section p {
    font-size: 15px;
    line-height: 1.8;
    color: #666;
    margin-bottom: 15px;
}

.doc-section ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.doc-section ol li {
    font-size: 15px;
    line-height: 1.8;
    color: #666;
    margin-bottom: 10px;
}

/* API表格 */
.api-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    table-layout: auto; /* 自适应宽度 */
}

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

.api-table th {
    padding: 10px;
    text-align: left;
    font-weight: bold;
    border: 1px solid #dcdcdc;
}

.api-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.3s ease;
}

.api-table tbody tr:hover {
    background: #f8f9ff;
}

.api-table td {
    padding: 8px 10px;
    vertical-align: top;
    border: 1px solid #dcdcdc;
}

.api-table td strong {
    color: #667eea;
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
}

.api-table td span {
    color: #888;
    font-size: 13px;
}

/* 文档子标题 */
.docs-sub {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.8;
    color: #666;
}

/* 签名算法代码块 */
.pp {
    margin-bottom: 8px;
    padding: 15px;
    background: #f8f9fa;
    border-left: 3px solid #667eea;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #333;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .doc-wrapper {
        flex-direction: column;
    }
    
    .doc-sidebar {
        width: 100%;
    }
    
    .doc-nav {
        position: relative;
        top: 0;
    }
    
    .doc-nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px;
    }
    
    .doc-nav li {
        flex: 1;
        min-width: 120px;
    }
    
    .doc-nav a {
        padding: 10px 15px;
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .doc-nav a:hover,
    .doc-nav li.active a {
        border-left: none;
        border-bottom-color: #667eea;
        padding-left: 15px;
    }
}

@media (max-width: 768px) {
    .doc-banner {
        padding: 50px 0;
    }
    
    .doc-banner h2 {
        font-size: 28px;
    }
    
    .doc-banner p {
        font-size: 16px;
    }
    
    .doc-content {
        padding: 25px;
    }
    
    .doc-section h3 {
        font-size: 20px;
    }
    
    .api-table {
        font-size: 13px;
    }
    
    .api-table th,
    .api-table td {
        padding: 10px;
    }
}

/* 开发语言 Demo */
.demo-lang-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0 16px;
}

.demo-lang-btn {
    border: 1px solid #d0d5f0;
    background: #f8f9ff;
    color: #555;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.demo-lang-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.demo-lang-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
}

.demo-lang-panel {
    display: none;
}

.demo-lang-panel.active {
    display: block;
}

.demo-code-wrap {
    position: relative;
    margin: 10px 0 22px;
}

.demo-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    border: none;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.demo-copy-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.demo-code {
    margin: 0;
    padding: 16px 16px 16px 16px;
    background: #1e1e2e;
    color: #e8e8f0;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.55;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    white-space: pre;
}
