﻿/* =========================================================
   K 線型態總表
   檔案：Content/kline-pattern-guide.css
   目的：與 stock.css 完全分離
========================================================= */

/* ===== K 線型態總表頁背景 ===== */

body {
    background: radial-gradient(circle at top, #10214a 0%, #07111f 45%, #020611 100%);
    background-attachment: fixed;
}

.stock-terminal-page {
    min-height: 100vh;
    background: transparent;
}

.kline-guide-shell {
    min-height: calc(100vh - 72px);
}

.kline-guide-shell {
    width: 100%;
    padding: 24px 24px 42px;
    box-sizing: border-box;
}

    .kline-guide-shell .terminal-main {
        width: 100%;
        max-width: none;
        display: block;
    }

.kline-guide-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
    padding: 22px 26px;
    border: 1px solid rgba(41, 182, 255, 0.28);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(8, 24, 39, 0.98), rgba(10, 32, 58, 0.9));
}

    .kline-guide-topbar h1 {
        margin: 6px 0;
        color: #ffffff;
        font-size: 34px;
        font-weight: 900;
    }

    .kline-guide-topbar p {
        margin: 0;
        color: #a9bed3;
        font-size: 15px;
        line-height: 1.6;
    }

.kline-guide-card {
    width: 100%;
    padding: 0;
    border: 1px solid rgba(41, 182, 255, 0.28);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(8, 24, 39, 0.98), rgba(3, 10, 18, 0.98));
    overflow: hidden;
}

.kline-guide-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid rgba(41, 182, 255, 0.16);
    border-bottom: 1px solid rgba(41, 182, 255, 0.22);
}

.kline-guide-filter {
    padding: 6px 14px;
    border: 1px solid rgba(41, 182, 255, 0.45);
    border-radius: 999px;
    background: rgba(3, 12, 22, 0.9);
    color: #dfe7ff;
    font-weight: 800;
    cursor: pointer;
}

    .kline-guide-filter.active,
    .kline-guide-filter:hover {
        color: #ffffff;
        background: rgba(41, 182, 255, 0.24);
    }

.kpg-count {
    padding: 14px 16px 0;
    color: #9fd7ff;
    font-size: 14px;
    font-weight: 900;
}

.kpg-table {
    min-width: 980px;
    margin: 12px 16px 18px;
    border: 1px solid rgba(61, 114, 157, 0.34);
    border-radius: 10px;
    overflow: hidden;
}

.kpg-row {
    display: grid;
    grid-template-columns: 90px 150px 180px 1.1fr 1.2fr 1.1fr;
    border-bottom: 1px solid rgba(61, 114, 157, 0.28);
}

    .kpg-row:last-child {
        border-bottom: none;
    }

    .kpg-row > div {
        padding: 14px 16px;
        color: #dfe7ff;
        font-size: 18px;
        line-height: 1.8;
        font-weight: 850;
        border-right: 1px solid rgba(61, 114, 157, 0.18);
    }

        .kpg-row > div:last-child {
            border-right: none;
        }

.kpg-head > div {
    color: #9fd7ff;
    font-weight: 900;
    background: rgba(7, 25, 42, 0.95);
}

.kpg-name {
    color: #ffffff;
    font-weight: 900;
}

.kpg-type {
    display: inline-block;
    min-width: 46px;
    padding: 3px 9px;
    border-radius: 999px;
    text-align: center;
    font-size: 12px;
    font-weight: 900;
}

.kpg-bull {
    color: #ff4d4f;
    border: 1px solid rgba(255, 77, 79, 0.68);
    background: rgba(255, 77, 79, 0.14);
}

.kpg-bear {
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.68);
    background: rgba(34, 197, 94, 0.14);
}

.kpg-neutral {
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.48);
    background: rgba(148, 163, 184, 0.12);
}

.kpg-empty {
    padding: 20px;
    color: #ffd23c;
    font-weight: 800;
}

@media (max-width: 768px) {
    .kline-guide-shell {
        padding: 12px;
    }

    .kline-guide-topbar {
        display: block;
        padding: 18px;
    }

        .kline-guide-topbar h1 {
            font-size: 28px;
        }

    .kline-pattern-table-host {
        overflow-x: auto;
    }
}

/* ===== K 線型態總表：圖解欄 ===== */

.kpg-sketch {
    min-height: 150px;
    background: rgba(2, 8, 15, 0.45);
}

    .kpg-sketch .kline-sketch-wrap {
        width: 100%;
        min-height: 138px;
    }

    .kpg-sketch .kline-sketch-title {
        font-size: 12px;
    }

    .kpg-sketch .kline-sketch-svg {
        max-width: 150px;
        height: 82px;
    }

    .kpg-sketch .kline-sketch-caption {
        font-size: 11px;
        line-height: 1.35;
    }

