* { margin: 0; padding: 0; box-sizing: border-box; font-family: "Inter", "PingFang TC", "Microsoft JhengHei", sans-serif; }
body { background-color: #f8fafc; color: #1e293b; overflow-x: hidden; }
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

.hidden { display: none !important; }
.loading-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(255, 255, 255, 0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.spinner { width: 32px; height: 32px; border: 3px solid #f1f5f9; border-top-color: #3b82f6; border-radius: 50%; animation: spin 0.8s linear infinite; will-change: transform; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.section-container { border-radius: 35px; padding: 30px; border: 1px solid transparent; transition: all 0.3s; margin-bottom: 40px; }
.section-keywordguide { background-color: rgba(238, 242, 255, 0.4); border-color: #e0e7ff; }
.section-radar { background-color: rgba(239, 246, 255, 0.4); border-color: #dbeafe; }
.mode-tab { cursor: pointer; padding: 8px 16px; font-weight: 800; font-size: 13px; border-radius: 10px; transition: all 0.2s; color: #94a3b8; display: flex; align-items: center; gap: 4px; }
.mode-tab.active { background: white; color: #2563eb; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.dna-tab-wrap { position: relative; }
.tab-hint-icon { font-size: 10px; color: #cbd5e1; font-weight: 400; pointer-events: none; }
.mode-tab.active .tab-hint-icon { color: #93c5fd; }
.tab-hint-box { visibility: hidden; opacity: 0; position: absolute; top: calc(100% + 10px); left: 0; white-space: nowrap; background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 14px; font-size: 11px; font-weight: 600; color: #64748b; box-shadow: 0 8px 24px rgba(0,0,0,0.08); z-index: 500; pointer-events: none; transition: opacity 0.2s, visibility 0s linear 0s; }
.dna-tab-wrap:hover .tab-hint-box { visibility: visible; opacity: 1; transition: opacity 0.2s 2s, visibility 0s linear 2s; }
.scanline { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to right, transparent, rgba(59, 130, 246, 0.05), transparent); animation: scan 3s infinite linear; pointer-events: none; }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.tender-table { border-collapse: separate; border-spacing: 0 8px; width: 100%; }
.tender-table tr { background: white; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: all 0.2s; border-radius: 15px; }
.tender-table tr:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,0.04); }
.tender-table tr.selected { background: #eff6ff; border: 1px solid #bfdbfe; }
.compact-table { border-collapse: collapse; }
.compact-table tr { border-bottom: 1px solid #f1f5f9; }
.compact-table tr:last-child { border-bottom: none; }

.btn-disabled { opacity: 0.5; pointer-events: none; filter: grayscale(1); }
.mini-pagination-btn { padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 800; color: #64748b; background: white; border: 1px solid #e2e8f0; transition: all 0.2s; }
.mini-pagination-btn:hover { background: #f8fafc; border-color: #3b82f6; color: #3b82f6; }
.mini-pagination-btn.active { background: #2563eb; color: white; border-color: #2563eb; }

/* 物理隔離標籤風格 v6.0.70 */
.manual-keyword-group { background: white; padding: 12px 16px; border-radius: 16px; border: 1px solid #e2e8f0; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: all 0.3s; }
.manual-keyword-group:focus-within { border-color: #3b82f6; box-shadow: 0 6px 12px rgba(59, 130, 246, 0.05); }
.manual-kw-input { border: none; border-bottom: 2px solid #f1f5f9; background: transparent; font-weight: 800; font-size: 14px; width: 100%; padding: 4px 0; outline: none; transition: all 0.2s; }
.manual-kw-input:focus { border-bottom-color: #2563eb; }
.manual-match-list { margin-top: 6px; padding-left: 24px; max-height: 80px; overflow-y: auto; }
.manual-match-item { font-size: 12px; font-weight: 700; color: #64748b; line-height: 1.6; margin-bottom: 4px; }
.highlight { background-color: #fef08a; color: #854d0e; padding: 0 2px; border-radius: 2px; }

/* 捲動固定與文字風格優化 v6.1.6 */
.manual-keyword-container { background: transparent; padding: 0; margin-bottom: 0; }
.manual-keyword-container > div { padding-right: 4px; }

/* 關鍵字搜尋區塊固定標題遮蔽層 */
#section-keywordguide > .shrink-0 {
    background: rgba(238, 242, 255, 0.97);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    margin: -30px -30px 20px -30px;
    padding: 30px 30px 16px 30px;
    border-radius: 35px 35px 0 0;
    z-index: 10;
}

/* 全自動雷達語意匹配區塊固定標題遮蔽層 */
#section-radar > .shrink-0 {
    background: rgba(239, 246, 255, 0.97);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    margin: -30px -30px 0 -30px;
    padding: 30px 30px 16px 30px;
    border-radius: 35px 35px 0 0;
    z-index: 10;
}

/* 【Keywordguide 專屬類別】 (kg- 前綴) */
.kg-ref-title { font-size: 12px !important; font-weight: 500 !important; color: #64748b !important; font-style: normal !important; }
.kg-ref-item { padding-top: 16px; border-top: 1px dashed #e2e8f0; }
.kg-ref-item:first-child { border-top: none; }
.kg-ref-main-title { font-size: 15px !important; font-weight: 900 !important; color: #0f172a !important; margin-bottom: 20px; }
.kg-ref-keyword { font-size: 13px !important; font-weight: 900 !important; color: #2563eb !important; }

/* Readability Typography Bump v6.8.16 */
.text-\[9px\] { font-size: 10px !important; }
.text-\[10px\] { font-size: 11px !important; }
.text-\[11px\] { font-size: 12px !important; }

/* 密碼欄「顯示/隱藏」眼睛圖示定位（v6.9.1） */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    z-index: 1;
}
.password-toggle:hover { color: #475569; }

/* ─── Settings Drawer ─────────────────────────────────── */
.settings-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100vh;
    background: #ffffff;
    z-index: 300;
    padding: 28px 24px 24px;
    box-shadow: -6px 0 40px rgba(0,0,0,0.12);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow: hidden;
}
.settings-drawer.open { transform: translateX(0); }
.settings-tab { color: #94a3b8; background: transparent; border: none; cursor: pointer; }
.settings-tab.active { background: #ffffff; color: #4f46e5; box-shadow: 0 1px 6px rgba(0,0,0,0.08); }
.kw-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}
.kw-tag .kw-remove { cursor: pointer; color: #cbd5e1; font-size: 15px; line-height: 1; transition: color 0.15s; }
.kw-tag .kw-remove:hover { color: #ef4444; }
.history-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    background: #f8fafc;
}
.history-card .hc-title { font-size: 12px; font-weight: 800; color: #1e293b; line-height: 1.4; margin-bottom: 4px; }
.history-card .hc-meta  { font-size: 10px; color: #94a3b8; margin-bottom: 6px; }
.history-card .hc-btns  { display: flex; gap: 6px; }
.hc-btn { font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 6px; border: 1px solid #e2e8f0; cursor: pointer; transition: all 0.15s; background: #ffffff; color: #94a3b8; }
.hc-btn.active-yes { background: #dcfce7; border-color: #86efac; color: #16a34a; }
.hc-btn.active-no  { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }
.hc-btn:hover { border-color: #c7d2fe; color: #4f46e5; }

/* ── AI 關鍵字建議：Pill 按鈕式（v6.9.12）──────────────────────────── */
.kg-pill-grid { display: flex; flex-direction: column; gap: 5px; }
.kg-pill-wrapper { border-radius: 10px; overflow: hidden; border: 1px solid #e2e8f0; }
.kg-pill-btn { width: 100%; display: flex; align-items: center; gap: 7px; padding: 8px 12px; background: #f8fafc; border: none; cursor: pointer; text-align: left; transition: background 0.15s; }
.kg-pill-btn:hover { background: #f1f5f9; }
.kg-pill-btn.active { background: #eff6ff; }
.kg-pill-label { flex: 1; font-size: 12px; font-weight: 900; color: #1e293b; text-align: left; }
.kg-pill-count { font-size: 9px; font-weight: 800; color: #64748b; background: #f1f5f9; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.kg-pill-amount { font-size: 9px; font-weight: 800; color: #2563eb; background: #eff6ff; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.kg-pill-arrow { font-size: 9px; color: #94a3b8; flex-shrink: 0; }
.kg-pill-list { background: #ffffff; border-top: 1px solid #f1f5f9; padding: 6px 12px; }
.kg-pill-tender { padding: 5px 0; border-bottom: 1px dashed #f1f5f9; }
.kg-pill-tender:last-child { border-bottom: none; }
.kg-pill-tender-title { font-size: 11px; font-weight: 600; color: #334155; line-height: 1.4; }
.kg-pill-tender-meta { font-size: 9px; color: #94a3b8; margin-top: 2px; }
