/* ================================================
   場勘助理 (Insight.razor) 專用樣式
   由 App.razor 掛載
   ================================================ */

/* ===== 暗色系調色盤 (與後台一致) ===== */
:root {
    --enno-bg: #0F1420;
    --enno-panel: #161D33;
    --enno-card: #1B2337;
    --enno-hover: #1F2840;
    --enno-border: #252E4A;
    --enno-text: #E5E9F2;
    --enno-text-2: #C3C9D9;
    --enno-text-3: #9AA3B8;
    --enno-accent: #22C55E;
    --enno-accent-dark: #16A34A;
    --enno-accent-light: rgba(34, 197, 94, 0.14);
    /* TAG顏色由頁面的調色盤依序分配,這裡只留未知TAG的fallback色 */
    --tag-custom: #64748B;
}

/* ===== 頂列 (InsightLayout,與後台 MainLayoutStyle 的 sidebar-logo + topbar 一致) ===== */
.insight-topbar {
    display: flex;
    align-items: center;
    height: 64px;
    min-height: 64px;
    background: var(--enno-panel);
    border-bottom: 1px solid var(--enno-border);
    font-family: Roboto, "Segoe UI", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
}

    /* 左側 Logo 區:寬度與側欄相同,視覺上接成一塊 */
    .insight-topbar-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 220px;
        min-width: 220px;
        height: 100%;
        padding: 0 16px;
        border-right: 1px solid var(--enno-border);
        cursor: pointer;
    }

        .insight-topbar-logo img {
            max-width: 100%;
            max-height: 40px;
            object-fit: contain;
        }

    .insight-topbar-right {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
        flex: 1;
        min-width: 0;
        padding: 0 20px;
    }

    /* 登入者帳號 */
    .insight-topbar-user {
        color: var(--enno-text-2);
        font-size: 15px;
        font-weight: 600;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* ===== 整體版面 ===== */
.app {
    display: flex;
    flex: 1;
    min-height: 0; /* 由 .insight-layout 決定總高(扣掉頂列),內容區自行捲動 */
    overflow: hidden;
    font-family: Roboto, "Segoe UI", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
    color: var(--enno-text);
}

/* ===== 側邊欄 (與後台同寬 220px) ===== */
.ia-sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--enno-panel);
    border-right: 1px solid var(--enno-border);
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
    z-index: 200;
}

.sidebar-header {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center; /* 標題置中 */
    position: relative;
    gap: 10px;
}

    .sidebar-header .logo {
        font-size: 20px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
    }

.btn-close-sidebar {
    display: none;
    position: absolute; /* 不影響標題置中 */
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: var(--enno-text-3);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
}

    .btn-close-sidebar:hover {
        background: var(--enno-hover);
    }

.btn-new-site {
    margin: 0 16px 12px;
    padding: 10px 16px;
    border: none;
    border-radius: 24px;
    background: var(--enno-accent);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: background .15s;
}

    .btn-new-site:hover {
        background: var(--enno-accent-dark);
    }

/* ===== Radzen Dialog 暗色 (新增案場等Dialog用,與後台一致)
   Radzen主題的<link>在本檔之後載入,用雙class提高權重確保覆蓋 ===== */
.rz-dialog.rz-dialog {
    background: var(--enno-card);
    color: var(--enno-text);
    border: 1px solid var(--enno-border);
}

.rz-dialog .rz-dialog-content {
    background: transparent;
    color: var(--enno-text);
}

.rz-dialog .rz-dialog-titlebar {
    background: transparent;
    color: var(--enno-text);
}

.site-search {
    margin: 0 16px 12px;
    position: relative;
}

    .site-search input {
        width: 100%;
        padding: 9px 12px 9px 36px;
        border: 1px solid var(--enno-border);
        border-radius: 24px;
        font-size: 14px;
        outline: none;
        background: var(--enno-bg);
        color: var(--enno-text);
        transition: border-color .15s;
    }

        .site-search input:focus {
            border-color: var(--enno-accent);
        }

    .site-search .icon {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--enno-text-3);
        font-size: 14px;
    }

.site-list-label {
    padding: 4px 20px 8px;
    font-size: 12px;
    color: var(--enno-text-3);
    font-weight: 500;
}