/* ===== K 線型態總表：手機版 ===== */
@media (max-width: 768px) {
    body {
        background: #020611;
    }

    .stock-terminal-page {
        padding: 0;
        min-height: 100vh;
        overflow-x: hidden;
    }

    .kline-guide-shell {
        padding: 14px;
        min-height: calc(100vh - 64px);
    }

    .kline-guide-topbar {
        padding: 18px 20px;
        margin-bottom: 14px;
        border-radius: 16px;
    }

        .kline-guide-topbar h1 {
            font-size: 30px;
            line-height: 1.2;
        }

        .kline-guide-topbar p {
            font-size: 15px;
            line-height: 1.7;
        }

    .kline-guide-card {
        border-radius: 14px;
        overflow: hidden;
    }

    .kline-guide-toolbar {
        gap: 10px;
        padding: 14px 16px;
    }

    .kline-guide-filter {
        padding: 8px 16px;
        font-size: 16px;
    }

    .kline-pattern-table-host {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .kpg-count {
        padding: 14px 16px;
        font-size: 16px;
    }

    .kpg-table {
        min-width: 980px;
        margin: 0 16px 18px;
    }

    .kpg-row > div {
        font-size: 15px;
        line-height: 1.6;
    }

    .kpg-sketch .kline-sketch-svg {
        max-width: 150px;
        height: 86px;
    }
}

/* ===== K 線型態總表：卡片標題對齊 ===== */

.kline-guide-card .card-head {
    padding: 18px 22px 14px;
}

    .kline-guide-card .card-head h2 {
        margin: 0;
        line-height: 1.25;
    }

    .kline-guide-card .card-head p {
        margin: 6px 0 0;
    }

@media (max-width: 768px) {
    .kline-guide-card .card-head {
        padding: 18px 20px 14px;
    }


    /* ===== K 線型態總表：表格標題與文字放大（排除圖解欄） ===== */

    .kpg-head > div {
        font-size: 16px;
        line-height: 1.55;
    }

    .kpg-row > div:not(.kpg-sketch) {
        font-size: 15px;
        line-height: 1.75;
    }

    .kpg-name {
        font-size: 16px;
    }

    .kpg-type {
        font-size: 13px;
    }

    /* 圖解欄維持原尺寸 */
    .kpg-row > .kpg-sketch,
    .kpg-row > .kpg-sketch * {
        font-size: inherit;
    }
}
@media (max-width: 768px) {
    .kpg-head > div {
        font-size: 17px;
    }

    .kpg-row > div:not(.kpg-sketch) {
        font-size: 16px;
        line-height: 1.8;
    }

    .kpg-name {
        font-size: 17px;
    }

    .kpg-type {
        font-size: 14px;
    }

    .kpg-row > .kpg-sketch,
    .kpg-row > .kpg-sketch * {
        font-size: inherit;
    }
}

.kpg-mobile-detail-head,
.kpg-mobile-detail-cell {
    display: none;
}

.kpg-type {
    font-size: 14px;
}

.kpg-name {
    font-size: 19px;
}

.kpg-sketch {
    min-height: 150px;
    background: rgba(2, 8, 15, 0.45);
    font-size: 12px;
}

/* ===== K 線型態總表：手機版改為 圖解 + 詳細說明 ===== */
@media (max-width: 768px) {
    .kline-pattern-table-host {
        overflow-x: hidden;
    }

    .kpg-table {
        min-width: 0;
        width: auto;
        margin: 0 12px 18px;
    }

    .kpg-row {
        grid-template-columns: 1fr 112px;
    }

    .kpg-head > div {
        display: none;
    }

    .kpg-head > .kpg-mobile-detail-head {
        display: block;
    }

    .kpg-head {
        display: grid;
        grid-template-columns: 1fr 112px;
    }

        .kpg-head::before {
            content: "圖解";
            display: block;
            padding: 12px 14px;
            color: #9fd7ff;
            font-size: 18px;
            font-weight: 900;
            background: rgba(7, 25, 42, 0.95);
            border-right: 1px solid rgba(61, 114, 157, 0.18);
        }

    .kpg-type-cell,
    .kpg-name,
    .kpg-meaning,
    .kpg-condition,
    .kpg-warning {
        display: none;
    }

    .kpg-sketch {
        display: block;
        min-height: 150px;
        padding: 12px 10px;
    }

    .kpg-mobile-detail-cell {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px;
    }

    .kpg-detail-btn {
        width: 82px;
        height: 42px;
        border: 1px solid rgba(41, 182, 255, 0.55);
        border-radius: 999px;
        background: rgba(41, 182, 255, 0.18);
        color: #ffffff;
        font-size: 17px;
        font-weight: 900;
    }

    .kpg-sketch .kline-sketch-svg {
        max-width: 160px;
        height: 90px;
    }
}

/* ===== K 線型態總表：手機版詳細說明 Modal ===== */
.kpg-modal {
    display: none;
}

    .kpg-modal.is-open {
        display: block;
    }

.kpg-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.72);
}

.kpg-modal-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 9001;
    width: min(92vw, 520px);
    max-height: 86vh;
    overflow-y: auto;
    transform: translate(-50%, -50%);
    padding: 20px;
    border: 1px solid rgba(41, 182, 255, 0.42);
    border-radius: 18px;
    background: linear-gradient(180deg, #071827, #020611);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

.kpg-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.9);
    color: #ffffff;
    font-size: 24px;
    line-height: 30px;
}

.kpg-modal-title {
    padding-right: 36px;
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.3;
}

.kpg-modal-type {
    margin-top: 8px;
}

.kpg-modal-sketch {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid rgba(61, 114, 157, 0.28);
    border-radius: 14px;
    background: rgba(2, 8, 15, 0.45);
}

.kpg-modal-section {
    margin-top: 16px;
}

    .kpg-modal-section h4 {
        margin: 0 0 6px;
        color: #9fd7ff;
        font-size: 18px;
        font-weight: 900;
    }

    .kpg-modal-section p {
        margin: 0;
        color: #dfe7ff;
        font-size: 17px;
        line-height: 1.8;
        font-weight: 800;
    }

.kpg-modal-open {
    overflow: hidden;
}