﻿.smart-pick-page {
    min-height: calc(100vh - 72px);
    padding: 22px;
    background: radial-gradient(circle at top left, rgba(38, 118, 255, .18), transparent 32%), #07111f;
    color: #e8f1ff;
}

.smart-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: stretch;
    padding: 22px;
    border: 1px solid rgba(120, 170, 255, .18);
    border-radius: 18px;
    background: rgba(7, 18, 34, .86);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
    margin-bottom: 18px;
}

.smart-kicker {
    color: #77aaff;
    font-size: 12px;
    letter-spacing: .16em;
    font-weight: 800;
    margin-bottom: 8px;
}

.smart-hero h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 900;
}

.smart-hero p {
    margin: 8px 0 0;
    color: #9fb4cf;
    font-size: 15px;
}

.smart-hero-meta {
    display: flex;
    gap: 12px;
    min-width: 280px;
}

    .smart-hero-meta > div {
        flex: 1;
        padding: 16px;
        border-radius: 16px;
        background: rgba(15, 34, 58, .95);
        border: 1px solid rgba(120, 170, 255, .16);
    }

    .smart-hero-meta span {
        display: block;
        color: #8ea6c5;
        font-size: 12px;
        margin-bottom: 8px;
    }

    .smart-hero-meta strong {
        display: block;
        font-size: 24px;
        color: #ffffff;
    }

.smart-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 280px;
    gap: 18px;
}

.smart-filter-panel,
.smart-result-panel,
.smart-info-panel {
    border: 1px solid rgba(120, 170, 255, .16);
    border-radius: 18px;
    background: rgba(7, 18, 34, .88);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .24);
}

.smart-filter-panel,
.smart-info-panel {
    padding: 18px;
}

.smart-result-panel {
    padding: 18px;
    min-height: 520px;
}

.panel-title {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 12px;
}

.panel-subtitle {
    color: #8ea6c5;
    font-size: 13px;
}

.filter-group {
    margin-bottom: 18px;
}

    .filter-group > label:first-child {
        display: block;
        color: #b9c9df;
        font-size: 13px;
        font-weight: 800;
        margin-bottom: 8px;
    }

.price-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.smart-filter-panel input[type="number"],
.smart-filter-panel select {
    width: 100%;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(120, 170, 255, .18);
    background: rgba(3, 12, 24, .85);
    color: #e8f1ff;
    padding: 0 10px;
    outline: none;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d7e5f7;
    font-size: 14px;
    margin: 8px 0;
}

.smart-main-btn {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #2f7dff, #6b5cff);
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.smart-result-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.smart-empty {
    padding: 36px;
    text-align: center;
    color: #8ea6c5;
    border: 1px dashed rgba(120, 170, 255, .22);
    border-radius: 14px;
}

.smart-stock-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 90px 90px;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(120, 170, 255, .16);
    background: rgba(12, 30, 52, .86);
}

.stock-name {
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
}

.stock-symbol {
    color: #8ea6c5;
    font-size: 13px;
    margin-top: 4px;
}

.stock-reason {
    color: #b8c8dc;
    font-size: 13px;
    margin-top: 8px;
}

.score-pill {
    justify-self: center;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255, 60, 80, .16);
    border: 1px solid rgba(255, 90, 105, .35);
    color: #ff6d7d;
    font-size: 22px;
    font-weight: 900;
}

.signal-text {
    justify-self: center;
    color: #ffd166;
    font-weight: 900;
}

.detail-link {
    justify-self: end;
    color: #8eb8ff;
    text-decoration: none;
    font-weight: 800;
}

.strategy-name {
    padding: 12px;
    border-radius: 12px;
    background: rgba(47, 125, 255, .12);
    border: 1px solid rgba(47, 125, 255, .25);
    color: #dce9ff;
    font-weight: 900;
    margin-bottom: 14px;
}