.site-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 16px;
}

    .site-list::-webkit-scrollbar {
        width: 8px;
    }

    .site-list::-webkit-scrollbar-thumb {
        background: var(--enno-border);
        border-radius: 4px;
    }

.site-item {
    display: flex;
    align-items: center;
    padding: 10px 8px 10px 14px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 16px;
    color: var(--enno-text-2);
    position: relative;
    margin-bottom: 2px;
}

    .site-item:hover {
        background: var(--enno-hover);
    }

    .site-item.active {
        background: var(--enno-accent-light);
        color: var(--enno-accent);
        font-weight: 600;
    }

    .site-item .site-name {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .site-item .btn-more {
        visibility: hidden;
        border: none;
        background: none;
        font-size: 16px;
        color: var(--enno-text-3);
        cursor: pointer;
        padding: 2px 8px;
        border-radius: 50%;
        line-height: 1.4;
    }

    .site-item:hover .btn-more,
    .site-item.active .btn-more {
        visibility: visible;
    }

    .site-item .btn-more:hover {
        background: rgba(255,255,255,.08);
    }

    .site-item .rename-input {
        flex: 1;
        min-width: 0;
        padding: 4px 8px;
        border: 1px solid var(--enno-accent);
        border-radius: 6px;
        font-size: 16px;
        outline: none;
        background: var(--enno-bg);
        color: var(--enno-text);
    }

/* ===== 案場「⋮」浮動選單 ===== */
.site-menu {
    position: absolute;
    right: 8px;
    top: calc(100% - 4px);
    background: var(--enno-card);
    border: 1px solid var(--enno-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
    padding: 6px 0;
    min-width: 140px;
    z-index: 300;
}

    .site-menu button {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 9px 16px;
        border: none;
        background: none;
        font-size: 14px;
        color: var(--enno-text-2);
        cursor: pointer;
        text-align: left;
    }

        .site-menu button:hover {
            background: var(--enno-hover);
            color: var(--enno-text);
        }

/* 點選單以外的區域關閉選單 */
.menu-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 150;
}

.empty-list-hint {
    padding: 24px 20px;
    text-align: center;
    color: var(--enno-text-3);
    font-size: 13px;
}

/* ===== 側欄底部:切換到後台 ===== */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--enno-border);
}

.btn-admin {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--enno-border);
    border-radius: 24px;
    background: transparent;
    color: var(--enno-text-2);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s, color .15s;
}

    .btn-admin:hover {
        background: var(--enno-hover);
        color: var(--enno-text);
    }

/* ===== 手機遮罩 ===== */
.ia-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 150;
}

    .ia-overlay.active {
        display: block;
    }

/* ===== Content 區 ===== */
.ia-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background: var(--enno-bg);
}

.content-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--enno-border);
}

.btn-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--enno-text);
    padding: 4px 8px;
    border-radius: 50%;
}

    .btn-hamburger:hover {
        background: var(--enno-hover);
    }

.current-site-name {
    font-size: 17px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .current-site-name .placeholder {
        color: var(--enno-text-3);
        font-weight: 400;
    }

/* 案場名稱旁的「報告分析中」提示 */
.analyzing-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px;
    border-radius: 16px;
    background: rgba(249, 171, 0, .14);
    border: 1px solid rgba(249, 171, 0, .5);
    color: #F9AB00;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.analyzing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #F9AB00;
    animation: analyzing-blink 1.2s ease-in-out infinite;
}

@keyframes analyzing-blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .25;
    }
}

/* ===== 頁籤 ===== */
.ia-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    border-bottom: 1px solid var(--enno-border);
}

.ia-tab {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--enno-text-3);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .ia-tab:hover {
        color: var(--enno-text);
        background: var(--enno-hover);
        border-radius: 8px 8px 0 0;
    }

    .ia-tab.active {
        color: var(--enno-accent);
        border-bottom-color: var(--enno-accent);
    }

.tab-panel {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ===== 頁籤一:案場資訊 ===== */
.info-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 860px;
}

.info-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--enno-text-2, #C3C9D9);
}

