/* =========================================
   The Equalizer 專屬 App Icon 樣式 (Dark Pro)
   ========================================= */
.equalizer-icon-pro {
    width: 100px;
    height: 100px;
    /* Apple 經典的 Space Grey / 暗夜黑漸層 */
    background: linear-gradient(135deg, #2C2C2E 0%, #1C1C1E 100%);
    border-radius: 24px;
    /* 增加金屬邊框與深色陰影 */
    border: 1px solid #3A3A3C;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin: 0 auto 15px auto;
}

/* 玻璃質感高光反光 (調暗以符合 Dark Mode) */
.equalizer-icon-pro::after {
    content: '';
    position: absolute;
    top: -10%; left: -10%; width: 120%; height: 60%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    transform: rotate(-10deg);
    pointer-events: none;
}

/* 讓裡面的霓虹 SVG 產生發光效果 */
.equalizer-icon-pro svg {
    filter: drop-shadow(0 0 6px rgba(0, 255, 204, 0.5));
    z-index: 1;
}

/* =========================================
   3lite Education - The Equalizer UI (iOS Glassmorphism)
   ========================================= */
:root {
    --apple-blue: #007aff; 
    --apple-green: #34c759; 
    --apple-red: #ff3b30; 
    --apple-orange: #ff9500; 
    --apple-purple: #af52de; 
    --apple-gray: #8e8e93;
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --dark: #2c3e50;
}

* { 
    box-sizing: border-box; 
} 

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 20px 10px; 
    overflow-x: hidden; 
    min-height: 100vh;
    -webkit-user-select: none;
    user-select: none;
}

/* ⚡ 動態流體背景 */
.fluid-bg {
    position: fixed; 
    top: -50%; left: -50%; 
    width: 200vw; height: 200vh; 
    z-index: -1;
    background: radial-gradient(circle at 50% 50%, #e0eafc, #cfdef3, #fdfbfb);
    background-size: 100% 100%;
    animation: flow 20s linear infinite; 
    will-change: transform;
}
@keyframes flow { 
    0% { transform: rotate(0deg) scale(1); } 
    50% { transform: rotate(180deg) scale(1.05); } 
    100% { transform: rotate(360deg) scale(1); } 
}

/* ⚡ 毛玻璃面板基底 */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
}