.strategy-list {
    padding-left: 20px;
    color: #b8c8dc;
    line-height: 1.8;
    font-size: 14px;
}

.risk-box {
    margin-top: 16px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 193, 7, .10);
    border: 1px solid rgba(255, 193, 7, .25);
    color: #ffe6a3;
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 1180px) {
    .smart-layout {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .smart-info-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .smart-pick-page {
        padding: 12px;
    }

    .smart-hero {
        flex-direction: column;
        padding: 16px;
    }

        .smart-hero h1 {
            font-size: 24px;
        }

    .smart-hero-meta {
        min-width: 0;
    }

    .smart-layout {
        grid-template-columns: 1fr;
    }

    .smart-stock-card {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .score-pill,
    .signal-text,
    .detail-link {
        justify-self: start;
    }
}

.stock-main {
    min-width: 0;
}

.stock-side {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
}

.stock-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.stock-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: #9bdcff;
    font-size: 12px;
    line-height: 1.4;
}

.smartpick-mini-btn {
    border: 1px solid rgba(80, 200, 255, .45);
    background: rgba(20, 40, 60, .9);
    color: #dff6ff;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
}

    .smartpick-mini-btn:hover {
        background: rgba(30, 80, 110, .95);
    }

    .smartpick-mini-btn:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

.smartpick-refresh-msg {
    margin-left: 10px;
    color: #9ee493;
    font-size: 13px;
}

.smart-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 24px;
}

.smart-hero-main {
    flex: 1 1 auto;
    min-width: 0;
}

.smart-hero-side {
    flex: 0 0 360px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

.smart-hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

    .smart-hero-meta > div {
        min-height: 92px;
        padding: 18px 20px;
    }

.smart-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 12px;
}

.smartpick-refresh-msg {
    display: block;
    margin-top: 8px;
    max-width: 260px;
    text-align: right;
    line-height: 1.5;
    color: #7dff8a;
    font-size: 13px;
}

.smartpick-mini-btn {
    width: 170px;
    height: 42px;
}

.smartpick-refresh-msg {
    display: block;
    margin-top: 8px;
    text-align: right;
}

.smart-tools {
    display: none;
}

.smartpick-mini-btn {
    min-width: 160px;
    height: 44px;
}

@media (max-width: 768px) {
    .smart-hero {
        flex-direction: column;
    }

    .smart-hero-meta {
        flex: none;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .smart-hero-actions {
        flex-wrap: wrap;
    }
}

/* ===== SmartPick result list fix ===== */

.smart-result-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.smart-result-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px 96px;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
}

.smart-result-main {
    min-width: 0;
}

.smart-result-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
}

.smart-result-meta,
.smart-result-reason {
    font-size: 13px;
    line-height: 1.6;
    color: #9fc5e8;
    white-space: normal;
}

.smart-score {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    font-size: 22px;
    font-weight: 800;
}

.smart-result-action {
    justify-self: end;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    word-break: keep-all;
    min-width: 82px;
    height: 38px;
    padding: 0 12px;
}

/* ===== Hero number card fix ===== */

.smart-hero-meta > div {
    min-width: 0;
}

.smart-hero-meta strong {
    font-size: 22px;
    line-height: 1.25;
    word-break: keep-all;
    white-space: nowrap;
}

#smartTradeDate {
    font-size: 21px;
}

/* ===== Mobile ===== */

@media (max-width: 768px) {
    .smart-result-card {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .smart-score {
        justify-self: start;
    }

    .smart-result-action {
        justify-self: stretch;
        width: 100%;
    }

    .smart-hero-meta strong {
        white-space: normal;
    }
}

/* ===== SmartPick result card actual class fix ===== */

.smart-stock-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: center;
    gap: 18px;
    padding: 20px;
}

.stock-main {
    min-width: 0;
}

.stock-side {
    display: grid;
    grid-template-columns: 62px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 14px;
    row-gap: 8px;
}

.score-pill {
    grid-row: 1 / span 2;
    justify-self: center;
}

