/* =========================================================================
   使用指南抽屉（Guide Drawer）样式
   -----------------------------------------------
   - 浮动按钮（fab）：固定在视口右下角
   - 遮罩（backdrop）：半透明覆盖层
   - 抽屉（drawer）：从右侧滑入，宽 400px
   ========================================================================= */

/* ---- Portal 容器：不生成盒子，子元素各自管理 pointer-events / fixed ---- */
.guide-drawer-portal {
    display: contents;
}

/* ---- 浮动按钮（圆形 FAB，对齐便捷计算器交互） ---- */
.guide-fab {
    position: fixed;
    right: var(--fab-right);
    bottom: var(--fab-bottom-guide);
    width: var(--fab-size);
    height: var(--fab-size);
    background: linear-gradient(135deg, #fb923c, #f97316);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    font-size: 22px;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.45);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    animation: guideFabPulse 5s ease-in-out infinite;
}

.guide-fab::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 64px;
    top: 50%;
    transform: translateY(-50%) scale(0.85);
    background: var(--text-primary, #1a202c);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
}

.guide-fab:hover {
    animation: none;
    transform: scale(1.12);
    box-shadow: 0 6px 24px rgba(249, 115, 22, 0.55);
}

.guide-fab:hover::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.guide-fab:active {
    transform: scale(0.94);
}

.guide-fab.is-open {
    animation: none;
    transform: rotate(15deg) scale(1.05);
    background: linear-gradient(135deg, #ea580c, #c2410c);
    box-shadow: 0 6px 20px rgba(194, 65, 12, 0.4);
}

.guide-fab--intro::after {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    animation: guideFabIntro 2.5s ease forwards;
}

@keyframes guideFabPulse {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-3px) scale(1.03); }
}

@keyframes guideFabIntro {
    0%, 65%  { opacity: 1; }
    100%     { opacity: 0; }
}

.guide-fab i {
    font-size: 22px;
    line-height: 1;
}

/* ---- 遮罩 ---- */
.guide-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.guide-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* ---- 抽屉 ---- */
.guide-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 400px;
    max-width: 92vw;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(var(--glass-blur-heavy));
    -webkit-backdrop-filter: blur(var(--glass-blur-heavy));
    border-left: 1px solid var(--glass-border-subtle);
    z-index: 1002;
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.guide-drawer.open {
    transform: translateX(0);
}

/* ---- 抽屉头部 ---- */
.guide-drawer-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--hero-orange-light-from, #fff7ed) 0%, var(--hero-orange-light-to, #ffedd5) 100%);
    border-bottom: 1px solid #fed7aa;
    flex-shrink: 0;
}

.guide-drawer-head-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--hero-orange-from, #fb923c), var(--hero-orange-to, #f97316));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guide-drawer-head-icon i {
    font-size: 1.3rem;
}

.guide-drawer-head-text {
    flex: 1;
    min-width: 0;
}

.guide-drawer-head-title {
    font-weight: 700;
    color: #7c2d12;
    font-size: 1rem;
}

.guide-drawer-head-desc {
    font-size: 0.78rem;
    color: #c2410c;
    margin-top: 2px;
}

.guide-drawer-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    color: #9ca3af;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.guide-drawer-close:hover {
    background: #fed7aa;
    color: #7c2d12;
}

/* ---- 抽屉内容区 ---- */
.guide-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ---- 通用区块 ---- */
.guide-section {
    margin-bottom: 20px;
}

.guide-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid;
}

.guide-section-head i {
    font-size: 1.1rem;
}

/* ---- 痛点区块 ---- */
.guide-section--pain .guide-section-head {
    color: #dc2626;
    border-color: #fecaca;
}

.guide-section--pain .guide-section-head i {
    color: #ef4444;
}

/* ---- 解决方案区块 ---- */
.guide-section--solution .guide-section-head {
    color: #059669;
    border-color: #a7f3d0;
}

.guide-section--solution .guide-section-head i {
    color: #10b981;
}

/* ---- 输出区块 ---- */
.guide-section--output .guide-section-head {
    color: #7c3aed;
    border-color: #ddd6fe;
}

.guide-section--output .guide-section-head i {
    color: #8b5cf6;
}

/* ---- 列表项 ---- */
.guide-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guide-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #374151;
    line-height: 1.5;
}

.guide-item i {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.guide-section--pain .guide-item i {
    color: #ef4444;
}

.guide-section--solution .guide-item i {
    color: #10b981;
}

/* ---- 输出网格 ---- */
.guide-output-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.guide-output-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border-radius: 8px;
    font-size: 0.82rem;
    color: #5b21b6;
    border-left: 3px solid #8b5cf6;
}

.guide-output-item i {
    color: #8b5cf6;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ---- 响应式 ---- */
@media (max-width: 480px) {
    .guide-drawer {
        width: 100%;
        max-width: 100%;
    }

    .guide-output-grid {
        grid-template-columns: 1fr;
    }

    .guide-fab {
        font-size: 20px;
    }

    .guide-fab i {
        font-size: 20px;
    }

    .guide-fab::after {
        max-width: 160px;
        font-size: 0.72rem;
    }
}

/* ---- 暗色主题 FAB ---- */
[data-theme="dark"] .guide-fab {
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
}

[data-theme="dark"] .guide-fab:hover {
    box-shadow: 0 6px 24px rgba(249, 115, 22, 0.45);
}

[data-theme="dark"] .guide-fab::after {
    background: var(--bg-elevated, #2d3748);
    color: var(--text-primary, #f7fafc);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
}