.info-input {
    width: 100%;
    resize: vertical;
    padding: 12px 14px;
    font-family: Roboto, "Segoe UI", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--enno-text, #E5E9F2);
    background: var(--enno-bg, #0F1420);
    border: 1px solid var(--enno-border, #252E4A);
    border-radius: 8px;
    outline: none;
}

    .info-input:focus {
        border-color: var(--enno-accent, #22C55E);
    }

    .info-input.demand {
        height: 140px;
        max-height: 30vh;
    }

    .info-input.desc {
        height: 240px;
        max-height: 45vh;
    }

.info-actions {
    display: flex;
    justify-content: flex-end;
}

/* ===== 未選擇案場 ===== */
.no-site-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--enno-text-3);
}

    .no-site-panel .big-icon {
        font-size: 56px;
    }

/* ===== 上傳區 ===== */
.upload-zone {
    position: relative; /* 讓透明的InputFile覆蓋整區 */
    border: 2px dashed var(--enno-border);
    border-radius: 8px;
    padding: 28px 20px;
    text-align: center;
    color: var(--enno-text-3);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    margin-bottom: 20px;
}

    /* 透明的檔案輸入,蓋滿上傳區:點擊與拖放都是原生行為 */
    .upload-zone .upload-input {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }

        .upload-zone .upload-input:disabled {
            cursor: default;
        }

/* 「選擇整個資料夾」按鈕:必須疊在上面那個蓋滿全區的透明輸入之上,否則點不到 */
.btn-pick-folder {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 7px 18px;
    border: 1px solid var(--enno-border);
    border-radius: 16px;
    background: var(--enno-card);
    color: var(--enno-text-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

    .btn-pick-folder:hover {
        background: var(--enno-hover);
        border-color: var(--enno-accent);
        color: var(--enno-text);
    }

    /* 資料夾選取的input藏起來,靠label觸發 */
    .btn-pick-folder .folder-input {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }

    .upload-zone:hover {
        border-color: var(--enno-accent);
        background: var(--enno-accent-light);
    }

    .upload-zone .up-icon {
        font-size: 32px;
        display: block;
        margin-bottom: 8px;
    }

    .upload-zone .hint-main {
        font-size: 15px;
        color: var(--enno-text);
        margin-bottom: 4px;
    }

    .upload-zone .hint-sub {
        font-size: 12px;
    }

/* ===== TAG 過濾列 ===== */
.tag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

    .tag-filter-bar .bar-label {
        font-size: 13px;
        color: var(--enno-text-3);
        margin-right: 4px;
    }

.tag-chip {
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid var(--enno-border);
    background: var(--enno-card);
    font-size: 13px;
    cursor: pointer;
    color: var(--enno-text-2);
    transition: all .15s;
}

    .tag-chip:hover {
        background: var(--enno-hover);
    }

    .tag-chip.active {
        background: var(--enno-accent);
        border-color: var(--enno-accent);
        color: #fff;
    }

/* ===== 檔案工具列(數量/全選/刪除) ===== */
.file-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.file-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-count-label {
    font-size: 13px;
    color: var(--enno-text-3);
}

.selected-count {
    margin-left: 10px;
    color: var(--enno-accent);
    font-weight: 600;
}

.btn-select-all {
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid var(--enno-border);
    background: var(--enno-card);
    color: var(--enno-text-2);
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
}

    .btn-select-all:hover {
        background: var(--enno-hover);
    }

.btn-delete-files {
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid #EF4444;
    background: transparent;
    color: #EF4444;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

    .btn-delete-files:hover {
        background: rgba(239, 68, 68, .12);
    }

.btn-batch-tag {
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid var(--enno-accent);
    background: transparent;
    color: var(--enno-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

    .btn-batch-tag:hover {
        background: var(--enno-hover);
    }

/* ===== 批次標TAG的chip:左半點擊=加到所選,右半✕=從所選移除 ===== */
.batch-tag-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 16px;
    border: 1px solid var(--enno-border);
    background: var(--enno-card);
    color: var(--enno-text-2);
    overflow: hidden;
    transition: all .15s;
}

    .batch-tag-chip:hover {
        background: var(--enno-hover);
    }

    .batch-tag-chip.active {
        background: var(--enno-accent);
        border-color: var(--enno-accent);
        color: #fff;
    }

    .batch-tag-chip .chip-add {
        padding: 6px 12px;
        border: none;
        background: transparent;
        font-size: 13px;
        cursor: pointer;
        color: inherit;
    }

    .batch-tag-chip .chip-remove {
        padding: 6px 10px 6px 4px;
        border: none;
        background: transparent;
        font-size: 12px;
        cursor: pointer;
        color: inherit;
        opacity: .65;
    }

        .batch-tag-chip .chip-remove:hover {
            opacity: 1;
        }

/* ===== 檔案網格 ===== */

/* 檔案上傳頁籤:上傳區/過濾列/工具列固定,捲動只發生在檔案清單 */
.tab-panel.upload-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .upload-panel .upload-zone,
    .upload-panel .tag-filter-bar,
    .upload-panel .file-toolbar {
        flex-shrink: 0;
    }

/* 捲動容器:包在grid外層。grid自己當捲動容器(flex+overflow)會讓列高被壓成均分,卡片塌陷 */
.upload-panel .file-scroll {
    flex: 1;
    min-height: 0; /* 沒有這行flex子項不會縮,scrollbar出不來 */
    overflow-y: auto;
    padding-right: 4px;
    position: relative; /* 拉框選取框以此定位 */
}

/* ===== 拉框多選(insight.js) ===== */
.file-scroll.marquee-active {
    user-select: none;
}

.insight-marquee {
    position: absolute;
    z-index: 6;
    pointer-events: none;
    border: 1px solid var(--enno-accent);
    background: rgba(34, 197, 94, .12); /* --enno-accent #22C55E 的半透明 */
    border-radius: 2px;
}

.file-card.marquee-hit {
    border-color: var(--enno-accent);
    box-shadow: 0 0 0 1px var(--enno-accent);
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
}

.file-card {
    position: relative; /* 讓核取方塊可絕對定位 */
    border: 1px solid var(--enno-border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--enno-card);
    transition: box-shadow .15s, transform .15s, border-color .15s;
}

    .file-card:hover {
        box-shadow: 0 2px 10px rgba(0,0,0,.5);
        transform: translateY(-2px);
    }

    /* 已選取的卡片 */
    .file-card.selected {
        border-color: var(--enno-accent);
        box-shadow: 0 0 0 1px var(--enno-accent);
    }

/* 卡片左上角的多選核取方塊 */
.file-check {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(15, 20, 32, .65);
    cursor: pointer;
}

    .file-check input {
        width: 16px;
        height: 16px;
        accent-color: var(--enno-accent);
        cursor: pointer;
        margin: 0;
    }

.file-thumb {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: #fff;
    background: var(--enno-hover);
    overflow: hidden;
}

    .file-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.file-info {
    padding: 8px 10px 10px;
}

.file-name {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 6px;
    color: var(--enno-text-2);
}

.file-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 18px;
}

.mini-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    white-space: nowrap;
}

    .mini-tag.untagged {
        background: none;
        color: var(--enno-text-3);
        border: 1px dashed var(--enno-border);
    }

/* ===== 檔案檢視 Modal ===== */
.ia-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ia-modal {
    background: var(--enno-card);
    border: 1px solid var(--enno-border);
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ia-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--enno-border);
}

    .ia-modal-header .title {
        font-size: 15px;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ia-modal-header .btn-close {
        background: none;
        border: none;
        font-size: 20px;
        cursor: pointer;
        color: var(--enno-text-3);
        padding: 2px 8px;
        border-radius: 50%;
    }

        .ia-modal-header .btn-close:hover {
            background: var(--enno-hover);
        }

.modal-preview {
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 84px;
    color: #fff;
    background: var(--enno-hover);
    overflow: hidden;
}

    .modal-preview img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        cursor: zoom-in;
    }

/* ===== 圖片放大檢視 (Lightbox) ===== */
.ia-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    z-index: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    cursor: zoom-out;
}

    .ia-lightbox img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        border-radius: 4px;
        box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
    }

    .ia-lightbox .lightbox-close {
        position: absolute;
        top: 16px;
        right: 20px;
        background: none;
        border: none;
        color: #fff;
        font-size: 28px;
        line-height: 1;
        cursor: pointer;
        padding: 6px 12px;
        border-radius: 50%;
    }

        .ia-lightbox .lightbox-close:hover {
            background: rgba(255, 255, 255, .15);
        }