.signal-text {
    white-space: nowrap;
    writing-mode: horizontal-tb;
    color: #ffd966;
    font-weight: 700;
}

.detail-link {
    white-space: nowrap;
    writing-mode: horizontal-tb;
    color: #7db7ff;
    font-weight: 700;
    text-decoration: none;
}

    .detail-link:hover {
        text-decoration: underline;
    }

.add-featured-btn {
    border: 1px solid rgba(120, 210, 255, .45);
    background: rgba(20, 70, 105, .65);
    color: #dff6ff;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

    .add-featured-btn:hover {
        background: rgba(35, 105, 145, .85);
    }

    .add-featured-btn:disabled {
        opacity: .75;
        cursor: default;
    }

/* =========================================================
   SmartPick Mobile 老花眼友善版
   貼在 smart-pick.css 最底部
   ========================================================= */

@media (max-width: 768px) {
    .smart-pick-page {
        padding: 14px;
        font-size: 17px;
    }

    .smart-hero,
    .smart-filter-panel,
    .smart-result-panel,
    .smart-info-panel {
        border-radius: 20px;
        padding: 20px;
    }

    .smart-kicker {
        font-size: 14px;
        letter-spacing: .14em;
    }

    .smart-hero h1 {
        font-size: 30px;
        line-height: 1.25;
    }

    .smart-hero p {
        font-size: 18px;
        line-height: 1.7;
        color: #b7d4ff;
    }

    .smart-hero-meta {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

        .smart-hero-meta > div {
            min-height: 104px;
            padding: 18px;
        }

        .smart-hero-meta span {
            font-size: 15px;
        }

        .smart-hero-meta strong,
        #smartTradeDate {
            font-size: 24px;
        }

    .smart-hero-actions {
        align-items: stretch;
    }

    .smartpick-mini-btn {
        width: 100%;
        height: 52px;
        font-size: 17px;
        border-radius: 12px;
    }

    .panel-title {
        font-size: 24px;
        margin-bottom: 18px;
    }

    .panel-subtitle {
        font-size: 16px;
        line-height: 1.6;
    }

    .filter-group {
        margin-bottom: 24px;
    }

        .filter-group > label:first-child {
            font-size: 17px;
            margin-bottom: 12px;
            color: #cfe2ff;
        }

    .price-row {
        gap: 12px;
    }

    .smart-filter-panel input[type="number"],
    .smart-filter-panel select {
        height: 52px;
        font-size: 20px;
        border-radius: 12px;
        padding: 0 14px;
    }

    .check-line {
        font-size: 18px;
        line-height: 1.7;
        gap: 12px;
        margin: 10px 0;
    }

        .check-line input[type="checkbox"] {
            width: 18px;
            height: 18px;
            flex: 0 0 auto;
        }

    .smart-main-btn {
        height: 56px;
        font-size: 19px;
        border-radius: 14px;
    }

    .smart-stock-card {
        grid-template-columns: 1fr;
        padding: 22px;
        gap: 18px;
        border-radius: 20px;
    }

    .stock-name {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .stock-symbol,
    .stock-reason {
        font-size: 17px;
        line-height: 1.7;
        color: #aad0ff;
    }

    .stock-tags {
        gap: 8px;
        margin-top: 12px;
    }

    .stock-tag {
        font-size: 15px;
        padding: 5px 10px;
    }

    .stock-side {
        width: 100%;
        display: grid;
        grid-template-columns: 76px 1fr 96px;
        grid-template-rows: auto auto;
        column-gap: 14px;
        row-gap: 10px;
        margin-left: 0;
    }

    .score-pill {
        grid-row: 1 / span 2;
        width: 72px;
        height: 72px;
        font-size: 28px;
        justify-self: start;
    }

    .signal-text {
        font-size: 20px;
        align-self: center;
        justify-self: start;
    }

    .add-featured-btn {
        height: 44px;
        font-size: 16px;
        border-radius: 10px;
        justify-self: end;
    }

    .detail-link {
        grid-column: 2 / span 2;
        font-size: 18px;
        justify-self: start;
    }

    .strategy-name {
        font-size: 20px;
        padding: 16px;
        border-radius: 14px;
    }

    .strategy-list {
        font-size: 18px;
        line-height: 1.9;
    }

    .risk-box {
        font-size: 16px;
        line-height: 1.8;
        padding: 16px;
        border-radius: 14px;
    }
}

/* =========================================================
   SmartPick Mobile Fix v2
   ========================================================= */

@media (max-width: 768px) {
    .smart-hero {
        min-height: auto;
        padding: 20px 22px 22px;
        gap: 22px;
    }

    .smart-hero-main {
        margin-bottom: 28px;
    }

    .smart-hero h1 {
        font-size: 32px;
    }

    .smart-hero p {
        font-size: 21px;
        line-height: 1.65;
    }

    .smart-hero-meta > div {
        min-height: 92px;
        padding: 16px 18px;
    }

    .smart-hero-actions {
        margin-top: 14px;
    }

    .check-line {
        font-size: 22px;
        gap: 16px;
        margin: 16px 0;
    }

        .check-line input[type="checkbox"] {
            width: 22px;
            height: 22px;
            transform: scale(1.25);
            transform-origin: center;
            accent-color: #4aa3ff;
        }

    .stock-name {
        font-size: 30px;
        line-height: 1.25;
    }

    .stock-symbol {
        font-size: 20px;
        color: #b9d8ff;
        margin-top: 10px;
    }

    .stock-reason {
        display: none;
    }

    .stock-tags {
        margin-top: 16px;
    }

    .stock-tag {
        font-size: 17px;
        padding: 6px 12px;
    }

    .smart-stock-card {
        padding: 24px;
    }

    .stock-side {
        grid-template-columns: 84px 1fr 110px;
    }

    .score-pill {
        width: 84px;
        height: 84px;
        font-size: 32px;
    }

    .signal-text {
        font-size: 22px;
    }

    .detail-link {
        font-size: 20px;
    }

    .add-featured-btn {
        height: 48px;
        font-size: 18px;
    }
}

/* ===== 智慧選股手機版：縮小頂部 Head 框高度 - 正確 class ===== */
@media (max-width: 768px) {
    .smart-hero {
        padding: 14px 18px !important;
        gap: 12px !important;
        margin-bottom: 14px !important;
    }

    .smart-hero-main {
        margin-bottom: 8px !important;
    }

    .smart-kicker {
        font-size: 12px !important;
        margin-bottom: 6px !important;
    }

    .smart-hero h1 {
        font-size: 26px !important;
        line-height: 1.18 !important;
        margin: 0 !important;
    }

    .smart-hero p {
        font-size: 17px !important;
        line-height: 1.45 !important;
        margin-top: 8px !important;
    }

    .smart-hero-meta {
        gap: 10px !important;
    }

        .smart-hero-meta > div {
            min-height: 72px !important;
            padding: 12px 14px !important;
        }

        .smart-hero-meta span {
            font-size: 13px !important;
            margin-bottom: 4px !important;
        }

        .smart-hero-meta strong,
        #smartTradeDate {
            font-size: 19px !important;
            line-height: 1.2 !important;
        }

    .smart-hero-actions {
        margin-top: 10px !important;
    }

    .smartpick-mini-btn {
        height: 44px !important;
        font-size: 16px !important;
    }
}

/* ===== 智慧選股手機版：Head 高度再壓縮 ===== */
@media (max-width: 768px) {
    .smart-hero {
        display: block !important;
        padding: 18px 20px !important;
        min-height: 0 !important;
    }

    .smart-hero-main {
        margin-bottom: 18px !important;
    }

    .smart-hero-side {
        display: block !important;
        flex: none !important;
    }

    .smart-hero h1 {
        font-size: 28px !important;
        margin-bottom: 8px !important;
    }

    .smart-hero p {
        font-size: 18px !important;
        line-height: 1.5 !important;
        margin: 8px 0 0 !important;
    }

    .smart-hero-meta > div {
        min-height: 68px !important;
        padding: 12px 16px !important;
    }

    .smart-hero-actions {
        margin-top: 12px !important;
    }
}

/* =========================================================
   智慧選股結果：桌機表格 / 手機卡片
========================================================= */

.smart-result-table-wrap {
    display: block;
    width: 100%;
    overflow-x: auto;
}

.smart-result-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

    .smart-result-table th,
    .smart-result-table td {
        padding: 10px 8px;
        border-bottom: 1px solid rgba(120, 170, 255, .14);
        color: #dcecff;
        font-size: 13px;
        vertical-align: middle;
    }

    .smart-result-table th {
        color: #9fd7ff;
        font-weight: 900;
        background: rgba(10, 28, 48, .95);
        white-space: nowrap;
    }

    .smart-result-table tbody tr:hover {
        background: rgba(47, 125, 255, .08);
    }

.sp-col-stock {
    width: 130px;
}

.sp-stock-name {
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
}

.sp-stock-symbol {
    margin-top: 3px;
    color: #8ea6c5;
    font-size: 12px;
}

.sp-score-pill {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 60, 80, .16);
    border: 1px solid rgba(255, 90, 105, .35);
    color: #ff6d7d;
    font-size: 17px;
    font-weight: 900;
}

