/* 通用样式 - 兼容手机端和PC端 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    font-size: 14px;
    overflow-x: hidden;
}

body.sidebar-open {
    overflow: hidden;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    gap: 4px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #333;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background-color: #f8f9fa;
}

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

.overlay.active {
    display: block;
    opacity: 1;
}

/* 侧边导航栏 */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: #fff;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 999;
    overflow-y: auto;
    transition: transform 0.3s ease;
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    position: relative;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.sidebar-header .help-center-logo-link {
    display: block;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.3s;
}

.sidebar-header .help-center-logo-link:hover {
    opacity: 0.8;
}

.sidebar-header .help-center-logo {
    max-width: 90%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
    transition: color 0.3s;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-close:hover {
    color: #333;
}

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

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin: 0;
}

/* 导航组 */
.nav-group {
    position: relative;
}

/* 导航项基础样式 */
.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.sidebar-nav .nav-item:hover {
    background-color: #f5f5f5;
    color: #333;
}

.sidebar-nav .nav-item.active {
    background-color: #e8f4f8;
    color: #1890ff;
    border-left-color: #1890ff;
    font-weight: 500;
}

/* 父菜单项 */
.nav-parent {
    font-weight: 500;
}

.nav-parent .nav-arrow {
    font-size: 18px;
    transition: transform 0.3s;
    color: #999;
    margin-left: auto;
}

.nav-group.expanded .nav-parent .nav-arrow {
    transform: rotate(90deg);
    color: #999;
}

.nav-group.expanded > .nav-parent {
    background-color: #f5f5f5;
    color: #333;
}

/* 一级tab点击后的背景色 */
.nav-parent:active,
.nav-parent.active {
    background-color: #f5f5f5 !important;
    color: #333 !important;
}

/* 子菜单 */
.nav-submenu {
    display: none;
    background-color: #fafafa;
    border-left: 3px solid #e0e0e0;
    margin-left: 3px;
}

.nav-group.expanded .nav-submenu {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* 子菜单项 */
.nav-child {
    padding-left: 40px !important;
    font-size: 13px;
    font-weight: normal;
}

.nav-child:hover {
    background-color: #f5f5f5;
}

.nav-child.active {
    background-color: #e8f4f8;
    color: #1890ff;
    border-left-color: #1890ff;
}

/* 主内容区域 */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    background-color: #fff;
    min-height: 100vh;
}

/* 页面内容 */
.page-content {
    display: none;
}

.page-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 加载状态 */
.page-content .loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* 错误状态 */
.page-content .error {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

.page-content .error h1 {
    color: #e74c3c;
    margin-bottom: 15px;
}

.page-content .error ol {
    text-align: left;
    display: inline-block;
    margin: 20px auto;
}

.page-content .error code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #e74c3c;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 标题样式 */
h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e5e5;
}

h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 25px 0 15px 0;
    color: #333;
    scroll-margin-top: 20px;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 10px 0;
    color: #333;
}

h4 {
    font-size: 15px;
    font-weight: 600;
    margin: 15px 0 8px 0;
    color: #333;
}

h5 {
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 12px 0;
    color: #333;
    scroll-margin-top: 20px;
}

/* 段落样式 */
p {
    margin-bottom: 12px;
    line-height: 1.8;
}

/* 买家指南和常见问题页面字体调大 */
.page-content.buyer-guide-page,
.page-content.faq-page {
    font-size: 16px;
}

.page-content.buyer-guide-page p,
.page-content.faq-page p {
    font-size: 16px;
    line-height: 1.8;
}

.page-content.buyer-guide-page h5,
.page-content.faq-page h5 {
    font-size: 18px;
}

.page-content.buyer-guide-page h2,
.page-content.faq-page h2 {
    font-size: 20px;
}

.page-content.buyer-guide-page .table-of-contents a,
.page-content.faq-page .table-of-contents a {
    font-size: 16px;
}

