body { background-color: #0b1120; color: #cbd5e1; font-family: -apple-system, sans-serif; padding: 15px; margin: 0; line-height: 1.6; -webkit-tap-highlight-color: transparent; }
.container { max-width: 600px; margin: 20px auto; background: #111827; padding: 25px; border-radius: 20px; border: 1px solid rgba(56, 189, 248, 0.15); box-shadow: 0 20px 50px rgba(0,0,0,0.5); position: relative; }
.main-title { text-align: center; color: #e0f2fe; margin-bottom: 20px; font-size: 1.4rem; font-weight: 800; letter-spacing: 1px; }

#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); }

button { width: 100%; padding: 16px; border: none; border-radius: 12px; font-weight: 700; cursor: pointer; transition: 0.2s; font-size: 1rem; }
.btn-advance, .btn-primary { background: linear-gradient(135deg, #0284c7, #2563eb); color: white; box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3); }
.btn-advance:hover, .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5); }
.btn-secondary { background: #1e293b; color: #94a3b8; margin-top: 20px; }
.btn-secondary:hover { background: #334155; color: #cbd5e1; }

#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; }
.pie-container { height: 280px; } 

.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; }

.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; }
.hidden { display: none !important; }
#loading-screen { text-align: center; padding: 60px 0; }
.spinner { width: 50px; height: 50px; border: 4px solid #1e293b; border-top: 4px solid #38bdf8; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.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 增加 relative 定位與右上角 X 按鈕樣式 */
.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; }
@media (max-width: 480px) { .match-list { grid-template-columns: 1fr; } }