.sp-tags-cell {
    width: 210px;
}

    .sp-tags-cell .stock-tag {
        margin: 2px;
    }

.sp-action-cell {
    width: 92px;
    text-align: center;
}

    .sp-action-cell .add-featured-btn,
    .sp-action-cell .detail-link {
        width: 64px;
        height: 28px;
        margin: 2px auto;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
    }

    .sp-action-cell .detail-link {
        border: 1px solid rgba(120, 210, 255, .35);
        border-radius: 8px;
        background: rgba(20, 70, 105, .35);
    }

/* 預設桌機隱藏手機卡片 */
.smart-result-mobile-cards {
    display: none;
}

/* 桌機表格模式下，舊卡片間距歸零 */
.smart-result-list {
    gap: 0;
}

/* =========================================================
   手機版：隱藏表格，改顯示卡片
========================================================= */
@media (max-width: 768px) {
    .smart-result-table-wrap {
        display: none;
    }

    .smart-result-mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .smart-result-list {
        gap: 14px;
    }
}

/* ===== 智慧選股：移除分數/標籤後的入選理由欄 ===== */

.sp-reason-cell {
    color: #ffd966 !important;
    font-weight: 800;
    line-height: 1.45;
    white-space: normal;
}

.smart-result-table th:nth-child(7),
.smart-result-table td:nth-child(7) {
    width: 150px;
}

