/* ==================================================
 * Guide Pages Typography, Floating Back Action & Layout
 * ================================================== */

:root {
    --guide-max-width: 840px;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --bg-glass: rgba(255, 255, 255, 0.65);
    --border-glass: rgba(255, 255, 255, 0.6);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --link-color: #2563eb;
    --code-bg: rgba(0, 0, 0, 0.05);
}

:root.theme-dark {
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --bg-glass: rgba(18, 24, 38, 0.65);
    --border-glass: rgba(255, 255, 255, 0.12);
    --card-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
    --link-color: #60a5fa;
    --code-bg: rgba(255, 255, 255, 0.08);
}

:root.theme-auto {
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --bg-glass: rgba(18, 24, 38, 0.65);
    --border-glass: rgba(255, 255, 255, 0.12);
    --card-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
    --link-color: #60a5fa;
    --code-bg: rgba(255, 255, 255, 0.08);
}

@media (prefers-color-scheme: light) {
    :root.theme-auto {
        --text-primary: #1e293b;
        --text-secondary: #475569;
        --text-muted: #64748b;
        --bg-glass: rgba(255, 255, 255, 0.65);
        --border-glass: rgba(255, 255, 255, 0.6);
        --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
        --link-color: #2563eb;
        --code-bg: rgba(0, 0, 0, 0.05);
    }
}

body.guide-body,
body.is-viewing-guide {
    margin: 0;
    padding: 0;
    font-family: "LXGW WenKai TC", "LXGW WenKai", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    line-height: 1.8;
    background-color: transparent !important;
    background-image: none !important;
    min-height: 100vh;
}

:root.theme-dark body.guide-body,
:root.theme-auto body.guide-body,
:root.theme-dark body.is-viewing-guide,
:root.theme-auto body.is-viewing-guide {
    background-color: transparent !important;
    background-image: none !important;
}

@media (prefers-color-scheme: light) {
    :root.theme-auto body.guide-body,
    :root.theme-auto body.is-viewing-guide {
        background-color: transparent !important;
        background-image: none !important;
    }
}

/* ==================================================
 * 悬浮返回按钮 (Floating Back Button)
 * 极简透明背景，纯白色图标（夜间与日间纯白醒目，与右上角主题按钮在移动端和桌面端对称）
 * ================================================== */
.floating-back-btn,
.floating-home-btn {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    color: #ffffff !important;
    text-shadow: none !important;
    filter: none !important;
    opacity: 1 !important;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.floating-back-btn svg,
.floating-home-btn svg {
    display: block;
    width: 1.75rem;
    height: 1.75rem;
    stroke: #ffffff !important;
    color: #ffffff !important;
    filter: none !important;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.floating-back-btn:hover,
.floating-home-btn:hover {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #ffffff !important;
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.6)) !important;
}

.floating-back-btn:hover svg,
.floating-home-btn:hover svg {
    transform: translateX(-2px);
}

.floating-back-btn:active,
.floating-home-btn:active {
    transform: scale(0.92);
}

:root.theme-dark .floating-back-btn,
:root.theme-auto .floating-back-btn,
:root.theme-dark .floating-home-btn,
:root.theme-auto .floating-home-btn {
    color: #ffffff !important;
}

@media (prefers-color-scheme: light) {
    :root.theme-auto .floating-back-btn,
    :root.theme-auto .floating-home-btn {
        color: #ffffff !important;
    }
}

@media (max-width: 34.375rem) {
    .floating-back-btn,
    .floating-home-btn {
        top: 0.875rem;
        left: 0.875rem;
        width: 2.5rem;
        height: 2.5rem;
    }
    .floating-back-btn svg,
    .floating-home-btn svg {
        width: 1.5rem;
        height: 1.5rem;
    }
    .guide-wrapper {
        padding-top: 4.8rem !important;
    }
}

/* ==================================================
 * 极简返回顶部按钮 (Back to Top Button)
 * 极简透明背景，纯白箭头图标，右下角浮动显示
 * ================================================== */
.back-to-top-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 50%;
    cursor: pointer;
    color: #ffffff !important;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(12px) scale(0.9);
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    text-shadow: none !important;
    filter: none !important;
}

.back-to-top-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.back-to-top-btn:hover,
.back-to-top-btn:focus {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transform: translateY(-3px) scale(1.15);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.6)) !important;
}

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

.back-to-top-btn .back-to-top-icon {
    width: 1.625rem;
    height: 1.625rem;
    stroke: #ffffff !important;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
    filter: none !important;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 34.375rem) {
    .back-to-top-btn {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }
    .back-to-top-btn .back-to-top-icon {
        width: 1.45rem;
        height: 1.45rem;
    }
}

/* ==================================================
 * 页面容器与排版
 * ================================================== */
.guide-wrapper {
    position: relative;
    max-width: var(--guide-max-width);
    margin: 0 auto;
    padding: 5.5rem 1.25rem 4rem 1.25rem;
    z-index: 2;
}

