/* 首頁架構樹：靜態載入，不依賴 Vite（僅 php artisan serve 也能有完整樣式） */

.arch-tree-section-heading {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
}

.arch-visual-canvas {
    /* 連線：偏青灰、夠深，與網格區隔（對齊參考站「清清楚楚」的正交線） */
    --arch-viz-line: #5c6f88;
    --arch-viz-line-rail: #4a5f7a;
    --arch-viz-root-bg: #0a0e1a;
    --arch-viz-root-shadow: 0 18px 48px rgba(10, 14, 26, 0.38);
    --arch-viz-grid: rgba(148, 163, 184, 0.16);
    position: relative;
    border-radius: 16px;
    padding: 2.25rem 1.25rem 2.5rem;
    background-color: #f4f7fb;
    background-image:
        linear-gradient(var(--arch-viz-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--arch-viz-grid) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center top;
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    overflow-x: auto;
}

/* 滿版寬度：與參考站相同，橫向主幹貫穿視窗，欄位區僅左右留邊距 */
.arch-visual-canvas--fullbleed {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-sizing: border-box;
}

/* ── AIAddress 式樹狀圖：連線由 li 幾何自動算出，橫線長度＝兄弟節點間距 ── */
.arch-bp-tree-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem clamp(0.75rem, 2.5vw, 2.5rem) 2.5rem;
    text-align: center;
}

.arch-bp-tree {
    --arch-bp-line: #94a3b8;
    display: inline-block;
    vertical-align: top;
    min-width: max-content;
    text-align: center;
}

.arch-bp-tree ul {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 2.5rem 0 0;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    transition: opacity 0.35s ease;
}

.arch-bp-tree li {
    position: relative;
    list-style: none;
    text-align: center;
    padding: 2.5rem 0.5rem 0;
    flex: 1 1 auto;
    min-width: min-content;
    transition: opacity 0.35s ease;
}

/* 兄弟間橫軌 + 垂線（與 AIAddress architecture 相同邏輯） */
.arch-bp-tree li::before,
.arch-bp-tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 2px solid var(--arch-bp-line);
    width: 50%;
    height: 2.5rem;
}

.arch-bp-tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid var(--arch-bp-line);
}

.arch-bp-tree li:only-child::before,
.arch-bp-tree li:only-child::after {
    display: none;
}

.arch-bp-tree li:only-child {
    padding-top: 0;
}

.arch-bp-tree li:first-child::before,
.arch-bp-tree li:last-child::after {
    border: 0 none;
}

.arch-bp-tree li:last-child::before {
    border-right: 2px solid var(--arch-bp-line);
    border-radius: 0 5px 0 0;
}

.arch-bp-tree li:first-child::after {
    border-radius: 5px 0 0 0;
}

/* 父層 → 子層第一排連線 */
.arch-bp-tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 2px solid var(--arch-bp-line);
    width: 0;
    height: 2.5rem;
    margin-left: -1px;
}

/* 根節點（單一 li）不畫上緣橫線 */
.arch-bp-tree > ul > li:only-child::before,
.arch-bp-tree > ul > li:only-child::after {
    display: none;
}

.arch-bp-tree > ul > li:only-child {
    padding-top: 0;
}

/* ── 節點外觀（對齊參考頁層級：root / hub pill / module / leaf）── */
.arch-bp-root {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 2.25rem;
    background: #0f172a;
    color: #fff;
    border-radius: 2.5rem;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.45);
    position: relative;
    z-index: 20;
    text-align: left;
}

.arch-bp-root-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #4f46e5, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.arch-bp-root-kicker {
    display: block;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #a5b4fc;
    margin-bottom: 0.2rem;
}

.arch-bp-root-title {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.arch-bp-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.35rem;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 9999px;
    font-weight: 800;
    font-size: 0.82rem;
    color: #1e293b;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 10;
    white-space: nowrap;
}

.arch-bp-pillar--a .arch-bp-pill:hover { border-color: #6366f1; background: #eef2ff; }
.arch-bp-pillar--b .arch-bp-pill:hover { border-color: #14b8a6; background: #f0fdfa; }
.arch-bp-pillar--c .arch-bp-pill:hover { border-color: #3b82f6; background: #eff6ff; }
.arch-bp-pillar--d .arch-bp-pill:hover { border-color: #ec4899; background: #fdf2f8; }
.arch-bp-pillar--e .arch-bp-pill:hover { border-color: #f59e0b; background: #fffbeb; }

.arch-bp-module {
    display: inline-block;
    padding: 0.72rem 1.25rem;
    border-width: 1.5px;
    border-style: solid;
    border-radius: 1.15rem;
    font-weight: 800;
    font-size: 0.76rem;
    color: #334155;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
    min-width: 148px;
    position: relative;
    z-index: 10;
}

.arch-bp-pillar--a .arch-bp-module {
    border-color: #c7d2fe;
    background: #eef2ff;
}

.arch-bp-pillar--b .arch-bp-module {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.arch-bp-pillar--c .arch-bp-module {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.arch-bp-pillar--d .arch-bp-module {
    border-color: #fbcfe8;
    background: #fdf2f8;
}

.arch-bp-pillar--e .arch-bp-module {
    border-color: #fde68a;
    background: #fffbeb;
}

.arch-bp-leaf {
    display: inline-block;
    padding: 0.55rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    font-weight: 700;
    font-size: 0.72rem;
    color: #64748b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    min-width: 132px;
    max-width: 220px;
    position: relative;
    z-index: 10;
    line-height: 1.35;
}

.arch-bp-leaf strong {
    font-weight: 700;
    color: #334155;
}

.arch-bp-leaf-hint {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.62rem;
    font-weight: 500;
    color: #94a3b8;
}

.arch-section-title {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.arch-tech-list {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

.arch-tech-list ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.arch-tech-list ul ul {
    margin-top: 0.35rem;
    margin-left: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid #e2e8f0;
}

.arch-tech-list li {
    padding: 0.2rem 0;
}

.arch-tech-list .arch-node-root {
    font-weight: 800;
    font-size: 1.05rem;
    color: #0f172a;
}

.arch-tech-list .arch-node-pillar {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1e293b;
}

.arch-tech-list .arch-node-leaf {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.55;
}

@media (max-width: 991.98px) {
    .arch-visual-canvas {
        padding: 1.5rem 0.75rem 1.75rem;
    }
    .arch-visual-canvas--fullbleed {
        border-radius: 0;
    }

    .arch-bp-tree-wrap {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .arch-bp-tree li::before,
    .arch-bp-tree li::after,
    .arch-bp-tree ul ul::before {
        display: none !important;
    }

    .arch-bp-tree ul {
        flex-direction: column;
        align-items: stretch;
        padding-top: 1.25rem;
    }

    .arch-bp-tree li {
        flex: none;
        width: 100%;
        max-width: 100%;
        padding-top: 0.75rem;
        padding-left: 0;
        padding-right: 0;
    }

    .arch-bp-tree li:only-child {
        padding-top: 0;
    }

    .arch-bp-root {
        flex-direction: column;
        text-align: center;
        padding: 1rem 1.25rem;
        gap: 0.85rem;
    }

    .arch-bp-root-text {
        text-align: center;
    }

    .arch-bp-pill {
        white-space: normal;
        width: 100%;
        max-width: 100%;
    }

    .arch-bp-module {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .arch-bp-leaf {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-width: 0;
    }
}