.smart-result-table th:nth-child(8),
.smart-result-table td:nth-child(8) {
    width: 92px;
}

/* =========================================================
   智慧選股結果：桌機老花眼友善字體
========================================================= */

.smart-result-table th,
.smart-result-table td {
    font-size: 17px !important;
    line-height: 1.65 !important;
    padding: 15px 10px !important;
}

.sp-stock-name {
    font-size: 21px !important;
    line-height: 1.35 !important;
}

.sp-stock-symbol {
    font-size: 17px !important;
    line-height: 1.35 !important;
}

.sp-reason-cell {
    font-size: 17px !important;
    font-weight: 900 !important;
    color: #ffd966 !important;
}

.sp-action-cell .add-featured-btn,
.sp-action-cell .detail-link {
    width: 76px !important;
    height: 36px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
}

.smart-result-table th:nth-child(7),
.smart-result-table td:nth-child(7) {
    width: 160px !important;
}

.smart-result-table th:nth-child(8),
.smart-result-table td:nth-child(8) {
    width: 100px !important;
}

/* ===== 智慧選股：表格欄寬重新分配，避免擠在一起 ===== */

.smart-result-table {
    width: 100% !important;
    table-layout: fixed !important;
}

    .smart-result-table th,
    .smart-result-table td {
        padding: 14px 8px !important;
        vertical-align: middle !important;
    }

        /* 股票 */
        .smart-result-table th:nth-child(1),
        .smart-result-table td:nth-child(1) {
            width: 22% !important;
        }

        /* 市場 */
        .smart-result-table th:nth-child(2),
        .smart-result-table td:nth-child(2) {
            width: 9% !important;
        }

        /* 參考價 */
        .smart-result-table th:nth-child(3),
        .smart-result-table td:nth-child(3) {
            width: 12% !important;
        }

        /* EPS */
        .smart-result-table th:nth-child(4),
        .smart-result-table td:nth-child(4) {
            width: 10% !important;
        }

        /* 本益比 */
        .smart-result-table th:nth-child(5),
        .smart-result-table td:nth-child(5) {
            width: 11% !important;
        }

        /* ROE */
        .smart-result-table th:nth-child(6),
        .smart-result-table td:nth-child(6) {
            width: 12% !important;
        }

        /* 入選理由 */
        .smart-result-table th:nth-child(7),
        .smart-result-table td:nth-child(7) {
            width: 14% !important;
        }

        /* 操作 */
        .smart-result-table th:nth-child(8),
        .smart-result-table td:nth-child(8) {
            width: 10% !important;
        }