.ia-modal-body {
    padding: 16px 20px 20px;
}

    .ia-modal-body .section-label {
        font-size: 13px;
        font-weight: 600;
        color: var(--enno-text-3);
        margin-bottom: 10px;
    }

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.custom-tag-form {
    display: flex;
    gap: 8px;
}

    .custom-tag-form input {
        flex: 1;
        min-width: 0;
        padding: 8px 12px;
        border: 1px solid var(--enno-border);
        border-radius: 8px;
        font-size: 13px;
        outline: none;
        background: var(--enno-bg);
        color: var(--enno-text);
    }

        .custom-tag-form input:focus {
            border-color: var(--enno-accent);
        }

    .custom-tag-form button {
        padding: 8px 16px;
        border: none;
        border-radius: 8px;
        background: var(--enno-accent);
        color: #fff;
        font-size: 13px;
        cursor: pointer;
    }

/* ===== Report 頁籤 ===== */
.report-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-primary-ia {
    padding: 10px 24px;
    border: none;
    border-radius: 24px;
    background: var(--enno-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .btn-primary-ia:hover:not(:disabled) {
        background: var(--enno-accent-dark);
    }

    .btn-primary-ia:disabled {
        opacity: .5;
        cursor: default;
    }

.btn-outline-ia {
    padding: 10px 24px;
    border: 1px solid var(--enno-border);
    border-radius: 24px;
    background: transparent;
    color: var(--enno-accent);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .btn-outline-ia:hover:not(:disabled) {
        background: var(--enno-accent-light);
    }

    .btn-outline-ia:disabled {
        opacity: .4;
        cursor: default;
    }

.report-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--enno-text-3);
    font-size: 14px;
    margin-bottom: 20px;
}

.ia-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid var(--enno-accent-light);
    border-top-color: var(--enno-accent);
    border-radius: 50%;
    animation: ia-spin .8s linear infinite;
}

