/* ==================== 基础样式重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

a {
    color: #1890ff;
    text-decoration: none;
}

a:hover {
    color: #40a9ff;
}

/* ==================== 顶部蓝色标题栏 ==================== */
.top-header {
    background: #1890ff;
    color: #fff;
    padding: 0 20px;
    height: 60px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.top-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo a {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
}

.top-search {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}

.top-search form {
    display: flex;
    gap: 10px;
}

.top-search input {
    flex: 1;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
}

.top-search button {
    padding: 8px 20px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.top-search button:hover {
    background: rgba(255,255,255,0.3);
}

/* ==================== 主体布局 ==================== */
.main-layout {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* ==================== 左侧目录树 ==================== */
.doc-sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    position: fixed;
    top: 60px;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-title {
    padding: 20px;
    font-size: 16px;
    font-weight: 600;
    color: #262626;
    border-bottom: 1px solid #e8e8e8;
}

.doc-nav {
    padding: 10px 0;
}

.nav-tree {
    list-style: none;
}

.nav-item {
    position: relative;
}

.nav-item-header {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-item-header:hover {
    background: #f5f5f5;
}

.nav-item.active > .nav-item-header {
    background: #e6f7ff;
    color: #1890ff;
}

.nav-link {
    flex: 1;
    color: #595959;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item.active .nav-link {
    color: #1890ff;
    font-weight: 500;
}

.toggle-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #8c8c8c;
    transition: transform 0.3s;
}

.toggle-icon.expanded {
    transform: rotate(90deg);
}

.toggle-placeholder {
    width: 16px;
}

.level-2-placeholder,
.level-3-placeholder {
    width: 28px;
}

.sub-nav {
    list-style: none;
    display: none;
}

.sub-nav.expanded {
    display: block;
}

.type-sub-nav {
    padding-left: 8px;
}

/* 统一的三级菜单样式 */
.level3-sub-nav {
    padding-left: 12px;
}

.level3-sub-nav .nav-level-3 {
    margin: 2px 0;
}

.level3-sub-nav .nav-level-3 .nav-link {
    padding: 4px 8px;
    font-size: 12px;
    color: #666;
}

.level3-sub-nav .nav-level-3.active .nav-link,
.level3-sub-nav .nav-level-3 .nav-link:hover {
    color: #1890ff;
    background: #e6f7ff;
    border-radius: 4px;
}

/* ==================== 右侧内容区 ==================== */
.doc-content {
    flex: 1;
    margin-left: 280px;
    padding: 30px;
    max-width: calc(100% - 280px);
}

.content-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== 页面标题区 ==================== */
.page-header {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 10px;
}

.page-meta {
    color: #8c8c8c;
    font-size: 14px;
}

/* ==================== 面包屑导航 ==================== */
.breadcrumb {
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}

.breadcrumb a {
    color: #595959;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #d9d9d9;
}

.breadcrumb .current {
    color: #262626;
    font-weight: 500;
}

/* ==================== 卡片网格 ==================== */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.doc-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.doc-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.doc-card-header {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.doc-type-badge,
.doc-category-badge {
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    color: #595959;
}

.doc-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #262626;
    margin-bottom: 8px;
}

.doc-card-title a {
    color: #262626;
}

.doc-card-title a:hover {
    color: #1890ff;
}

.doc-card-subtitle {
    font-size: 13px;
    color: #8c8c8c;
    font-weight: normal;
    margin-left: 8px;
}

.doc-card-desc {
    font-size: 14px;
    color: #595959;
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #8c8c8c;
}

.doc-card-meta .tag {
    padding: 2px 8px;
    background: #e6f7ff;
    color: #1890ff;
    border-radius: 4px;
    font-size: 12px;
}

.doc-card-meta .tag-sub {
    background: #f6ffed;
    color: #52c41a;
}

.doc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.view-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #8c8c8c;
}

/* ==================== 命令详情页 ==================== */
.command-header {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: #fff;
    padding: 20px 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(24,144,255,0.3);
}

.command-title-wrapper,
.command-title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.command-title-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.command-meta-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

.meta-item-inline {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-divider-inline {
    color: rgba(255,255,255,0.4);
}

/* ==================== 纠错建议按钮 ==================== */
.correction-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #fff;
    transition: all 0.3s;
}

.correction-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
}

.correction-btn svg {
    stroke: #fff;
}

.copy-btn {
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: #fff;
}

.copy-btn svg {
    stroke: #fff;
}

.command-name {
    font-size: 32px;
    font-weight: 600;
    color: #fff;
    font-family: 'Consolas', 'Monaco', monospace;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.command-name-cn {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

.command-category {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.category-tag,
.sub-category-tag {
    padding: 3px 10px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.3);
    margin-left: 8px;
}

.sub-category-tag {
    background: rgba(255,255,255,0.15);
    margin-left: 6px;
}

.command-description-line {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 17px;
    color: rgba(255,255,255,0.95);
    line-height: 1.6;
}

.command-description-line .description-label {
    font-weight: 600;
    color: #fff;
    margin-right: 8px;
}

.copy-tooltip {
    font-size: 12px;
}

.copy-btn.copied {
    background: #52c41a;
    border-color: #52c41a;
    color: #fff;
}

/* ==================== 代码块复制按钮 ==================== */
.code-block-wrapper {
    position: relative;
}

.code-copy-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #595959;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.code-copy-btn:hover {
    background: #f5f5f5;
    border-color: #1890ff;
    color: #1890ff;
}

.code-copy-btn svg {
    stroke: currentColor;
}

.code-copy-btn.copied {
    background: #52c41a;
    border-color: #52c41a;
    color: #fff;
}

/* ==================== 元信息区 ==================== */
.command-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
    margin-top: 20px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.meta-label {
    font-size: 12px;
    color: #8c8c8c;
}

.meta-value {
    font-size: 16px;
    font-weight: 600;
    color: #262626;
}

.meta-divider {
    width: 1px;
    height: 30px;
    background: #d9d9d9;
}

/* ==================== 上一篇/下一篇导航 ==================== */
.nav-links-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 12px 0;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
}

.nav-links-simple a {
    color: #1890ff;
    transition: all 0.3s;
}

.nav-links-simple a:hover {
    color: #40a9ff;
}

.nav-prev,
.nav-next {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-prev::before {
    content: "←";
    color: #8c8c8c;
    font-size: 12px;
}

.nav-next::after {
    content: "→";
    color: #8c8c8c;
    font-size: 12px;
}

.nav-links-simple .disabled {
    color: #bfbfbf;
    cursor: not-allowed;
}

.nav-command-name {
    color: #262626;
    font-weight: 500;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 8px;
}

.pagination .page-link {
    display: block;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #595959;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination .page-link:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination .page-link.active {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.pagination ul {
    display: flex;
    list-style: none;
    gap: 8px;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #595959;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination li a:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.pagination li.active span {
    background: #1890ff;
    border-color: #1890ff;
    color: #fff;
}

.pagination li.ellipsis {
    padding: 8px 12px;
    color: #8c8c8c;
}

/* ==================== 命令区块 ==================== */
.command-section {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.section-header {
    padding: 14px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    font-size: 18px;
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #262626;
}

.section-content {
    padding: 24px;
}

/* ==================== 标题栏复制按钮 ==================== */
.section-copy-btn {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    color: #8c8c8c;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    margin-right: 4px;
}

.section-copy-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
    background: #e6f7ff;
}

.section-copy-btn.copied {
    background: #52c41a;
    border-color: #52c41a;
    color: #fff;
}

.syntax-hint {
    margin-left: 12px;
    font-size: 13px;
    color: #8c8c8c;
    font-weight: normal;
}

/* ==================== 语法高亮 ==================== */
.syntax-box {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 15px;
    color: #262626;
    overflow-x: auto;
}

/* ==================== 描述文本 ==================== */
.description-text {
    color: #595959;
    font-size: 15px;
    line-height: 1.8;
}

/* ==================== 参数列表（旧样式，兼容） ==================== */
.parameters-content {
    color: #595959;
    font-size: 14px;
    line-height: 1.8;
}

/* ==================== 使用示例 ==================== */
.example-item {
    margin-bottom: 12px;
}

.example-item:last-child {
    margin-bottom: 0;
}

.example-label {
    font-size: 13px;
    color: #8c8c8c;
    margin-bottom: 6px;
}

.example-box {
    background: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    color: #262626;
    overflow-x: auto;
}

/* ==================== HTML内容区 ==================== */
.html-content {
    line-height: 1.8;
}

.html-content h1,
.html-content h2,
.html-content h3,
.html-content h4 {
    margin: 20px 0 15px;
    color: #262626;
}

.html-content p {
    margin-bottom: 15px;
    color: #595959;
}

.html-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.html-content th,
.html-content td {
    border: 1px solid #e8e8e8;
    padding: 12px;
    text-align: left;
}

.html-content th {
    background: #fafafa;
    font-weight: 600;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8c8c8c;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #262626;
}

/* ==================== 移动端适配 ==================== */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .top-search {
        display: none;
    }
    
    .doc-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .doc-sidebar.active {
        transform: translateX(0);
    }
    
    .doc-content {
        margin-left: 0;
        max-width: 100%;
        padding: 20px;
    }
    
    .command-name {
        font-size: 20px;
    }
}

/* ==================== 参数列表 V2 新样式 ==================== */
.parameters-list-v2 {
    display: flex;
    flex-direction: column;
}

.parameter-item-v2 {
    padding: 10px 0;
}

.param-line-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
    font-size: 15px;
}