.sp-stock-name {
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
    line-height: 1.35 !important;
}

.sp-stock-symbol {
    white-space: nowrap !important;
}

.sp-reason-cell {
    white-space: normal !important;
    word-break: keep-all !important;
    line-height: 1.45 !important;
}

/* ===== 智慧選股：操作欄壓縮，避免按鈕被截掉 ===== */

.smart-result-table th:nth-child(8),
.smart-result-table td:nth-child(8) {
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
}

.sp-action-cell {
    text-align: center !important;
}

    .sp-action-cell .add-featured-btn,
    .sp-action-cell .detail-link {
        width: 54px !important;
        min-width: 54px !important;
        height: 30px !important;
        margin: 2px auto !important;
        padding: 0 !important;
        font-size: 14px !important;
        line-height: 30px !important;
        border-radius: 8px !important;
    }

    .sp-action-cell .detail-link {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }


/* ===== 智慧選股結果：高度貼近瀏覽器底端 ===== */

.smart-result-panel {
    max-height: 680px !important;
    overflow: hidden !important;
}

.smart-result-list {
    max-height: 580px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 6px !important;
}

/* 表頭固定 */
.smart-result-table thead th {
    position: sticky !important;
    top: 0 !important;
    z-index: 5 !important;
}

/* 捲軸美化 */
.smart-result-list::-webkit-scrollbar {
    width: 8px;
}

.smart-result-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

.smart-result-list::-webkit-scrollbar-thumb {
    background: rgba(80, 170, 255, 0.45);
    border-radius: 999px;
}

    .smart-result-list::-webkit-scrollbar-thumb:hover {
        background: rgba(80, 170, 255, 0.7);
    }

/* ===== 手機版：智慧選股結果不固定高度、不用內部捲軸 ===== */
@media (max-width: 768px) {
    .smart-result-panel {
        max-height: none !important;
        overflow: visible !important;
    }

    .smart-result-list {
        max-height: none !important;
        overflow: visible !important;
        padding-right: 0 !important;
    }

    .smart-result-table thead th {
        position: static !important;
    }
}