@keyframes ia-spin {
    to {
        transform: rotate(360deg);
    }
}

.report-empty {
    border: 1px solid var(--enno-border);
    border-radius: 8px;
    padding: 48px 20px;
    text-align: center;
    color: var(--enno-text-3);
    background: var(--enno-card);
}

    .report-empty .big-icon {
        font-size: 48px;
        display: block;
        margin-bottom: 12px;
    }

.report-frame-wrap {
    border: 1px solid var(--enno-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

    .report-frame-wrap .report-frame {
        width: 100%;
        height: 72vh;
        border: none;
        display: block;
        background: #fff;
    }

/* ===== MessageDialog (Bootstrap modal) 暗色化 ===== */
.modal-content {
    background: var(--enno-card);
    color: var(--enno-text);
    border: 1px solid var(--enno-border);
}

.modal-header, .modal-footer {
    border-color: var(--enno-border);
}

/* ===== Toast ===== */
.ia-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #323232;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 700;
    transition: transform .25s ease;
    max-width: calc(100vw - 40px);
}

    .ia-toast.active {
        transform: translateX(-50%) translateY(0);
    }

/* ===== RWD:手機版 ===== */
@media (max-width: 768px) {
    .ia-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 2px 0 12px rgba(0,0,0,.4);
    }

        .ia-sidebar.open {
            transform: translateX(0);
        }

    .btn-close-sidebar {
        display: block;
    }

    .btn-hamburger {
        display: block;
    }

    .ia-tabs {
        padding: 0 12px;
    }

    .ia-tab {
        padding: 12px 14px;
    }

    .tab-panel {
        padding: 14px;
    }

    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .file-thumb {
        height: 88px;
        font-size: 34px;
    }

    .content-header {
        padding: 10px 12px;
    }

    /* 手機:頂列 Logo 區不再佔固定 220px */
    .insight-topbar-logo {
        width: auto;
        min-width: 0;
        border-right: none;
    }

    .insight-topbar-right {
        padding: 0 12px;
    }

    .insight-topbar-user {
        max-width: 120px;
    }
}
