/* 深空科技感底色優化 */
body { background-color: #0b1120 !important; color: #f8fafc !important; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 15px; margin: 0; line-height: 1.6; -webkit-tap-highlight-color: transparent; }
.container { max-width: 550px; margin: 20px auto; background: #111827; padding: 25px; border-radius: 20px; box-shadow: 0 30px 60px -12px rgba(0,0,0,0.7); border: 1px solid rgba(56, 189, 248, 0.15); }

.main-title { text-align: center; color: #e0f2fe; font-size: 1.4rem; font-weight: 800; margin-top: 0; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #1e293b; letter-spacing: 1px; }

.phase-indicator { color: #38bdf8; font-weight: 800; margin-bottom: 5px; font-size: 1.15rem; border-left: 5px solid #38bdf8; padding-left: 12px; text-transform: uppercase; letter-spacing: 1px; }
.phase-desc { font-size: 0.85rem; color: #94a3b8; margin-bottom: 25px; padding-left: 17px; }
.question { margin-bottom: 25px; padding: 22px; border-radius: 16px; border: 1px solid #1e293b; background: #0f172a; transition: border-color 0.3s, box-shadow 0.3s; }
.options { display: flex; flex-direction: column; gap: 12px; margin-top: 15px; }
label { cursor: pointer; padding: 16px; border: 1.5px solid #1e293b; border-radius: 12px; font-size: 0.95rem; display: block; background: #162032; color: #cbd5e1; transition: all 0.2s ease; }
@media (hover: hover) { label:hover { border-color: #38bdf8; background: #1e293b; color: #f1f5f9; } }
input[type="radio"] { margin-right: 12px; accent-color: #38bdf8; transform: scale(1.1); }

/* 按鈕優化 */
button { width: 100%; padding: 18px; border: none; border-radius: 14px; font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: all 0.2s ease; }
.btn-advance { background: linear-gradient(135deg, #0284c7, #2563eb); color: white; box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4); }
.btn-advance:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6); }

#mbti-type { font-size: 4.5rem; font-weight: 900; color: #38bdf8; text-align: center; margin: 10px 0 0 0; letter-spacing: -1px; line-height:1; text-shadow: 0 0 20px rgba(56, 189, 248, 0.3); }
#spectrum-subtitle { text-align:center; color:#94a3b8; font-weight:700; margin-bottom:20px; font-size:1.05rem; letter-spacing:1px; }

.chart-container { width: 100%; max-width: 380px; margin: 10px auto 20px; position: relative; }
#anomaly-warning { background: rgba(120, 53, 15, 0.4); border: 1px solid #b45309; color: #fde68a; padding: 15px; border-radius: 12px; font-size: 0.9rem; margin-bottom: 15px; line-height: 1.6; }

/* 數據表格優化 */
.score-table-wrapper { display: flex; justify-content: center; overflow-x: auto; margin: 20px 0 30px; }
table { width: 100%; max-width: 480px; border-collapse: collapse; background: #0f172a; border-radius: 10px; font-size: 0.8rem; color: #94a3b8; border: 1px solid #1e293b; overflow: hidden; }
th, td { padding: 12px 6px; text-align: center; border: 1px solid #1e293b; }
th { background: #162032; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
td { font-weight: 800; color: #7dd3fc; }

/* 報告區塊優化 */
#analysis-text { padding: 25px; background: #0f172a; border-radius: 18px; border: 1px solid #1e293b; margin-top: 15px; box-shadow: inset 0 2px 10px rgba(0,0,0,0.2); }
.report-section { margin-bottom: 30px; border-bottom: 1px solid #1e293b; padding-bottom: 20px; }
.report-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.report-section h3 { color: #38bdf8; margin-top: 0; font-size: 1.15rem; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.report-section p { font-size: 0.95rem; color: #cbd5e1; margin: 10px 0; line-height: 1.7; }
.hidden { display: none !important; }

/* 16型全光譜契合度清單樣式 (加入點擊反饋) */
.match-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 15px; }
.match-item { background: #162032; padding: 14px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #1e293b; cursor: pointer; transition: all 0.2s ease; }
.match-item:hover { background: #1e293b; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.4); }
.match-item.active { border-color: #38bdf8; background: #1e293b; box-shadow: 0 0 15px rgba(56, 189, 248, 0.2); }
.match-info { width: 75%; pointer-events: none; }
.match-type { font-weight: 800; color: #e2e8f0; font-size: 0.95rem; letter-spacing: 1px; }
.match-pct { font-weight: 900; font-size: 1.1rem; pointer-events: none; }
.match-bar-bg { width: 100%; background: #0b1120; height: 6px; border-radius: 3px; margin-top: 8px; overflow: hidden; }
.match-bar-fill { height: 100%; border-radius: 3px; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); }

@media (max-width: 480px) {
    .match-list { grid-template-columns: 1fr; }
}

/* 行動按鈕 */
.action-buttons { display: flex; gap: 15px; margin-top: 25px; }
.btn-primary { background: #0284c7; flex: 1; font-size: 1rem; padding: 15px; color: white; }
.btn-primary:hover { background: #0369a1; }
.btn-secondary { background: #334155; margin-top: 15px; font-size: 1rem; color: #f1f5f9; }
.btn-secondary:hover { background: #475569; }

/* 載入動畫 */
#loading-screen { text-align: center; padding: 60px 0; }
.spinner { width: 60px; height: 60px; border: 4px solid #1e293b; border-top: 4px solid #38bdf8; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 25px auto; box-shadow: 0 0 15px rgba(56, 189, 248, 0.2); }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-text { color: #38bdf8; font-weight: 700; letter-spacing: 2px; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* 分享視窗 */
#image-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(11, 17, 32, 0.95); display: flex; justify-content: center; align-items: center; z-index: 9999; padding: 20px; box-sizing: border-box; backdrop-filter: blur(5px); }
.modal-content { background: #111827; padding: 25px; border-radius: 20px; border: 1px solid #1e293b; max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto; text-align: center; box-shadow: 0 25px 50px rgba(0,0,0,0.8); }
.modal-hint { color: #38bdf8; font-weight: 800; margin-bottom: 20px; font-size: 0.95rem; letter-spacing: 1px; }
#image-preview { width: 100%; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.6); margin-bottom: 25px; border: 1px solid #1e293b; }
.modal-actions { display: flex; flex-direction: column; gap: 12px; }
.modal-actions button { margin: 0; padding: 16px; }