.param-label {
    color: #595959;
    font-weight: 500;
}

.param-name-v2 {
    color: #1890ff;
    font-weight: 600;
    font-size: 16px;
}

.param-divider {
    width: 1px;
    height: 14px;
    background: #d9d9d9;
    margin: 0 10px;
}

.param-type-label {
    color: #8c8c8c;
}

.param-type-value {
    color: #262626;
    font-weight: 500;
}

.param-optional-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 4px;
    font-size: 12px;
    color: #fa8c16;
    font-weight: 500;
    margin-left: 4px;
}

.param-optional-tag::before {
    content: '';
    width: 1px;
    height: 12px;
    background: #d9d9d9;
    margin-right: 8px;
}

.param-desc-v2 {
    color: #595959;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 6px;
    padding-left: 0;
}

.param-options-v2 {
    margin-bottom: 6px;
}

.options-label-v2 {
    font-size: 13px;
    color: #8c8c8c;
    margin-right: 8px;
}

.option-tag-v2 {
    display: inline-block;
    padding: 2px 8px;
    background: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 4px;
    font-size: 12px;
    color: #1890ff;
    margin-right: 4px;
    margin-bottom: 2px;
    cursor: help;
}

.options-hint {
    font-size: 12px;
    color: #bfbfbf;
    margin-left: 8px;
}

.param-default-v2 {
    font-size: 13px;
    color: #8c8c8c;
}

.param-default-v2 code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #262626;
}

.param-separator {
    height: 0;
    border-bottom: 1px dashed #e0e0e0;
    margin: 0;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .param-line-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .param-divider {
        display: none;
    }
    
    .param-type-label {
        margin-left: 0;
    }
}
