/* ==========================================================================
   灵感可视 —— 落地页（服务端渲染的纯 HTML 页面）样式
   这个文件同时承载两部分：
     1. 概述正文的样式（原来的 frontend/src/assets/styles/content.css 搬到这里，
        因为落地页已经不再由 Vue 渲染，这里成为唯一来源）
     2. 落地页自身的布局：顶栏 / 侧边菜单 / 正文 / 页脚，以及浅色深色两套配色
   主题由 <html data-bs-theme="light|dark"> 控制，和主应用保持一致。
   ========================================================================== */

:root {
    --docs-accent: #3498db;
    --docs-accent-strong: #2980b9;
    --docs-bg: #f8f9fa;
    --docs-surface: #ffffff;
    --docs-text: #212529;
    --docs-muted: #7f8c8d;
    --docs-border: #eaeaea;
    --docs-shadow: 0 4px 12px rgba(0, 0, 0, .05);
    --docs-sidebar-width: 264px;
    /* 顶栏与侧栏沿用改版前的配色（导航栏 bg-dark、侧栏 #333） */
    --docs-navbar: #212529;
    --docs-navbar-border: rgba(255, 255, 255, .25);
    --docs-menu-bg: #333;
    --docs-menu-link: #bbb;
    --docs-menu-active: #555;
}

html[data-bs-theme="dark"] {
    --docs-bg: #212529;
    --docs-surface: #2b3035;
    --docs-text: #d8d9da;
    --docs-muted: #98a2a8;
    --docs-border: #3a4046;
    --docs-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

/* ---------------------------------------------------------------- 基本排版 */
body {
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
    color: var(--docs-text);
    background-color: var(--docs-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a {
    color: var(--docs-accent);
    text-decoration: none;
}

a:hover {
    color: var(--docs-accent-strong);
    text-decoration: underline;
}

/* ------------------------------------------------------------------ 顶栏 */
.docs-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 56px;
    padding: 0 20px;
    color: #fff;
    background: var(--docs-navbar);
    border-bottom: 1px solid var(--docs-navbar-border);
}

/* 汉堡：点击展开/收起侧边菜单 */
.docs-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 32px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 6px;
    cursor: pointer;
}

.docs-menu-toggle span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

.docs-menu-toggle:hover {
    border-color: #fff;
}

.docs-brand {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
    margin-right: auto;
}

.docs-brand:hover {
    color: var(--docs-accent);
    text-decoration: none;
}

.docs-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.docs-action {
    padding: 5px 12px;
    font-size: .875rem;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 6px;
    cursor: pointer;
}

.docs-action:hover {
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border-color: #fff;
    text-decoration: none;
}

/* ---------------------------------------------------------- 侧栏（抽屉） */
/* 默认收起，点顶栏汉堡才滑出 —— 与改版前的 offcanvas 左菜单一致 */
.docs-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    z-index: 25;
    width: var(--docs-sidebar-width);
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 12px;
    color: #fff;
    background: var(--docs-menu-bg);
    transform: translateX(-100%);
    transition: transform .25s ease;
}

.docs-sidebar.is-open {
    transform: translateX(0);
}

.docs-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
}

.docs-sidebar__title {
    font-size: .95rem;
    font-weight: 600;
}

.docs-sidebar__close {
    width: 26px;
    height: 26px;
    font-size: 18px;
    line-height: 1;
    color: #fff;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.docs-sidebar__close:hover {
    background: rgba(255, 255, 255, .12);
    border-radius: 4px;
}

/* 抽屉打开时的遮罩（点它也能关） */
.docs-backdrop {
    position: fixed;
    inset: 56px 0 0 0;
    z-index: 20;
    background: rgba(0, 0, 0, .45);
}

.docs-backdrop[hidden] {
    display: none;
}

.docs-main {
    min-width: 0;
    padding: 20px;
}

/* ------------------------------------------------------------------ 菜单 */
.docs-menu__title {
    margin-bottom: 8px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #999;
}

.docs-menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.docs-menu details > summary {
    padding: 6px 4px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    list-style: none;
}

.docs-menu details > summary::-webkit-details-marker {
    display: none;
}

/* 收起时给个 ▸，展开时转成 ▾ */
.docs-menu details > summary::before {
    content: "▸";
    display: inline-block;
    width: 14px;
    color: #999;
    transition: transform .15s ease;
}

.docs-menu details[open] > summary::before {
    transform: rotate(90deg);
}

.docs-menu details > summary:hover {
    color: var(--docs-accent);
}

.docs-menu__parents,
.docs-menu__children {
    margin-left: 10px !important;
    padding-left: 8px !important;
    border-left: 1px solid rgba(255, 255, 255, .15);
}

.docs-menu__parent > details > summary {
    font-weight: 500;
    font-size: .92rem;
    color: var(--docs-menu-link);
}

.docs-menu__link {
    display: block;
    padding: 5px 8px;
    font-size: .92rem;
    color: var(--docs-menu-link);
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docs-menu__link:hover {
    color: #fff;
    background: var(--docs-menu-active);
    text-decoration: none;
}

.docs-menu__link.is-current {
    font-weight: 600;
    color: #fff;
    background: var(--docs-menu-active);
}

/* ------------------------------------------------------------------ 页脚 */
.docs-footer {
    padding: 20px;
    text-align: center;
    font-size: .85rem;
    color: var(--docs-muted);
    border-top: 1px solid var(--docs-border);
}

/* ==========================================================================
   以下为概述正文的样式
   ========================================================================== */

.overview-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--docs-border);
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--docs-accent);
    margin-bottom: 15px;
}

.page-header h2 {
    color: var(--docs-accent);
}

.tagline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    color: var(--docs-muted);
}

.core-modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.module-card {
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    box-shadow: var(--docs-shadow);
    padding: 25px;
    transition: transform .3s ease;
}

.module-card:hover {
    transform: translateY(-5px);
}

.module-card h2 {
    font-size: 1.8rem;
    color: var(--docs-accent);
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 2px solid var(--docs-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.module-content h3 {
    color: var(--docs-accent-strong);
}

.featured-text {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--docs-accent);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.feature-item h3 {
    font-size: 1.3rem;
    color: var(--docs-accent-strong);
    margin-top: 0;
    margin-bottom: 10px;
}

.quiz-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.flow-step {
    position: relative;
    padding: 15px;
    border-radius: 6px;
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
}

.step-number {
    position: absolute;
    top: -15px;
    left: -15px;
    width: 30px;
    height: 30px;
    background: var(--docs-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.learning-path {
    margin-top: 40px;
}

.path-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.path-step {
    background: var(--docs-surface);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    box-shadow: var(--docs-shadow);
    padding: 20px;
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.step-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--docs-accent);
    color: #fff;
    border-radius: 50%;
    margin-right: 15px;
    font-weight: bold;
}

.path-step h3 {
    font-size: 1.3rem;
    color: var(--docs-accent);
    margin: 0;
}

.step-description {
    margin: 0;
}

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 900px) {
    /* 窄屏时抽屉占满宽度 */
    .docs-sidebar {
        width: min(86vw, var(--docs-sidebar-width));
    }
}

@media (max-width: 768px) {
    .core-modules,
    .feature-grid,
    .quiz-flow,
    .path-steps {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }
}
