/* --- 1. CSS 变量与深色模式定义 --- */
:root {
    /* 浅色模式 (默认) */
    --c-primary: #3B80E6;
    --c-bg-body: #ffffff;
    --c-bg-sidebar: #F9F9F9;
    --c-bg-card: rgba(61, 128, 230, 0.06);
    --c-bg-hover: #3B80E620;
    --c-bg-header: rgba(255, 255, 255, 0.9);
    --c-text-main: #16181b;
    --c-text-secondary: #323740;
    --c-text-tertiary: #abb2ba;
    --c-border: #dee0e3;
    --c-feat-text: #3B80E6;
    --c-feat-border: #b3cff8;
    --c-feat-bg: #f2f7ff;
    --c-em-text: #A253FF;
    --c-em-bg: #fbf7ff;
    --c-warn-text: #f59e0b;
    --c-warn-bg: #fffbeb;
    --c-card-hover-shadow: 0 6px 16px rgba(31, 35, 41, 0.08);
    --c-item-hover-shadow: 0 3px 8px rgba(31, 35, 41, 0.08);
    --c-active-bg: #eaf2ff;
    --c-faq-list-dot: #cbd5e0;

    --corner-radius: 12px;
    --header-height: 58px;
    --sidebar-left-width: 260px;
    --sidebar-right-width: 220px;
    --content-max-width: 800px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* 平滑过渡效果 */
    /* 优化阅读宽度 */
}

/* 深色模式覆盖 */
[data-theme="dark"] {
    --c-primary: #5d98f0;
    --c-bg-body: #1a1b1e;
    --c-bg-hover: #5d98f020;
    --c-bg-sidebar: #1d1e21;
    --c-bg-card: #222326;
    --c-bg-header: rgba(26, 27, 30, 0.9);
    --c-text-main: #f0f2f5;
    --c-text-secondary: #d0d4d9;
    --c-text-tertiary: #9ba0a8;
    --c-border: #2f3136;
    --c-feat-text: #5d98f0;
    --c-feat-border: #25406a;
    --c-feat-bg: #081a35;
    --c-em-text: #aa76e5;
    --c-em-bg: #1f063a;
    --c-warn-text: #d7a959;
    --c-warn-bg: #39362d;
    --c-card-hover-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    --c-item-hover-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    --c-active-bg: #5d98f026;
    --c-faq-list-dot: #4a5568;
    
    /* 深色模式显示月亮，隐藏太阳 */
    .sun-icon {
        opacity: 0;
        position: absolute;
    }

    .moon-icon {
        opacity: 1;
        position: static;
    }

}

/* --- 2. 全局重置 --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Tahoma, Arial, STXihei, "华文细黑", "Microsoft YaHei", SimSun, "宋体", Heiti, "黑体", sans-serif; min-width: 300px; color: #757575; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    background-color: var(--c-bg-body);
    color: var(--c-text-main);
    line-height: 1.7;
    transition: background-color 0.3s, color 0.3s;
}

img.icon { 
    vertical-align: middle; 
    width: 20px;
    height: 20px;
    margin-bottom: 4px;
}

img.present {
    border-radius: var(--corner-radius);
    border: 1px solid var(--c-border);
}

/* General link hover effects */

a { text-decoration: none; color: var(--c-text-secondary); transition: all 0.3s ease; position: relative; }
a.link {
  color: var(--c-text-secondary);
  transition: color 0.3s ease;
}

a.link:hover {
  color: var(--c-primary);
}

/* 移除FAQ列表中链接的下划线效果 */
.main-content > ul li a.link::after {
  display: none;
}

ul {
    list-style: none;
}

/* --- 3. 顶部导航栏 --- */
.header {
    height: var(--header-height);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: sticky;
    top: 0;
    background: var(--c-bg-header);
    backdrop-filter: blur(10px);
    z-index: 100;
    width: 100%;
}

/* Header内部容器保持原布局 */
.header-inner {
    display: grid;
    grid-template-columns: var(--sidebar-left-width) 1fr var(--sidebar-right-width);
    align-items: center;
    max-width: 1280px;
    width: 100%;
    height: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-left: 20px;
}

.logo {
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 汉堡菜单按钮 (默认隐藏) */
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 20px;
    background: none;
    border: none;
    color: var(--c-text-main);
}

/* 深色模式切换开关 */
.theme-switch {
    font-size: 13px;
    cursor: pointer;
    color: var(--c-text-main);
    display: flex;
    align-items: center;
    margin: 12px;
    justify-self: start;
}

/* 主题图标样式 */
.sun-icon, .moon-icon {
    transition: opacity 0.3s ease;
}

/* 默认浅色模式显示太阳，隐藏月亮 */
.sun-icon {
    opacity: 1;
}

