/* public/feature-enhancements.css
 * ─────────────────────────────────────────────────────────────────
 * 新功能模組樣式（從 component.css 拆出來，避免巨檔繼續膨脹）。
 * 這裡放：dashboard 趨勢 / Beebe 互動探索 / type-detail tabs / 結果頁互補配對。
 * 未來新功能可繼續加這裡，等到某類別累積夠多再拆獨立檔。
 *
 * 載入順序：必須在 component.css 之後（依賴 var(--sp-*), var(--bd-*) 等 token）。
 * ───────────────────────────────────────────────────────────────── */

/* ── Dashboard 四軸傾向時間序列 ───────────────────────────────────── */
.trend-section { margin-top: var(--sp-6); padding: var(--sp-5); border: 1px solid var(--bd-subtle); border-radius: 12px; background: rgba(15, 23, 42, 0.5); }
.trend-section .dash-h2 { color: #e0f2fe; font-size: 1.1rem; margin: 0 0 8px; }
.trend-hint { color: #94a3b8; font-size: 0.9rem; margin: 0 0 16px; line-height: 1.6; }
.trend-chart-wrap { position: relative; width: 100%; height: 280px; }
.trend-deltas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; justify-content: center; }
.trend-delta { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.2); color: #cbd5e1; font-size: 0.85rem; }
.trend-delta b { color: #e0f2fe; }
.trend-delta .trend-arrow { color: #7dd3fc; font-size: 0.8rem; }
.trend-delta--big { background: rgba(168, 85, 247, 0.15); border-color: rgba(168, 85, 247, 0.4); color: #f5d0fe; }
.trend-delta--big .trend-arrow { color: #f5d0fe; }
@media (max-width: 480px) {
    .trend-chart-wrap { height: 220px; }
    .trend-section { padding: var(--sp-4); }
}

/* ── Beebe 互動探索 ─────────────────────────────────────────────── */
.interactive-section { background: rgba(15, 23, 42, 0.4); border: 1px solid rgba(56, 189, 248, 0.2); border-radius: 12px; padding: var(--sp-5); margin-bottom: var(--sp-8); }
.explorer-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; padding: 12px 16px; background: rgba(15, 23, 42, 0.6); border-radius: 8px; }
.explorer-label { color: #cbd5e1; font-weight: 600; font-size: 0.95rem; }
.explorer-select { background: var(--bg-base); color: #e0f2fe; border: 1px solid var(--bd-subtle); border-radius: 6px; padding: 8px 12px; font-size: 0.95rem; min-width: 200px; cursor: pointer; }
.explorer-select:focus { outline: 2px solid #38bdf8; outline-offset: 2px; }
.explorer-hint { color: #7dd3fc; font-size: 0.85rem; margin-left: auto; font-style: italic; }
.explorer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.exp-card { position: relative; background: var(--bg-base); border: 1px solid var(--bd-subtle); border-radius: 10px; padding: 14px 12px 12px; cursor: pointer; transition: transform 0.15s ease, border-color 0.2s, box-shadow 0.2s, background 0.2s; user-select: none; }
.exp-card:hover { transform: translateY(-2px); }
.exp-card:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.exp-card--conscious { border-color: rgba(56, 189, 248, 0.3); }
.exp-card--shadow { border-color: rgba(239, 68, 68, 0.25); background: rgba(15, 23, 42, 0.7); }
.exp-card.is-self { border-color: #fde047; box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.5), 0 0 24px rgba(253, 224, 71, 0.3); background: rgba(253, 224, 71, 0.08); }
.exp-card.is-pair { border-color: #a855f7; box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.5), 0 0 24px rgba(168, 85, 247, 0.3); background: rgba(168, 85, 247, 0.08); }
.exp-num { position: absolute; top: 8px; right: 10px; font-size: 0.7rem; color: #64748b; font-weight: 700; }
.exp-side-tag { font-size: 0.65rem; color: #94a3b8; letter-spacing: 0.5px; margin-bottom: 4px; }
.exp-pos { color: #e0f2fe; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; }
.exp-fn { color: #38bdf8; font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; letter-spacing: 0.5px; }
.exp-card--shadow .exp-fn { color: #fca5a5; }
.exp-tip { color: #cbd5e1; font-size: 0.75rem; line-height: 1.4; margin-bottom: 6px; min-height: 32px; }
.exp-phrase { color: #94a3b8; font-size: 0.72rem; line-height: 1.4; font-style: italic; padding-top: 6px; border-top: 1px dashed var(--bd-subtle); }
@media (max-width: 768px) {
    .explorer-grid { grid-template-columns: repeat(2, 1fr); }
    .explorer-hint { margin-left: 0; width: 100%; }
}
@media (max-width: 380px) {
    .explorer-grid { grid-template-columns: 1fr; }
}

/* ── Type detail 分頁 (Tabs) ─────────────────────────────────────── */
.td-tabs { position: sticky; top: 60px; z-index: 20; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; margin: 20px 0 16px; background: rgba(11, 17, 32, 0.95); backdrop-filter: blur(8px); border: 1px solid var(--bd-subtle); border-radius: 10px; }
.td-tab { flex: 1 1 auto; min-width: 0; padding: 10px 14px; background: transparent; border: 1px solid transparent; border-radius: 6px; color: #94a3b8; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; white-space: nowrap; }
.td-tab:hover { color: #e0f2fe; background: rgba(56, 189, 248, 0.08); }
.td-tab:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.td-tab.is-active { color: #0b1120; background: #38bdf8; border-color: #38bdf8; box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3); }
.td-panes { animation: tdPaneIn 0.25s ease; }
.td-pane { display: none; }
.td-pane.is-active { display: block; animation: tdPaneIn 0.25s ease; }
@keyframes tdPaneIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 480px) {
    .td-tabs { top: 56px; gap: 2px; padding: 6px; }
    .td-tab { padding: 8px 10px; font-size: 0.8rem; }
}

/* ── 結果頁互補配對 (Compatibility) ───────────────────────────── */
.compat-section { padding: var(--sp-5) 0; border-bottom: 1px solid var(--bd-subtle); margin-bottom: var(--sp-4); }
.compat-section h3 { color: var(--c-cyan); font-size: 1.15rem; margin: 0 0 8px; }
.compat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.compat-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 14px; background: rgba(15, 23, 42, 0.6); border: 1px solid var(--bd-subtle); border-radius: 10px; text-decoration: none; color: inherit; transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s; cursor: pointer; }
.compat-card:hover { transform: translateY(-3px); border-color: #38bdf8; box-shadow: 0 8px 20px rgba(56, 189, 248, 0.18); }
.compat-card:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.compat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.compat-label { color: #e0f2fe; font-weight: 700; font-size: 0.9rem; }
.compat-sub { color: #64748b; font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase; }
.compat-type { font-size: 1.8rem; font-weight: 900; color: #38bdf8; letter-spacing: 3px; line-height: 1.1; margin: 4px 0 2px; }
.compat-desc { color: #cbd5e1; font-size: 0.82rem; line-height: 1.5; flex-grow: 1; }
.compat-cta { color: #7dd3fc; font-size: 0.78rem; font-weight: 600; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--bd-subtle); }
@media (max-width: 600px) {
    .compat-grid { grid-template-columns: 1fr; gap: 10px; }
    .compat-type { font-size: 1.6rem; }
}

/* ── 進度存檔 / 暫停測驗 banner ───────────────────────────────────────
 * 設計：克制、低調、不浮誇 (給使用者放心關視窗的安全感, 不是促銷 / 不是預告結論)
 * feedback_assessment_integrity: 中途不顯示已預測型 / 信心
 */
.resume-banner {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; margin: 0 0 22px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(110, 231, 183, 0.3); /* 綠色系：「儲存成功」的訊號顏色 */
    border-left: 4px solid #6ee7b7;
    border-radius: 10px;
    animation: rsbIn 0.35s ease;
}
.rsb-icon { font-size: 1.4rem; line-height: 1; flex-shrink: 0; opacity: 0.9; }
.rsb-body { flex: 1; min-width: 0; }
.rsb-headline { color: #d1fae5; font-size: 0.92rem; line-height: 1.5; font-weight: 600; }
.rsb-sub { color: #94a3b8; font-size: 0.8rem; margin-top: 3px; line-height: 1.5; }
.rsb-btn-pause { width: auto; padding: 8px 16px; font-size: 0.82rem; flex-shrink: 0; }
@keyframes rsbIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
    .resume-banner { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
    .rsb-btn-pause { width: 100%; padding: 10px; }
}
@media (max-width: 380px) {
    .rsb-headline { font-size: 0.86rem; }
    .rsb-sub { font-size: 0.74rem; }
}

/* ── 語言切換按鈕（i18n.js 自動注入到 .header-actions） ───────────── */
.lang-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px;
    padding: 0 10px;
    border: 1px solid var(--bd-subtle);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.6);
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.lang-toggle:hover { color: #38bdf8; border-color: #38bdf8; background: rgba(56, 189, 248, 0.08); }
.lang-toggle:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
@media (max-width: 480px) { .lang-toggle { min-width: 32px; height: 32px; padding: 0 8px; font-size: 0.78rem; } }

/* ── 內容層尚未翻 (en) 提醒橫幅 ──────────────────────────────────── */
.i18n-content-notice {
    background: rgba(253, 224, 71, 0.1);
    border-bottom: 1px solid rgba(253, 224, 71, 0.3);
    color: #fde68a;
    text-align: center;
    padding: 8px 16px;
    font-size: 0.82rem;
    line-height: 1.5;
}

/* ─────────────────────────────────────────────────────────────────
 * Inline-style refactor (CSP unsafe-inline removal — 2026-05-23)
 * 為了拔掉 _headers 的 style-src 'unsafe-inline'，把全站 HTML / JS
 * template literal 內的 inline style="..." 全部搬到這裡用 class 表達。
 *
 * 動態值（width:${pct}%、background:${color}、left:${x}%、animation-duration:
 * ${ms}ms）改走 CSSOM (element.style.foo = bar)，不算 inline style attribute
 * (CSP 不擋 CSSOM)。caller 端 render 完 innerHTML 後再 setProperty。
 * ───────────────────────────────────────────────────────────────── */

/* Init-hidden：取代 #dash-nav-btn style="display:none" x8 */
.is-init-hidden { display: none; }

/* Margin / Text 全部用 !important — utility class 慣例（對齊 Tailwind / Bootstrap）。
 * 主要動機是要對抗 component.css 既有的 `.report-section p / h4` 選擇器
 * (特異度 0,1,1)，否則套在 .report-section 內的 `<p class="tx-rose">` 等會被
 * 預設色蓋掉，原本 inline style="color:#fca5a5" 因 specificity 1,0,0,0 不受影響。
 */
.u-mt-15 { margin-top: 15px !important; }
.u-mt-20 { margin-top: 20px !important; }
.u-mt-25 { margin-top: 25px !important; }
.u-mt-40 { margin-top: 40px !important; }
.u-mb-15 { margin-bottom: 15px !important; }
.u-mb-50 { margin-bottom: 50px !important; }

.tx-cyan { color: var(--c-cyan) !important; }
.tx-cyan-light { color: #7dd3fc !important; }
.tx-soft-cyan { color: #e0f2fe !important; }
.tx-slate-light { color: #94a3b8 !important; }
.tx-yellow { color: #fde047 !important; }
.tx-emerald-bold { color: #6ee7b7 !important; font-weight: bold !important; }
.tx-rose { color: #fca5a5 !important; }
.tx-rose-strong { color: #ef4444 !important; }

/* Dashboard 區塊標題：原 4 處 inline color/size 統一抽出 */
.dash-section-h2 {
    color: #e0f2fe;
    font-size: 1.1rem;
    margin: 0 0 15px;
}
.dash-section-h2--top-spaced { margin-top: 25px; }
.dash-section-h2--inline { margin: 0; }
.dash-section-h2--snug { margin-bottom: 12px; }

/* Dashboard history header row（h2 + 啟動新測驗 button 並排） */
.dash-history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    margin-bottom: 15px;
}
.dash-history-head .btn-primary {
    width: auto;
    padding: 8px 15px;
    font-size: 0.85rem;
}

/* jung-theory.html 區塊標題（border-left 藍/紫，文字維持 #f8fafc 白） */
.jung-section-h2 {
    margin-bottom: 20px;
    color: #f8fafc;
    border-left: 4px solid #94a3b8;
    padding-left: 10px;
}
.jung-section-h2--blue { border-left-color: #38bdf8; }
.jung-section-h2--purple { border-left-color: #a855f7; }

/* jung-theory.html f-card 4 種主題色（border-color 對應 J/P/感知/判斷分組） */
.f-card--blue   { border-color: rgba(56, 189, 248, 0.3); }
.f-card--green  { border-color: rgba(16, 185, 129, 0.3); }
.f-card--purple { border-color: rgba(168, 85, 247, 0.3); }
.f-card--yellow { border-color: rgba(234, 179, 8, 0.3); }

/* beebe-model.html 簡介段落樣式（3 處） */
.beebe-intro-p {
    color: #94a3b8;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.beebe-intro-p--snug { margin-bottom: 18px; }

/* type-detail.html / .js 容器與 loading / not-found */
.detail-container {
    max-width: 800px;
    margin-top: 40px;
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
}
.detail-loading {
    text-align: center;
    color: #38bdf8;
    padding: 50px;
}
.detail-not-found {
    color: #ef4444;
    text-align: center;
}
.stack-box--inferior { border-color: #ef4444; }
.stack-role--inferior, .stack-func--inferior { color: #fca5a5; }

/* mbti-stats.html 提示與 tip-yellow */
.stats-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 15px;
}
.stats-tip-yellow {
    color: #fde047;
    font-size: 0.9rem;
    margin-top: 10px;
}

/* result-render.js compatibility / report-section 變體 */
.report-section--tight { padding-bottom: 10px; }
.report-section--no-border { border-bottom: none; margin-bottom: 0; }
/* scope 加 .compat-section 前綴讓 (0,2,0) 贏過 .report-section p (0,1,1)；
   .compat-hint 只用在 compat-section 內，前綴不會誤套到其他地方 */
.compat-section .compat-hint {
    color: #94a3b8;
    font-size: 0.92rem;
    margin-bottom: 14px;
}

/* landing-progress.js skeleton：原本 hardcode width/height inline */
.skel-line--lg-w { width: 55%; height: 10px; }
.skel-line--sm-w { width: 25%; height: 10px; }

/* dashboard.js history 內 fallback note 與置信度小字 */
.dash-fallback-note {
    color: #94a3b8;
    font-size: 0.9rem;
}
.history-confidence {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: normal;
}

/* Dynamic width / left / color：CSSOM 設定，這裡只給「容器需要 position
 * 或定位 anchor」的 baseline。caller (result-render.js / dashboard.js / toast.js)
 * 在 innerHTML 後跑 querySelectorAll([data-*]) 設定 .style.x。
 *
 * 注意：.match-bar-fill / .tl-dot / .cmp-dot / .toast-progress-fill
 * 既有的 CSS（component.css / global.css）已經包好布局，只缺動態值；本批不重複定義靜態屬性。
 */