/* 首行缩进容器 */
.text-indent {
    text-indent: 2em;
}

.text-indent p {
    text-indent: 2em;
}

.text-indent h2 {
    text-indent: 0;
    margin-top: 30px;
    margin-bottom: 20px;
}

.text-indent h5 {
    text-indent: 0;
    margin-top: 25px;
}

/* 列表样式 */
ul, ol {
    margin: 10px 0 15px 20px;
    padding-left: 20px;
}

li {
    margin-bottom: 8px;
    line-height: 1.6;
}

/* 强调文本 */
strong, b {
    font-weight: 600;
}

em, i {
    font-style: italic;
}

/* 链接样式 */
a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* 图片样式 */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 15px 0;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px 8px;
    text-align: left;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* 引用块样式 */
blockquote {
    border-left: 4px solid #e74c3c;
    padding-left: 15px;
    margin: 15px 0;
    color: #7f8c8d;
    font-style: italic;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
}

/* 分割线 */
hr {
    border: none;
    height: 1px;
    background-color: #e5e5e5;
    margin: 20px 0;
}

/* 目录样式 */
.table-of-contents {
    background-color: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0 30px 0;
}

.table-of-contents h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e5e5;
}

.table-of-contents ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.table-of-contents li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.table-of-contents a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
    display: inline-block;
    font-size: 15px;
    font-style: italic;
}

.table-of-contents a:hover {
    color: #1890ff;
    text-decoration: underline;
}

/* 响应式设计 - 平板和移动端 */
@media (max-width: 768px) {
    /* 显示移动端菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
    }

    /* 侧边栏在移动端默认隐藏 */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* 显示关闭按钮 */
    .sidebar-close {
        display: block;
    }

    /* 移动端子菜单样式优化 */
    .nav-child {
        padding-left: 35px !important;
        font-size: 13px;
    }

    .nav-submenu {
        border-left-width: 2px;
    }

    /* 主内容区域在移动端占满宽度 */
    .main-content {
        margin-left: 0;
    }

    .container {
        padding: 60px 15px 20px;
    }

    h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    h2 {
        font-size: 16px;
        margin: 20px 0 12px 0;
    }

    h3 {
        font-size: 15px;
        margin: 15px 0 8px 0;
    }

    h4 {
        font-size: 14px;
        margin: 12px 0 6px 0;
    }

    h5 {
        font-size: 15px;
        margin: 18px 0 10px 0;
    }

    p {
        font-size: 14px;
        margin-bottom: 10px;
    }

    ul, ol {
        margin: 8px 0 12px 15px;
        padding-left: 15px;
    }

    .table-of-contents {
        padding: 15px;
        margin: 15px 0 20px 0;
    }

    .table-of-contents h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .table-of-contents li {
        margin-bottom: 6px;
        font-size: 14px;
    }

    .table-of-contents a {
        font-size: 14px;
    }

    table {
        font-size: 13px;
    }

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

@media (max-width: 480px) {
    .sidebar {
        width: 260px;
    }

    .container {
        padding: 60px 10px 20px;
    }

    h1 {
        font-size: 18px;
    }

    h2 {
        font-size: 15px;
    }

    h3 {
        font-size: 14px;
    }

    h4 {
        font-size: 13px;
    }

    h5 {
        font-size: 14px;
        margin: 15px 0 8px 0;
    }

    p {
        font-size: 13px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 6px 4px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #1890ff;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    background-color: #40a9ff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.back-to-top:active {
    transform: translateY(0);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top span {
    line-height: 1;
    font-weight: bold;
}

/* 打印样式 */
@media print {
    .mobile-menu-toggle,
    .sidebar,
    .overlay,
    .back-to-top {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    body {
        font-size: 12pt;
        line-height: 1.4;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    h1, h2, h3, h4 {
        page-break-after: avoid;
    }

    p, li {
        orphans: 3;
        widows: 3;
    }
}