.moon-icon {
    opacity: 0;
    position: absolute;
}

/* --- 4. 主要布局 (Grid) --- */
.container {
    display: grid;
    /* 左侧栏 | 内容区(自动填充) | 右侧栏 */
    grid-template-columns: var(--sidebar-left-width) 1fr var(--sidebar-right-width);
    max-width: 1280px;
    margin: 0 auto;
    min-height: calc(100vh - var(--header-height));
    position: relative;
}

/* --- 5. 左侧导航 (页面级) --- */
.sidebar-left {
    background: var(--c-bg-sidebar);
    /* 仅在左侧使用不同背景区分 */
    border-right: 1px solid transparent;
    border-radius: 24px;
    padding: 28px 12px;
    position: sticky;
    top: calc(var(--header-height) + 20px);
    height: calc(100vh - var(--header-height) - 40px);
    overflow-y: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.menu-group {
    margin-bottom: 32px;
}

.menu-title {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--c-text-tertiary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    padding-left: 12px;
}

.nav-item {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--c-text-secondary);
    border-radius: var(--corner-radius);
    margin-bottom: 2px;
}

.nav-item:hover {
    color: var(--c-primary);
    transform: translateY(-1px) scale(1.01);
    box-shadow: var(--c-item-hover-shadow);
}

.nav-item.active {
    background-color: var(--c-active-bg);
    color: var(--c-primary);
    font-weight: 500;
}

/* --- 6. 中间内容区 --- */
.main-content {
    padding: 40px 30px;
    /* 限制内容宽度，提高阅读舒适度 */
    max-width: var(--content-max-width);
    margin: 0 auto;
    width: 100%;
}

/* 面包屑 */
.breadcrumb {
    font-size: 13px;
    color: var(--c-text-tertiary);
    margin-bottom: 24px;
}

/* 排版样式 */
h1 {
    font-size: 32px;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
    color: var(--c-text-main);
}

h2 {
    font-size: 22px;
    margin: 40px 0 16px;
    padding-top: 20px;
    border-top: 1px solid var(--c-border);
    color: var(--c-text-main);
}

h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

h3 {
    font-size: 20px;
    margin: 0px 0px 30px;
    color: var(--c-text-main);
}

p {
    margin-bottom: 16px;
    color: var(--c-text-secondary);
    font-size: 16px;
}

/* FAQ 列表样式优化 */
.main-content > ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.main-content > ul li {
    margin-bottom: 20px;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: var(--corner-radius);
    background-color: var(--c-bg-card);
    border: 1px solid transparent;
    cursor: pointer;
}

.main-content > ul li:last-child {
    margin-bottom: 0;
}

.main-content > ul li:hover {
    border: 1px solid var(--c-feat-border);
    background-color: var(--c-bg-hover);
    transform: translateY(-1px) scale(1.01);
    box-shadow: var(--c-card-hover-shadow);
}