/* 文章容器：磨砂玻璃质感，完全呼应主页背景 */
.guide-article {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2.5rem 2.2rem;
    box-shadow: var(--card-shadow);
}

@media (max-width: 600px) {
    .guide-article {
        padding: 1.75rem 1.25rem;
    }
}

.guide-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 1rem 0;
    letter-spacing: -0.02em;
}

/* 文章顶部元数据：无分隔线 */
.guide-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-bottom: 0.5rem;
    margin-bottom: 1.75rem;
    border-bottom: none;
}

.guide-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* 内部正文排版 */
.guide-article h2 {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(125, 125, 125, 0.2);
    color: var(--text-primary);
}

.guide-article h3 {
    font-size: 1.18rem;
    font-weight: 700;
    margin: 1.8rem 0 0.75rem 0;
    color: var(--text-primary);
}

.guide-article p {
    margin: 0 0 1.2rem 0;
    font-size: 1.02rem;
    color: var(--text-secondary);
}

.guide-article ul,
.guide-article ol {
    margin: 0 0 1.5rem 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.guide-article li {
    margin-bottom: 0.6rem;
}

.guide-article strong {
    color: var(--text-primary);
    font-weight: 700;
}

.guide-article a {
    color: var(--link-color);
    text-decoration: underline;
}

/* 提示块 */
.callout {
    padding: 1.1rem 1.25rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    line-height: 1.65;
}

.callout-info {
    background: rgba(59, 130, 246, 0.12);
    border-left: 4px solid #3b82f6;
    color: var(--text-primary);
}

.callout-warning {
    background: rgba(245, 158, 11, 0.12);
    border-left: 4px solid #f59e0b;
    color: var(--text-primary);
}

.callout-success {
    background: rgba(16, 185, 129, 0.12);
    border-left: 4px solid #10b981;
    color: var(--text-primary);
}

/* 表格 */
.guide-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 10px;
    border: 1px solid var(--border-glass);
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
    white-space: nowrap;
}

.guide-table th,
.guide-table td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid rgba(125, 125, 125, 0.15);
}

.guide-table th {
    background: rgba(0, 0, 0, 0.05);
    font-weight: 700;
    color: var(--text-primary);
}

:root.theme-dark .guide-table th,
:root.theme-auto .guide-table th {
    background: rgba(255, 255, 255, 0.06);
}

@media (prefers-color-scheme: light) {
    :root.theme-auto .guide-table th {
        background: rgba(0, 0, 0, 0.05);
    }
}

.guide-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* 底部返回按钮（与左上角风格一致，背景透明，纯白色图标与纯白文字，夜间与日间均保持纯白） */
.guide-footer-cta {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-glass);
    text-align: center;
}

.guide-footer-btn,
.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.6rem 1.6rem;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    font-size: 1.08rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff !important;
    border-radius: 9999px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-shadow: none !important;
    filter: none !important;
    opacity: 1 !important;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.guide-footer-btn svg,
.cta-button svg {
    display: block;
    width: 1.55rem;
    height: 1.55rem;
    stroke: #ffffff !important;
    color: #ffffff !important;
    filter: none !important;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.guide-footer-btn span,
.cta-button span {
    color: #ffffff !important;
    text-shadow: none !important;
}

.guide-footer-btn:hover,
.cta-button:hover {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-decoration: none !important;
    transform: scale(1.08);
    color: #ffffff !important;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.6)) !important;
}

.guide-footer-btn:hover svg,
.cta-button:hover svg {
    transform: translateX(-3px);
}

.guide-footer-btn:active,
.cta-button:active {
    transform: scale(0.95);
}

:root.theme-dark .guide-footer-btn,
:root.theme-auto .guide-footer-btn,
:root.theme-dark .cta-button,
:root.theme-auto .cta-button,
:root.theme-dark .guide-footer-btn span,
:root.theme-auto .guide-footer-btn span,
:root.theme-dark .cta-button span,
:root.theme-auto .cta-button span {
    color: #ffffff !important;
    text-shadow: none !important;
    filter: none !important;
}

:root.theme-dark .guide-footer-btn:hover,
:root.theme-auto .guide-footer-btn:hover,
:root.theme-dark .cta-button:hover,
:root.theme-auto .cta-button:hover {
    color: #ffffff !important;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.6)) !important;
}

@media (prefers-color-scheme: light) {
    :root.theme-auto .guide-footer-btn,
    :root.theme-auto .cta-button,
    :root.theme-auto .guide-footer-btn span,
    :root.theme-auto .cta-button span,
    :root.theme-auto .guide-footer-btn svg,
    :root.theme-auto .cta-button svg {
        color: #ffffff !important;
        stroke: #ffffff !important;
        text-shadow: none !important;
        filter: none !important;
    }
    :root.theme-auto .guide-footer-btn:hover,
    :root.theme-auto .cta-button:hover {
        color: #ffffff !important;
        filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 16px rgba(255, 255, 255, 0.6)) !important;
    }
}