/* =========================================================
   手機版：智慧選股結果卡片壓縮
   股票名稱左上，代號/市場與入選理由放右上
========================================================= */
@media (max-width: 768px) {
    .smart-result-mobile-cards .smart-stock-card {
        padding: 18px 20px !important;
        gap: 12px !important;
    }

    .smart-result-mobile-cards .stock-main {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "name meta"
            "name reason";
        align-items: start !important;
        column-gap: 14px !important;
        row-gap: 3px !important;
    }

    .smart-result-mobile-cards .stock-name {
        grid-area: name !important;
        font-size: 30px !important;
        line-height: 1.25 !important;
        font-weight: 900 !important;
        margin: 0 !important;
    }

    .smart-result-mobile-cards .stock-symbol {
        grid-area: meta !important;
        font-size: 24px !important;
        line-height: 1.25 !important;
        font-weight: 900 !important;
        color: #dcecff !important;
        text-align: right !important;
        margin: 0 !important;
        white-space: nowrap !important;
    }

    .smart-result-mobile-cards .stock-mobile-reason {
        grid-area: reason !important;
        font-size: 24px !important;
        line-height: 1.25 !important;
        font-weight: 900 !important;
        color: #ffd966 !important;
        text-align: right !important;
        white-space: nowrap !important;
    }

    .smart-result-mobile-cards .stock-side.stock-side-simple {
        display: flex !important;
        align-items: center !important;
        gap: 14px !important;
        margin-top: 6px !important;
    }

    .smart-result-mobile-cards .add-featured-btn {
        width: auto !important;
        min-width: 112px !important;
        height: 46px !important;
        font-size: 22px !important;
    }

    .smart-result-mobile-cards .detail-link {
        font-size: 22px !important;
        line-height: 46px !important;
    }
}

/* ===== 手機版：智慧選股結果卡片字體縮小 ===== */
@media (max-width: 768px) {
    .smart-result-mobile-cards .stock-name {
        font-size: 25px !important;
        line-height: 1.25 !important;
    }

    .smart-result-mobile-cards .stock-symbol {
        font-size: 21px !important;
        line-height: 1.25 !important;
    }

    .smart-result-mobile-cards .stock-mobile-reason {
        font-size: 21px !important;
        line-height: 1.25 !important;
    }

    .smart-result-mobile-cards .add-featured-btn {
        height: 42px !important;
        min-width: 100px !important;
        font-size: 19px !important;
    }

    .smart-result-mobile-cards .detail-link {
        font-size: 19px !important;
        line-height: 42px !important;
    }

    .smart-result-mobile-cards .smart-stock-card {
        padding: 15px 18px !important;
    }
}

/* =========================================================
   智慧選股：股價與漲跌顯示
   台股色系：上漲紅、下跌綠
========================================================= */

.sp-price-cell {
    text-align: center;
}

.sp-price-value {
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.3;
    white-space: nowrap;
}

.sp-price-change {
    margin-top: 3px;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.3;
    white-space: nowrap;
}

    .sp-price-change.is-up,
    .stock-card-change.is-up {
        color: #ff3b4d !important;
    }

    .sp-price-change.is-down,
    .stock-card-change.is-down {
        color: #18d957 !important;
    }

    .sp-price-change.is-flat,
    .stock-card-change.is-flat {
        color: #dcecff !important;
    }


/* =========================================================
   智慧選股手機版：
   1. 顯示股價與漲跌
   2. 移除「條件符合」
========================================================= */
@media (max-width: 768px) {
    .smart-result-mobile-cards .stock-main {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "name meta"
            "quote quote" !important;
        align-items: start !important;
        column-gap: 14px !important;
        row-gap: 10px !important;
    }

    .smart-result-mobile-cards .stock-name {
        grid-area: name !important;
    }

    .smart-result-mobile-cards .stock-symbol {
        grid-area: meta !important;
    }

    .smart-result-mobile-cards .stock-mobile-reason {
        display: none !important;
    }

    .smart-result-mobile-cards .stock-card-quote {
        grid-area: quote !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        width: 100% !important;
        padding-top: 8px !important;
        border-top: 1px solid rgba(120, 170, 255, 0.14) !important;
    }

    .smart-result-mobile-cards .stock-card-price {
        color: #ffffff !important;
        font-size: 20px !important;
        line-height: 1.35 !important;
        font-weight: 900 !important;
        white-space: nowrap !important;
    }

    .smart-result-mobile-cards .stock-card-change {
        font-size: 19px !important;
        line-height: 1.35 !important;
        font-weight: 900 !important;
        text-align: right !important;
        white-space: nowrap !important;
    }
}