.main-content > ul li::before {
    content: '→';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    font-size: 16px;
    color: var(--c-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
}

.main-content > ul li:hover::before {
    opacity: 1;
    left: 8px;
}

.main-content > ul li a {
    color: var(--c-text-secondary);
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
    display: block;
    width: 100%;
    height: 100%;
    padding: 14px 20px 14px 35px;
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease;
}

.main-content > ul li:hover a {
    color: var(--c-primary);
}

/* 更多按钮样式 */
.main-content > ul li.more-item {
    background-color: var(--c-primary-light);
    border: 1px solid var(--c-primary);
    margin-top: 30px;
}

.main-content > ul li.more-item::before {
    content: '';
}

.main-content > ul li.more-item a {
    color: var(--c-primary);
    font-size: 16px;
    text-align: center;
}

.feat-text {
    color: var(--c-feat-text);
    font-weight: 500;
    background-color: var(--c-feat-bg);
    padding: 2px 7px;
    border-radius: 8px;
    margin: 16px 0;
}

.em-text {
    color: var(--c-em-text);
    background: var(--c-em-bg);
    padding: 2px 7px;
    border-radius: 8px;
}

.warn-text {
    color: var(--c-warn-text);
    background-color: var(--c-warn-bg);
    padding: 6px 8px;
    border-radius: 8px;
    margin: 16px 0;
    border-left: 3px solid var(--c-warn-text);
    display: block;
}

/* 升级步骤序号样式 */
.upgrade-steps {
    counter-reset: step-counter;
}

.upgrade-steps p {
    position: relative;
    padding-left: 32px;
    margin-bottom: 12px;
}

.upgrade-steps p::before {
    content: counter(step-counter); /* 显示序号数字 */
    counter-increment: step-counter; /* 计数器递增 */
    position: absolute;
    left: 0;
    top: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--c-bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.line-separator {
    display: block;
    content: "";
    margin-top: 30px;
}

/* --- 商店版和专业版的区别 --- */

#edtions { width: 860px; text-align: center; }

.edition-listview {border-collapse: separate; border-spacing: 0;}
.edition-listview td {padding: 10px; transition: all 0.3s ease;}
.edition-listview tr:not(:first-child) {transition: all 0.3s ease;}
.edition-listview tr:not(:first-child):hover {background-color: rgba(59, 128, 230, 0.05);}
.edition-listview tr:not(:first-child):hover td {color: #3B80E6;}
.edition-listview tr:not(:first-child):hover td:first-child {border-top-left-radius: 8px; border-bottom-left-radius: 8px;}
.edition-listview tr:not(:first-child):hover td:last-child {border-top-right-radius: 8px; border-bottom-right-radius: 8px;}
.funflag {width: 24px;}

/* --- 文章卡片 --- */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.article-card {
    border: 1px solid transparent;
    background-color: var(--c-bg-card);
    border-radius: var(--corner-radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.article-card:hover {
    border: 1px solid var(--c-feat-border);
    background-color: var(--c-bg-hover);
    transform: translateY(-1px) scale(1.01);
    box-shadow: var(--c-card-hover-shadow);
}

.article-card::after {
    content: '→';
    position: absolute;
    right: 20px;
    bottom: 20px;
    color: var(--c-text-tertiary);
    font-size: 18px;
    transition: var(--transition);
    opacity: 0;
}

.article-card:hover::after {
    color: var(--c-primary);
    opacity: 1;
    transform: translateX(8px);
}

.article-title {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--c-text-main);
}

.article-excerpt {
    font-size: 14px;
    color: var(--c-text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    font-size: 12px;
    color: var(--c-text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-meta i {
    margin-right: 4px;
}


/* --- 7. 右侧目录 (TOC) --- */
.sidebar-right {
    padding: 40px 20px;
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
    overflow-y: auto;
    border-left: 1px solid transparent;
}

.toc-title {
    font-size: 12px;
    color: var(--c-text-tertiary);
    margin-bottom: 12px;
}

.toc-list {
    position: relative;
    border-left: 2px solid var(--c-border);
}

.toc-item {
    display: block;
    padding: 6px 0 6px 16px;
    font-size: 13px;
    color: var(--c-text-secondary);
    position: relative;
}

.toc-item:hover {
    color: var(--c-primary);
}

/* TOC 激活状态 (ScrollSpy) */
.toc-item.active {
    color: var(--c-primary);
    font-weight: 500;
}

.toc-item.active::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--c-primary);
}

/* --- 8. 移动端适配 (响应式) --- */
@media (max-width: 1024px) {

    .theme-switch {
        justify-self: end;
    }

    /* 平板/窄屏：隐藏右侧目录 */
    .container {
        grid-template-columns: var(--sidebar-left-width) 1fr;
    }

    .sidebar-right {
        display: none;
    }

    .main-content {
        padding: 32px 30px;
        max-width: 100%;
    }
}

@media (max-width: 768px) {

    /* 手机端 */
    .menu-toggle {
        display: block;
    }

    .container {
        display: block;
    }

    /* 取消 Grid，改为流式 */

    /* 左侧导航变为抽屉 */
    .sidebar-left {
        position: fixed;
        left: -100%;
        /* 默认移出屏幕 */
        width: 80%;
        max-width: 300px;
        top: 0px;
        height: 100vh;
        z-index: 200;
        transition: left 0.3s ease;
        background: var(--c-bg-body);
        border-radius: 0;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    }

    .sidebar-left.open {
        left: 0;
    }

    .main-content {
        padding: 24px;
    }
    
    /* 手机端FAQ列表样式调整 */
     .main-content > ul {
        padding: 0;
        margin: 20px 0 30px;
    }
    
    .main-content > ul li {
        padding: 0;
        margin-bottom: 6px;
    }
    
    .main-content > ul li a {
        font-size: 14px;
        padding: 12px 16px 12px 30px;
    }
    
    /* 移动端更多按钮样式 */
    .main-content > ul li.more-item {
        margin-top: 20px;
    }
    
    .main-content > ul li::before {
        width: 16px;
        font-size: 12px;
        left: 8px;
    }
    
    .main-content > ul li:hover::before {
        left: 6px;
    }
    
    /* 手机端其他列表样式 */
    .main-content > ul:not(.faq-list) {
        margin: 20px 0 30px;
    }
    
    .main-content > ul li {
        padding: 10px 0;
        margin-bottom: 12px;
    }
    
    .main-content > ul li a {
        font-size: 15px;
    }

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

    .overlay.active {
        opacity: 1;
        pointer-events: auto;
    }
}