/* 佈局容器與視圖切換 */
.app-container { 
    width: 100%; max-width: 550px; 
    margin: 0 auto; 
    padding: 0 10px 100px 10px; 
    position: relative; 
    z-index: 1;
}
.view-section { 
    display: none; 
    animation: slideUpFade 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; 
    margin-top: 15px;
}
.view-section.active { display: block; }
@keyframes slideUpFade { 
    from { opacity: 0; transform: translateY(20px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* =========================================
   頂部玩家名片區 (Player Profile)
   ========================================= */
.player-profile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    margin-bottom: 25px;
    position: relative;
    color: #1c1c1e;
}
.profile-left { text-align: left; z-index: 2; flex: 1;}
.player-title { 
    font-size: 16px; font-weight: 800; 
    color: var(--apple-blue); 
    letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px;
}
.player-subtitle { font-size: 13px; color: var(--apple-gray); font-weight: 700; }
.coin-badge { 
    padding: 8px 14px; border-radius: 20px; 
    font-weight: 800; color: #d35400; font-size: 16px; 
    display: flex; align-items: center; gap: 5px; 
    background: rgba(255,255,255,0.9); box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 蘋果風字體層次 */
.ios-title { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; color: #1c1c1e; margin-bottom: 10px; margin-top: 5px; }
.ios-subtitle { font-size: 18px; font-weight: 700; color: #3a3a3c; margin-bottom: 12px;}
.ios-desc { font-size: 14px; color: var(--apple-gray); line-height: 1.4; font-weight: 600;}

/* iOS 物理回彈按鈕 */
.ios-btn { 
    width: 100%; padding: 16px; border-radius: 18px; border: none; 
    font-size: 17px; font-weight: 700; cursor: pointer; 
    display: flex; justify-content: center; align-items: center; gap: 8px; 
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s; 
    color: white; box-shadow: 0 4px 12px rgba(0,0,0,0.15); 
}
.ios-btn:active { transform: scale(0.95); box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.primary-btn { background: var(--apple-blue); } 
.mt-3 { margin-top: 20px; }

/* 單行輸入框樣式 (下拉選單) */
.ios-input {
    width: 100%; height: 50px; margin: 15px 0; padding: 10px; border-radius: 12px; 
    border: 1px solid rgba(0,0,0,0.1); font-size: 16px; 
    font-weight: bold; text-align: center; box-sizing: border-box; 
    background: rgba(255,255,255,0.8); color: #1c1c1e; outline: none; transition: 0.2s;
    appearance: none; /* 移除預設下拉箭頭，讓整體更乾淨 */
}
.ios-input:focus { border-color: var(--apple-blue); box-shadow: 0 0 0 3px rgba(0,122,255,0.2); background: white; }

/* 底部導覽列 */
.bottom-tab-bar { 
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); 
    width: 92%; max-width: 400px; 
    display: flex; justify-content: space-around; 
    padding: 12px 5px; z-index: 100; border-radius: 35px; 
}
.tab-item { text-align: center; font-size: 24px; cursor: pointer; opacity: 0.4; transition: 0.3s; transform: scale(0.9); }
.tab-item span { display: block; font-size: 11px; font-weight: 700; margin-top: 5px; }
.tab-item.active { opacity: 1; transform: scale(1.1); color: var(--apple-blue); }

/* =========================================
   The Equalizer 專屬區塊設計
   ========================================= */

/* 方程式展示區 */
.equation-display { 
    display: flex; align-items: center; justify-content: center; 
    flex-wrap: wrap; gap: 8px; margin: 30px 0; 
    font-size: 28px; font-weight: bold; font-family: 'Times New Roman', serif; 
    color: #2c3e50;
}

/* 係數輸入框 */
.coef-input { 
    width: 55px; height: 55px; text-align: center; 
    font-size: 24px; font-weight: 800; border-radius: 14px; 
    border: 2px solid rgba(0,0,0,0.1); background: rgba(255,255,255,0.9); 
    outline: none; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    color: var(--apple-blue);
}
.coef-input:focus { 
    border-color: var(--apple-blue); 
    box-shadow: 0 0 15px rgba(0,122,255,0.3); 
    transform: scale(1.1);
}
.coef-input::placeholder { color: #ccc; font-weight: 400; }

/* 代數步驟卡片 */
.step-card { 
    background: rgba(255,255,255,0.75); 
    border-radius: 18px; padding: 20px; margin-top: 15px; 
    text-align: left; border: 1px solid var(--glass-border); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.step-label { 
    font-size: 13px; font-weight: 800; color: var(--apple-blue); 
    text-transform: uppercase; margin-bottom: 10px; display: block; 
    letter-spacing: 0.5px;
}
.math-text { 
    font-family: 'Courier New', Courier, monospace; 
    font-size: 16px; line-height: 1.6; color: #1c1c1e; 
    white-space: pre-line; font-weight: 600;
}
sub { font-size: 0.6em; bottom: -0.2em; }

/* 修復化學式與下標的間距問題 */
.equation-display, .math-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    letter-spacing: 0 !important;
}
sub {
    font-family: -apple-system, sans-serif;
    font-size: 0.6em;
    margin-left: 1px; /* 縮小字母與下標的距離 */
    bottom: -0.2em;
}
/* 讓 KaTeX 渲染的化學式與輸入框垂直置中對齊 */
.katex {
    font-size: 1.1em; /* 微調大小以匹配周圍文字 */
}
.equation-display .katex, .math-text .katex {
    margin: 0 4px; /* 與旁邊的加號或輸入框保持優雅間距 */
}

/* =========================================
   修正：表單元素字體繼承與 Placeholder 樣式
   ========================================= */

/* 強制所有輸入框、按鈕使用蘋果系統字體 */
input, button, select, textarea, .ios-input {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
}

/* 針對 Placeholder 進行嚴格字體覆蓋 */
.ios-input::placeholder {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    color: #a1a1a6 !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
}

/* 補回橘色按鈕的顏色 (一鍵平衡專用) */
.warning-btn { 
    background: var(--apple-orange) !important; 
    color: white !important; 
}

/* =========================================
   Solver 專屬：iOS 切換控制列 (Segmented Control)
   ========================================= */
.ios-segment { 
    display: flex; background: rgba(0,0,0,0.08); border-radius: 12px; 
    padding: 4px; margin: 15px 0; border: 1px solid rgba(0,0,0,0.05);
}
.seg-btn { 
    flex: 1; text-align: center; padding: 10px; font-size: 14px; 
    font-weight: 700; color: var(--apple-gray); border-radius: 8px; 
    cursor: pointer; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}
.seg-btn.active { 
    background: white; color: var(--apple-blue); 
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); 
}
.solver-panel { display: none; animation: slideUpFade 0.3s; }
.solver-panel.active { display: block; }
