/* =========================================
   COMPONENT.CSS - 局部特效、測驗介面與圖表
   ========================================= */

/* -----------------------------------------
   [模塊 1] 測驗頁面 (assessment.html)
   ----------------------------------------- */
#watermark { position: absolute; top: 10px; right: 15px; font-size: 0.65rem; color: rgba(255,255,255,0.15); text-transform: uppercase; letter-spacing: 1px; z-index: 10; font-weight: bold; }

.progress-container { width: 100%; background: #1e293b; height: 6px; border-radius: 3px; margin-bottom: 5px; overflow: hidden; }
#progress-fill { height: 100%; background: linear-gradient(90deg, #0284c7, #38bdf8); width: 20%; transition: width 0.5s ease; }
#progress-text { text-align: right; font-size: 0.75rem; color: #64748b; margin-bottom: 20px; }

.phase-indicator { color: #38bdf8; font-weight: 800; border-left: 4px solid #38bdf8; padding-left: 10px; margin-bottom: 5px; font-size: 1.1rem; text-transform: uppercase; }
.phase-desc { font-size: 0.85rem; color: #94a3b8; margin-bottom: 20px; padding-left: 14px; line-height: 1.5; }
.question { margin-bottom: 25px; padding: 20px; border-radius: 12px; background: #0f172a; border: 1px solid #1e293b; transition: 0.3s; }
.options { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; }
label { cursor: pointer; padding: 15px; border: 1px solid #1e293b; border-radius: 10px; background: #162032; font-size: 0.95rem; display: block; transition: 0.2s; }
label:hover { border-color: #38bdf8; background: #1e293b; color: #f8fafc; }
input[type="radio"] { margin-right: 10px; accent-color: #38bdf8; transform: scale(1.1); }

/* --- 測驗結果與診斷警示 --- */
#mbti-type { font-size: 4.5rem; font-weight: 900; color: #38bdf8; text-align: center; line-height: 1; text-shadow: 0 0 20px rgba(56, 189, 248, 0.3); margin-top: 10px; }
#spectrum-subtitle { text-align: center; margin-bottom: 15px; color: #94a3b8; font-weight: bold; letter-spacing: 1px; font-size: 0.95rem; }

#topology-diagnosis, #grip-warning { margin-bottom: 15px; font-size: 0.85rem; text-align: center; padding: 12px; border-radius: 10px; line-height: 1.6; }
.diag-warning { background: rgba(120, 53, 15, 0.2); border: 1px solid #b45309; color: #fde68a; }
.diag-danger { background: rgba(127, 29, 29, 0.2); border: 1px solid #dc2626; color: #fca5a5; }
.diag-safe { background: rgba(6, 78, 59, 0.2); border: 1px solid #059669; color: #6ee7b7; }
.diag-grip { background: rgba(153, 27, 27, 0.2); border: 1px solid #991b1b; color: #fecaca; }
.grip-exit { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(248, 113, 113, 0.3); font-size: 0.8rem; color: #f87171; text-align: left; }

/* --- 圖表與分數表格 --- */
.charts-flex-container { display: flex; flex-direction: column; gap: 20px; margin-bottom: 25px; align-items: center; }
.chart-box { width: 100%; max-width: 400px; position: relative; text-align: center; }
.chart-label { color: #e0f2fe; font-weight: bold; margin-bottom: 10px; font-size: 0.9rem; letter-spacing: 1px; }
.radar-container { height: 300px; width: 100%; }
.pie-container { height: 280px; width: 100%; } 

.score-table-wrapper { margin-bottom: 25px; border-radius: 10px; border: 1px solid #1e293b; overflow: visible; }
table { width: 100%; border-collapse: collapse; text-align: center; font-size: 0.8rem; }
th { background: #1e293b; padding: 10px; color: #94a3b8; font-weight: 600; cursor: help; position: relative; }
th:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); background: #0f172a; color: #cbd5e1; padding: 8px 12px; border-radius: 6px; font-size: 0.75rem; width: max-content; max-width: 200px; white-space: normal; line-height: 1.4; border: 1px solid #38bdf8; z-index: 1000; box-shadow: 0 4px 10px rgba(0,0,0,0.5); pointer-events: none; }
th:nth-child(1):hover::after, th:nth-child(2):hover::after { left: 0; transform: translateX(0); }
th:nth-child(7):hover::after, th:nth-child(8):hover::after { left: auto; right: 0; transform: translateX(0); }
td { color: #38bdf8; padding: 10px; border-top: 1px solid #1e293b; font-weight: 800; }

/* --- 16人格列表與標籤 --- */
.match-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 15px 0; }
.match-item { background: #162032; padding: 12px; border-radius: 10px; border: 1px solid #1e293b; cursor: pointer; font-size: 0.85rem; transition: 0.2s; display: flex; justify-content: space-between; align-items: center; }
.match-item:hover { background: #1e293b; border-color: #38bdf8; transform: translateY(-2px); }
.match-item.active { border-color: #38bdf8; background: #1e293b; box-shadow: 0 0 10px rgba(56, 189, 248, 0.2); }
.match-info { flex: 1; padding-right: 15px; pointer-events: none; text-align: left; min-width: 0; }
.match-bar-bg { width: 100%; background: #0b1120; height: 5px; border-radius: 3px; margin-top: 6px; }
.match-bar-fill { height: 100%; background: #38bdf8; border-radius: 3px; transition: width 1s ease; }
.match-pct { font-weight: 900; font-size: 1rem; pointer-events: none; color: #cbd5e1; flex-shrink: 0; }

.tag-ego { color: #38bdf8; font-size: 0.65rem; border: 1px solid #38bdf8; padding: 1px 4px; border-radius: 4px; margin-left: 4px; display: inline-block; margin-top: 2px;}
.tag-sub { color: #facc15; font-size: 0.65rem; border: 1px solid #facc15; padding: 1px 4px; border-radius: 4px; margin-left: 4px; display: inline-block; margin-top: 2px;}
.tag-unc { color: #fb7185; font-size: 0.65rem; border: 1px solid #fb7185; padding: 1px 4px; border-radius: 4px; margin-left: 4px; display: inline-block; margin-top: 2px;}

/* --- 報告文字區塊 --- */
.report-section { background: #0f172a; padding: 20px; border-radius: 15px; margin-bottom: 20px; border: 1px solid #1e293b; box-shadow: inset 0 2px 10px rgba(0,0,0,0.2); }
.report-section h3 { color: #38bdf8; margin-top: 0; font-size: 1.05rem; letter-spacing: 1px; margin-bottom: 12px; border-bottom: 1px solid #1e293b; padding-bottom: 8px; }
.report-section h4 { color: #94a3b8; font-size: 0.95rem; margin: 15px 0 5px 0; }
.report-section p { font-size: 0.9rem; color: #cbd5e1; margin: 10px 0; line-height: 1.7; text-align: justify; }
.report-section b { color: #e0f2fe; }
.blindspot-box { background: rgba(127, 29, 29, 0.1); border-left: 4px solid #ef4444; padding: 15px; margin-top: 15px; border-radius: 4px; font-size: 0.9rem; line-height: 1.6; color: #fca5a5; }

/* --- 圖片分享 Modal --- */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); display: flex; justify-content: center; align-items: center; z-index: 9999; backdrop-filter: blur(5px); }
.modal-content { background: #111827; padding: 25px; border-radius: 20px; width: 90%; max-width: 400px; text-align: center; border: 1px solid #1e293b; position: relative; }
.close-modal-x { position: absolute; top: 12px; right: 16px; font-size: 1.2rem; color: #64748b; cursor: pointer; transition: 0.2s; font-weight: 900; line-height: 1; padding: 5px; }
.close-modal-x:hover { color: #cbd5e1; transform: scale(1.1); }
.modal-hint { color: #38bdf8; font-weight: 700; margin-bottom: 15px; font-size: 0.9rem; margin-top: 10px; }
#image-preview { width: 100%; border-radius: 12px; margin-bottom: 20px; border: 1px solid #334155; }
.action-buttons { display: flex; gap: 15px; margin: 20px 0; }

/* RWD 響應式 (手機版清單單排) */
@media (max-width: 480px) { .match-list { grid-template-columns: 1fr; } }


/* -----------------------------------------
   [模塊 2] 科普頁面共用基礎樣式
   ----------------------------------------- */
.theory-container { max-width: 1100px; margin: 100px auto 50px; padding: 0 20px; color: #f8fafc; }
.theory-header { text-align: center; margin-bottom: 40px; }
.theory-header h1 { font-size: 2.5rem; color: #38bdf8; margin-bottom: 15px; }
.theory-header p { font-size: 1.1rem; color: #94a3b8; line-height: 1.6; max-width: 800px; margin: 0 auto; }
.intro-box { background: rgba(30, 41, 59, 0.5); border: 1px solid #334155; border-radius: 12px; padding: 25px; margin-bottom: 40px; line-height: 1.7; }
.intro-box strong { color: #38bdf8; }

/* -----------------------------------------
   [模塊 3] 榮格八維與畢比模型專屬 (jung-theory & beebe-model)
   ----------------------------------------- */
.function-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-bottom: 40px; }
.f-card { background: #0f172a; border: 1px solid #1e293b; border-radius: 12px; padding: 25px; transition: all 0.3s ease; }
.f-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.f-header { display: flex; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #1e293b; }
.f-icon { font-size: 1.5rem; font-weight: bold; margin-right: 15px; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.color-nt { background: rgba(168, 85, 247, 0.1); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); } 
.color-st { background: rgba(234, 179, 8, 0.1); color: #eab308; border: 1px solid rgba(234, 179, 8, 0.3); }  
.color-t  { background: rgba(56, 189, 248, 0.1); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); } 
.color-f  { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); } 
.f-title { font-size: 1.2rem; color: #f1f5f9; }
.f-desc { color: #94a3b8; font-size: 0.95rem; line-height: 1.6; }
.f-tag { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; background: #1e293b; color: #cbd5e1; margin-top: 10px; margin-right: 5px; }

.archetype-section { margin-bottom: 50px; padding: 25px; border-radius: 12px; }
.ego-section { background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.4)); border: 1px solid #38bdf8; box-shadow: 0 0 20px rgba(56, 189, 248, 0.1); }
.shadow-section { background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(69, 10, 10, 0.2)); border: 1px solid #ef4444; box-shadow: 0 0 20px rgba(239, 68, 68, 0.1); }
.section-title { font-size: 1.5rem; font-weight: bold; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.ego-section .section-title { color: #7dd3fc; }
.shadow-section .section-title { color: #fca5a5; }
.archetype-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; }
.a-card { background: #0b1120; border: 1px solid #1e293b; border-radius: 8px; padding: 20px; position: relative; overflow: hidden; transition: transform 0.2s; }
.a-card:hover { transform: translateY(-3px); }
.a-num { position: absolute; top: -10px; right: -10px; font-size: 4rem; font-weight: 900; opacity: 0.05; color: white; }
.a-title { font-size: 1.1rem; font-weight: bold; margin-bottom: 10px; color: #f1f5f9; }
.ego-section .a-title { color: #bae6fd; }
.shadow-section .a-title { color: #fecaca; }
.a-desc { font-size: 0.9rem; color: #94a3b8; line-height: 1.6; }

/* -----------------------------------------
   [模塊 4] 16人格圖鑑專屬 (mbti-types.html)
   ----------------------------------------- */
.temperament-section { margin-bottom: 60px; background: rgba(15, 23, 42, 0.6); border-radius: 16px; padding: 30px; border: 1px solid #1e293b; }
.temp-title { font-size: 1.8rem; font-weight: bold; margin-bottom: 10px; display: flex; align-items: center; gap: 15px; }
.temp-desc { color: #94a3b8; margin-bottom: 30px; font-size: 1rem; line-height: 1.5; }
.nt-group { border-top: 4px solid #a855f7; } .nt-group .temp-title { color: #a855f7; }
.nf-group { border-top: 4px solid #10b981; } .nf-group .temp-title { color: #10b981; }
.sj-group { border-top: 4px solid #38bdf8; } .sj-group .temp-title { color: #38bdf8; }
.sp-group { border-top: 4px solid #eab308; } .sp-group .temp-title { color: #eab308; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.type-card { background: #0b1120; border: 1px solid #1e293b; border-radius: 12px; padding: 20px; transition: all 0.3s ease; position: relative; overflow: hidden; }
.type-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.4); border-color: #cbd5e1; }
.t-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 15px; border-bottom: 1px solid #1e293b; padding-bottom: 10px; }
.t-code { font-size: 2rem; font-weight: 900; letter-spacing: 2px; }
.t-name { font-size: 1.1rem; color: #cbd5e1; font-weight: bold; }
.nt-group .t-code { color: #d8b4fe; } .nf-group .t-code { color: #6ee7b7; } .sj-group .t-code { color: #7dd3fc; } .sp-group .t-code { color: #fde047; }
.t-stack { display: flex; gap: 5px; margin-bottom: 15px; }
.t-stack span { background: #1e293b; padding: 3px 6px; border-radius: 4px; font-size: 0.75rem; color: #94a3b8; font-family: monospace; }
.t-stack span:first-child { color: #f8fafc; font-weight: bold; border: 1px solid #475569; }
.t-desc { font-size: 0.9rem; color: #94a3b8; line-height: 1.6; }

/* -----------------------------------------
   [模塊 5] 有趣數據專屬 (mbti-stats.html)
   ----------------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 25px; margin-bottom: 50px; }
.stat-card { background: linear-gradient(145deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.4)); border: 1px solid #1e293b; border-radius: 16px; padding: 30px; position: relative; overflow: hidden; transition: transform 0.3s; }
.stat-card:hover { transform: translateY(-5px); border-color: #38bdf8; box-shadow: 0 10px 25px rgba(56, 189, 248, 0.1); }
.stat-card h3 { font-size: 1.3rem; color: #f1f5f9; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #1e293b; padding-bottom: 10px; }
.bar-group { margin-bottom: 15px; }
.bar-label { display: flex; justify-content: space-between; font-size: 0.95rem; color: #cbd5e1; margin-bottom: 5px; }
.bar-label span:last-child { font-family: monospace; color: #38bdf8; font-weight: bold; }
.bar-bg { background: #0f172a; height: 10px; border-radius: 5px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #0284c7, #38bdf8); width: 0; transition: width 1.5s ease-out; }
.trivia-list { list-style: none; padding: 0; margin: 0; }
.trivia-list li { background: rgba(15, 23, 42, 0.5); padding: 15px 20px; border-radius: 8px; margin-bottom: 15px; border-left: 4px solid #a855f7; color: #94a3b8; line-height: 1.6; }
.trivia-list li strong { color: #d8b4fe; display: block; margin-bottom: 5px; font-size: 1.05rem; }
.highlight-tag { display: inline-block; background: rgba(16, 185, 129, 0.15); color: #34d399; padding: 5px 12px; border-radius: 20px; font-size: 0.85rem; margin-bottom: 15px; border: 1px solid rgba(16, 185, 129, 0.3); }

/* -----------------------------------------
   [模塊 6] 儀表板專屬 (dashboard.html)
   ----------------------------------------- */
.dashboard-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid #1e293b; padding-bottom: 15px; }
.nav-brand { color: #38bdf8; font-weight: 900; font-size: 1.2rem; letter-spacing: 1px; cursor: pointer; transition: 0.3s; }
.nav-brand:hover { color: #e0f2fe; }
.nav-links button { padding: 8px 15px; font-size: 0.85rem; width: auto; margin-left: 10px; }
.btn-outline { background: transparent; border: 1px solid #64748b; color: #cbd5e1; border-radius: 8px; cursor: pointer; font-weight: bold; transition: 0.3s; }
.btn-outline:hover { background: #334155; color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 30px; }
.stat-value { font-size: 2rem; font-weight: 900; color: #e0f2fe; margin-bottom: 5px; }
.stat-label { font-size: 0.8rem; color: #64748b; text-transform: uppercase; letter-spacing: 1px; }
.history-list { display: flex; flex-direction: column; gap: 15px; margin-bottom: 40px; }
.history-item { background: #162032; border: 1px solid #1e293b; border-radius: 12px; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; transition: 0.3s; }
.history-item:hover { border-color: #38bdf8; transform: translateY(-2px); }
.history-info { flex: 1; }
.history-date { font-size: 0.8rem; color: #94a3b8; margin-bottom: 5px; }
.history-type { font-size: 1.2rem; font-weight: 900; color: #38bdf8; }
.history-action button { padding: 8px 15px; font-size: 0.85rem; width: auto; }
.danger-zone { border: 1px solid #7f1d1d; background: rgba(127, 29, 29, 0.1); border-radius: 12px; padding: 20px; text-align: center; }
.danger-zone h3 { color: #fca5a5; margin-top: 0; }
.danger-zone p { color: #cbd5e1; font-size: 0.85rem; margin-bottom: 15px; }
.btn-danger { background: #991b1b; color: white; }
.btn-danger:hover { background: #b91c1c; }

/* -----------------------------------------
   [模塊 7] 登入頁專屬 (login.html)
   ----------------------------------------- */
.auth-container { max-width: 400px; margin: 80px auto; text-align: center; }
.auth-box { background: #0f172a; padding: 30px; border-radius: 15px; border: 1px solid #1e293b; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid #1e293b; }
.tab { flex: 1; padding: 10px; cursor: pointer; color: #64748b; font-weight: bold; transition: 0.3s; }
.tab.active { color: #38bdf8; border-bottom: 2px solid #38bdf8; }
.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; font-size: 0.85rem; color: #94a3b8; margin-bottom: 5px; padding: 0; border: none; background: transparent; }
.input-group input { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #334155; background: #162032; color: #fff; font-size: 1rem; box-sizing: border-box; }
.input-group input:focus { outline: none; border-color: #38bdf8; }
.auth-msg { margin-top: 15px; font-size: 0.85rem; color: #ef4444; min-height: 20px; }