/* =========================================================
   智慧選股結果最終版
   1. 股價跟隨漲跌變色
   2. 桌機版移除入選理由欄後重新分配欄寬
========================================================= */

/* 股價與漲跌使用相同顏色 */
.sp-price-value.is-up,
.stock-card-price.is-up {
    color: #ff3b4d !important;
}

.sp-price-value.is-down,
.stock-card-price.is-down {
    color: #18d957 !important;
}

.sp-price-value.is-flat,
.stock-card-price.is-flat {
    color: #ffffff !important;
}

/* 桌機版表格重新分配為 7 欄 */
@media (min-width: 769px) {
    .smart-result-table {
        width: 100% !important;
        table-layout: fixed !important;
    }

        /* 股票 */
        .smart-result-table th:nth-child(1),
        .smart-result-table td:nth-child(1) {
            width: 22% !important;
        }

        /* 市場 */
        .smart-result-table th:nth-child(2),
        .smart-result-table td:nth-child(2) {
            width: 9% !important;
        }

        /* 股價 / 漲跌 */
        .smart-result-table th:nth-child(3),
        .smart-result-table td:nth-child(3) {
            width: 22% !important;
            min-width: 150px !important;
        }

        /* EPS */
        .smart-result-table th:nth-child(4),
        .smart-result-table td:nth-child(4) {
            width: 12% !important;
            min-width: 72px !important;
        }

        /* 本益比 */
        .smart-result-table th:nth-child(5),
        .smart-result-table td:nth-child(5) {
            width: 12% !important;
        }

        /* ROE */
        .smart-result-table th:nth-child(6),
        .smart-result-table td:nth-child(6) {
            width: 13% !important;
        }

        /* 操作 */
        .smart-result-table th:nth-child(7),
        .smart-result-table td:nth-child(7) {
            width: 82px !important;
            min-width: 82px !important;
            max-width: 82px !important;
            padding-left: 4px !important;
            padding-right: 4px !important;
        }

    .sp-price-cell {
        text-align: center !important;
    }

    .sp-price-value {
        font-size: 17px !important;
        font-weight: 900 !important;
        line-height: 1.25 !important;
        white-space: nowrap !important;
    }

    .sp-price-change {
        margin-top: 2px !important;
        font-size: 14px !important;
        font-weight: 900 !important;
        line-height: 1.25 !important;
        white-space: nowrap !important;
    }
}
/* =========================================================
   智慧選股手機版：
   1. 股價不顯示「股價」文字
   2. 補回 EPS / 本益比 / ROE
========================================================= */
@media (max-width: 768px) {
    .smart-result-mobile-cards .stock-main {
        grid-template-areas:
            "name meta"
            "quote quote"
            "fundamental fundamental" !important;
    }

    .smart-result-mobile-cards .stock-card-fundamental {
        grid-area: fundamental !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 5px 14px !important;
        padding-top: 9px !important;
        border-top: 1px solid rgba(120, 170, 255, 0.12) !important;
        color: #b9d8ff !important;
        font-size: 17px !important;
        line-height: 1.4 !important;
        font-weight: 800 !important;
    }

        .smart-result-mobile-cards .stock-card-fundamental span {
            white-space: nowrap !important;
        }

    .smart-result-mobile-cards .stock-card-price {
        font-size: 23px !important;
        font-weight: 900 !important;
    }

    .smart-result-mobile-cards .stock-card-change {
        font-size: 20px !important;
        font-weight: 900 !important;
    }
}