/* ========================================== */
/* 0. 核心主題變數 (CSS Variables)             */
/* ========================================== */
:root {
    /* 🌞 預設淺色模式 (明亮極光) */
    --bg-base: #F3E8FF;
    --bg-grad-1: rgba(156, 234, 254, 0.9);
    --bg-grad-2: rgba(200, 141, 221, 0.9);
    --bg-grad-3: rgba(182, 223, 255, 0.6);
    --text-main: #1D1D1F;
    --text-muted: #86868B;
    
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(255, 255, 255, 0.6);
    --card-bg: rgba(255, 255, 255, 0.45);
    --card-hover: #FFFFFF;
    --input-bg: rgba(255, 255, 255, 0.8);
    
    --btn-grad-1: #9CEAFE;
    --btn-grad-2: #C88DDD;
    --btn-text: #1D1D1F;
}

/* ========================================== */
/* 🌙 夜間模式：終極雙色極光 (50% 粉藍 / 50% 粉紫) */
/* ========================================== */
[data-theme="dark"] {
    --bg-base: #070B14; 
    --bg-grad-1: rgba(85, 195, 255, 0.25); 
    --bg-grad-2: rgba(200, 141, 221, 0.25); 
    --bg-grad-3: rgba(85, 195, 255, 0.15); 
    
    --text-main: #E0F2FE; 
    --text-muted: #8ba4b5; 
    
    --glass-bg: rgba(10, 15, 25, 0.55);
    --glass-border: rgba(178, 187, 237, 0.3); 
    --card-bg: rgba(15, 20, 30, 0.45);
    --card-hover: rgba(25, 35, 55, 0.7);
    --input-bg: rgba(10, 15, 25, 0.6);
    
    --btn-text: #FFFFFF;
}

/* ------------------------------------------ */
/* 🎯 夜間專屬覆蓋：全局與獨立面板玻璃化 */
/* ------------------------------------------ */

/* 1. 頂部大廳選單標題 (收緊雙色邊緣光暈) */
[data-theme="dark"] .nav-title-glass {
    background-image: linear-gradient(rgba(10, 15, 25, 0.7), rgba(10, 15, 25, 0.4)), linear-gradient(135deg, #55C3FF 0%, #C88DDD 100%) !important; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), -4px 0 12px rgba(85, 195, 255, 0.7), 4px 0 12px rgba(200, 141, 221, 0.7), inset 0 0 6px rgba(255, 255, 255, 0.4) !important; 
    text-shadow: 0 0 4px rgba(178, 187, 237, 0.8); 
    color: #FFFFFF !important;
}

/* 2. 左右小按鈕 (收緊 Hover 光暈) */
[data-theme="dark"] .nav-btn { 
    background: rgba(15, 20, 30, 0.6) !important; 
    color: #E0F2FE !important; 
    border-color: rgba(178, 187, 237, 0.2) !important; 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 0 6px rgba(178, 187, 237, 0.1) !important; 
}
[data-theme="dark"] .nav-btn:hover { 
    background: rgba(25, 35, 55, 0.8) !important; 
    box-shadow: -3px 0 10px rgba(85, 195, 255, 0.6), 3px 0 10px rgba(200, 141, 221, 0.6), inset 0 0 6px rgba(178, 187, 237, 0.2) !important; 
}

/* 3. 首頁大標題 (文字光芒集中) */
[data-theme="dark"] .main-site-title { 
    color: #FFFFFF !important; 
    text-shadow: -2px 0 8px rgba(85, 195, 255, 0.8), 2px 0 8px rgba(200, 141, 221, 0.8); 
}

/* 4. 主選單工具卡片 (移除光害，改為銳利邊框發光) */
[data-theme="dark"] .app-card { 
    border: 1px solid rgba(178, 187, 237, 0.2); 
}
[data-theme="dark"] .app-card:hover { 
    border-color: rgba(178, 187, 237, 0.6); 
    box-shadow: -4px 0 15px rgba(85, 195, 255, 0.4), 4px 0 15px rgba(200, 141, 221, 0.4), inset 0 0 8px rgba(178, 187, 237, 0.15); 
}
[data-theme="dark"] .app-card:focus-visible {
    outline-color: #a994ff;
    border-color: rgba(169, 148, 255, 0.62);
}
[data-theme="dark"] .app-icon { 
    background: linear-gradient(135deg, rgba(85, 195, 255, 0.15) 0%, rgba(200, 141, 221, 0.15) 100%); 
    border-color: rgba(178, 187, 237, 0.3); 
}
[data-theme="dark"] .app-card:hover .app-icon { 
    background: linear-gradient(135deg, rgba(85, 195, 255, 0.4) 0%, rgba(200, 141, 221, 0.4) 100%); 
    box-shadow: -3px 0 10px rgba(85, 195, 255, 0.5), 3px 0 10px rgba(200, 141, 221, 0.5); 
}

/* 5. 全局獨立面板套用夜間科技玻璃 */
[data-theme="dark"] .settings-panel, 
[data-theme="dark"] .instructions-panel, 
[data-theme="dark"] .memo-card, 
[data-theme="dark"] .panel, 
[data-theme="dark"] .detail-box {
    background: linear-gradient(135deg, rgba(20, 25, 35, 0.85) 0%, rgba(10, 15, 25, 0.7) 100%) !important; 
    border: 1px solid rgba(178, 187, 237, 0.2) !important; 
    border-top: 1px solid rgba(85, 195, 255, 0.4) !important; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(85, 195, 255, 0.08) !important; 
    color: #E0F2FE !important;
}

/* 6. 布告欄夜間專屬標題與底線 */
[data-theme="dark"] #tab-home .memo-title { 
    color: #ff6b6b !important; 
    text-shadow: 0 0 8px rgba(255,107,107,0.4); 
}
[data-theme="dark"] .section-title { 
    border-bottom: 1px solid rgba(178, 187, 237, 0.25) !important; 
}

/* 7. 夜間模式：所有隱形文字強制提亮 (精準排除無視卡片與六轉卡片) */
[data-theme="dark"] .stats-text { 
    background: rgba(15, 20, 30, 0.6) !important; 
    border: 1px solid rgba(178, 187, 237, 0.2) !important; 
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.2) !important; 
    color: #E0F2FE !important; 
}

[data-theme="dark"] .stats-text legend, 
[data-theme="dark"] .stats-text span, 
[data-theme="dark"] .stats-text div, 
[data-theme="dark"] .hexa-inputs, 
[data-theme="dark"] .hexa-inputs div, 
[data-theme="dark"] .hexa-inputs span, 
[data-theme="dark"] .panel h3, 
[data-theme="dark"] .detail-box h3, 
[data-theme="dark"] .inv-item label, 
[data-theme="dark"] .prog-header, 
[data-theme="dark"] .checkbox-label, 
[data-theme="dark"] .panel div, 
[data-theme="dark"] .panel span, 
[data-theme="dark"] .panel center, 
[data-theme="dark"] .panel label { 
    color: #E0F2FE; 
}

[data-theme="dark"] .target-divider { 
    background-color: rgba(178, 187, 237, 0.2) !important; 
}

/* ========================================== */
/* 1. 基礎全域設定與導覽 (Global & Layout)       */
/* ========================================== */
html, body { 
    width: 100%; 
    max-width: 100%; 
    overflow-x: hidden; 
}
html { 
    box-sizing: border-box; 
}
*, *:before, *:after { 
    box-sizing: inherit; 
}

button, input, select, label, .btn-action { 
    touch-action: manipulation; 
    font-family: inherit; 
}

.txt-sharp { 
    font-weight: 800 !important; 
    -webkit-text-stroke: 0px transparent !important; 
    -webkit-font-smoothing: antialiased !important; 
    -moz-osx-font-smoothing: grayscale !important; 
    text-shadow: none !important; 
}

body { 
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "PingFang TC", "Microsoft JhengHei", sans-serif;
    background-color: var(--bg-base); 
    background-image: radial-gradient(circle at 15% 40%, var(--bg-grad-1) 0%, transparent 55%), radial-gradient(circle at 85% 60%, var(--bg-grad-2) 0%, transparent 55%), radial-gradient(circle at 50% 10%, var(--bg-grad-3) 0%, transparent 40%);
    background-attachment: fixed; 
    color: var(--text-main); 
    display: flex; 
    justify-content: center; 
    padding: 20px; 
    user-select: none; 
    -webkit-user-select: none; 
    margin: 0; 
    min-height: 100vh; 
    align-items: flex-start;
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale; 
    -webkit-text-size-adjust: 100%; 
    text-size-adjust: 100%;
}

.top-header-section { display: flex; flex-direction: column; align-items: center; width: 100%;  }
.main-site-title { margin: 0 0 15px 0; font-size: 26px; font-weight: 900; color: var(--text-main); text-align: center; }
.top-nav-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0px; width: 100%; margin-bottom: 20px; }
.left-side { justify-self: end; }
.right-side { justify-self: start; }
.home-hide { display: none !important; }

/* 🌟 導航列按鈕與返回切換修復 */
.nav-btn {
    background: rgba(255, 255, 255, 0.6) !important; 
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important; 
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 18px !important; 
    border-radius: 20px !important; 
    font-size: 14px; 
    font-weight: bold; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    margin: 0; 
    white-space: nowrap; 
    color: #2c3e50 !important; 
    cursor: pointer; 
    transition: all 0.3s ease; 
}
.nav-btn:hover { 
    background: rgba(255, 255, 255, 0.95) !important; 
    transform: translateY(-2px); 
    box-shadow: 0 6px 16px rgba(85, 195, 255, 0.3) !important; 
}

/* 修正：主選單按鈕點擊後瞬間隱藏，不延遲 */
.nav-btn[style*="visibility: hidden"], 
.nav-btn[style*="opacity: 0"], 
.nav-btn[style*="display: none"], 
.home-hide { 
    transition: none !important; 
}

.nav-title-glass {
    padding: 8px 24px !important; 
    font-size: 15px; 
    font-weight: 900; 
    color: #2c3e50 !important;
    border-radius: 20px !important; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin: 0 10px; 
    white-space: nowrap; 
    cursor: default; 
    border: 2px solid transparent !important;
    background-image: linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.3)), linear-gradient(135deg, #55C3FF 0%, #C88DDD 100%) !important;        
    background-origin: border-box !important; 
    background-clip: padding-box, border-box !important;
    backdrop-filter: blur(16px); 
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 0 15px rgba(85, 195, 255, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.9) !important;  
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8); 
}

/* 🌟 日夜切換按鈕 (滑動膠囊 - 100% 絕對置中版) */
.theme-toggle {
    position: relative; display: flex; align-items: center; justify-content: space-between;
    width: 72px; height: 34px; padding: 0 2px; border-radius: 34px; box-sizing: border-box; cursor: pointer; border: none; outline: none;
    background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: inset 0 2px 5px rgba(0,0,0,0.05), 0 4px 10px rgba(0,0,0,0.05);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); margin: 0;
}
.theme-toggle::before {
    content: ""; position: absolute; top: 2px; left: 2px; width: 32px; height: 28px; border-radius: 28px;
    background: linear-gradient(135deg, var(--btn-grad-1), var(--btn-grad-2)); box-shadow: 0 2px 6px rgba(200, 141, 221, 0.4);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); z-index: 1;
}
.theme-toggle .icon-sun, .theme-toggle .icon-moon { 
    position: relative; z-index: 2; font-size: 15px; width: 32px; height: 100%; display: flex; justify-content: center; align-items: center; transition: all 0.4s ease; 
}
.theme-toggle .icon-sun { opacity: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2)); transform: scale(1.05); }
.theme-toggle .icon-moon { opacity: 0.4; filter: grayscale(1); transform: scale(0.9); }

/* --- 🌙 夜間模式切換 --- */
[data-theme="dark"] .theme-toggle {
    background: rgba(10, 15, 25, 0.6);
    border: 1px solid rgba(178, 187, 237, 0.3);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5), 0 4px 15px rgba(0,0,0,0.4);
}
[data-theme="dark"] .theme-toggle::before {
    transform: translateX(34px); 
    background: rgba(85, 195, 255, 0.15); 
    border: 1px solid rgba(85, 195, 255, 0.4); 
    box-shadow: inset 0 0 8px rgba(85, 195, 255, 0.2), 0 0 10px rgba(85, 195, 255, 0.3); 
}
[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 0.3;
    filter: grayscale(1);
    transform: scale(0.9);
}
[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(85, 195, 255, 0.8)); 
    transform: scale(1.05);
}
.theme-toggle:hover { 
    transform: translateY(-2px); 
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05), 0 6px 15px rgba(200, 141, 221, 0.2); 
}
[data-theme="dark"] .theme-toggle:hover {
    border-color: rgba(85, 195, 255, 0.6); 
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5), 0 6px 16px rgba(85, 195, 255, 0.2); 
}

/* ========================================== */
/* 🌟 日間模式：清除/重置按鈕 (科技霓虹紅)     */
/* ========================================== */
.btn-reset-tr, .action-btn.clear-btn { 
    width: 100%; 
    padding: 14px; 
    font-size: 17px; 
    font-weight: bold; 
    border-radius: 12px; 
    cursor: pointer; 
    transition: all 0.2s; 
    background: rgba(255, 59, 48, 0.08) !important; 
    backdrop-filter: blur(8px); 
    -webkit-backdrop-filter: blur(8px); 
    border: 1px solid rgba(255, 59, 48, 0.2) !important; 
    color: #FF3B30 !important; 
}
.btn-reset-tr:hover, .action-btn.clear-btn:hover { 
    background: rgba(255, 59, 48, 0.15) !important; 
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.15); 
    transform: translateY(-2px); 
}

/* ========================================== */
/* 🌙 夜間模式：清除/重置按鈕 (科技霓虹紅)     */
/* ========================================== */
[data-theme="dark"] .btn-reset-tr,
[data-theme="dark"] .action-btn.clear-btn {
    background: rgba(255, 75, 114, 0.1) !important; 
    border: 1px solid rgba(255, 75, 114, 0.4) !important;
    color: #FF6B8B !important; 
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5) !important;
    transition: all 0.3s ease !important;
}
[data-theme="dark"] .btn-reset-tr:hover, 
[data-theme="dark"] .btn-reset-tr:focus,
[data-theme="dark"] .action-btn.clear-btn:hover,
[data-theme="dark"] .action-btn.clear-btn:focus {
    background: rgba(255, 75, 114, 0.2) !important;
    border-color: rgba(255, 75, 114, 0.8) !important;
    box-shadow: 0 0 10px rgba(255, 75, 114, 0.3), inset 0 2px 6px rgba(0,0,0,0.6) !important;
    transform: translateY(-1px) !important;
    color: #FFFFFF !important; 
}

/* 全局容器與卡片 */
.container { 
    background: transparent !important; border: none !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    padding: 10px 20px; max-width: 1000px; width: 100%; display: flex; flex-wrap: wrap;  align-content: flex-start; transition: max-width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); margin: 3vh auto 20px auto;
}
.container:has(#tab-transcend.active), .container:has(#tab-craft.active), .container:has(#tab-hexa-visual.active), .container:has(#tab-ignore.active), .container:has(#tab-acc-enhance.active) { max-width: 900px; }

h1 { width: 100%; text-align: center; color: var(--text-main); margin-bottom: 5px; font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.hint { width: 100%; font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 0px; font-weight: 500; }

.container:has(#tab-home.active) .tab-menu { display: none; }
.tab-menu { width: 100%; display: flex; justify-content: center; background: transparent; border: none; padding: 0; margin-bottom: 20px; box-shadow: none; }
.tab-menu button { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); padding: 12px 30px; font-size: 16px; font-weight: bold; color: var(--text-main); border-radius: 30px; cursor: pointer; transition: all 0.3s; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.tab-menu button:hover { background: var(--card-hover); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); }

.tab-content { display: none; width: 100%; flex-wrap: wrap; gap: 16px; align-items: flex-start;}
.tab-content.active { display: flex; animation: appleFadeIn 0.4s ease; }
#tab-emb-enhance { gap: 0; }
@keyframes appleFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; width: 100%; margin-top: 10px; }
.app-card { width: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: var(--card-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 18px; padding: 16px 20px; display: flex; align-items: center; gap: 16px; color: var(--text-main); font: inherit; text-align: left; cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.app-card:hover { background: var(--card-hover); transform: translateY(-4px); border-color: rgba(200, 141, 221, 0.8); box-shadow: -8px 0 25px rgba(85, 195, 255, 0.6), 8px 0 25px rgba(200, 141, 221, 0.6), 0 8px 15px rgba(0, 0, 0, 0.05), inset 0 0 15px rgba(255, 255, 255, 0.9); }
.app-card:active { transform: translateY(-1px) scale(0.98); }
.app-card:focus-visible { outline: 2px solid #7657dc; outline-offset: 3px; border-color: rgba(118, 87, 220, 0.65); }
.app-card-highlight { background: rgba(200, 141, 221, 0.05); border-color: rgba(200, 141, 221, 0.2); }
.app-card-highlight:hover { border-color: rgba(200, 141, 221, 0.6); }
.app-card-notice { grid-column: 1 / -1; }
.app-card { position: relative; }
.app-card-has-badge { padding-right: 96px; }

.app-status-badge {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 22px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.055em;
    box-shadow: 0 5px 12px rgba(57, 43, 110, 0.16);
    pointer-events: none;
}
.app-status-badge-new {
    background: linear-gradient(135deg, #3abbd8, #7b5de8);
}
.app-status-badge-update {
    background: linear-gradient(135deg, #ef8e4b, #e86782);
}
.app-status-badge-unread::before {
    content: "";
    width: 5px;
    height: 5px;
    margin-right: 5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 7px rgba(255, 255, 255, 0.9);
}
.app-status-badge[hidden] { display: none !important; }

[data-theme="dark"] .app-status-badge {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.36);
}

.home-menu-category {
    --category-accent: #7c5ce7;
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
    margin: 8px 3px -3px;
    color: var(--text-main);
}
.home-menu-category::before {
    content: "";
    width: 5px;
    height: 16px;
    flex: 0 0 5px;
    border-radius: 999px;
    background: var(--category-accent);
    box-shadow: 0 0 10px rgba(124, 92, 231, 0.22);
}
.home-menu-category::after {
    content: "";
    height: 1px;
    flex: 1;
    margin-left: 3px;
    background: linear-gradient(90deg, rgba(124, 92, 231, 0.2), transparent);
}
.home-menu-category > span {
    font-size: 14px;
    font-weight: 750;
    letter-spacing: 0.02em;
}
.home-menu-category > small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(124, 92, 231, 0.1);
    color: var(--category-accent);
    font-size: 9px;
    font-weight: 750;
}
.home-menu-category-simulator { --category-accent: #159fbd; }
.home-menu-category-calculator { --category-accent: #7c5ce7; }
.home-menu-category-hexa { --category-accent: #497ce8; }

[data-theme="dark"] .home-menu-category > small {
    background: rgba(169, 148, 255, 0.11);
}
[data-theme="dark"] .home-menu-category::after {
    background: linear-gradient(90deg, rgba(178, 187, 237, 0.2), transparent);
}

.app-icon { font-size: 26px; width: 46px; height: 46px; background: linear-gradient(135deg, rgba(85, 195, 255, 0.3), rgba(200, 141, 221, 0.3)); border: 1px solid rgba(200, 141, 221, 0.2); border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.3s; overflow: hidden; }
.app-card:hover .app-icon { background: linear-gradient(135deg, rgba(85, 195, 255, 0.6), rgba(200, 141, 221, 0.6)); transform: scale(1.05); }
.app-info { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.app-title { display: block; margin: 0; font-size: 15.5px; font-weight: 600; color: var(--text-main); letter-spacing: -0.2px; }
.app-info p { margin: 0; font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-custom-img { width: 100%; height: 100%; object-fit: contain; display: block; }

.section-title { font-weight: 700; color: var(--text-main); margin-bottom: 15px; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 6px; width: 100%; font-size: 17px; }
.panel, .detail-box { background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); padding: 18px; border-radius: 16px; width: 100%; box-shadow: 0 4px 20px rgba(0,0,0,0.03); color: var(--text-main); box-sizing: border-box; min-width: 0; overflow-x: auto; }
.left-panel { flex: 2; min-width: 300px; }
.right-panel { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 15px; }
.grid-container { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; }

/* ========================================== */
/* 🎯 全局輸入框與焦點光暈 (極簡純淨版)         */
/* ========================================== */
.input-group label { font-size: 14px; color: var(--text-main); font-weight: 500; }
.input-group input, .setting-row input[type="text"], .setting-row input[type="number"], .setting-row select, .hexa-inputs input, .inv-grid input { 
    user-select: auto; -webkit-user-select: auto; border-radius: 8px; font-size: 14px; text-align: center; font-weight: 600; 
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important; outline: none !important;
}

/* 🌞 日間全域輸入格基礎 */
:not([data-theme="dark"]) .input-group input, :not([data-theme="dark"]) .setting-row input[type="text"], :not([data-theme="dark"]) .setting-row input[type="number"], :not([data-theme="dark"]) .setting-row select, :not([data-theme="dark"]) .hexa-inputs input, :not([data-theme="dark"]) .inv-grid input {
    background: #FFFFFF !important; border: 1px solid rgba(0, 0, 0, 0.12) !important; color: #0071E3 !important; box-shadow: inset 0 2px 4px rgba(0,0,0,0.04) !important;
}

/* 🌙 夜間全域輸入格基礎 */
[data-theme="dark"] .input-group input, 
[data-theme="dark"] .setting-row input[type="text"], 
[data-theme="dark"] .setting-row input[type="number"], 
[data-theme="dark"] .setting-row select, 
[data-theme="dark"] .hexa-inputs input, 
[data-theme="dark"] .inv-grid input {
    background: rgba(10, 12, 20, 0.95) !important; 
    border: 1px solid rgba(85, 195, 255, 0.4) !important; 
    color: #55C3FF !important; 
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.6) !important;
}

/* 🌞 日間全域輸入格 Focus (柔和空氣光暈) */
:not([data-theme="dark"]) input:focus, :not([data-theme="dark"]) select:focus {
    background: #FFFFFF !important; border-color: rgba(200, 141, 221, 0.7) !important; box-shadow: 0 0 8px rgba(200, 141, 221, 0.35), inset 0 1px 3px rgba(0,0,0,0.02) !important; transform: translateY(-1px) !important;
}

/* 🌙 夜間全域輸入格 Focus (純淨科技藍光暈) */
[data-theme="dark"] input:focus, 
[data-theme="dark"] select:focus {
    background: rgba(10, 12, 20, 0.95) !important; 
    border-color: rgba(85, 195, 255, 0.8) !important; 
    box-shadow: 0 0 10px rgba(85, 195, 255, 0.4), inset 0 2px 6px rgba(0,0,0,0.6) !important; 
    transform: translateY(-1px) !important;
}

/* 按鈕樣式 */
.btn-group { display: flex; gap: 10px; margin-top: 10px; width: 100%; }
.action-btn { background: linear-gradient(135deg, var(--btn-grad-1), var(--btn-grad-2)); color: var(--btn-text); border: none; padding: 12px; font-size: 15px; font-weight: 700; border-radius: 10px; transition: all 0.2s; flex: 1; cursor: pointer; box-shadow: 0 4px 12px rgba(200, 141, 221, 0.2); }
.action-btn:hover { filter: brightness(1.05); transform: scale(1.01); box-shadow: 0 6px 16px rgba(200, 141, 221, 0.4); }
.action-btn:active { transform: scale(0.99); }
.clear-btn { background: #E5E5EA; color: #1D1D1F; flex: 0.2; min-width: 80px; box-shadow: none;}
.clear-btn:hover { background: #D1D1D6; transform: scale(1.01); box-shadow: none; filter: none;}
.error-msg { font-size: 14px; color: var(--text-main); line-height: 1.6; font-weight: 600; text-align: center; }

/* 主選單：資料備份與還原 */
#tab-home .data-backup-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px 22px;
    width: 100%;
    padding: 18px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    background: var(--glass-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#tab-home .data-backup-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

#tab-home .data-backup-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(124, 92, 231, 0.15);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(85, 195, 255, 0.18), rgba(200, 141, 221, 0.2));
    color: #6c50d4;
    font-size: 20px;
    font-weight: 750;
    overflow: hidden;
}

#tab-home .data-backup-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#tab-home .data-backup-heading h2 {
    margin: 0 0 4px;
    color: var(--text-main);
    font-size: 15px;
}

#tab-home .data-backup-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.5;
}

#tab-home .data-backup-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#tab-home .data-backup-btn {
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid rgba(124, 92, 231, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.48);
    color: var(--text-main);
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#tab-home .data-backup-btn:hover {
    border-color: rgba(124, 92, 231, 0.38);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 5px 13px rgba(92, 76, 168, 0.1);
    transform: translateY(-1px);
}

#tab-home .data-backup-btn:active {
    transform: translateY(0) scale(0.98);
}

#tab-home .data-backup-export {
    border-color: transparent;
    background: linear-gradient(135deg, #55c3ff, #9c72e8);
    color: #fff;
}

#tab-home .data-backup-export:hover {
    border-color: transparent;
    background: linear-gradient(135deg, #48b9f6, #8e63df);
}

#tab-home .data-backup-clear {
    border-color: rgba(225, 63, 74, 0.24);
    background: rgba(225, 63, 74, 0.07);
    color: #c93442;
}

#tab-home .data-backup-clear:hover {
    border-color: rgba(225, 63, 74, 0.4);
    background: rgba(225, 63, 74, 0.12);
}

#tab-home .data-backup-status {
    display: none;
    grid-column: 1 / -1;
    margin: -2px 0 0 54px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.45;
}

#tab-home .data-backup-status:not(:empty) {
    display: block;
}

#tab-home .data-backup-status[data-state="success"] {
    color: #16875f;
}

#tab-home .data-backup-status[data-state="error"] {
    color: #d73745;
}

[data-theme="dark"] #tab-home .data-backup-panel {
    border-color: rgba(178, 187, 237, 0.2);
    border-top-color: rgba(85, 195, 255, 0.4);
    background: linear-gradient(135deg, rgba(20, 25, 35, 0.85), rgba(10, 15, 25, 0.7));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), inset 0 0 20px rgba(85, 195, 255, 0.05);
}

[data-theme="dark"] #tab-home .data-backup-icon {
    border-color: rgba(178, 187, 237, 0.22);
    background: linear-gradient(135deg, rgba(85, 195, 255, 0.13), rgba(200, 141, 221, 0.14));
    color: #a994ff;
}

[data-theme="dark"] #tab-home .data-backup-btn {
    border-color: rgba(178, 187, 237, 0.22);
    background: rgba(17, 24, 39, 0.55);
}

[data-theme="dark"] #tab-home .data-backup-btn:hover {
    border-color: rgba(169, 148, 255, 0.42);
    background: rgba(28, 38, 57, 0.75);
}

[data-theme="dark"] #tab-home .data-backup-export {
    border-color: transparent;
    background: linear-gradient(135deg, #378ec9, #7557ce);
}

[data-theme="dark"] #tab-home .data-backup-clear {
    border-color: rgba(255, 107, 107, 0.28);
    background: rgba(210, 52, 64, 0.11);
    color: #ff858d;
}

@media (max-width: 600px) {
    #tab-home .data-backup-panel {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
        border-radius: 14px;
    }

    #tab-home .data-backup-icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 18px;
    }

    #tab-home .data-backup-heading h2 {
        font-size: 13.5px;
    }

    #tab-home .data-backup-heading p {
        font-size: 10.5px;
    }

    #tab-home .data-backup-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    #tab-home .data-backup-btn {
        width: 100%;
        min-height: 40px;
        padding: 8px 6px;
        font-size: 11px;
    }

    #tab-home .data-backup-clear {
        grid-column: 1 / -1;
    }

    #tab-home .data-backup-status {
        margin: -2px 0 0;
        font-size: 10px;
        text-align: center;
    }
}

@media (max-width: 350px) {
    #tab-home .data-backup-actions {
        grid-template-columns: 1fr;
    }

    #tab-home .data-backup-clear {
        grid-column: auto;
    }
}

/* 手機版：返回頁面頂部 */
.mobile-back-to-top {
    display: none;
}

@media (max-width: 768px) {
    .mobile-back-to-top {
        position: fixed;
        right: max(14px, env(safe-area-inset-right, 0px));
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        z-index: 1500;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid rgba(124, 92, 231, 0.25);
        border-radius: 15px;
        background: rgba(255, 255, 255, 0.78);
        color: #684bd1;
        box-shadow: 0 8px 22px rgba(72, 55, 135, 0.2), inset 0 1px 5px rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px) scale(0.92);
        pointer-events: none;
        cursor: pointer;
        transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
    }

    .mobile-back-to-top.is-visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .mobile-back-to-top:active {
        transform: translateY(1px) scale(0.95);
    }

    .mobile-back-to-top:focus-visible {
        outline: 2px solid #7657dc;
        outline-offset: 3px;
    }

    .mobile-back-to-top span {
        display: block;
        margin-top: -2px;
        font-size: 23px;
        font-weight: 650;
        line-height: 1;
    }

    [data-theme="dark"] .mobile-back-to-top {
        border-color: rgba(169, 148, 255, 0.36);
        background: rgba(18, 25, 40, 0.82);
        color: #b6a4ff;
        box-shadow: 0 9px 24px rgba(0, 0, 0, 0.48), inset 0 1px 6px rgba(85, 195, 255, 0.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-back-to-top {
        transition: none;
    }
}

/* 🌟 DISCORD 布告欄修復 */
#tab-home .memo-card { width: 100% !important; max-width: none !important; box-sizing: border-box !important; padding: 25px !important; background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--glass-border); border-radius: 16px; }
#tab-home .memo-content { display: flex; align-items: center; gap: 50px; }
#tab-home .memo-media { display: block; width: 300px; flex: 0 0 300px; }
#tab-home .memo-apng { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
#tab-home .memo-text-area { color: var(--text-main); font-size: 13px; line-height: 1.6; font-weight: bold; }
#tab-home .memo-title { font-size: 16px; font-weight: 900; color: #E42123; margin-bottom: 8px; transition: color 0.3s;}
#tab-home .memo-text-area p { margin: 0 0 6px 0; }
#tab-home .memo-simple-text { margin-top: 5px !important; }

/* ========================================== */
/* 2. 無視防禦計算機 (全玻璃化與連動發光升級)    */
/* ========================================== */
#equip-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.equip-section { margin-bottom: 20px; }
.equip-section-title { font-size: 15px; font-weight: bold; margin-bottom: 10px; padding-left: 8px; border-left: 4px solid; }

.equip-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.card-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.card-input-wrapper { display: flex; align-items: center; gap: 5px; background: transparent !important; border: none !important; box-shadow: none !important; width: 100%; box-sizing: border-box; margin-top: 4px;}
.card-input-wrapper input { flex: 1; width: 100%; min-width: 0; text-align: center; font-size: 16px; font-weight: bold; outline: none; border-radius: 6px; padding: 4px; transition: all 0.3s ease; }

/* iOS 小數鍵盤沒有負號，以獨立按鈕切換正負值。 */
#equip-grid .bg-armor { --ignore-sign-rgb: 0, 122, 255; --ignore-sign-color: #007AFF; }
#equip-grid .bg-weapon { --ignore-sign-rgb: 255, 59, 48; --ignore-sign-color: #FF3B30; }
#equip-grid .bg-acc { --ignore-sign-rgb: 175, 82, 222; --ignore-sign-color: #AF52DE; }
#equip-grid .bg-ability { --ignore-sign-rgb: 52, 199, 89; --ignore-sign-color: #34C759; }
#equip-grid .bg-special { --ignore-sign-rgb: 255, 149, 0; --ignore-sign-color: #FF9500; }
#equip-grid .bg-reserve { --ignore-sign-rgb: 100, 116, 139; --ignore-sign-color: #64748b; }
.ignore-sign-toggle {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(var(--ignore-sign-rgb), 0.35);
    border-radius: 6px;
    background: rgba(var(--ignore-sign-rgb), 0.08);
    color: var(--ignore-sign-color);
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.ignore-sign-toggle:hover { background: rgba(var(--ignore-sign-rgb), 0.15); border-color: rgba(var(--ignore-sign-rgb), 0.55); }
.ignore-sign-toggle:active { transform: scale(0.94); }
.ignore-sign-toggle:focus-visible { outline: 2px solid rgba(var(--ignore-sign-rgb), 0.55); outline-offset: 2px; }
.ignore-sign-toggle.is-negative { background: rgba(255, 59, 48, 0.14); border-color: rgba(255, 59, 48, 0.55); color: #d62f27; }
[data-theme="dark"] #equip-grid .bg-armor { --ignore-sign-color: #66b3ff; }
[data-theme="dark"] #equip-grid .bg-weapon { --ignore-sign-color: #ff8080; }
[data-theme="dark"] #equip-grid .bg-acc { --ignore-sign-color: #d896ff; }
[data-theme="dark"] #equip-grid .bg-ability { --ignore-sign-color: #80ff99; }
[data-theme="dark"] #equip-grid .bg-special { --ignore-sign-color: #ffcc80; }
[data-theme="dark"] #equip-grid .bg-reserve { --ignore-sign-rgb: 184, 196, 212; --ignore-sign-color: #b8c4d4; }
[data-theme="dark"] .ignore-sign-toggle { background: rgba(var(--ignore-sign-rgb), 0.12); border-color: rgba(var(--ignore-sign-rgb), 0.42); }
[data-theme="dark"] .ignore-sign-toggle.is-negative { background: rgba(255, 107, 107, 0.18); border-color: rgba(255, 107, 107, 0.6); color: #ff8585; }

/* 🌟 卡片本體玻璃化 */
.equip-card { border-radius: 12px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; transition: all 0.3s ease !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-style: solid; border-width: 1.5px; }

/* 裝備卡片底色 (日間微透淡色) */
#equip-grid .bg-armor { background: rgba(0, 122, 255, 0.06) !important; border-color: rgba(0, 122, 255, 0.2) !important; }
#equip-grid .bg-weapon { background: rgba(255, 59, 48, 0.06) !important; border-color: rgba(255, 59, 48, 0.2) !important; }
#equip-grid .bg-acc { background: rgba(175, 82, 222, 0.06) !important; border-color: rgba(175, 82, 222, 0.2) !important; }
#equip-grid .bg-ability { background: rgba(52, 199, 89, 0.06) !important; border-color: rgba(52, 199, 89, 0.2) !important; }
#equip-grid .bg-special { background: rgba(255, 149, 0, 0.06) !important; border-color: rgba(255, 149, 0, 0.2) !important; }

/* 裝備卡片底色 (夜間深色) */
[data-theme="dark"] #equip-grid .bg-armor { background: rgba(0, 122, 255, 0.12) !important; border-color: rgba(0, 122, 255, 0.6) !important; }
[data-theme="dark"] #equip-grid .bg-weapon { background: rgba(255, 59, 48, 0.12) !important; border-color: rgba(255, 59, 48, 0.6) !important; }
[data-theme="dark"] #equip-grid .bg-acc { background: rgba(175, 82, 222, 0.12) !important; border-color: rgba(175, 82, 222, 0.6) !important; }
[data-theme="dark"] #equip-grid .bg-ability { background: rgba(52, 199, 89, 0.12) !important; border-color: rgba(52, 199, 89, 0.6) !important; }
[data-theme="dark"] #equip-grid .bg-special { background: rgba(255, 149, 0, 0.12) !important; border-color: rgba(255, 149, 0, 0.6) !important; }

/* 標題與 % 符號回歸原本的文字顏色 */
#equip-grid .card-title { color: var(--text-main) !important; }
[data-theme="dark"] #equip-grid .card-title { color: var(--text-main) !important; text-shadow: none !important; }

/* 裝備輸入框內部數字色彩 (日/夜) */
:not([data-theme="dark"]) #equip-grid .bg-armor .card-input-wrapper input { color: #007AFF !important; }
:not([data-theme="dark"]) #equip-grid .bg-weapon .card-input-wrapper input { color: #FF3B30 !important; }
:not([data-theme="dark"]) #equip-grid .bg-acc .card-input-wrapper input { color: #AF52DE !important; }
:not([data-theme="dark"]) #equip-grid .bg-ability .card-input-wrapper input { color: #34C759 !important; }
:not([data-theme="dark"]) #equip-grid .bg-special .card-input-wrapper input { color: #FF9500 !important; }

[data-theme="dark"] #equip-grid .bg-armor .card-input-wrapper input { color: #66b3ff !important; }
[data-theme="dark"] #equip-grid .bg-weapon .card-input-wrapper input { color: #ff8080 !important; }
[data-theme="dark"] #equip-grid .bg-acc .card-input-wrapper input { color: #d896ff !important; }
[data-theme="dark"] #equip-grid .bg-ability .card-input-wrapper input { color: #80ff99 !important; }
[data-theme="dark"] #equip-grid .bg-special .card-input-wrapper input { color: #ffcc80 !important; }

/* 裝備輸入框基礎 (加入各色淡邊框與專屬底色) */
:not([data-theme="dark"]) #equip-grid .card-input-wrapper input { background: #FFFFFF !important; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05) !important; }
[data-theme="dark"] #equip-grid .card-input-wrapper input { background: rgba(0, 0, 0, 0.5) !important; border: 1px solid rgba(255, 255, 255, 0.15) !important; box-shadow: inset 0 2px 6px rgba(0,0,0,0.6) !important; }

/* 日間裝備輸入框邊框色彩 */
:not([data-theme="dark"]) #equip-grid .bg-armor .card-input-wrapper input { border: 1px solid rgba(0, 122, 255, 0.3) !important; }
:not([data-theme="dark"]) #equip-grid .bg-weapon .card-input-wrapper input { border: 1px solid rgba(255, 59, 48, 0.3) !important; }
:not([data-theme="dark"]) #equip-grid .bg-acc .card-input-wrapper input { border: 1px solid rgba(175, 82, 222, 0.3) !important; }
:not([data-theme="dark"]) #equip-grid .bg-ability .card-input-wrapper input { border: 1px solid rgba(52, 199, 89, 0.3) !important; }
:not([data-theme="dark"]) #equip-grid .bg-special .card-input-wrapper input { border: 1px solid rgba(255, 149, 0, 0.3) !important; }

/* 裝備卡片 Hover 發光聯動 */
.bg-armor:hover { box-shadow: 0 4px 15px rgba(0, 122, 255, 0.25) !important; border-color: rgba(0, 122, 255, 0.5) !important; }
.bg-armor:focus-within { box-shadow: 0 0 15px rgba(0, 122, 255, 0.5), inset 0 0 10px rgba(0, 122, 255, 0.1) !important; border-color: #007AFF !important; transform: translateY(-2px); }
.bg-weapon:hover { box-shadow: 0 4px 15px rgba(255, 59, 48, 0.25) !important; border-color: rgba(255, 59, 48, 0.5) !important; }
.bg-weapon:focus-within { box-shadow: 0 0 15px rgba(255, 59, 48, 0.5), inset 0 0 10px rgba(255, 59, 48, 0.1) !important; border-color: #FF3B30 !important; transform: translateY(-2px); }
.bg-acc:hover { box-shadow: 0 4px 15px rgba(175, 82, 222, 0.25) !important; border-color: rgba(175, 82, 222, 0.5) !important; }
.bg-acc:focus-within { box-shadow: 0 0 15px rgba(175, 82, 222, 0.5), inset 0 0 10px rgba(175, 82, 222, 0.1) !important; border-color: #AF52DE !important; transform: translateY(-2px); }
.bg-ability:hover { box-shadow: 0 4px 15px rgba(52, 199, 89, 0.25) !important; border-color: rgba(52, 199, 89, 0.5) !important; }
.bg-ability:focus-within { box-shadow: 0 0 15px rgba(52, 199, 89, 0.5), inset 0 0 10px rgba(52, 199, 89, 0.1) !important; border-color: #34C759 !important; transform: translateY(-2px); }
.bg-special:hover { box-shadow: 0 4px 15px rgba(255, 149, 0, 0.25) !important; border-color: rgba(255, 149, 0, 0.5) !important; }
.bg-special:focus-within { box-shadow: 0 0 15px rgba(255, 149, 0, 0.5), inset 0 0 10px rgba(255, 149, 0, 0.1) !important; border-color: #FF9500 !important; transform: translateY(-2px); }

/* 日間裝備輸入框 Focus (5色柔和空氣光暈) */
:not([data-theme="dark"]) #equip-grid .bg-armor .card-input-wrapper input:focus { border-color: rgba(0, 122, 255, 0.6) !important; box-shadow: 0 0 8px rgba(0, 122, 255, 0.35), inset 0 1px 3px rgba(0,0,0,0.02) !important; }
:not([data-theme="dark"]) #equip-grid .bg-weapon .card-input-wrapper input:focus { border-color: rgba(255, 59, 48, 0.6) !important; box-shadow: 0 0 8px rgba(255, 59, 48, 0.35), inset 0 1px 3px rgba(0,0,0,0.02) !important; }
:not([data-theme="dark"]) #equip-grid .bg-acc .card-input-wrapper input:focus { border-color: rgba(175, 82, 222, 0.6) !important; box-shadow: 0 0 8px rgba(175, 82, 222, 0.35), inset 0 1px 3px rgba(0,0,0,0.02) !important; }
:not([data-theme="dark"]) #equip-grid .bg-ability .card-input-wrapper input:focus { border-color: rgba(52, 199, 89, 0.6) !important; box-shadow: 0 0 8px rgba(52, 199, 89, 0.35), inset 0 1px 3px rgba(0,0,0,0.02) !important; }
:not([data-theme="dark"]) #equip-grid .bg-special .card-input-wrapper input:focus { border-color: rgba(255, 149, 0, 0.6) !important; box-shadow: 0 0 8px rgba(255, 149, 0, 0.35), inset 0 1px 3px rgba(0,0,0,0.02) !important; }

/* 預留格：冷灰色分類，活動維持橘色。 */
#equip-grid .bg-reserve {
    --reserve-rgb: 100, 116, 139;
    --reserve-text: #64748b;
    background: rgba(var(--reserve-rgb), 0.06) !important;
    border-color: rgba(var(--reserve-rgb), 0.22) !important;
}
[data-theme="dark"] #equip-grid .bg-reserve {
    --reserve-rgb: 184, 196, 212;
    --reserve-text: #b8c4d4;
    background: rgba(var(--reserve-rgb), 0.12) !important;
    border-color: rgba(var(--reserve-rgb), 0.45) !important;
}
#equip-grid .bg-reserve .card-input-wrapper input {
    color: var(--reserve-text) !important;
    border: 1px solid rgba(var(--reserve-rgb), 0.3) !important;
}
#equip-grid .bg-reserve:hover {
    box-shadow: 0 4px 15px rgba(var(--reserve-rgb), 0.2) !important;
    border-color: rgba(var(--reserve-rgb), 0.5) !important;
}
#equip-grid .bg-reserve:focus-within {
    box-shadow: 0 0 15px rgba(var(--reserve-rgb), 0.35), inset 0 0 10px rgba(var(--reserve-rgb), 0.08) !important;
    border-color: var(--reserve-text) !important;
    transform: translateY(-2px);
}
#equip-grid .bg-reserve .card-input-wrapper input:focus {
    border-color: rgba(var(--reserve-rgb), 0.6) !important;
    box-shadow: 0 0 8px rgba(var(--reserve-rgb), 0.25), inset 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

/* 🌟 右側套組選擇區玻璃化 */
.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-label { background: rgba(255, 255, 255, 0.5) !important; border: 1px solid rgba(255, 255, 255, 0.8) !important; border-radius: 8px; padding: 10px 5px; text-align: center; font-size: 14px; color: var(--text-muted) !important; cursor: pointer; transition: all 0.2s ease; user-select: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 4px 10px rgba(0,0,0,0.02) !important; }
.radio-label:hover { background: rgba(255, 255, 255, 0.8) !important; }
.radio-label input[type="radio"] { display: none; }
.panel-absolab .section-title { color: #007AFF; }
.absolab-group .radio-label:has(input:checked) { background: rgba(0, 122, 255, 0.1) !important; border-color: rgba(0, 122, 255, 0.4) !important; color: #007AFF !important; box-shadow: 0 4px 12px rgba(0, 122, 255, 0.15), inset 0 0 8px rgba(255,255,255,0.8) !important; text-shadow: 0 1px 2px rgba(255,255,255,0.8); font-weight: bold; }
.panel-arcane .section-title { color: #AF52DE; }
.arcane-group .radio-label:has(input:checked) { background: rgba(175, 82, 222, 0.1) !important; border-color: rgba(175, 82, 222, 0.4) !important; color: #AF52DE !important; box-shadow: 0 4px 12px rgba(175, 82, 222, 0.15), inset 0 0 8px rgba(255,255,255,0.8) !important; text-shadow: 0 1px 2px rgba(255,255,255,0.8); font-weight: bold; }

/* 🌟 右側套組選擇區 (夜間修復：去除模糊與灰白) */
[data-theme="dark"] .radio-label { background: rgba(0, 0, 0, 0.3) !important; border: 1px solid rgba(255, 255, 255, 0.2) !important; color: #E0F2FE !important; box-shadow: none !important; }
[data-theme="dark"] .radio-label:hover { background: rgba(255, 255, 255, 0.1) !important; }
[data-theme="dark"] .absolab-group .radio-label:has(input:checked) { background: rgba(0, 122, 255, 0.15) !important; border: 1.5px solid #66b3ff !important; box-shadow: none !important; }
[data-theme="dark"] .arcane-group .radio-label:has(input:checked) { background: rgba(175, 82, 222, 0.15) !important; border: 1.5px solid #d896ff !important; box-shadow: none !important; }
.absolab-group .radio-label:has(input:checked), .arcane-group .radio-label:has(input:checked),
[data-theme="dark"] .absolab-group .radio-label:has(input:checked), [data-theme="dark"] .arcane-group .radio-label:has(input:checked) { text-shadow: none !important; }

/* 🌟 總結果面板與清除按鈕 */
.result-gradient { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: bold; border-radius: 12px; margin: 0; background: rgba(255, 255, 255, 0.6) !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(0, 113, 227, 0.3) !important; color: #0071E3 !important; box-shadow: 0 8px 24px rgba(0, 113, 227, 0.08), inset 0 0 15px rgba(255, 255, 255, 0.9) !important; }
[data-theme="dark"] .result-gradient { background: rgba(0, 0, 0, 0.4) !important; border: 1px solid rgba(85, 195, 255, 0.4) !important; color: #55C3FF !important; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important; }
.btn-clear { width: 100%; padding: 14px; font-size: 17px; font-weight: bold; border-radius: 12px; cursor: pointer; transition: all 0.2s; background: rgba(255, 59, 48, 0.08) !important; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 59, 48, 0.2) !important; color: #FF3B30 !important; }
.btn-clear:hover { background: rgba(255, 59, 48, 0.15) !important; box-shadow: 0 4px 12px rgba(255, 59, 48, 0.15); transform: translateY(-2px); }
[data-theme="dark"] .btn-clear { background: rgba(255, 59, 48, 0.1) !important; border: 1px solid rgba(255, 59, 48, 0.5) !important; color: #ff6b6b !important; box-shadow: none !important; }
[data-theme="dark"] .btn-clear:hover { background: rgba(255, 59, 48, 0.2) !important; }

.ignore-layout-wrapper { display: flex; gap: 20px; align-items: stretch; width: 100%; }
.ignore-left-panel { flex: 1.4; margin: 0; display: flex; flex-direction: column; }
.ignore-right-panel { flex: 1; display: flex; flex-direction: column; gap: 15px; }

/* 桌機版右欄跟隨 7×3 輸入區等高，總無視防禦區填滿剩餘高度。 */
@media (min-width: 769px) {
    .ignore-right-panel { align-self: stretch; }
    .ignore-right-panel .result-gradient { flex: 1 1 auto; }
}

/* 星火輸入提醒：整合至輸入區標題右側。 */
.ignore-input-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 10px;
}
.ignore-input-title { white-space: nowrap; }
.ignore-input-notice {
    --ignore-input-glow: 0, 113, 227;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    margin-left: auto;
    padding: 4px 7px;
    border: 1px solid rgba(0, 113, 227, 0.18);
    border-radius: 6px;
    background: rgba(240, 248, 255, 0.55);
    color: #0756a8 !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    animation: ignoreInputNoticeBreath 2.4s ease-in-out infinite;
}
.ignore-input-notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    line-height: 1;
}
[data-theme="dark"] .ignore-input-notice {
    --ignore-input-glow: 105, 189, 255;
    border-color: rgba(105, 189, 255, 0.25);
    background: rgba(105, 189, 255, 0.07);
    color: #9ad2ff !important;
}
@keyframes ignoreInputNoticeBreath {
    0%, 100% {
        box-shadow: 0 0 0 rgba(var(--ignore-input-glow), 0);
    }
    50% {
        box-shadow: 0 0 5px rgba(var(--ignore-input-glow), 0.14);
    }
}
@media (prefers-reduced-motion: reduce) {
    .ignore-input-notice { animation: none; }
}

/* HEXA 面板差異：清除按鈕下方的固定提醒。 */
#tab-ignore {
    --ignore-notice-text: #ba2035;
    --ignore-notice-bg: rgba(227, 38, 61, 0.07);
    --ignore-notice-border: rgba(227, 38, 61, 0.3);
}
[data-theme="dark"] #tab-ignore {
    --ignore-notice-text: #ff8b98;
    --ignore-notice-bg: rgba(255, 105, 120, 0.1);
    --ignore-notice-border: rgba(255, 105, 120, 0.35);
}
.ignore-bug-notice {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 1px solid var(--ignore-notice-border);
    border-radius: 12px;
    background: var(--ignore-notice-bg);
    color: var(--ignore-notice-text);
    line-height: 1.6;
}
.ignore-bug-notice strong { display: block; font-size: 14px; }
.ignore-bug-notice p { margin: 5px 0 0; font-size: 13px; }

/* ========================================== */
/* 🌟 3. 六轉進度與懶人決策 (四色玻璃全框發光)   */
/* ========================================== */
.core-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }

/* --- 四色專屬變數設定 --- */
.prog-item[id*="sk"] { --hx-color-light: #673AB7; --hx-bg-light: rgba(103, 58, 183, 0.08); --hx-glow-light: rgba(103, 58, 183, 0.35); --hx-color-dark: #9575CD; --hx-bg-dark: rgba(149, 117, 205, 0.15); --hx-glow-dark: rgba(149, 117, 205, 0.6); }
.prog-item[id*="ma"] { --hx-color-light: #D279E6; --hx-bg-light: rgba(210, 121, 230, 0.08); --hx-glow-light: rgba(210, 121, 230, 0.35); --hx-color-dark: #E1BEE7; --hx-bg-dark: rgba(225, 190, 231, 0.15); --hx-glow-dark: rgba(225, 190, 231, 0.6); }
.prog-item[id*="en"] { --hx-color-light: #00BFFF; --hx-bg-light: rgba(0, 191, 255, 0.08); --hx-glow-light: rgba(0, 191, 255, 0.35); --hx-color-dark: #80D8FF; --hx-bg-dark: rgba(128, 216, 255, 0.15); --hx-glow-dark: rgba(128, 216, 255, 0.6); }
.prog-item[id*="co"] { --hx-color-light: #90A4AE; --hx-bg-light: rgba(144, 164, 174, 0.08); --hx-glow-light: rgba(144, 164, 174, 0.35); --hx-color-dark: #CFD8DC; --hx-bg-dark: rgba(207, 216, 220, 0.15); --hx-glow-dark: rgba(207, 216, 220, 0.5); }

/* 卡片本體玻璃化 */
.prog-item { border-radius: 12px; padding: 12px 10px; text-align: center; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1.5px solid var(--hx-color-light) !important; background: var(--hx-bg-light) !important; transition: all 0.3s ease !important; }
.prog-item label, .prog-item span { color: var(--hx-color-light) !important; font-weight: 800 !important; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.prog-item:hover { box-shadow: 0 4px 15px var(--hx-glow-light) !important; transform: translateY(-2px); }
.prog-item:focus-within { box-shadow: 0 0 15px var(--hx-glow-light), inset 0 0 8px var(--hx-bg-light) !important; transform: translateY(-2px); }

/* 輸入框下拉選單玻璃化 */
.prog-item select { width: 100%; padding: 6px; border-radius: 6px; text-align: center; font-weight: bold; font-size: 14px; background: rgba(255, 255, 255, 0.7) !important; border: 1px solid var(--hx-color-light) !important; color: var(--hx-color-light) !important; backdrop-filter: blur(4px); transition: all 0.3s ease; box-shadow: none !important; outline: none; }
.prog-item select:focus { background: #fff !important; border-color: var(--hx-color-light) !important; box-shadow: 0 0 8px var(--hx-glow-light) !important; }

/* 禁用狀態 (未解鎖) */
.prog-item:has(select:disabled) { border-color: rgba(134, 134, 139, 0.3) !important; background: rgba(134, 134, 139, 0.05) !important; box-shadow: none !important; transform: none !important; }
.prog-item:has(select:disabled) label { color: #86868B !important; }
.prog-item select:disabled { background-color: rgba(0,0,0,0.03) !important; color: #86868B !important; border-color: transparent !important; box-shadow: none !important;}

/* 夜間模式對應 */
[data-theme="dark"] .prog-item { border-color: var(--hx-color-dark) !important; background: var(--hx-bg-dark) !important; }
[data-theme="dark"] .prog-item label, [data-theme="dark"] .prog-item span { color: var(--hx-color-dark) !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8) !important; }
[data-theme="dark"] .prog-item:hover { box-shadow: 0 4px 15px var(--hx-glow-dark) !important; }
[data-theme="dark"] .prog-item:focus-within { box-shadow: 0 0 15px var(--hx-glow-dark), inset 0 0 10px var(--hx-bg-dark) !important; }
[data-theme="dark"] .prog-item select { background: rgba(0, 0, 0, 0.4) !important; border: 1px solid var(--hx-color-dark) !important; color: var(--hx-color-dark) !important; }
[data-theme="dark"] .prog-item select:focus { background: rgba(0, 0, 0, 0.6) !important; border-color: var(--hx-color-dark) !important; box-shadow: 0 0 8px var(--hx-glow-dark) !important; }
[data-theme="dark"] .prog-item:has(select:disabled) { border-color: rgba(255, 255, 255, 0.1) !important; background: rgba(255, 255, 255, 0.02) !important; }
[data-theme="dark"] .prog-item:has(select:disabled) label { color: rgba(255, 255, 255, 0.3) !important; }
[data-theme="dark"] .prog-item select:disabled { color: rgba(255,255,255,0.3) !important; background: rgba(0,0,0,0.2) !important; }

.inv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.inv-item { display: flex; flex-direction: column; gap: 5px; }
.inv-item label { font-size: 13px; font-weight: bold; color: var(--text-main); display: flex; align-items: center; }
.res-icon { width: 18px; height: 18px; object-fit: contain; margin-right: 6px; }

.prog-bar-wrap { margin-top: 15px; background: var(--glass-bg); padding: 15px; border-radius: 12px; border: 1px solid var(--glass-border); }
.prog-header { display: flex; justify-content: space-between; font-size: 14px; font-weight: bold; color: var(--text-main); margin-bottom: 5px; align-items: center; }
.prog-header span { color: var(--text-muted); font-size: 13px; }
.prog-bar-bg { width: 100%; height: 20px; background-color: rgba(0,0,0,0.05); border-radius: 10px; overflow: hidden; margin-bottom: 10px; position: relative; }
.prog-bar-fill { height: 100%; transition: width 0.4s ease; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; font-size: 11px; font-weight: bold; color: white; }
.prog-fill-frag { background: linear-gradient(90deg, #34C759, #30D158); }
.prog-fill-sol { background: linear-gradient(90deg, #AF52DE, #BF5AF2); }
.time-box { background: rgba(0,113,227,0.04); border-left: 4px solid #0071E3; padding: 15px; border-radius: 8px; margin-top: 15px; font-size: 15px; line-height: 1.6; color: var(--text-main); }

.hexa-inputs { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-bottom: 15px; }
.hexa-inputs div { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 60px;}
.hexa-inputs input { width: 50px; border-radius: 6px; }
.target-divider { width: 100%; height: 1px; background-color: rgba(0,0,0,0.05); margin: 10px 0; }
.checkbox-label { display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; color: #FF3B30; font-weight: bold; margin-top: 10px;}
.checkbox-label input { margin-right: 8px; width: 16px; height: 16px;}

.lazy-table-container { width: 100%; max-width: 100%; border: none !important; background: transparent !important; box-shadow: none !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; border-radius: 12px; }
.lazy-table { width: 100%; border-collapse: collapse; font-size: 14.5px; text-align: center; background: var(--glass-bg) !important; backdrop-filter: blur(8px); }
.lazy-table th { background-color: var(--glass-border) !important; color: var(--text-main) !important; padding: 10px; border-bottom: 1px solid rgba(0,0,0,0.1) !important; font-weight: 700 !important; }
.lazy-table td { padding: 10px; border-bottom: 1px solid rgba(0,0,0,0.05) !important; vertical-align: middle; border-left: none !important; border-right: none !important; color: var(--text-main);}
.lazy-table tr:hover { background-color: var(--card-hover) !important; }
.lazy-table tr:last-child td { border-bottom: none !important; }

.tag { padding: 4px 8px; border-radius: 6px; font-size: 13px; font-weight: bold; color: #fff; display: inline-block; }
.tag-green { background-color: #34C759; }
.tag-yellow { background-color: #FF9500; }
.tag-red { background-color: #FF3B30; }
.loader { font-weight: bold; color: #0071E3; text-align: center; padding: 20px; }

.update-list { line-height: 1.8; color: var(--text-main); padding-left: 20px; }
.update-list li { margin-bottom: 8px; }
.disclaimer-box { background: rgba(255,59,48,0.04); padding: 18px; border-radius: 12px; border-left: 6px solid #FF3B30; line-height: 1.8; color: var(--text-main); box-shadow: none; }

.mobile-br { display: none; }
.desktop-space { display: inline; }

/* ========================================== */
/* 🛡️ 4. HEXA 屬性模擬器 (1:1 復刻防護網)         */
/* ========================================== */
#tab-hexa-visual .visual-container { width: 100%; max-width: 720px; margin: 0 auto; background-color: #171b2f !important; padding: 25px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.8) !important; color: white !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; border: none !important; }
#tab-hexa-visual .visual-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1) !important; }
#tab-hexa-visual .v-fragment-text { font-size: 15px; color: #a1c4fd !important; font-weight: bold; display: flex; align-items: center; }
#tab-hexa-visual .frag-icon { width: 18px; height: 18px; object-fit: contain; margin-right: 6px; filter: none !important;}
#tab-hexa-visual .v-top-controls { display: flex; gap: 8px; }
#tab-hexa-visual .v-btn-top { background-color: #34495e !important; color: white !important; border: none !important; padding: 6px 12px; font-size: 13px; border-radius: 4px; transition: 0.2s; font-weight: bold; }
#tab-hexa-visual .v-btn-top:hover { background-color: #4b6584 !important; }
#tab-hexa-visual .v-btn-top.muted-active { background-color: #7f8c8d !important; color: #bdc3c7 !important; border-color: transparent !important; }
#tab-hexa-visual .v-core-title { font-size: 16px; font-weight: bold; color: #dbe4f0 !important; margin-bottom: 15px; padding-left: 5px; }

#tab-hexa-visual .visual-box { background: linear-gradient(180deg, #2b3e75 0%, #1e2a55 100%) !important; border: 1.5px solid #5a7ec2 !important; border-radius: 8px; padding: 15px 20px; display: flex; align-items: center; gap: 15px; box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 5px 15px rgba(0,0,0,0.3) !important; margin-bottom: 15px; backdrop-filter: none !important;}
#tab-hexa-visual .hexa-img { width: 55px; height: 55px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(255,255,255,0.4)) !important; }
#tab-hexa-visual .v-content { flex-grow: 1; display: flex; flex-direction: column; gap: 8px; }
#tab-hexa-visual .v-header-row { display: flex; justify-content: space-between; align-items: flex-end; }
#tab-hexa-visual .v-title-main { color: #d094ff !important; font-weight: bold; font-size: 15px; } 
#tab-hexa-visual .v-title-sub { color: #8cb6ff !important; font-weight: bold; font-size: 15px; }  
#tab-hexa-visual .v-stat-name { font-size: 16px; font-weight: bold; color: #ffffff !important; letter-spacing: 1px; margin-top: 2px;}
#tab-hexa-visual .v-prob { color: #b3c2d1 !important; font-size: 14px; }
#tab-hexa-visual .v-bar { display: flex; width: 100%; height: 14px; background-color: #050a15 !important; border: 2px solid #0a1128 !important; border-radius: 2px; gap: 2px; padding: 1px; }
#tab-hexa-visual .v-segment { flex: 1; background-color: #0b132b !important; transition: all 0.05s ease-in-out; border-radius: 0 !important; }
#tab-hexa-visual .v-segment.active-main { background: linear-gradient(180deg, #e499ff 0%, #b854d4 100%) !important; box-shadow: 0 0 8px #d094ff !important; border-top: 1px solid #ffccff !important; }
#tab-hexa-visual .v-segment.active-sub { background: linear-gradient(180deg, #66eeff 0%, #15a0d3 100%) !important; box-shadow: 0 0 8px #66eeff !important; border-top: 1px solid #b3ffff !important; }

#tab-hexa-visual .visual-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 25px; padding: 15px; background: rgba(255,255,255,0.05) !important; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1) !important; gap: 15px;}
#tab-hexa-visual .v-control-group { display: flex; align-items: center; gap: 12px; }
#tab-hexa-visual .v-reset-tracker { font-size: 14px; color: #bdc3c7 !important; font-weight: normal !important;}
#tab-hexa-visual .v-btn { background: linear-gradient(135deg, #e67e22, #d35400) !important; color: white !important; border: none !important; padding: 12px 25px; font-size: 16px; font-weight: bold; border-radius: 6px; transition: transform 0.1s, filter 0.2s; box-shadow: none !important; }
#tab-hexa-visual .v-btn:hover { filter: brightness(1.2) !important; transform: none !important;}
#tab-hexa-visual .v-btn:active { transform: scale(0.95) !important; }
#tab-hexa-visual .v-btn-10x { background: linear-gradient(135deg, #8e44ad, #6c3483) !important; color: white !important; border: none !important; padding: 12px 20px; font-size: 16px; font-weight: bold; border-radius: 6px; transition: transform 0.1s, filter 0.2s; box-shadow: none !important; }
#tab-hexa-visual .v-btn-10x:hover { filter: brightness(1.2) !important; transform: none !important;}
#tab-hexa-visual .v-btn-10x:active { transform: scale(0.95) !important; }
#tab-hexa-visual .v-btn-reset { background-color: #7f8c8d !important; color: white !important; border: none !important; padding: 12px 25px; font-size: 16px; font-weight: bold; border-radius: 6px; transition: transform 0.1s, filter 0.2s, background 0.3s; box-shadow: none !important; }
#tab-hexa-visual .v-btn-reset:active { transform: scale(0.95) !important; }
#tab-hexa-visual .v-btn-reset.highlight { background: linear-gradient(135deg, #e67e22, #d35400) !important; box-shadow: 0 0 10px rgba(230, 126, 34, 0.5) !important; border-color: transparent !important;}
#tab-hexa-visual .v-btn-reset.highlight:hover { filter: brightness(1.2) !important; transform: none !important;}

/* ========================================== */
/* 5. 鐵匠鋪共用UI (Transcend & Craft)           */
/* ========================================== */
.msm-forge-ui, .msm-forge-ui *, .msm-forge-ui *:before, .msm-forge-ui *:after,
.modal-box, .modal-box *, .modal-box *:before, .modal-box *:after,
.cr-confirm-box, .cr-confirm-box *, .cr-confirm-box *:before, .cr-confirm-box *:after { box-sizing: content-box !important; }
.msm-forge-ui, .modal-box { color: #333 !important; font-family: "微軟正黑體", Arial, sans-serif !important; }
.msm-forge-ui { width: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column;  box-shadow: 0 10px 40px rgba(0,0,0,0.15); position: relative; border-radius: 6px; overflow: hidden; }
.forge-header { background-color: #455468; color: white !important; padding: 12px 20px; font-size: 22px; font-weight: bold; display: flex; align-items: center; gap: 10px; }
.forge-info-icon { display: inline-flex; justify-content: center; align-items: center; width: 22px; height: 22px; border: 2px solid white; border-radius: 4px; font-size: 14px; transform: rotate(45deg); }
.forge-info-icon span { transform: rotate(-45deg); }
.forge-body { display: flex; width: 100%; background-color: #f4f5f7; }
.forge-sidebar { width: 115px; background-color: #344253; display: flex; flex-direction: column; flex-shrink: 0; }
.menu-item { flex: 1; display: flex; align-items: center; justify-content: center; color: #a6b2c2 !important; font-size: 14px; font-weight: bold; border-bottom: 1px solid #2a3543; transition: background-color 0.2s;}
.menu-item:last-child { border-bottom: none; }
.menu-item.active { background-color: #f3724c; color: white !important; border-bottom: none; }
.forge-main { flex: 1; display: flex; flex-direction: column; position: relative; min-height: 480px; }

.sec-top { display: flex; justify-content: center; align-items: flex-start; padding: 20px; gap: 20px; background-color: #F0F0F0; transition: background-color 0.2s}
.sec-white { background-color: #ffffff; padding: 1px 0; text-align: center; border-top: 1px solid #e1e4e8; border-bottom: 1px solid #e1e4e8; display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 60px; transition: background-color 0.2s;}
.sec-grey-mid { background-color: #F0F0F0; padding: 15px 30px; display: flex; flex-direction: column; align-items: center; flex: 1; transition: background-color 0.2s;}
.sec-bottom { background-color: #FCFCFC; width: 100%; padding: 20px 0; display: flex; justify-content: center; align-items: center; gap: 15px; transition: background-color 0.2s;}

.item-col { display: flex; flex-direction: column; align-items: center; width: 140px;}
.img-box { width: 85px; height: 85px; background-color: #e4e6e9; border: 1px solid #dcdde1; border-radius: 6px; display: flex; justify-content: center; align-items: center; font-size: 45px; margin-bottom: 5px; box-shadow: inset 0 0 10px rgba(0,0,0,0.05); position: relative; }
.img-box img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; filter: none !important; }
.dynamic-lv-overlay { position: absolute; bottom: 4px; right: 4px; background-color: rgba(17, 17, 17, 1); color: #ffffff !important; font-family: Arial, Helvetica, sans-serif; font-size: 10px; font-weight: 600; letter-spacing: -0.1px; line-height: 1; padding: 2px 0px; border-radius: 10px; border: none; z-index: 10; min-width: 36px; text-align: center; box-sizing: border-box; -webkit-font-smoothing: antialiased; }
.equip-name { font-size: 12px; font-weight: bold; color: #333 !important; margin-bottom: 5px; text-align: center; width: 160px; white-space: nowrap; overflow: hidden;text-overflow: ellipsis; }

.fail-text { font-size: 12px; color: #888 !important; }
.plus-sign { font-size: 35px; font-weight: bold; color: #888 !important; margin-top: 20px; }
.lv-arrow { color: #f3724c !important; margin: 0 20px; font-size: 24px; display: inline-block; transform: scaleX(1.5); }
.lv-text { font-size: 22px; font-weight: bold; color: #555 !important; }
.lv-next { color: #f3724c !important; }

.rate-box { width: 100%; text-align: center; margin-bottom: 15px; }
.rate-title { font-size: 18px; font-weight: bold; color: #555 !important; margin-bottom: 5px;}
.rate-highlight { font-size: 22px; color: #f3724c !important; margin-left: 5px;}
.rate-detail { font-size: 13px; color: #666 !important; margin-bottom: 15px;}
.rate-detail span { color: #f3724c !important; }
hr.divider { border: none; border-top: 2px solid #E0E0E0; margin: 10px 0 15px 0; width: calc(100% + 60px); }

.bonus-row { width: 65%; margin: 0 auto 5px auto; display: flex; justify-content: space-between; font-size: 14px; font-weight: bold; color: #555 !important; margin-top: -15px; margin-bottom: 0px; }
.desc-text { font-size: 12px; color: #777 !important; text-align: center; line-height: 1.6; font-weight: bold; width: 90%; }
.coin-box { background: #ffffff; padding: 10px 20px; border-radius: 20px; border: 1px solid #ccc; font-size: 16px; color: #333 !important; display: flex; align-items: center; gap: 8px; width: 200px; justify-content: center; font-weight: bold; }

.btn-action-tr { padding: 12px 0; width: 140px; font-size: 18px; font-weight: bold; color: white !important; border: none; border-radius: 6px; transition: 0.1s; background-color: #f3724c; box-shadow: 0 3px 0 #d35400; }
.btn-action-tr:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.btn-action-tr:disabled { background-color: #bdc3c7; box-shadow: 0 3px 0 #95a5a6; cursor: not-allowed; }

/* 🌟 鐵匠鋪下方設定面板 */
.settings-panel { width: 100%; max-width: 720px; margin: 0px auto 0 auto; background: var(--glass-bg) !important; backdrop-filter: blur(16px) !important; -webkit-backdrop-filter: blur(16px) !important; border: 1px solid var(--glass-border) !important; border-radius: 16px !important; padding: 20px; box-sizing: border-box; box-shadow: 0 4px 20px rgba(0,0,0,0.03) !important; color: var(--text-main); }
.settings-title { font-size: 16px; font-weight: 700; color: #0071E3 !important; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 6px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center;}
.setting-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 14px; color: var(--text-main) !important; flex-wrap: wrap; }
.setting-row input[type="number"], .setting-row select { font-weight: bold;}
.setting-row label { cursor: pointer; display: flex; align-items: center; gap: 4px; color: var(--text-main) !important; }
.stats-text { font-size: 14px; color: var(--text-main) !important; text-align: left; background: var(--glass-bg) !important; padding: 15px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.05) !important; margin-top: 15px;}
.btn-sound { background: #fff; border: 1px solid #bdc3c7; padding: 6px 12px; border-radius: 8px; font-size: 13px; transition: 0.2s; font-weight: bold; color: #2c3e50;}
.btn-sound.muted { background: #FF3B30; color: white; border-color: #FF3B30; }

.modal-backdrop { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); z-index: 2000; justify-content: center; align-items: center; backdrop-filter: blur(8px); }
.modal-backdrop.active { display: flex; }
.modal-box { width: 90%; max-width: 420px; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.15); display: flex; flex-direction: column; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.modal-header { background: #4a5468; color: #ffffff !important; text-align: center; padding: 18px; font-size: 22px; font-weight: bold; }
.m-enh-grey-top { background-color: #F0F0F0; padding: 15px 20px 0px 20px !important; display: flex; flex-direction: column; align-items: center; text-align: center; }
.m-enh-grey-top .lv-text { margin-top: 8px !important; margin-bottom: 5px !important; font-size: 18px !important; }
.m-enh-white-mid { background-color: #ffffff; padding: 12px 20px 20px 20px; text-align: center; } 
.m-enh-grey-bot { background-color: #e4e6e9; padding: 20px; display: flex; justify-content: center; }

.m-scr-white-body { background-color: #ffffff; padding: 35px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.m-scr-grey-box { background-color: #F0F0F0; margin: 20px auto; padding: 14px; border-radius: 4px; width: 85%; font-weight: bold; font-size: 16px; text-align: center; letter-spacing: 0.5px;}
.m-scr-text-orange { color: #ed7245 !important; } 
.m-scr-text-grey { color: #888888 !important; } 

.m-item-name { font-size: 13px; font-weight: bold; color: #333 !important; margin-top: 10px;}
.m-fail-text { font-size: 12px; color: #777 !important; margin-top: 3px;}
.m-fail-change { color: #777 !important; font-weight: bold; margin-left: 4px; } 
.m-status-title { font-size: 18px; font-weight: bold; margin-bottom: 5px; color: #333 !important; }
.m-status-sub { font-size: 12px; color: #7f8c8d !important; margin-bottom: 10px; }
.m-bonus-rate { font-size: 22px; color: #f3724c !important; font-weight: bold; margin-bottom: 5px; }
.m-bonus-hint { font-size: 11px; color: #95a5a6 !important; }
.m-btn { background: #f3724c; color: #fff !important; border: none; padding: 14px 0; font-size: 18px; font-weight: bold; border-radius: 8px; width: 60%; box-shadow: 0 4px 0 #d35400; transition: 0.1s; }
.m-btn:active { transform: translateY(4px); box-shadow: none; }

.scroll-mode-active #ui-level-content { display: none !important; } 
.scroll-mode-active .sec-middle { background-color: #ffffff !important; justify-content: center !important; padding: 30px 20px !important; } 
.scroll-mode-active #ui-rate-wrapper { display: none !important; } 
.scroll-mode-active #ui-divider-line { display: none !important; } 
.scroll-mode-active #ui-bonus-row { display: none !important; }    
.scroll-mode-active .desc-text { color: #555 !important; font-weight: normal; margin-bottom: 0; }
.scroll-mode-active #ui-coin-box { display: none !important; } 
.scroll-mode-active .sec-bottom { background-color: #ffffff !important; padding-top: 10px !important; }

.lightning-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 999; display: none; justify-content: center; align-items: center; overflow: hidden; }
.lightning-overlay.active { display: flex; animation: flash-bang 1s ease-out forwards; }
.lightning-img { width: 150%; height: 150%; object-fit: cover; transform: rotate(-15deg); mix-blend-mode: screen; animation: strike-flicker 0.6s infinite alternate; }
@keyframes flash-bang { 0% { background-color: rgba(255,255,255,0); } 10% { background-color: rgba(255,255,255,1); } 30% { background-color: rgba(255,255,255,0.5); } 100% { background-color: rgba(255,255,255,0); } }
@keyframes strike-flicker { 0% { opacity: 0; transform: scale(0.9) rotate(-15deg); } 20% { opacity: 1; transform: scale(1.2) rotate(-15deg); } 40% { opacity: 0.2; } 60% { opacity: 1; transform: scale(1.0) rotate(-15deg); } 80% { opacity: 0; } 100% { opacity: 1; transform: scale(1.1) rotate(-15deg); } }

/* ========================================== */
/* 7. 製作模擬器特定設定 (Craft Specific)        */
/* ========================================== */
#cr-game-ui-container .sec-top { display: flex !important; justify-content: center !important; align-items: flex-start !important; gap: 15px !important; padding: 20px 0 15px 0 !important; flex-wrap: nowrap !important; }
#cr-game-ui-container .item-col { display: flex !important; flex-direction: column !important; align-items: center !important; width: 130px !important; min-width: 130px !important; max-width: 130px !important; flex: 0 0 130px !important; margin: 0 !important; padding: 0 !important; }
#cr-game-ui-container .img-box { width: 90px !important; height: 90px !important; margin: 0 0 6px 0 !important; flex-shrink: 0 !important; }
#cr-game-ui-container .plus-sign { display: block !important; width: 30px !important; min-width: 30px !important; flex: 0 0 30px !important; text-align: center !important; font-size: 35px !important; margin: 0 !important; padding: 0 !important; margin-top: 25px !important; line-height: 1 !important; color: #555 !important;}
#cr-game-ui-container .item-col:nth-child(3) { margin-right: 25px !important; }
#cr-game-ui-container .equip-name { width: 100% !important; max-width: 130px !important; min-height: 31px; white-space: normal !important; overflow: visible !important; overflow-wrap: anywhere; word-break: normal; font-size: 12px !important; line-height: 1.3; text-align: center !important; margin: 0 !important; letter-spacing: -0.2px !important; color: #555 !important; }
#cr-game-ui-container .item-col:nth-child(4) .equip-name { font-size: 11px !important; letter-spacing: -0.5px !important; }
#cr-game-ui-container .forge-main { height: 520px; }

/* 製作確認後，背景材料槽維持遊戲內的空槽狀態，直到關閉結果視窗。 */
#cr-game-ui-container.cr-crafting-slots-empty #cr-ui-diamond-badge,
#cr-game-ui-container.cr-crafting-slots-empty #cr-ui-star-badge,
#cr-game-ui-container.cr-crafting-slots-empty #cr-ui-lv-badge {
    display: none !important;
}

.cr-stage-setting-row {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: start;
    column-gap: 18px;
}
.cr-setting-heading {
    color: var(--text-main);
    font-weight: 700;
    white-space: nowrap;
}
.cr-stage-options {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    white-space: nowrap;
}
.cr-stage-options label {
    min-width: 0;
    justify-content: flex-start;
    white-space: nowrap;
}
.cr-scroll-setting-row {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    justify-content: start;
    column-gap: 12px;
}
.cr-scroll-selects {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.cr-scroll-selects select {
    width: 76px;
    min-width: 0;
}

.cr-chaos-tier-list {
    width: 100%;
    margin-bottom: 5px;
    color: #555 !important;
    text-align: center;
}
.cr-chaos-tier-caption {
    margin-bottom: 11px;
    color: #555 !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
}
.cr-chaos-route-list {
    width: min(460px, 100%);
    margin: 0 auto 8px;
    display: grid;
    gap: 12px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
}
.cr-chaos-route {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    align-items: center;
}
.cr-chaos-route-source {
    min-width: 0;
    text-align: center;
    white-space: nowrap;
}
.cr-chaos-route-arrow {
    color: #ed795e !important;
    text-align: center;
    font-size: 18px;
    line-height: 1;
    transform: translateY(-1px);
}
.cr-chaos-route-target {
    min-width: 0;
    text-align: center;
    white-space: nowrap;
}
.cr-tier-ancient { color: #1cc8de !important; }
.cr-tier-chaos { color: #d72a9e !important; }
.cr-tier-or {
    margin: 0 2px;
    color: #555 !important;
}
#cr-game-ui-container .coin-box { color: #555 !important; }
#cr-game-ui-container .rate-box { margin-bottom: 12px !important; }
.cr-craft-rate-line {
    position: relative;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-right: 34px !important;
    padding-left: 34px !important;
    font-size: clamp(10px, 2.1vw, 15px) !important;
    font-weight: 700 !important;
    line-height: 1.35;
    white-space: nowrap;
}
.cr-rate-info-button {
    position: absolute;
    top: 50%;
    right: 15px;
    z-index: 42;
    width: 20px;
    height: 20px;
    padding: 0;
    display: grid;
    place-items: center;
    color: #fff !important;
    background: #344253;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(21, 30, 42, 0.2);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-indent: 2px;
    transform: translateY(-50%);
    cursor: pointer;
}
.cr-rate-info-button:hover,
.cr-rate-info-button:focus-visible,
.cr-rate-info-button[aria-expanded="true"] {
    background: #263446;
    box-shadow: 0 0 0 3px rgba(52, 66, 83, 0.16);
    outline: none;
}
.cr-rate-detail-popover {
    position: absolute;
    top: auto;
    bottom: calc(100% + 7px);
    right: 10px;
    z-index: 45;
    width: min(230px, calc(100% - 20px));
    padding: 11px 13px;
    color: #f3f6fb !important;
    background: rgba(45, 53, 65, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    box-shadow: 0 10px 24px rgba(23, 29, 38, 0.28);
    text-align: left;
}
.cr-rate-detail-popover[hidden] { display: none !important; }
.cr-rate-detail-popover,
.cr-rate-detail-popover * { color: #f3f6fb !important; }
.cr-rate-detail-title {
    margin-bottom: 7px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 13px;
    font-weight: 900;
}
.cr-rate-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 2px 0;
    font-size: 12px;
    line-height: 1.35;
}
.cr-rate-detail-row strong {
    flex: 0 0 auto;
    font-weight: 800;
}
.cr-rate-detail-row.is-total {
    margin-bottom: 3px;
    font-weight: 800;
}
.cr-rate-detail-row.is-total strong { color: #58c701 !important; }

.cr-confirm-box { width: 90%; max-width: 380px; background: #fff; border-radius: 12px; overflow: hidden; text-align: center; margin: 0 auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15); color: #333; }
.cr-confirm-header { background: #455468; color: white !important; padding: 14px; font-size: 18px; font-weight: bold; letter-spacing: 1px; }
.cr-confirm-body { padding: 25px 15px; font-size: 15px; line-height: 1.6; color: #333 !important; }
.cr-confirm-footer { display: flex; gap: 12px; padding: 0px 20px 20px; }
.cr-btn-cancel { flex: 1; background: #5482a9; color: white !important; border: none; padding: 12px; border-radius: 8px; font-weight: bold; font-size: 16px; cursor: pointer; transition: 0.2s;}
.cr-btn-cancel:hover { background: #436a8b; }
.cr-btn-confirm { flex: 1; background: #f3724c; color: white !important; border: none; padding: 12px; border-radius: 8px; font-weight: bold; font-size: 16px; cursor: pointer; transition: 0.2s; }
.cr-btn-confirm:hover { background: #d35400; }
.cr-result-stats { background: #fff; padding: 12px 15px; text-align: left; font-size: 13px; line-height: 1.2; font-weight: bold; border-top: 1px solid #eee; color: #333 !important; }
.cr-stat-row { display: flex; justify-content: space-between; margin-bottom: 0px; padding: 4px 0; }

@keyframes cr-flash-success { 0% { background-color: rgba(0, 0, 0, 0.85); } 35% { background-color: rgba(180, 50, 255, 0.5); } 50% { background-color: rgba(220, 100, 255, 0.8); } 65% { background-color: rgba(255, 255, 255, 1); } 85% { background-color: rgba(240, 200, 255, 0.9); } 100% { background-color: rgba(0, 0, 0, 0.85); } }
@keyframes cr-flash-fail { 0% { background-color: rgba(0, 0, 0, 0.85); } 35% { background-color: rgba(180, 50, 255, 0.5); } 50% { background-color: rgba(220, 100, 255, 0.8); } 65% { background-color: rgba(0, 0, 0, 0.75); } 85% { background-color: rgba(0, 0, 0, 0.65); } 100% { background-color: rgba(0, 0, 0, 0.85); } }
.cr-anim-success { display: block !important; animation: cr-flash-success 1.26s ease-in-out forwards; mix-blend-mode: hard-light; }
.cr-anim-fail { display: block !important; animation: cr-flash-fail 1.26s ease-in-out forwards; mix-blend-mode: hard-light; }

@keyframes cr-flash-success-gold { 0% { background-color: rgba(0, 0, 0, 0.85); } 35% { background-color: rgba(255, 150, 0, 0.5); } 50% { background-color: rgba(255, 200, 50, 0.8); } 65% { background-color: rgba(255, 255, 255, 1); } 85% { background-color: rgba(255, 240, 180, 0.9); } 100% { background-color: rgba(0, 0, 0, 0.85); } }
@keyframes cr-flash-fail-gold { 0% { background-color: rgba(0, 0, 0, 0.85); } 35% { background-color: rgba(255, 150, 0, 0.5); } 50% { background-color: rgba(255, 200, 50, 0.8); } 65% { background-color: rgba(0, 0, 0, 0.75); } 85% { background-color: rgba(0, 0, 0, 0.65); } 100% { background-color: rgba(0, 0, 0, 0.85); } }
.cr-anim-success-gold { display: block !important; animation: cr-flash-success-gold 1.26s ease-in-out forwards; mix-blend-mode: hard-light; }
.cr-anim-fail-gold { display: block !important; animation: cr-flash-fail-gold 1.26s ease-in-out forwards; mix-blend-mode: hard-light; }

#cr-anim-overlay.cr-original-effect {
    display: block !important;
    /* The game keeps its popup screen blocker visible behind the result
       effect. Recorded luminance measures it at roughly 73% black; the
       exported Dim and Whiteout nodes are rendered separately on canvas. */
    background: rgba(0, 0, 0, 0.73);
    mix-blend-mode: normal;
}

#cr-effect-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ========================================== */
/* 🌟 8. 威爾練習機 (全面變數玻璃化) */
/* ========================================== */
.container:has(#tab-will.active) { padding: 0 !important; max-width: 100% !important; border-radius: 0 !important; margin: 3vh auto 20px auto !important; background: transparent !important; border: none !important; box-shadow: none !important; }
#tab-will.active { padding: 0; margin: 0; width: 100%; display: flex; flex-direction: column; }
#will-game-wrapper { position: relative; width: 100%; max-width: 1300px !important; margin: 0 auto; background-color: #000; overflow: hidden; border-radius: 8px; touch-action: none; user-select: none; display: flex; justify-content: center; align-items: center; }
#will-inner-container { position: relative; width: 100%; aspect-ratio: 1741 / 713; max-width: min(100%, calc(85vh * (1741 / 713))); margin: 0 auto; }
#willCanvas { width: 100%; height: 100%; display: block; touch-action: none; background: #000; }
#will-status-container { position: absolute; top: 5%; left: 50%; transform: translateX(-50%); text-align: center; z-index: 100; pointer-events: none; width: 100%; }
#will-status { font-weight: bold; font-size: 28px; color: #2ecc71; text-shadow: 2px 2px 4px #000, 0 0 10px #000; margin-bottom: 5px; }
#will-timer { font-weight: bold; color: #fff; font-size: 18px; text-shadow: 2px 2px 4px #000; margin-top: 5px; }
#tab-will .will-z-1000 { z-index: 1000 !important; } 
#tab-will .will-font-20 { font-size: 20px !important; }
#tab-will .will-mt-3 { margin-top: 3px; }
#tab-will .will-ml-4 { margin-left: 4px; }
#tab-will input:focus,
#tab-will select:focus {
    /* 強制覆蓋全域的死白背景，改回原本的半透明微黑底色 */
    background-color: rgba(0, 0, 0, 0.5) !important; 
    /* 確保打字時的文字依然是清楚的白色 */
    color: #ffffff !important; 
}

#ms-player-hud { position: absolute; top: 0; left: 0; z-index: 150; pointer-events: none; display: flex; flex-direction: column; gap: 2px; font-family: 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', sans-serif; letter-spacing: 0.5px; background: linear-gradient(to right, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.15) 75%, transparent 100%); padding: 12px 40px 12px 12px; border-radius: 0; }
.ms-lv, #ms-name-text, .ms-stat-text { text-shadow: -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111, 1px 1px 0 #111, 0px 2px 2px rgba(0,0,0,0.8) !important; -webkit-text-stroke: 0px transparent !important; }
.ms-hud-name-row { font-weight: 900; margin-bottom: 2px; display: flex; gap: 6px; align-items: baseline; }
.ms-lv { color: #ffdf00; font-size: 16px; } 
#ms-name-text { color: #ffffff; font-size: 18px; }
.ms-bar-row { position: relative; width: 175px; height: 12px; display: flex; align-items: center; margin-bottom: 1px; }
.ms-bar-bg { width: 100%; height: 90%; background-color: #222; border: 1px solid #000; border-radius: 2px; box-shadow: 0 1px 20px rgba(0,0,0,0.5); overflow: hidden; }
.ms-hp-fill { width: 100%; height: 100%; background: linear-gradient(to right, #d90000 0%, #ff4444 100%); border-right: none; }
.ms-mp-fill { width: 100%; height: 100%; background: linear-gradient(to right, #0077dd 0%, #22bbff 100%); border-right: none; }
.ms-bar-text { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: white; font-size: 14px; line-height: 1; font-weight: 100; font-family: Tahoma, Arial, sans-serif; letter-spacing: 0px; text-shadow: -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111, 1px 1px 0 #111, 1px 1px 1px rgba(0,0,0,0.9) !important; -webkit-text-stroke: 0px transparent !important; }
.ms-stat-row { display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.ms-stat-text { color: #ffffff; font-size: 14px; font-weight: bold; }
.ms-dark-pill { background: linear-gradient(to right, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.25) 60%, transparent 100%); border-radius: 12px 0 0 12px; padding: 2px 40px 2px 2px; align-self: flex-start; }
.ms-hit-pill { background: linear-gradient(to right, rgba(80,0,0,0.65) 0%, rgba(60,0,0,0.25) 60%, transparent 100%); margin-top: 2px; }

.ms-icon { width: 16px; height: 16px; background-color: #555; border: 1px solid #111; border-radius: 4px; box-shadow: inset 0 1px 2px rgba(255,255,255,0.2); background-size: 75%; background-position: center; background-repeat: no-repeat; }
.ms-icon-cp { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6 2l3 3-1 1-3-3-1 1 3 3-1 1-3-3L2 6l5-5 1 1zm12 0l-3 3 1 1 3-3 1 1-3 3 1 1-3 3 1-1-5-5-1 1zM3 21l3-3 1 1-3 3-1-1zm18 0l-3-3-1 1 3 3 1-1zM12 10l-2 2 2 2 2-2-2-2z'/%3E%3C/svg%3E"); }
.ms-icon-map { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E"); }
.ms-icon-hit { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff6b6b'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E"); }

.glass-panel { position: absolute; background: rgba(255,255,255,0.05); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.2); border-top: 1px solid rgba(255,255,255,0.4); border-left: 1px solid rgba(255,255,255,0.4); box-shadow: 0 8px 32px rgba(0,0,0,0.2); border-radius: 12px; display: flex; gap: 10px; padding: 6px 10px; z-index: 1000 !important; }
#glass-controls-top { top: 15px; right: 15px; }
#glass-controls-mid { top: 50%; right: 15px; transform: translateY(-50%); }
#glass-controls-bottom { bottom: 15px; right: 15px; }
.glass-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.9); border-radius: 8px; width: 36px; height: 36px; font-size: 16px; font-family: Arial, sans-serif !important; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: all 0.3s; box-shadow: inset 0 0 8px rgba(255,255,255,0.05), 0 4px 10px rgba(0,0,0,0.1); pointer-events: auto !important; }
.glass-btn:hover { background: rgba(255,255,255,0.15); transform: translateY(-2px); color: #fff; box-shadow: inset 0 0 10px rgba(255,255,255,0.1), 0 6px 15px rgba(0,0,0,0.2); }
.glass-btn:active { transform: translateY(1px) scale(0.95); background: rgba(255,255,255,0.2); }
.glass-btn-restart { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(255, 255, 255, 0.08) !important; border: 1px solid rgba(255, 255, 255, 0.2) !important; border-top: 1px solid rgba(255, 255, 255, 0.5) !important; border-left: 1px solid rgba(255, 255, 255, 0.5) !important; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: white; padding: 14px 35px; font-size: 20px; font-weight: bold; border-radius: 12px; cursor: pointer; z-index: 1000 !important; box-shadow: 0 8px 32px rgba(0,0,0,0.5); transition: all 0.3s ease; pointer-events: auto !important; }
.glass-btn-restart:hover { background: rgba(255, 255, 255, 0.2) !important; transform: translate(-50%, -52%); box-shadow: 0 12px 40px rgba(0,0,0,0.6); }
.glass-btn-restart:active { transform: translate(-50%, -49%) scale(0.95); }
.hint-bulb-btn { filter: grayscale(1) opacity(0.5); transition: all 0.3s ease !important; }
.hint-bulb-btn.active-hint { filter: grayscale(0) opacity(1) drop-shadow(0 0 6px #f1c40f) !important; color: #f1c40f !important; }
#joystick-base { position: absolute; bottom: 10%; left: 5%; width: 130px; height: 130px; border-radius: 50%; z-index: 100; display: flex; justify-content: center; align-items: center; background: rgba(255,255,255,0.05); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.2); border-top: 1px solid rgba(255,255,255,0.4); border-left: 1px solid rgba(255,255,255,0.4); box-shadow: 0 8px 32px rgba(0,0,0,0.2), inset 0 0 20px rgba(255,255,255,0.05); }
#joystick-stick { width: 55px; height: 55px; border-radius: 50%; pointer-events: none; transition: transform 0.1s; background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 100%); border: 1px solid rgba(255,255,255,0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 15px rgba(0,0,0,0.3), inset 0 2px 10px rgba(255,255,255,0.4); }

#tab-will .instructions-panel { display: block !important; visibility: visible !important; opacity: 1 !important; }

#tab-will .settings-panel,
#tab-will .instructions-panel {
    background: var(--glass-bg); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--glass-border); box-shadow: 0 8px 24px rgba(0,0,0,0.1), inset 0 0 12px var(--glass-border); 
    border-radius: 16px; padding: 25px; font-family: 'PingFang TC', 'Microsoft JhengHei', sans-serif; 
    position: relative; z-index: 10; color: var(--text-main); max-width: 1000px !important; margin: 10px auto !important; box-sizing: border-box;
}

#tab-will .container, #tab-will > div {max-width: 100% !important; width: 100% !important;}
#tab-will .inst-btn-grid {display: grid !important;grid-template-columns: repeat(2, 1fr) !important;gap: 10px !important;width: 100% !important;}
#tab-will .inst-btn-grid > div:nth-child(5), #tab-will .inst-btn-grid > div:nth-child(6) {grid-column: span 2 !important;}

#tab-will .settings-title { margin-top: 0; margin-bottom: 12px; font-size: 18px; color: var(--text-main); font-weight: 900; border-bottom: none; text-shadow: none; }
#tab-will .setting-row { display: flex; align-items: center; flex-wrap: wrap; font-weight: bold; color: var(--text-main); border-bottom: 1px solid rgba(178, 187, 237, 0.2); padding-bottom: 12px; margin-top: 15px; gap: 8px; }
#tab-will .setting-row:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
#tab-will .setting-label { margin-right: 0px; color: var(--text-main); font-weight: bold; }
#tab-will .setting-opt { cursor: pointer; display: flex; align-items: center; gap: 5px; color: var(--text-main); font-weight: bold; }
#tab-will .custom-num-input { width: 40px; text-align: center; border: 1px solid var(--glass-border); border-radius: 6px; padding: 3px; font-weight: bold; font-size: 14px; background: var(--input-bg); color: var(--text-main); outline: none; transition: all 0.3s; box-shadow: none; }
#tab-will .custom-num-input:focus { border-color: #55C3FF; box-shadow: 0 0 5px rgba(85,195,255,0.5); }
#tab-will .will-vol-group-wrapper { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap !important; }
#tab-will .vol-group { display: flex; align-items: center; gap: 8px; border-left: 2px solid rgba(178, 187, 237, 0.2); padding-left: 12px; margin-left: 5px; white-space: nowrap !important; }

#tab-will .inst-section { margin-bottom: 10px; background: var(--card-bg); border-radius: 12px; padding: 15px 20px; border: 1px solid var(--glass-border); }
#tab-will .inst-section:last-child { margin-bottom: 0 !important; }
#tab-will .inst-subtitle { color: var(--text-main); font-size: 15px; font-weight: bold; margin-bottom: 12px; border-bottom: 1px solid rgba(178, 187, 237, 0.2); padding-bottom: 8px; }
#tab-will .inst-list { color: var(--text-muted); font-size: clamp(12px, 3vw, 14px); line-height: 1.8; padding-left: 22px; margin: 0; }
#tab-will .inst-list b { color: #C88DDD; }
#tab-will .inst-section-compact { margin-bottom: 8px !important; padding: 12px 15px !important; }
#tab-will .inst-subtitle-compact { margin-bottom: 6px !important; padding-bottom: 4px !important; font-size: 14px !important; }
#tab-will .inst-list-compact { line-height: 1.5 !important; gap: 2px !important; }
#tab-will .inst-list-compact li { font-size: clamp(12px, 3vw, 13px) !important; }
#tab-will .mock-btn { flex-shrink: 0; pointer-events: none; width: clamp(28px, 8vw, 36px); height: clamp(28px, 8vw, 36px); font-size: clamp(14px, 4vw, 18px); display: flex; justify-content: center; align-items: center; background: var(--input-bg); color: var(--text-main); border: 1px solid var(--glass-border); border-radius: 6px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
#tab-will .inst-mock-glass-panel { display: flex; gap: clamp(2px, 1vw, 4px); padding: 3px; justify-content: center; align-items: center; background: var(--card-bg); border: 1px solid var(--glass-border); border-radius: 8px; margin-right: clamp(2px, 1vw, 5px); flex-shrink: 0; }
#tab-will .inst-mock-glass-panel .mock-btn { width: clamp(24px, 6vw, 30px); height: clamp(24px, 6vw, 30px); font-size: clamp(12px, 3vw, 14px); box-shadow: none; border-color: rgba(0, 0, 0, 0.05); background: var(--input-bg); }
#tab-will .inst-zoom-text { font-size: clamp(10px, 2.5vw, 12px); color: var(--text-main); font-family: monospace; font-weight: bold; display: flex; justify-content: center; align-items: center; line-height: 1; padding: 0; margin: 0; }
#tab-will .inst-btn-item { display: flex; align-items: center; gap: clamp(8px, 2vw, 12px); padding: 8px 10px; background: var(--card-bg); border-radius: 8px; border: 1px solid var(--glass-border); transition: all 0.3s ease; overflow: hidden; }
#tab-will .inst-btn-text { color: var(--text-main); font-size: clamp(12px, 3.5vw, 14px); line-height: 1.2; white-space: nowrap; }
#tab-will .span-special .inst-btn-text { white-space: normal; line-height: 1.4; }
#tab-will .span-special .inst-btn-text span { color: var(--text-muted); font-size: clamp(11px, 3vw, 12px); }

.will-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 500; display: flex; flex-direction: column; justify-content: center; align-items: center; }
#will-result-overlay { z-index: 600; display: none; }
.zoom-text { color: rgba(255, 255, 255, 0.9); font-weight: bold; font-size: 15px; font-family: monospace; display: flex; align-items: center; min-width: 40px; justify-content: center; text-shadow: none; }
.start-card { background: rgba(15, 15, 20, 0.45) !important; backdrop-filter: blur(16px) saturate(120%) !important; -webkit-backdrop-filter: blur(16px) saturate(120%) !important; border: 1px solid rgba(255, 255, 255, 0.15) !important; border-top: 1px solid rgba(255, 255, 255, 0.4) !important; border-left: 1px solid rgba(255, 255, 255, 0.4) !important; box-shadow: 0 8px 25px rgba(0,0,0,0.25), inset 0 0 20px rgba(255,255,255,0.05) !important; border-radius: 16px !important; padding: 30px !important; text-align: center; display: flex; flex-direction: column; align-items: center; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); max-width: 450px; width: 90%; pointer-events: auto; }
.will-game-title { font-size: 26px; font-weight: bold; color: white; margin-bottom: 16px; text-shadow: 0 2px 10px rgba(0,0,0,0.8); letter-spacing: 2px; text-align: center; }
.will-rule-box { font-size: 14px; color: #bdc3c7; text-shadow: 0 1px 4px rgba(0,0,0,0.8); background: rgba(0, 0, 0, 0.4); padding: 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); box-shadow: inset 0 0 10px rgba(0,0,0,0.5); display: grid; grid-template-columns: auto auto; justify-content: center; gap: 8px 6px; text-align: left; align-items: center; width: 100%; max-width: 250px; box-sizing: border-box; margin: 0 auto 16px auto; }
.will-rule-green { color: #2ecc71; font-weight: bold; white-space: nowrap; }
.will-rule-red { color: #E42123; font-weight: bold; white-space: nowrap; }
.will-rule-highlight { color: white; font-weight: bold; margin: 0 2px; }
.green-line { border-bottom: 1px solid #2ecc71; }
.red-line { border-bottom: 1px solid #E42123; }
.will-input-group { display: flex; flex-direction: row; gap: 8px; width: 100%; max-width: 250px; justify-content: center; align-items: center; margin: 0 auto; }

.glass-input, .glass-btn-start { box-sizing: border-box !important; height: 50px !important; margin: 0 !important; }
.glass-input { flex: none !important; width: 100% !important; max-width: 100% !important; text-align: center; font-weight: bold; font-size: 16px; background: rgba(255,255,255,0.05) !important; border: 1px solid rgba(255,255,255,0.2) !important; border-top: 1px solid rgba(255,255,255,0.4) !important; border-left: 1px solid rgba(255,255,255,0.4) !important; color: white !important; padding: 0 15px !important; border-radius: 8px !important; outline: none; box-shadow: inset 0 0 8px rgba(0,0,0,0.2) !important; transition: all 0.3s ease; pointer-events: auto !important; }
.glass-input::placeholder { color: rgba(255,255,255,0.5); font-weight: normal; }
.glass-input:focus { background: rgba(255,255,255,0.1) !important; border-color: rgba(255,255,255,0.6) !important; box-shadow: 0 0 10px rgba(255,255,255,0.2), inset 0 0 8px rgba(0,0,0,0.2) !important; }
.glass-btn-start { flex: 0 0 auto !important; display: flex !important; align-items: center !important; justify-content: center !important; white-space: nowrap !important; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-top: 1px solid rgba(255,255,255,0.5); border-left: 1px solid rgba(255,255,255,0.5); color: white; padding: 0 25px !important; font-size: 18px; font-weight: bold; border-radius: 8px; cursor: pointer; transition: all 0.3s; box-shadow: 0 4px 15px rgba(0,0,0,0.2); text-shadow: 0 2px 4px rgba(0,0,0,0.5); pointer-events: auto !important; }
.glass-btn-start:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.glass-btn-start:active { transform: translateY(1px) scale(0.95); background: rgba(255,255,255,0.15); }
.start-card .start-custom-input { flex: 1 !important; min-width: 0 !important; max-width: none !important; height: 40px !important; font-size: 14px !important; padding: 0 12px !important; margin: 0 !important; }
.start-card .start-custom-btn { flex-shrink: 0 !important; height: 40px !important; font-size: 15px !important; padding: 0 16px !important; margin: 0 !important; }

.result-card { background: rgba(15, 15, 20, 0.45) !important; backdrop-filter: blur(16px) saturate(120%) !important; -webkit-backdrop-filter: blur(16px) saturate(120%) !important; border: 1px solid rgba(255, 255, 255, 0.15) !important; border-top: 1px solid rgba(255, 255, 255, 0.4) !important; border-left: 1px solid rgba(255, 255, 255, 0.4) !important; box-shadow: 0 15px 40px rgba(0,0,0,0.6), inset 0 0 20px rgba(255,255,255,0.05) !important; font-family: 'PingFang TC', 'Microsoft JhengHei', sans-serif; box-sizing: border-box !important; width: 90% !important; max-width: 320px !important; height: auto !important; border-radius: 16px !important; padding: 20px 25px !important; display: flex; flex-direction: column; justify-content: space-between; animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); pointer-events: auto; }
.result-stat { display: grid !important; grid-template-columns: 70px 1fr !important; gap: 10px !important; align-items: center; font-size: 14px !important; margin-bottom: 8px !important; }
.stat-label { color: #95a5a6 !important; font-weight: bold; text-align: left !important; line-height: 1.2 !important; }
.stat-value, div.result-stat:nth-child(1) .stat-value { color: #ffffff !important; font-weight: bold; text-shadow: 0 2px 4px rgba(0,0,0,0.8); text-align: center !important; word-break: break-all; white-space: normal; line-height: 1.3 !important; }
.result-total { margin-top: 5px !important; border-top: 1px solid rgba(255,255,255,0.15) !important; padding-top: 12px !important; margin-bottom: 15px !important; display: flex !important; justify-content: center; gap: 30px !important; align-items: center; }
.result-total .stat-label { padding-left: 0 !important; }
.will-res-title { font-size: 16px; color: #ffffff !important; }
.will-res-hit-val { color: #ff6b6b !important; font-weight: 900; font-size: 18px; text-shadow: 0 2px 10px rgba(255,107,107,0.4); }
.will-res-hit-num { font-size: 32px; }
.will-res-btn-group { display: flex; gap: 15px; margin-top: auto !important; width: 100%; justify-content: center; }
.btn-res-secondary, .btn-res-primary { flex: 1 !important; max-width: none !important; height: 36px !important; font-size: 14px !important; padding: 0 !important; margin: 0 !important; border-radius: 8px !important; font-weight: bold !important; cursor: pointer !important; transition: all 0.3s !important; display: flex; justify-content: center; align-items: center; border: none !important; pointer-events: auto !important; z-index: 1000 !important;}
.btn-res-secondary { background: rgba(255,255,255,0.05) !important; color: rgba(255,255,255,0.8) !important; border: 1px solid rgba(255,255,255,0.2) !important; }
.btn-res-secondary:hover { background: rgba(255,255,255,0.15) !important; color: #fff !important; }
.btn-res-primary { background: rgba(52, 152, 219, 0.3) !important; color: white !important; border: 1px solid rgba(52, 152, 219, 0.5) !important; box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3) !important; }
.btn-res-primary:hover { background: rgba(52, 152, 219, 0.5) !important; box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5) !important; }
.mode-title-wrapper {position: relative;display: inline-block; }
.mode-subtitle {position: absolute;left: 100%;top: 50%;transform: translateY(-50%);margin-left: 8px;font-size: 11px;font-weight: normal;text-shadow: none;white-space: nowrap;}
.note-gray { color: #bdc3c7; }
.note-red { color: #ff6b6b; }
.hit-danger, .hit-danger * {color: #ff6b6b !important;text-shadow: 0 2px 10px rgba(255, 107, 107, 0.4) !important;}
.hit-success, .hit-success * {color: #2ecc71 !important;text-shadow: 0 2px 10px rgba(46, 204, 113, 0.4) !important;}

#will-game-wrapper.fake-fullscreen { position: fixed !important; top: 0 !important; left: 0 !important; width: 100vw !important; height: 100dvh !important; border-radius: 0 !important; z-index: 9999 !important; background-color: #000 !important; display: flex !important; justify-content: center !important; align-items: center !important; margin: 0 !important; padding: 0 !important; }
#will-game-wrapper.fake-fullscreen canvas { width: auto !important; height: auto !important; max-width: 100vw !important; max-height: 100dvh !important; object-fit: contain !important; }
body.body-no-scroll { overflow: hidden !important; touch-action: none !important; }
#will-game-wrapper:fullscreen #will-inner-container, #will-game-wrapper:-webkit-full-screen #will-inner-container, #will-game-wrapper.fake-fullscreen #will-inner-container { max-width: min(100vw, calc(100dvh * (1741 / 713))) !important; max-height: 100dvh !important; }
#will-game-wrapper:fullscreen canvas, #will-game-wrapper:-webkit-full-screen canvas, #will-game-wrapper.fake-fullscreen canvas { width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important; object-fit: fill !important; }

/* ========================================================= */
/* 💍 飾品強化模擬器：專屬排版與樣式 */
/* ========================================================= */
#tab-acc-enhance * { box-sizing: border-box !important; }
#tab-acc-enhance .sec-top { padding: 20px 10px; gap: 60px; justify-content: center; }
#tab-acc-enhance .item-col { display: flex; flex-direction: column; align-items: center; }
#tab-acc-enhance .equip-name { font-size: 14px; white-space: nowrap !important; text-align: center; margin-top: 5px; width: max-content !important; }
#tab-acc-enhance .m-item-name { font-size: 15px; }
#tab-acc-enhance .img-box { background-image: url('assets/common/Item_卷軸空格.png'); background-size: cover; background-position: center; background-repeat: no-repeat; background-color: transparent; }

.acc-equip-placeholder { color: #555555 !important; font-size: 14px !important; font-weight: bold !important; }
#acc-ui-lv-sec { padding: 20px 0; }
#acc-ui-lv-text { display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 24px; }
.acc-lv-text .acc-lv-next { font-size: inherit !important; color: inherit !important; }
.acc-lv-arrow { color: #f3724c; font-size: 24px; margin: 0 100px; }

#acc-ui-grey-sec { padding: 15px 20px; overflow: hidden; }
#acc-ui-grey-sec .divider { width: calc(100% + 40px) !important; margin-left: -20px !important; }
#acc-ui-grey-sec .acc-stat-container { min-height: 44px; display: flex; align-items: center; }

.acc-stat-container { width: 100%; font-size: 14px; }
.acc-stat-wrapper { width: 100%; display: flex; justify-content: space-between; align-items: center; white-space: nowrap; }
.acc-stat-title { flex-shrink: 0; color: #555555; font-weight: bold; }
.acc-stat-values { display: flex; align-items: center; white-space: nowrap; }
.acc-stat-total { color: #f3724c; font-weight: bold; }
.acc-stat-up { color: #58C701; font-weight: bold; margin-left: 2px; }
.acc-stat-base { color: #555555; font-weight: bold; margin: 0 5px; }

.acc-placeholder-text { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.acc-placeholder-main { color: #555555; font-size: 14px; font-weight: bold; }
.acc-placeholder-sub { color: #888888; font-size: 12px; font-weight: normal; }

.acc-prob-container { width: 100%; display: flex; justify-content: flex-end; }
.acc-prob-wrapper { width: 220px; display: flex; flex-direction: column; }
.acc-prob-row { display: flex; justify-content: space-between; align-items: baseline; white-space: nowrap; margin-bottom: 3px; }
.acc-prob-row:nth-child(1) { margin-bottom: 8px; }
.acc-prob-row:last-child { margin-bottom: 0; }
.acc-prob-label { font-size: 14px; color: #555555; font-family: inherit; font-weight: bold; }
.acc-prob-label-s { font-size: 22px; color: #555555; font-family: inherit; font-weight: bold; }
.val-success { font-size: 22px; color: #f3724c; font-weight: bold; }
.val-neutral { font-size: 14px; color: #555555; font-weight: bold; }

/* 飾品強化彈出視窗 */
.acc-m-attempts { margin-top: 5px; font-size: 12px; color: #888888; }
.acc-m-attempts-num { color: #f3724c; font-weight: bold; }
.m-enh-white-mid { background-color: #ffffff; padding: 25px 0; text-align: center; }
.m-status-title { font-size: 16px; font-weight: bold; color: #555555; }
#acc-m-white-mid { padding: 20px 12px; }
#acc-m-white-mid .acc-stat-wrapper { font-size: 12px; }
#acc-m-white-mid .acc-stat-base { margin: 0 3px; }
.acc-modal-stat { padding-bottom: 0 !important; }

/* 飾品專屬星星遮罩 (已合併去背圖設定) */
.acc-star-badge { 
    position: absolute; top: -3.5px; right: 0px; width: 22px; height: 28px; 
    display: flex; align-items: center; justify-content: center; z-index: 10; 
    background-image: url('assets/common/icon_星星.png') !important; 
    background-size: contain; background-position: center; background-repeat: no-repeat; 
}
.acc-star-badge span {
    position: relative; z-index: 1; color: #222222; font-size: 12px;
    font-weight: 500; font-family: Arial, sans-serif;
    margin-top: 3.5px; margin-right: -1px; letter-spacing: 0.5px;
}

/* 飾品消耗統計面板 */
.acc-stats-header { font-weight: bold; color: var(--text-main); margin-bottom: 8px; border-bottom: 1px solid var(--glass-border); padding-bottom: 6px; display: flex; justify-content: space-between; align-items: flex-end; }
.acc-stats-hint, .acc-stats-hint-ev { font-size: 11px; color: var(--text-muted) !important; font-weight: normal; margin-left: 2px; }
.acc-stats-body { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.acc-stat-hist-row { display: grid; grid-template-columns: 75px 1fr 50px; gap: 5px; align-items: center; color: var(--text-main); }
.acc-hist-lv {  align-items: center; justify-content: center; }
.acc-hist-lv .arr { color: #888 !important; margin: 0 4px; width: 14px; text-align: center; }
.acc-hist-main { text-align: right; white-space: nowrap; }
.acc-hist-main .val-try { color: #f3724c !important; font-weight: bold; display: inline-block; width: 20px; text-align: center; margin: 0 2px; }
.acc-hist-ev { text-align: right; color: var(--text-muted) !important; font-size: 12px; font-family: monospace; }
.acc-stat-hist-row.current-lv { color: #0071E3 !important; font-weight: bold; }
.acc-stat-hist-row.current-lv .acc-hist-lv .arr { color: #0071E3 !important; }
.acc-hist-lv .lv-num, .acc-hist-lv .lv-next-num { display: inline-block; width: 22px; text-align: center; font-weight: bold; }
[data-theme="dark"] .acc-stat-hist-row.current-lv { color: #55C3FF !important; }
[data-theme="dark"] .acc-stat-hist-row.current-lv .acc-hist-lv .arr { color: #55C3FF !important; }
.acc-stats-footer { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--glass-border); font-size: 13px; font-weight: bold; display: flex; justify-content: center; gap: 20px; }
.acc-stats-footer .val-try { color: #f3724c !important; }
.acc-stats-footer .val-success { color: #27ae60 !important; }
.acc-stats-footer .val-fail { color: #c0392b !important; }

/* ========================================================= */
/* 🛡️ 紋章強化模擬器：專屬排版與樣式 */
/* ========================================================= */
.emb-tabs { display: flex; padding: 15px 15px 0 15px; background-color: #F0F0F0; }
.emb-tab { flex: 1; display: flex; align-items: center; justify-content: center; height: 42px; font-size: 16px; font-weight: bold; cursor: default; }
.emb-tab.active { background-color: #f3724c; color: white; border-radius: 6px 0 0 6px; }
.emb-tab.inactive { background-color: #344253; color: #a6b2c2; border-radius: 0 6px 6px 0; }

.emb-top-section { display: flex; background: #F0F0F0; min-height: 130px; }
.emb-equip-col { width: 170px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 15px 0; position: relative; }
.emb-equip-col::after { content: ''; position: absolute; right: 0; top: 15%; height: 70%; width: 1px; background-color: #dcdde1; }
.emb-stat-col { flex: 1; padding: 15px 25px; display: flex; flex-direction: column; justify-content: center; }

.emb-img-box { width: 80px; height: 80px; background: #e4e6e9; border: 1px solid #dcdde1; border-radius: 6px; position: relative; display: flex; justify-content: center; align-items: center; box-shadow: inset 0 0 10px rgba(0,0,0,0.05); margin-bottom: 5px; }
.emb-img-box img { width: 100%; height: 100%; object-fit: contain; }
.emb-equip-name { font-size: 13px; font-weight: bold; color: #333; text-align: center; width: 100%; padding: 4px 0; margin-top: 5px; background: linear-gradient(90deg, rgba(220,222,225,0) 0%, rgba(220,222,225,0.8) 20%, rgba(220,222,225,0.8) 80%, rgba(220,222,225,0) 100%); }

.emb-stat-inner-box { background-color: #e4e6e9; padding: 12px 15px; border-radius: 6px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.02); }
.emb-emblem-name { font-size: 14px; font-weight: bold; color: #333; }
.emb-lv-row { display: flex; align-items: baseline; gap: 15px; margin-bottom: 12px; }
.emb-lv-text { font-size: 16px; font-weight: bold; color: #555; }
.emb-lv-arrow { font-size: 20px; color: #f3724c; transform: scaleX(1.5); }
.emb-lv-next { font-size: 16px; font-weight: bold; color: #f3724c; }

.emb-stat-list { display: flex; flex-direction: column;}
.emb-stat-item { display: flex; justify-content: space-between; font-size: 12px; }
.emb-stat-label { color: #555; font-weight: bold; }
.emb-stat-val { color: #777; font-family: "微軟正黑體", Arial, sans-serif; font-weight: bold; }
.emb-val-highlight { color: #58C701; }

.emb-mid-section { background-color: #F0F0F0; flex: 1; display: flex; flex-direction: column; align-items: stretch; padding-bottom: 25px; }
.emb-mid-hint { align-self: stretch; background-color: #FFFFFF; padding: 15px 15px; font-size: 13px; color: #7f8c8d; text-align: center; font-weight: bold; line-height: 1.6; border-top: 1px solid #dcdde1; border-bottom: 1px solid #dcdde1; margin-bottom: 20px; }

.emb-mat-area { align-self: center; display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.emb-mat-box { width: 65px; height: 65px; background: #dcdde1; border-radius: 4px; display: flex; justify-content: center; align-items: center; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.emb-mat-box img {width: 100%;height: 100%;object-fit: contain;}
.emb-rate-col { display: flex; flex-direction: column; gap: 2px; justify-content: center; }
.emb-rate-row { display: flex; align-items: baseline; gap: 15px; min-width: 120px;}
.emb-rate-label { font-size: 16px; font-weight: bold; color: #555; width: 70px; text-align: left; }
.emb-rate-val-s, .emb-rate-val-m { font-size: 18px; font-weight: bold; }
.emb-rate-val-s { color: #333; }
.emb-rate-val-m { color: #f3724c; }
.emb-rate-success-main,
.emb-rate-premium-value,
.emb-rate-percent { color: #58C701; }
.emb-rate-formula { color: #333; }

.emb-controller-wrap { align-self: center; display: flex; justify-content: center; align-items: center; gap: 0; }
.emb-ctrl-btn { background: #455468; color: white; border: none; width: 36px; height: 32px; font-size: 20px; font-weight: bold; cursor: pointer; display: flex; justify-content: center; align-items: center; box-shadow: 0 2px 0 #2c3e50; transition: transform 0.1s; }
.emb-ctrl-btn-minus { border-radius: 6px 0 0 6px; }
.emb-ctrl-btn-plus { border-radius: 0 6px 6px 0; }
.emb-ctrl-btn:active { transform: translateY(2px); box-shadow: none; }
.emb-ctrl-display { background: #fff; border: none; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: bold; color: #333; width: 90px; }
.emb-ctrl-btn.emb-ctrl-max { width: auto; padding: 0 15px; font-size: 14px; border-radius: 6px; margin-left: 10px; background: #455468; box-shadow: 0 2px 0 #2c3e50; }
.emb-ctrl-max[hidden] { display: none !important; }
.emb-controller-wrap.disabled { opacity: 0.5; pointer-events: none; }
.emb-premium-external-panel {
    width: 100%;
    max-width: 720px;
    min-height: 68px;
    margin: 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 13px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
}
.emb-premium-external-panel[hidden] { display: none !important; }
.emb-premium-external-panel.is-disabled .emb-premium-label {
    filter: grayscale(0.45);
    opacity: 0.65;
}
.emb-premium-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    background: #dcdfe3;
    border: 1px solid #c9ced4;
    border-radius: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}
.emb-premium-label img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}
.emb-premium-controller { align-self: auto; flex: 0 0 auto; }
.emb-premium-display { width: 62px; }
.emb-rate-breakdown {
    font-size: inherit;
    white-space: nowrap;
}
.emb-hist-materials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 82px;
}
.emb-hist-material-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1;
}
.emb-hist-material-item img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.emb-hist-material-item strong {
    min-width: 12px;
    font-size: 13px;
    text-align: left;
}
.emb-hist-material-plus {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}
.emb-hist-empty {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}
.emb-material-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 25px;
    margin: 15px 0 5px;
    color: #555;
    font-size: 14px;
    font-weight: bold;
}

@media (max-width: 600px) {
    .emb-premium-external-panel {
        width: calc(100% - 16px);
        min-height: 62px;
        gap: 9px;
        margin-top: 10px;
        padding: 11px 12px;
    }
    .emb-premium-label { width: 46px; height: 46px; }
    .emb-premium-label img { width: 40px; height: 40px; }
    .emb-material-summary { gap: 7px 14px; font-size: 12px; }
}

/* 紋章彈出視窗 */
.emb-modal-body { background: #ffffff; width: 100%; display: flex; flex-direction: column; }
#emb-result-modal .m-enh-grey-top { padding: 20px 20px 0 20px !important; border-bottom: 1px solid #e1e4e8; }
#emb-result-modal .m-item-name { margin-top: 5px; font-size: 14px; color: #333; }
#emb-result-modal .acc-m-attempts { margin-top: 4px; margin-bottom: 15px; }
#emb-result-modal .emb-img-box { width: 80px; height: 80px; margin-bottom: 8px; }
#emb-m-new-lv-color { color: #f3724c; }

.emb-m-lv-row { display: flex; justify-content: center; align-items: center; gap: 20px; padding: 0 0 20px 0; margin: 0; }
.emb-m-lv-old { font-size: 18px; font-weight: bold; color: #555; }
.emb-m-lv-arr { font-size: 22px; color: #f3724c; font-weight: 900; transform: scaleX(1.2); }
.emb-m-lv-new { font-size: 18px; font-weight: bold; color: #f3724c; } 

.emb-m-stat-list { padding: 20px 25px; display: flex; flex-direction: column; }
.emb-m-stat-item { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: bold; }
.emb-m-stat-label { color: #555; }
.emb-m-stat-label.success { color: #58C701; }
.emb-m-stat-val.success-val { color: #f3724c; }
.emb-m-stat-val.fail-val { color: #f3724c; font-family: "微軟正黑體", Arial, sans-serif; } 
.emb-m-stat-val span { color: #58C701; margin-left: 4px; }

.emb-m-bottom-cost { background-color: #EAEAEA; padding: 15px 25px; text-align: right; font-size: 16px; font-weight: bold; color: #E42123; }
.emb-m-bottom-cost span { color: #58C701; font-size: 14px; margin-left: 5px; }
#emb-result-modal .m-enh-grey-bot { background-color: #F4F4F4; }

/* 修復下拉選單過長的問題 */
#emb-equip-select, #tr-equip-select { width: auto !important; min-width: 180px; max-width: 100%; cursor: pointer; }


/* ========================================================= */
/* 🌟 全域通用組件：裝備遮罩 (星力、等級、菱形紋章) */
/* ========================================================= */

/* 1. 星力遮罩 */
.equip-badge-star {
    position: absolute; top: -1px; right: -3px; width: 29px; height: 23px;
    display: flex; align-items: center; justify-content: center; z-index: 15;
    background-image: url('assets/common/icon_星星.png') !important;
    background-size: contain; background-position: center; background-repeat: no-repeat;
}
.equip-badge-star span {
    font-size: 10px; font-weight: 900; text-shadow: 0px 0px 0px rgba(0,0,0,0.8);
    margin-top: 2px; margin-right: -1px; color: #111 !important;
}

/* 2. 裝備等級遮罩 */
.equip-badge-lv {
    position: absolute; bottom: 4px; right: 5px;
    font-size: 11px;
    background-color: rgba(17, 17, 17, 1); color: #ffffff;
    letter-spacing: -0.1px; line-height: 1.2; 
    border-radius: 11px; border: none; z-index: 15; text-align: center; box-sizing: border-box;
    min-width: auto !important; 
    padding: 1px 5px !important; 
}

/* 3. 菱形紋章遮罩 */
.emb-diamond-badge {
    position: absolute; top: 15px; left: -4.5px; width: 25px; height: 34px;
    display: flex; align-items: center; justify-content: center; z-index: 10;
    background-size: contain; background-position: center; background-repeat: no-repeat;
    background-color: transparent !important;
}

/* ========================================================= */
/* 🌟 菱形紋章數字設定 (分離紫/藍色邊框) */
/* ========================================================= */

/* 共通文字設定 */
.emb-diamond-badge span {
    position: relative; z-index: 1; color: #ffffff !important;
    font-size: 13px !important; font-family: Arial, Tahoma, sans-serif !important;
    letter-spacing: -1.2px !important; margin-top: -1px !important; margin-left: 0px !important;
}

/* 紫/藍色紋章文字外框 */
.emb-bg-purple span {
    text-shadow: -1px -1px 0 #5b277b, 1px -1px 0 #5b277b, -1px 1px 0 #5b277b, 1px 1px 0 #5b277b, 0px 2px 0 rgba(0, 0, 0, 0.8) !important;
}
.emb-bg-blue span {
    text-shadow: -1px -1px 0 #1b3b6f, 1px -1px 0 #1b3b6f, -1px 1px 0 #1b3b6f, 1px 1px 0 #1b3b6f, 0px 2px 0 rgba(0, 0, 0, 0.8) !important;
}

/* 雙位數專屬微調 */
.emb-diamond-badge.is-double span { margin-left: -2px !important; }

/* 紋章底圖 */
.emb-bg-blue { background-image: url('assets/common/icon_藍紋章等級.png') !important; }
.emb-bg-purple { background-image: url('assets/common/icon_紫紋章等級.png') !important; }

/* ========================================================= */
/* 🎯 終極防跑版：各模擬器遮罩「獨立位置控制台」 (電腦版) */
/* ========================================================= */
/* 💍 紋章強化模擬器 */
#emb-ui-diamond-badge  { top: 14px !important; left: -2.5px !important; } 
#emb-m-diamond-badge   { top: 14px !important; left: -2px !important; }   
#emb-result-modal .emb-diamond-badge { top: 13px !important; left: -3px !important; }

/* ⚔️ 超越強化模擬器 */
#tr-ui-diamond-badge   { top: 16px !important; left: -3.5px !important; } 
#tr-m-diamond-badge    { top: 14px !important; left: -3px !important; }   
#tr-m-scr-diamond-badge{ top: 22px !important; left: -6px !important; }   

/* 🔨 製作模擬器 */
#cr-ui-diamond-badge   { top: 16px !important; left: -2px !important; } 
#cr-m-diamond-badge    { top: 13px !important; left: -3px !important; }
#cr-m-lv-badge { bottom: 3px !important; right: 4px !important; padding: 1px 7px !important;}   

/* ⭐ 星星遮罩通用微調 */
#tr-m-star-badge, #cr-m-star-badge { top: -2px !important; right: -4px !important; }
#emb-m-star-badge { top: -2px !important; right: -4px !important; }


/* ========================================================= */
/* 🚀 修復：彈出視窗動畫結束跳動/閃移 */
/* ========================================================= */
.modal-box {
    will-change: transform, opacity;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    transform: translateZ(0);
}
.equip-badge-star, .equip-badge-star span,
.emb-diamond-badge, .emb-diamond-badge span, .equip-badge-lv {
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    transform: translateZ(0); 
    -webkit-font-smoothing: subpixel-antialiased;
}

/* ========================================================= */
/* 🎭 星力模擬器：嘲諷公告 (現代毛玻璃風格) */
/* ========================================================= */
.sarcasm-banner {
    max-width: 550px; margin: 15px auto; 
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-left: 6px solid #ff4757; border-radius: 12px;
    padding: 35px 25px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center; font-family: sans-serif;
}
.sarcasm-title { color: #ff4757; font-size: 20px; font-weight: 900; margin-bottom: 20px; letter-spacing: 2px; }
.sarcasm-content { color: #2f3542; font-size: 15px; line-height: 1.8; }
.highlight-red { color: #e84118; font-weight: bold; text-decoration: underline; white-space: nowrap; }
.highlight-gold { color: #e58e26; font-weight: bold; font-size: 17px; white-space: nowrap; }
.sarcasm-img { max-width: 100%; margin-top: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15); }


/* ================================================= */
/* 📱 響應式佈局 (Mobile & Tablet RWD)               */
/* ================================================= */

@media (max-width: 768px) {
    .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .home-menu-category {
        min-height: 24px;
        margin: 9px 2px -2px;
    }
    .home-menu-category > span { font-size: 13px; }
    .home-menu-category::before { height: 14px; }
    .ignore-layout-wrapper { flex-direction: column; }
    .ignore-left-panel, .ignore-right-panel { width: 100%; flex: none; }
    .inst-btn-grid { grid-template-columns: repeat(2, 1fr); }
    .inst-btn-item { grid-column: span 1; }
    .span-special { grid-column: 1 / -1 !important; }
    #will-game-wrapper, #tab-will .settings-panel, #tab-will .instructions-panel {
        width: calc(100% - 16px) !important;
        margin-left: auto !important; margin-right: auto !important;
    }
}

@media (max-width: 600px) {
    .app-grid { gap: 10px; }

    .app-card {
        min-width: 0;
        min-height: 104px;
        padding: 12px 8px 10px;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        border-radius: 15px;
        text-align: center;
    }

    .app-card .app-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .app-card .app-info {
        width: 100%;
        align-items: center;
        overflow: visible;
    }

    .app-card .app-title {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        width: 100%;
        font-size: 13px;
        line-height: 1.3;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: center;
    }

    .app-card.app-card-has-badge {
        padding: 12px 8px 10px;
    }

    .app-status-badge {
        top: 9px;
        right: 8px;
        height: 19px;
        min-width: 35px;
        padding: 0 6px;
        transform: none;
        font-size: 7.5px;
    }

    .app-card-notice.app-card-has-badge {
        min-height: 66px;
        padding: 10px 72px 10px 14px;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }

    .app-card-notice .app-status-badge {
        top: 50%;
        right: 14px;
        transform: translateY(-50%);
    }

    .app-card-notice .app-info {
        align-items: flex-start;
    }

    .app-card-notice .app-title {
        min-height: 0;
        justify-content: flex-start;
        text-align: left;
    }
}

@media (max-width: 350px) {
    .app-grid { grid-template-columns: 1fr; }

    .app-card {
        min-height: 68px;
        padding: 10px 14px;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }

    .app-card.app-card-has-badge {
        padding: 10px 76px 10px 14px;
    }

    .app-status-badge {
        top: 50%;
        right: 12px;
        transform: translateY(-50%);
    }

    .app-card .app-info {
        align-items: flex-start;
    }

    .app-card .app-title {
        min-height: 0;
        justify-content: flex-start;
        text-align: left;
    }
}

@media (max-width: 500px) {
    body { padding: 4px; }
    .container { padding: 12px 8px; border-radius: 16px; }
    .panel, .detail-box { padding: 10px 6px; border-radius: 12px; }

    /* 通用與其他模擬器微調 */
    .lazy-table th, .lazy-table td { font-size: clamp(10px, 3.2vw, 14px); padding: 10px 4px; }
    .lazy-table th { white-space: nowrap; }
    .mobile-br { display: block; }
    .desktop-space { display: none; }
    .tag { font-size: 11px; padding: 4px 6px; line-height: 1.3; }
    .core-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .dynamic-lv-overlay { transform: scale(0.85); transform-origin: bottom right; bottom: 3px; right: 3px; }

    .forge-sidebar { display: none; }
    .sec-white { min-height: 50px; padding: 10px 0; }
    .sec-grey-mid { padding: 15px 10px; }
    .cr-chaos-tier-caption { margin-bottom: 10px; font-size: 12px; line-height: 1.5; }
    .cr-chaos-route-list { width: min(330px, 100%); gap: 11px; font-size: 12px; line-height: 1.4; }
    .cr-chaos-route { grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); }
    .cr-chaos-route-arrow { font-size: 17px; }
    .cr-tier-or { margin: 0 1px; }
    .cr-craft-rate-line {
        padding-right: 27px !important;
        padding-left: 27px !important;
        font-size: clamp(11px, 3vw, 13px) !important;
    }
    .cr-rate-info-button {
        right: 6px;
        width: 18px;
        height: 18px;
        font-size: 11px;
    }
    #cr-game-ui-container .rate-box { margin-top: 16px !important; }
    .scroll-mode-active .sec-middle { padding: 20px 10px !important; }
    .lv-arrow { margin: 0 10px; font-size: 18px; }
    .lv-text, .lv-next { font-size: 18px; }
    .rate-title { font-size: 16px; }
    .rate-highlight { font-size: 18px; }
    .rate-detail { font-size: 12px; }
    .bonus-row { width: 65%; font-size: 13px; }
    hr.divider { margin: 10px 0 15px 0; width: calc(100% + 20px); }
    .desc-text { width: 95%; font-size: 11px; }

    .modal-box { width: 95%; max-width: 340px; }
    .m-enh-white-mid { padding: 12px; }
    .m-scr-white-body { padding: 24px 12px; }
    .m-scr-grey-box { width: 95%; font-size: 14px; padding: 12px; }

    .sec-top { padding: 15px 5px; gap: 10px; justify-content: center; align-items: flex-start; flex-wrap: nowrap !important; }
    .item-col { width: 110px; }
    .img-box { width: 70px; height: 70px; margin-bottom: 5px; }
    .plus-sign { font-size: 30px; margin-top: 15px; }
    .equip-name { width: 100%; font-size: 11px; white-space: nowrap; overflow: visible; word-break: break-word; line-height: 1.3; margin-top: 5px; }
    
    .coin-box { width: 140px; font-size: 14px; padding: 8px 10px; }
    .btn-action-tr { width: 110px; font-size: 15px; padding: 10px 0; }
    .sec-bottom { gap: 10px; padding: 15px 0; }

    #cr-game-ui-container .sec-top { gap: 4px !important; padding: 15px 8px 10px !important; } 
    #cr-game-ui-container .item-col { width: 96px !important; min-width: 96px !important; max-width: 96px !important; flex: 0 0 96px !important; }
    #cr-game-ui-container .img-box { width: 70px !important; height: 70px !important; }
    #cr-game-ui-container .plus-sign { width: 20px !important; min-width: 20px !important; flex: 0 0 20px !important; font-size: 26px !important; margin-top: 22px !important; }
    #cr-game-ui-container .item-col:nth-child(3) { margin-right: 8px !important; }
    #cr-game-ui-container .equip-name { width: 100% !important; max-width: 96px !important; min-height: 29px; white-space: normal !important; overflow-wrap: anywhere; font-size: 10px !important; line-height: 1.25; transform: none !important; }
    #cr-game-ui-container .item-col:nth-child(4) .equip-name { font-size: 10px !important; letter-spacing: -0.5px !important; transform: none !important; }
    #cr-game-ui-container .forge-main { height: auto !important; min-height: 0 !important; }
    #cr-game-ui-container .sec-grey-mid { padding-top: 10px !important; }

    .cr-stage-setting-row {
        grid-template-columns: 1fr;
        row-gap: 8px;
    }
    .cr-stage-options { gap: 8px; }
    .cr-stage-options {
        display: grid;
        grid-template-columns: repeat(2, max-content);
        justify-content: start;
        column-gap: 18px;
        row-gap: 8px;
        white-space: normal;
    }
    .cr-stage-setting-row .cr-stage-options label {
        gap: 2px !important;
        font-size: 11px !important;
        letter-spacing: -0.4px;
    }
    .cr-stage-options input { margin: 0; }
    .cr-scroll-setting-row {
        grid-template-columns: auto auto;
        justify-content: start;
        column-gap: 7px;
    }
    .cr-scroll-setting-row .cr-setting-heading {
        font-size: 11px;
        letter-spacing: -0.3px;
    }
    .cr-scroll-selects { gap: 5px; }
    .cr-scroll-selects select {
        width: 62px;
        padding-right: 2px;
        padding-left: 2px;
        font-size: 11px;
    }

    .setting-row { gap: 6px !important; font-size: 13px !important; }
    .setting-row label { font-size: 13px !important; }
    .checkbox-label { font-size: 13px !important; letter-spacing: -0.5px !important; }

    #tab-hexa-visual .visual-container { padding: 15px 12px !important; }
    #tab-hexa-visual .visual-header-top { flex-direction: row !important; align-items: center !important; padding-bottom: 10px !important; }
    #tab-hexa-visual .v-fragment-text { font-size: 12px !important; white-space: nowrap !important; }
    #tab-hexa-visual .v-btn-top { padding: 6px 7px !important; font-size: 11px !important; }
    #tab-hexa-visual .visual-box { padding: 10px 8px !important; gap: 8px !important; border-radius: 12px !important; }
    #tab-hexa-visual .hexa-img { width: 38px !important; height: 38px !important; }
    #tab-hexa-visual .v-header-row { flex-direction: row !important; justify-content: space-between !important; align-items: flex-end !important; flex-wrap: nowrap !important; }
    #tab-hexa-visual .v-title-main, #tab-hexa-visual .v-title-sub { font-size: 12px !important; margin-bottom: 2px !important; }
    #tab-hexa-visual .v-stat-name { font-size: 12px !important; letter-spacing: 0 !important; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    #tab-hexa-visual .v-prob { font-size: 11px !important; white-space: nowrap !important; margin-left: 5px !important;}
    #tab-hexa-visual .visual-controls { flex-direction: column !important; align-items: stretch !important; padding: 15px 12px !important; gap: 15px !important; border-radius: 12px !important;}
    #tab-hexa-visual .v-control-group { width: 100% !important; justify-content: space-between !important; }
    #tab-hexa-visual .v-btn-10x, #tab-hexa-visual .v-btn { flex: 1 !important; padding: 12px 10px !important; font-size: 15px !important; text-align: center !important; border-radius: 8px !important;}
    
    /* 飾品強化 */
    .acc-stat-wrapper { font-size: 11px !important; }
    #acc-stat-detail { flex-direction: row !important; justify-content: space-between !important; font-size: 11px !important; }
    #acc-stat-detail > div { white-space: nowrap !important; }
    #tab-acc-enhance .lv-text, #tab-acc-enhance .lv-next { font-size: 22px !important; }
    #tab-acc-enhance .acc-lv-arrow { font-size: 22px !important; margin: 0 40px !important; color: #f3724c;}
    #tab-acc-enhance .acc-prob-wrapper { -webkit-text-size-adjust: 100%; }
    #tab-acc-enhance .acc-prob-label-s, #tab-acc-enhance .val-success { font-size: 22px !important; }
    #tab-acc-enhance .acc-prob-label, #tab-acc-enhance .val-neutral { font-size: 14px !important; }
    #acc-m-white-mid { padding: 15px 8px !important; }
    #acc-m-white-mid .acc-stat-wrapper { font-size: 13px !important; letter-spacing: -1.2px; }
    #tab-acc-enhance .acc-star-badge { top: -5px !important; right: 0px !important; width: 20px; }
    #tab-acc-enhance .acc-star-badge span { margin-top: 2px !important; }
    
    /* 紋章強化：保持左右並排 */
    .emb-top-section { flex-direction: row !important; align-items: stretch !important; }
    .emb-equip-col { width: 110px !important; padding: 12px 5px !important; border-right: none; border-bottom: 1px solid #e1e4e8; }
    .emb-equip-col::after { display: block !important; }
    .emb-img-box { width: 70px !important; height: 70px !important; }
    .emb-stat-col { padding: 12px 10px !important; min-width: 0; }
    .emb-stat-inner-box { padding: 8px 10px !important; }
    .emb-stat-item { font-size: 11px !important; }
    .emb-lv-row, .emb-m-lv-row {gap: 8px !important; white-space: nowrap !important; margin-bottom: 8px;}
    .emb-m-lv-old, .emb-m-lv-new { font-size: 15px !important; }
    .emb-m-lv-arr { font-size: 18px !important; }
    .emb-mat-section { margin: 0 10px; padding: 15px; flex-direction: column; gap: 10px; }
    .emb-rate-row { min-width: 150px; }

    /* 🌟 星力嘲諷公告：手機版優化 */
    .sarcasm-banner { padding: 25px 15px; margin: 10px auto; }
    .sarcasm-content { font-size: 14px; }
    .sarcasm-img { margin-top: 20px; }

    /* ---------------------------------------------------------
       📱 【手機版】裝備遮罩：縮放與獨立位置控制台
    --------------------------------------------------------- */
    /* 🌟 魔法招式：等比例縮小！ */
    .emb-diamond-badge { transform: scale(0.9) !important; transform-origin: top left !important; }
    .equip-badge-star { transform: scale(0.9) !important; transform-origin: top right !important; }
    .equip-badge-lv { transform: scale(1) !important; transform-origin: bottom right !important; bottom: 3px !important; right: 3px !important;  padding: 1px 3px !important; font-size: 10px;}

    /* 👇 菱形遮罩：手機版個別位置微調 */
    #emb-ui-diamond-badge  { top: 10px !important; left: -3px !important; }
    #emb-m-diamond-badge   { top: 11px !important; left: -1px !important; }
    #tr-ui-diamond-badge   { top: 11px !important; left: -4px !important; }
    #tr-m-diamond-badge    { top: 15px !important; left: -2px !important; }
    #tr-m-scr-diamond-badge{ top: 18px !important; left: -4px !important; width: 21px; }
    #cr-ui-diamond-badge   { top: 10px !important; left: -4px !important; }
    #cr-m-diamond-badge    { top: 14px !important; left: -3px !important; width: 27px; }

    /* 👇 等級遮罩：手機版個別位置微調 */
    #cr-m-lv-badge { bottom: 3px !important; right: 4px !important; padding: 1px 7px !important; min-width: 16px !important;}
    #tr-m-lv-badge, #tr-m-scr-lv-badge { bottom: 3px !important; right: 4px !important; padding: 1px 5px !important;}
    #emb-m-lv-badge { bottom: 2px !important; right: 3px !important; padding: 1px 4px !important; }

    /* 👇 星星遮罩：手機版個別位置微調 */
    #tr-ui-star-badge      { top: -1px !important; right: -3px !important; }
    #tr-m-star-badge, #tr-m-scr-star-badge { top: 0px !important; right: -2px !important; height: 21px; }
    #emb-ui-star-badge     { top: 0px !important; right: -3px !important; }
    #emb-m-star-badge      { top: -1px !important; right: 0px !important; width: 21px; }
    #cr-ui-star-badge      { top: -2px !important; right: -5px !important; }
    #cr-m-star-badge       { top: -1px !important; right: -2px !important; }
}

@media (max-width: 768px) and (orientation: portrait) {
    #ms-player-hud { transform: scale(0.6) !important; transform-origin: top left; }
    .glass-panel { padding: 3px 6px !important; gap: 4px !important; border-radius: 6px !important; }
    .glass-btn { font-size: 12px !important; width: 26px !important; height: 26px !important; padding: 0 !important; }
    #glass-controls-top { top: 4px !important; right: 4px !important; }
    #glass-controls-mid { right: 4px !important; }
    #glass-controls-bottom { bottom: 4px !important; right: 4px !important; }
    
    #joystick-base { width: 45px !important; height: 45px !important; bottom: 5% !important; left: 2% !important; border-width: 1px !important; }
    #joystick-stick { width: 18px !important; height: 18px !important; }
    #will-status { font-size: 14px !important; margin-bottom: 2px !important; }
    #will-timer { font-size: 10px !important; margin-top: 0 !important; }
    #tab-will .custom-num-input { width: 25px !important; padding: 2px !important; font-size: 12px !important; }
    
    #will-game-wrapper { min-height: auto !important; overflow: hidden !important; }
    #will-inner-container { height: auto !important; aspect-ratio: 1741 / 713 !important; }
    #willCanvas { position: relative !important; top: auto !important; transform: none !important; height: 100% !important; }

    #will-start-overlay, #will-result-overlay { position: absolute !important; width: 100% !important; height: 100% !important; border-radius: 8px !important; }

    #will-start-overlay .start-card { width: 90% !important; max-width: 250px !important; height: auto !important; padding: 25px 25px !important; transform-origin: center center !important; overflow-y: visible !important; max-height: none !important; animation: popInPortraitStart 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important; }
    #will-result-overlay .result-card { width: 95% !important; max-width: 260px !important; height: auto !important; padding: 25px 20px !important; transform-origin: center center !important; overflow-y: visible !important; max-height: none !important; animation: popInPortraitResult 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important; }
    
    #will-start-overlay .will-game-title { font-size: 16px !important; margin-bottom: 5px !important; letter-spacing: 1px !important; }
    #will-start-overlay .will-rule-box { padding: 6px !important; font-size: 11px !important; gap: 2px 4px !important; margin-bottom: 6px !important; width: 100% !important; max-width: 240px !important;}
    #will-start-overlay .glass-input, #will-start-overlay .glass-btn-start { height: 32px !important; font-size: 13px !important; }
    
    .result-stat { margin-bottom: 3px !important; gap: 4px !important; font-size: 12px !important; }
    .result-total { margin-top: 2px !important; padding-top: 5px !important; margin-bottom: 6px !important; gap: 10px !important;}
    .will-res-hit-num { font-size: 20px !important; }
    
    .will-res-btn-group { flex-wrap: nowrap !important; gap: 8px !important; }
    .btn-res-secondary, .btn-res-primary { height: 28px !important; font-size: 12px !important; padding: 0 8px !important; white-space: nowrap !important; }

    #tab-will .settings-panel { padding: 15px !important; }
    #tab-will .will-vol-group-wrapper { flex-wrap: nowrap !important; gap: 5px !important; }
    #tab-will .vol-group { border-left: none !important; padding-left: 0 !important; margin-left: 0 !important; width: auto !important; flex: 1 !important; }
    #tab-will .vol-group input[type="range"] { width: 100% !important; min-width: 40px !important; }
    #tab-will .vol-group label { white-space: nowrap !important; }

    .memo-content { flex-direction: column !important; gap: 15px !important; align-items: center !important; text-align: center !important; }
    .memo-media { width: 100% !important; max-width: 250px !important; flex-basis: auto !important; }
    .memo-apng { width: 100% !important; }

    #tab-will .inst-btn-grid { display: grid !important; grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; width: 100% !important; }
    #tab-will .inst-btn-grid > div:nth-child(5), #tab-will .inst-btn-grid > div:nth-child(6) { grid-column: span 2 !important; }
}

@keyframes hexaResultPop { 0% { transform: translateY(15px); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes popInPortraitStart { 0% { opacity: 0; transform: scale(0.2); } 100% { opacity: 1; transform: scale(0.52); } }
@keyframes popInPortraitResult { 0% { opacity: 0; transform: scale(0.2); } 100% { opacity: 1; transform: scale(0.46); } }

/* ========================================================= */
/* 極限屬性計算機                                             */
/* ========================================================= */
#tab-hyper-stat {
    --hyper-accent: #7557dc;
    --hyper-blue: #438fd4;
    color: var(--text-main);
    gap: 14px;
}

.hyper-overview {
    display: grid;
    grid-template-columns: minmax(190px, 0.8fr) minmax(0, 2.2fr);
    align-items: stretch;
    gap: 16px;
    overflow: visible;
}

.hyper-level-field {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding: 4px 2px;
}

.hyper-level-field > label {
    color: var(--text-main);
    font-size: 14px;
    font-weight: 800;
}

.hyper-level-field > small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.hyper-level-input {
    height: 44px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--input-bg);
    border: 1px solid rgba(117, 87, 220, 0.23);
    border-radius: 11px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

:not([data-theme="dark"]) #tab-hyper-stat .hyper-level-input:focus-within,
:not([data-theme="dark"]) #tab-hyper-stat .hyper-skill-level-input:focus-within {
    border-color: rgba(200, 141, 221, 0.72);
    box-shadow: none;
}

[data-theme="dark"] #tab-hyper-stat .hyper-level-input:focus-within,
[data-theme="dark"] #tab-hyper-stat .hyper-skill-level-input:focus-within {
    border-color: rgba(85, 195, 255, 0.82);
    box-shadow: none;
}

#tab-hyper-stat .hyper-level-input input:focus,
#tab-hyper-stat .hyper-skill-level-input input:focus {
    box-shadow: none !important;
    transform: none !important;
}

.hyper-level-input > span {
    padding-left: 13px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
}

.hyper-level-input input {
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0 12px 0 4px;
    color: var(--text-main);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 17px;
    font-weight: 900;
}

#tab-hyper-stat .hyper-level-input > span {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
}

.hyper-overview-stats {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(82px, 0.8fr)) minmax(180px, 1.45fr);
    gap: 9px;
}

.hyper-overview-item {
    min-width: 0;
    min-height: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px;
    background: linear-gradient(145deg, rgba(229, 220, 255, 0.72), rgba(235, 244, 255, 0.56));
    border: 1px solid rgba(117, 87, 220, 0.12);
    border-radius: 12px;
    box-sizing: border-box;
    text-align: center;
}

.hyper-overview-item > span:not(.hyper-coin-wrap) {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.hyper-overview-item > strong {
    color: var(--text-main);
    font-size: clamp(19px, 2.4vw, 25px);
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.hyper-overview-item.is-over {
    background: linear-gradient(145deg, rgba(255, 218, 223, 0.82), rgba(255, 237, 240, 0.62));
    border-color: rgba(217, 69, 92, 0.25);
}

.hyper-overview-item.is-over strong { color: #d23f58; }

.hyper-overview-mesos {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    background: linear-gradient(145deg, rgba(255, 234, 183, 0.68), rgba(232, 224, 255, 0.6));
}

.hyper-overview-mesos > strong {
    min-width: 0;
    font-size: clamp(18px, 2.3vw, 24px);
    white-space: nowrap;
}

.hyper-coin-wrap {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
}

.hyper-coin-wrap img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.hyper-profile-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hyper-profile-tab {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 17px;
    color: var(--text-main);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(40, 34, 82, 0.05);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hyper-profile-tab:hover { transform: translateY(-2px); }

.hyper-profile-tab.active {
    border-color: rgba(117, 87, 220, 0.65);
    box-shadow: 0 7px 20px rgba(117, 87, 220, 0.14);
}

.hyper-profile-tab > span {
    font-size: 16px;
    font-weight: 900;
}

.hyper-profile-tab > small {
    padding: 5px 9px;
    color: #6449bf;
    background: rgba(117, 87, 220, 0.1);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.hyper-profile-panel { width: 100%; }
.hyper-profile-panel.active { animation: appleFadeIn 0.28s ease; }

.hyper-skill-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.hyper-skill-card {
    min-width: 0;
    padding: 14px;
    color: var(--text-main);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    box-shadow: 0 5px 17px rgba(40, 34, 82, 0.055);
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hyper-skill-card.is-max {
    border-color: rgba(117, 87, 220, 0.42);
    box-shadow: 0 7px 20px rgba(117, 87, 220, 0.11);
}

:not([data-theme="dark"]) #tab-hyper-stat .hyper-skill-card:focus-within {
    border-color: #7658df;
    box-shadow: 0 0 15px rgba(117, 87, 220, 0.46);
    transform: translateY(-2px);
}

[data-theme="dark"] #tab-hyper-stat .hyper-skill-card:focus-within {
    border-color: #55c3ff;
    box-shadow: 0 0 15px rgba(85, 195, 255, 0.48);
    transform: translateY(-2px);
}

.hyper-skill-heading {
    min-height: 27px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 11px;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(117, 87, 220, 0.1);
}

.hyper-skill-heading h3 {
    min-width: 0;
    margin: 0;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.hyper-skill-heading-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hyper-skill-heading-actions > span {
    flex: 0 0 auto;
    padding: 4px 8px;
    color: #6043bd;
    background: rgba(117, 87, 220, 0.1);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.hyper-max-button {
    height: 24px;
    padding: 0 7px;
    color: #fff;
    background: linear-gradient(135deg, #8064e5, #5d3ab9);
    border: 0;
    border-radius: 7px;
    box-shadow: 0 3px 8px rgba(93, 58, 185, 0.22);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.hyper-max-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.hyper-max-button.is-clear {
    background: linear-gradient(135deg, #ff6259, #d93636);
    box-shadow: 0 3px 8px rgba(217, 54, 54, 0.24);
}

.hyper-skill-stepper {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    align-items: center;
    gap: 7px;
}

.hyper-skill-stepper > button {
    width: 36px;
    height: 38px;
    padding: 0;
    color: #6449bf;
    background: rgba(117, 87, 220, 0.09);
    border: 1px solid rgba(117, 87, 220, 0.14);
    border-radius: 10px;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.hyper-skill-stepper > button:hover {
    background: rgba(117, 87, 220, 0.16);
    transform: translateY(-1px);
}

.hyper-skill-level-input {
    height: 38px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--input-bg);
    border: 1px solid rgba(117, 87, 220, 0.18);
    border-radius: 10px;
}

.hyper-skill-level-input > span {
    padding-left: 10px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
}

.hyper-skill-level-input input {
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0 8px 0 3px;
    color: var(--text-main);
    background: transparent;
    border: 0;
    outline: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 900;
}

.hyper-skill-cost {
    min-width: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: 11px;
}

.hyper-skill-cost-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hyper-skill-cost-main img {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    object-fit: contain;
}

.hyper-skill-cost-main strong {
    min-width: 0;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hyper-skill-cost > small {
    flex: 0 0 auto;
    color: #6f6a78;
    text-align: right;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
}

.hyper-bottom-actions {
    width: 100%;
    margin-top: 1px;
}

.hyper-bottom-actions button {
    width: 100%;
    min-height: 42px;
    color: var(--text-main);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 13px;
    box-shadow: 0 4px 15px rgba(40, 34, 82, 0.055);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.hyper-bottom-actions button:hover {
    color: #5c3caf;
    background: rgba(117, 87, 220, 0.09);
    border-color: rgba(117, 87, 220, 0.27);
}

[data-theme="dark"] .hyper-overview-item {
    background: linear-gradient(145deg, rgba(69, 54, 114, 0.68), rgba(31, 49, 70, 0.58));
    border-color: rgba(177, 156, 244, 0.17);
}

[data-theme="dark"] .hyper-overview-item.is-over {
    background: linear-gradient(145deg, rgba(103, 35, 50, 0.72), rgba(61, 29, 41, 0.6));
}

[data-theme="dark"] .hyper-overview-mesos {
    background: linear-gradient(145deg, rgba(91, 66, 28, 0.7), rgba(63, 48, 91, 0.6));
}

[data-theme="dark"] .hyper-profile-tab > small,
[data-theme="dark"] .hyper-skill-heading-actions > span,
[data-theme="dark"] .hyper-skill-stepper > button {
    color: #d8ccff;
}

[data-theme="dark"] .hyper-max-button {
    color: #fff;
    background: linear-gradient(135deg, #9b83ef, #7454d0);
    box-shadow: 0 3px 10px rgba(155, 131, 239, 0.2);
}

[data-theme="dark"] .hyper-max-button.is-clear {
    background: linear-gradient(135deg, #ff7068, #c93c46);
    box-shadow: 0 3px 10px rgba(255, 91, 91, 0.2);
}

[data-theme="dark"] .hyper-skill-cost > small {
    color: #afbed0;
}

@media (max-width: 800px) {
    .hyper-overview { grid-template-columns: 1fr; }
    .hyper-overview-stats { grid-template-columns: repeat(3, minmax(70px, 1fr)) minmax(165px, 1.5fr); }
    .hyper-skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    #tab-hyper-stat { gap: 11px; }
    .hyper-overview { gap: 12px; padding: 14px; }
    .hyper-level-field { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 10px; }
    .hyper-overview-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
    .hyper-overview-item { min-height: 66px; padding: 10px 8px; }
    .hyper-overview-item > strong { font-size: 19px; }
    .hyper-overview-mesos { grid-column: 1 / -1; min-height: 62px; justify-content: center; }
    .hyper-overview-mesos > strong { font-size: 21px; }
    .hyper-profile-tab { min-height: 54px; padding: 10px 12px; }
    .hyper-profile-tab > span { font-size: 15px; }
    .hyper-profile-tab > small { font-size: 9px; }
    .hyper-skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .hyper-skill-card { padding: 10px; }
    .hyper-skill-heading { min-height: 27px; align-items: center; margin-bottom: 8px; padding-bottom: 7px; }
    .hyper-skill-heading h3 { font-size: 12px; }
    .hyper-skill-heading-actions { flex-direction: row; flex-wrap: nowrap; gap: 3px; }
    .hyper-skill-heading-actions > span { padding: 3px 6px; font-size: 9px; }
    .hyper-max-button { height: 21px; padding: 0 6px; font-size: 8px; }
    .hyper-skill-stepper { grid-template-columns: 30px minmax(0, 1fr) 30px; gap: 4px; }
    .hyper-skill-stepper > button { width: 30px; height: 35px; font-size: 17px; }
    .hyper-skill-level-input { height: 35px; }
    .hyper-skill-level-input > span { display: none; }
    .hyper-skill-level-input input { padding: 0 3px; font-size: 13px; }
    .hyper-skill-cost { flex-direction: row; align-items: center; gap: 4px; margin-top: 8px; }
    .hyper-skill-cost-main img { width: 16px; height: 16px; flex-basis: 16px; }
    .hyper-skill-cost-main strong { font-size: 10px; }
    .hyper-skill-cost > small { width: auto; margin-left: auto; text-align: right; font-size: 10px; }
}

/* ========================================================= */
/* 符文計算機                                                 */
/* ========================================================= */
.rune-menu-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    background:
        radial-gradient(circle at 35% 30%, #f8f3ff 0 7%, transparent 8%),
        linear-gradient(145deg, #7167f9 0%, #8c4fd3 56%, #41217e 100%);
    border: 2px solid rgba(255,255,255,0.78);
    box-shadow: 0 0 0 2px rgba(120, 81, 214, 0.24), 0 4px 10px rgba(76, 43, 143, 0.35);
}
.rune-menu-icon span { filter: drop-shadow(0 0 4px rgba(255,255,255,0.9)); }

#tab-rune {
    --rune-purple: #7658df;
    --rune-purple-deep: #4f35ad;
    --rune-blue: #2f88cf;
    --rune-gold: #d6962e;
    color: var(--text-main);
}

.rune-hero {
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: 150px;
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 22px;
    overflow: hidden;
    border-radius: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 85% 18%, rgba(124, 225, 255, 0.33), transparent 30%),
        radial-gradient(circle at 8% 120%, rgba(220, 153, 255, 0.35), transparent 38%),
        linear-gradient(130deg, #24204e 0%, #4e3b95 54%, #266b9e 100%);
    box-shadow: 0 14px 35px rgba(54, 39, 118, 0.25);
}
.rune-hero::after {
    content: "✦  ·  ✧  ·  ✦";
    position: absolute;
    z-index: -1;
    right: 28px;
    top: 20px;
    color: rgba(255,255,255,0.12);
    font-size: 54px;
    letter-spacing: 9px;
    transform: rotate(-8deg);
}
.rune-hero-mark {
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    display: grid;
    place-items: center;
    border-radius: 28px;
    font-size: 42px;
    color: #fff;
    background: linear-gradient(145deg, rgba(255,255,255,0.28), rgba(255,255,255,0.08));
    border: 1px solid rgba(255,255,255,0.42);
    box-shadow: inset 0 1px 8px rgba(255,255,255,0.24), 0 12px 28px rgba(21, 16, 66, 0.26);
    backdrop-filter: blur(10px);
}
.rune-hero-mark span { filter: drop-shadow(0 0 11px #d8c9ff); }
.rune-eyebrow {
    margin-bottom: 5px;
    color: #c9efff !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.6px;
}
.rune-hero h2 {
    margin: 0 0 7px;
    color: #fff !important;
    font-size: clamp(25px, 4vw, 35px);
    line-height: 1.15;
}
.rune-hero p {
    margin: 0;
    color: rgba(255,255,255,0.82) !important;
    font-size: 14px;
    line-height: 1.65;
}

.rune-category-switch {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.rune-category-btn {
    min-height: 76px;
    padding: 13px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    color: var(--text-main);
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 17px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.035);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.rune-category-btn:hover { transform: translateY(-2px); }
.rune-category-btn.active {
    border-color: rgba(118, 88, 223, 0.65);
    box-shadow: 0 8px 24px rgba(88, 63, 175, 0.15), inset 0 0 0 1px rgba(118, 88, 223, 0.16);
}
.rune-category-btn > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.rune-category-btn b { color: var(--text-main); font-size: 16px; }
.rune-category-btn small { color: var(--text-muted); font-size: 12px; }
.rune-category-glyph {
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    font-size: 23px;
}
.arcane-glyph { background: linear-gradient(145deg, #8b72ec, #5032ae); box-shadow: 0 7px 16px rgba(91, 58, 182, 0.3); }
.authentic-glyph { background: linear-gradient(145deg, #56bed9, #267aaf); box-shadow: 0 7px 16px rgba(38, 122, 175, 0.28); }

.rune-category-panel { width: 100%; }
.rune-category-panel.active { display: block; animation: appleFadeIn 0.3s ease; }
.rune-controls-panel { overflow: visible; }
.rune-symbol-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.rune-symbol-btn {
    min-width: 0;
    padding: 12px 13px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    background: rgba(255,255,255,0.36);
    border: 1px solid rgba(107, 92, 150, 0.14);
    border-radius: 13px;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.rune-symbol-btn:hover { transform: translateY(-2px); }
.rune-symbol-btn.active {
    background: rgba(118, 88, 223, 0.12);
    border-color: rgba(118, 88, 223, 0.62);
    box-shadow: 0 6px 15px rgba(88, 63, 175, 0.13), inset 0 0 0 1px rgba(118, 88, 223, 0.12);
}
.rune-symbol-orb {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff !important;
    font-size: 12px;
    font-weight: 900;
    border: 2px solid rgba(255,255,255,0.7);
    box-shadow: 0 3px 9px rgba(28, 22, 73, 0.25);
}
.rune-tone-violet .rune-symbol-orb { background: linear-gradient(145deg, #9278ee, #5736b5); }
.rune-tone-aqua .rune-symbol-orb { background: linear-gradient(145deg, #55cdd3, #1c8394); }
.rune-tone-rose .rune-symbol-orb { background: linear-gradient(145deg, #ee7eae, #a63a7d); }
.rune-tone-indigo .rune-symbol-orb { background: linear-gradient(145deg, #657fe8, #384ba1); }
.rune-tone-amber .rune-symbol-orb { background: linear-gradient(145deg, #e8b34e, #a56b19); }
.rune-tone-blue .rune-symbol-orb { background: linear-gradient(145deg, #58acec, #2868ad); }

.rune-level-controls {
    margin-top: 20px;
    padding-top: 18px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 18px;
    border-top: 1px solid rgba(100, 89, 140, 0.12);
}
.rune-level-field {
    width: min(190px, 42%);
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}
.rune-level-field select {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    color: var(--text-main);
    background: var(--input-bg);
    border: 1px solid rgba(118, 88, 223, 0.24);
    border-radius: 11px;
    font-size: 15px;
    font-weight: 800;
    outline: none;
}
.rune-level-field select:focus { border-color: var(--rune-purple); box-shadow: 0 0 0 3px rgba(118, 88, 223, 0.14); }
.rune-level-arrow {
    height: 44px;
    display: grid;
    place-items: center;
    color: var(--rune-purple) !important;
    font-size: 26px;
    font-weight: 700;
}

.rune-result-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.rune-result-card {
    min-width: 0;
    padding: 19px;
    display: flex;
    align-items: center;
    gap: 13px;
    border-radius: 17px;
    border: 1px solid rgba(255,255,255,0.56);
    box-shadow: 0 8px 22px rgba(40, 34, 82, 0.09);
}
.rune-result-symbol { background: linear-gradient(145deg, rgba(225, 212, 255, 0.78), rgba(244, 238, 255, 0.6)); }
.rune-result-meso { background: linear-gradient(145deg, rgba(255, 229, 167, 0.78), rgba(255, 246, 218, 0.62)); }
.rune-result-force { background: linear-gradient(145deg, rgba(185, 230, 255, 0.78), rgba(225, 245, 255, 0.62)); }
.rune-result-card > div:last-child { min-width: 0; display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 5px; }
.rune-result-card span { grid-column: 1 / -1; margin-bottom: 4px; color: #655f78 !important; font-size: 11px; font-weight: 700; }
.rune-result-card strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #272038 !important;
    font-size: clamp(18px, 2.5vw, 25px);
    line-height: 1.05;
}
.rune-result-card small { color: #777085 !important; font-size: 10px; font-weight: 700; }
.rune-result-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff !important;
    font-size: 21px;
    font-weight: 900;
}
.rune-result-symbol .rune-result-icon { background: linear-gradient(145deg, #8e71e8, #5b3fb8); }
.rune-result-meso .rune-result-icon { background: linear-gradient(145deg, #e6b24b, #bd741c); }
.rune-result-force .rune-result-icon { background: linear-gradient(145deg, #50addf, #3172b3); }

.rune-breakdown-panel { padding: 0; overflow: hidden; }
.rune-breakdown-heading { padding: 18px 20px 10px; }
.rune-breakdown-heading .section-title { margin-bottom: 4px; }
.rune-breakdown-heading p { margin: 0; color: var(--text-muted); font-size: 12px; }
.rune-table-wrap { width: 100%; overflow-x: auto; }
.rune-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rune-table th {
    padding: 11px 15px;
    color: var(--text-muted);
    background: rgba(101, 85, 155, 0.07);
    font-size: 11px;
    text-align: right;
    white-space: nowrap;
}
.rune-table th:first-child { text-align: left; }
.rune-table td {
    padding: 12px 15px;
    color: var(--text-main);
    text-align: right;
    font-weight: 700;
    border-top: 1px solid rgba(100, 89, 140, 0.09);
}
.rune-table td:first-child { text-align: left; white-space: nowrap; }
.rune-level-pill {
    display: inline-flex;
    padding: 4px 8px;
    color: #625a75 !important;
    background: rgba(105, 92, 148, 0.1);
    border-radius: 8px;
    font-size: 11px;
}
.rune-level-pill.target { color: #5a38ba !important; background: rgba(118, 88, 223, 0.14); }
.rune-row-arrow { margin: 0 7px; color: var(--text-muted) !important; font-size: 11px; }
.rune-no-upgrade-row td { padding: 28px 15px; color: var(--text-muted); text-align: center !important; font-weight: 500; }

.authentic-panel { overflow: visible; }
.authentic-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.authentic-heading .section-title { margin-bottom: 5px; }
.authentic-heading p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.rune-data-badge {
    flex: 0 0 auto;
    padding: 6px 10px;
    color: #8a5d14 !important;
    background: rgba(240, 183, 76, 0.17);
    border: 1px solid rgba(214, 150, 46, 0.3);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}
.rune-version-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px 12px;
    line-height: 1.5;
}
.rune-version-notice {
    width: 100%;
    color: #e3263d !important;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    animation: runeVersionNoticeBreath 2.4s ease-in-out infinite;
}
@keyframes runeVersionNoticeBreath {
    0%, 100% {
        opacity: 0.82;
        text-shadow: 0 0 0 rgba(227, 38, 61, 0);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 6px rgba(227, 38, 61, 0.28);
    }
}
[data-theme="dark"] .rune-version-notice {
    color: #ff6978 !important;
}
@media (prefers-reduced-motion: reduce) {
    .rune-version-notice { animation: none; opacity: 1; }
}
.authentic-world-switch {
    margin: 20px 0 14px;
    padding: 4px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    background: rgba(86, 115, 153, 0.09);
    border-radius: 12px;
}
.authentic-world-btn {
    padding: 10px 14px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.authentic-world-btn.active {
    color: #286f9b;
    background: var(--input-bg);
    box-shadow: 0 3px 10px rgba(40, 70, 110, 0.1);
}
.authentic-world-panel.active { display: block; animation: appleFadeIn 0.25s ease; }
.authentic-symbol-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(119, 210, 223, 0.12), rgba(89, 114, 210, 0.09));
    border: 1px solid rgba(69, 145, 177, 0.2);
    border-radius: 16px;
}
.authentic-symbol-orb {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: grid;
    place-items: center;
    border-radius: 19px;
    color: #fff !important;
    font-size: 25px;
    border: 1px solid rgba(255,255,255,0.66);
}
.erin-orb { background: linear-gradient(145deg, #63c8c4, #377fb2); box-shadow: 0 8px 18px rgba(55, 127, 178, 0.24); }
.grandis-orb { background: linear-gradient(145deg, #709ce8, #6550b5); box-shadow: 0 8px 18px rgba(101, 80, 181, 0.24); }
.authentic-symbol-card > div:nth-child(2) { flex: 1; min-width: 0; }
.authentic-symbol-card small { color: var(--text-muted); font-size: 10px; }
.authentic-symbol-card h3 { margin: 3px 0 5px; color: var(--text-main); font-size: 19px; }
.authentic-symbol-card span { color: var(--text-muted); font-size: 12px; }
.authentic-symbol-card > strong {
    padding: 7px 9px;
    color: #357a9d !important;
    background: rgba(255,255,255,0.54);
    border-radius: 8px;
    font-size: 9px;
    letter-spacing: 0.8px;
}
.rune-empty-state {
    margin-top: 14px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    background: rgba(91, 115, 143, 0.07);
    border-radius: 12px;
}
.rune-empty-state > span {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: grid;
    place-items: center;
    color: #fff !important;
    background: #7595aa;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 13px;
    font-weight: 700;
}
.rune-empty-state p { margin: 0; color: var(--text-muted) !important; font-size: 12px; line-height: 1.55; }

[data-theme="dark"] .rune-symbol-btn { background: rgba(9, 16, 30, 0.42); border-color: rgba(178, 187, 237, 0.2); }
[data-theme="dark"] .rune-symbol-btn.active { background: rgba(118, 88, 223, 0.22); border-color: rgba(166, 141, 255, 0.7); }
[data-theme="dark"] .rune-result-card { border-color: rgba(178, 187, 237, 0.18); }
[data-theme="dark"] .rune-result-symbol { background: linear-gradient(145deg, rgba(72, 50, 121, 0.85), rgba(36, 27, 68, 0.82)); }
[data-theme="dark"] .rune-result-meso { background: linear-gradient(145deg, rgba(108, 72, 23, 0.85), rgba(55, 39, 21, 0.82)); }
[data-theme="dark"] .rune-result-force { background: linear-gradient(145deg, rgba(27, 73, 103, 0.85), rgba(20, 42, 65, 0.82)); }
[data-theme="dark"] .rune-result-card span,
[data-theme="dark"] .rune-result-card small { color: #b6bed4 !important; }
[data-theme="dark"] .rune-result-card strong { color: #fff !important; }
[data-theme="dark"] .rune-table th { background: rgba(178, 187, 237, 0.08); }
[data-theme="dark"] .rune-table td { border-top-color: rgba(178, 187, 237, 0.12); }
[data-theme="dark"] .rune-level-pill { color: #c2c9dc !important; background: rgba(178, 187, 237, 0.11); }
[data-theme="dark"] .rune-level-pill.target { color: #d6c8ff !important; background: rgba(142, 113, 232, 0.22); }
[data-theme="dark"] .authentic-world-btn.active,
[data-theme="dark"] .authentic-symbol-card > strong { color: #8ed8f4 !important; }

@media (max-width: 720px) {
    .rune-symbol-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rune-result-grid { grid-template-columns: 1fr; }
    .rune-result-card { min-height: 82px; }
    .rune-result-card strong { font-size: 24px; }
}

@media (max-width: 500px) {
    .rune-hero { min-height: 128px; padding: 21px 18px; gap: 14px; border-radius: 17px; }
    .rune-hero::after { right: -10px; top: 10px; font-size: 37px; }
    .rune-hero-mark { width: 58px; height: 58px; flex-basis: 58px; border-radius: 20px; font-size: 29px; }
    .rune-hero p { font-size: 12px; }
    .rune-eyebrow { font-size: 9px; letter-spacing: 1.8px; }
    .rune-category-btn { min-height: 68px; padding: 10px; gap: 9px; }
    .rune-category-glyph { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; font-size: 19px; }
    .rune-category-btn b { font-size: 14px; }
    .rune-category-btn small { font-size: 10px; }
    .rune-symbol-list { grid-template-columns: 1fr; }
    .rune-symbol-btn { padding: 10px 12px; }
    .rune-level-controls { gap: 8px; }
    .rune-level-field { width: 44%; }
    .rune-result-card { padding: 16px; }
    .rune-result-card strong { font-size: 22px; }
    .rune-table th, .rune-table td { padding: 10px 9px; }
    .authentic-heading { flex-direction: column; }
    .authentic-symbol-card { padding: 15px 12px; gap: 10px; }
    .authentic-symbol-orb { width: 46px; height: 46px; flex-basis: 46px; border-radius: 15px; }
    .authentic-symbol-card > strong { display: none; }
}

/* 符文計算機：獨立符文卡片與圖片 */
.rune-menu-icon,
.rune-category-glyph,
.rune-card-symbol,
.rune-summary-image,
.authentic-symbol-orb {
    position: relative;
    overflow: hidden;
}
.rune-menu-icon img,
.rune-category-glyph img,
.rune-card-symbol img,
.rune-summary-image img,
.authentic-symbol-orb img {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.rune-menu-icon img { border-radius: inherit; }
.rune-category-glyph img { padding: 0; }
.rune-card-symbol img,
.authentic-symbol-orb img { padding: 0; }
.rune-summary-image img { padding: 0; }

.rune-menu-icon {
    width: 100%;
    height: 100%;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.rune-menu-icon > span { display: none; }
.rune-category-btn {
    min-height: 60px;
    padding: 9px 14px;
}
.rune-category-glyph {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
}
.rune-category-glyph > span { display: none; }

.rune-guide-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    overflow: visible;
}
.rune-guide-panel .section-title { margin-bottom: 4px; }
.rune-guide-panel p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.65;
}
.rune-reset-all {
    flex: 0 0 auto;
    padding: 9px 14px;
    color: var(--rune-purple-deep);
    background: rgba(118, 88, 223, 0.1);
    border: 1px solid rgba(118, 88, 223, 0.24);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
}
.rune-reset-all:hover { transform: translateY(-1px); background: rgba(118, 88, 223, 0.16); }
.rune-bottom-actions {
    width: 100%;
    margin-top: 12px;
    display: flex;
}
.rune-bottom-actions .rune-reset-all {
    width: 100%;
    min-height: 44px;
    color: var(--text-main);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(40, 34, 82, 0.06);
    font-size: 13px;
}
.rune-bottom-actions .rune-reset-all:hover {
    color: var(--rune-purple-deep);
    background: rgba(118, 88, 223, 0.1);
    border-color: rgba(118, 88, 223, 0.28);
}

.rune-cards-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.rune-calc-card {
    min-width: 0;
    padding: 14px;
    color: var(--text-main);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: 0 7px 22px rgba(40, 34, 82, 0.07);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.rune-calc-card.is-ready {
    border-color: rgba(47, 162, 111, 0.5);
    box-shadow: 0 8px 24px rgba(47, 162, 111, 0.12);
}
.rune-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(100, 89, 140, 0.11);
}
.rune-card-symbol {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border-radius: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    border: 0;
    box-shadow: none;
}
.rune-card-symbol > span { display: none; }
.rune-tone-violet .rune-card-symbol,
.rune-tone-aqua .rune-card-symbol,
.rune-tone-rose .rune-card-symbol,
.rune-tone-indigo .rune-card-symbol,
.rune-tone-amber .rune-card-symbol,
.rune-tone-blue .rune-card-symbol { background: transparent; }
.rune-card-title { flex: 1; min-width: 0; }
.rune-card-title small { color: var(--text-muted); font-size: 10px; }
.rune-card-title h3 {
    margin: 0;
    overflow: hidden;
    color: var(--text-main);
    font-size: 17px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rune-card-level-badge {
    flex: 0 0 auto;
    padding: 5px 9px;
    color: #5b3fb8 !important;
    background: rgba(118, 88, 223, 0.12);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.rune-card-inputs {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}
.rune-card-inputs > label {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rune-card-inputs > label > span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.rune-card-inputs select,
.rune-progress-input {
    width: 100%;
    height: 36px;
    color: var(--text-main);
    background: var(--input-bg);
    border: 1px solid rgba(118, 88, 223, 0.2);
    border-radius: 10px;
    outline: none;
}
.rune-card-inputs select {
    padding: 0 9px;
    font-size: 13px;
    font-weight: 800;
}
.rune-progress-input {
    display: flex;
    align-items: center;
    overflow: hidden;
}
.rune-progress-input input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0 5px 0 10px;
    color: var(--text-main);
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 13px;
    font-weight: 800;
}
.rune-progress-input > small {
    padding-right: 9px;
    color: var(--text-muted);
    font-size: 11px;
}
.rune-card-inputs select:focus,
.rune-progress-input:focus-within {
    border-color: var(--rune-purple);
    box-shadow: 0 0 0 3px rgba(118, 88, 223, 0.12);
}
.rune-current-requirement {
    min-height: 13px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rune-card-results {
    min-height: 52px;
    margin-top: 12px;
    display: grid;
    grid-template-columns: minmax(90px, 1fr) minmax(0, 2fr);
    gap: 0;
    overflow: hidden;
    background: rgba(255,255,255,0.22);
    border: 1px solid rgba(118, 88, 223, 0.1);
    border-radius: 12px;
}
.rune-card-result {
    min-width: 0;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
}
.rune-card-result.meso {
    background: transparent;
    border-left: 1px solid rgba(118, 88, 223, 0.12);
}
.rune-card-resource-line strong,
.rune-card-meso-line strong {
    color: var(--text-main) !important;
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.rune-card-resource-line {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.rune-card-resource-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
}
.rune-card-resource-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.rune-card-meso-line {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.rune-card-coin-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    position: relative;
    overflow: hidden;
}
.rune-card-coin-icon img {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.rune-coin-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #fff !important;
    background: #d6962e;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 900;
}
.rune-card-status {
    min-height: 15px;
    margin: 7px 1px 0;
    color: var(--text-muted) !important;
    font-size: 11px;
    line-height: 1.5;
}
.rune-calc-card.is-ready .rune-card-status { color: #27845a !important; font-weight: 700; }

.rune-grand-total {
    width: 100%;
    margin-top: 24px;
    padding: 15px 18px;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgba(91, 208, 232, 0.28), transparent 32%),
        linear-gradient(130deg, #282251, #51419a 58%, #276f9b);
    border-radius: 19px;
    box-shadow: 0 13px 30px rgba(45, 34, 103, 0.2);
}
.rune-grand-heading { display: flex; flex-direction: column; gap: 5px; }
.rune-grand-heading > span { color: #fff !important; font-size: 18px; font-weight: 900; }
.rune-grand-heading small { color: rgba(255,255,255,0.68) !important; font-size: 11px; }
.rune-grand-results {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 0.9fr);
    gap: 10px;
}
.rune-grand-item {
    min-width: 0;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 13px;
}
.rune-summary-image {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    color: #fff;
    background: transparent;
    border-radius: 0;
}
.rune-summary-image > span { color: #fff !important; }
.rune-summary-image > span { display: none; }
.rune-summary-image.coin-image { background: transparent; }
.rune-grand-item > div:last-child { min-width: 0; }
.rune-grand-item > div:last-child > span {
    display: block;
    margin-bottom: 2px;
    color: rgba(255,255,255,0.67) !important;
    font-size: 9px;
    font-weight: 800;
}
.rune-grand-item strong {
    color: #fff !important;
    font-size: clamp(17px, 2.4vw, 23px);
    overflow-wrap: anywhere;
}
.rune-grand-item:not(.rune-grand-symbols-panel) strong {
    font-size: clamp(17px, 2vw, 21px);
    white-space: nowrap;
}
.rune-grand-item small { margin-left: 3px; color: rgba(255,255,255,0.65) !important; font-size: 9px; }
.rune-grand-symbols-panel {
    display: block;
}
.rune-grand-item-title {
    display: block;
    margin-bottom: 7px;
    color: rgba(255,255,255,0.67) !important;
    font-size: 10px;
    font-weight: 800;
}
.rune-grand-symbol-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px 8px;
}
.rune-grand-symbol-entry {
    min-width: 0;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    column-gap: 6px;
}
.rune-grand-symbol-image {
    width: 24px;
    height: 24px;
}
.rune-grand-symbol-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.rune-grand-symbol-entry strong {
    color: #fff !important;
    font-size: 13px;
    line-height: 1.15;
}

[data-theme="dark"] .rune-calc-card {
    background: linear-gradient(135deg, rgba(20, 25, 35, 0.84), rgba(10, 15, 25, 0.72));
    border-color: rgba(178, 187, 237, 0.2);
}
[data-theme="dark"] .rune-calc-card.is-ready { border-color: rgba(75, 205, 144, 0.5); }
[data-theme="dark"] .rune-card-level-badge { color: #d2c4ff !important; background: rgba(118, 88, 223, 0.22); }
[data-theme="dark"] .rune-card-results {
    background: rgba(178, 187, 237, 0.06);
    border-color: rgba(178, 187, 237, 0.15);
}
[data-theme="dark"] .rune-card-result { background: transparent; }
[data-theme="dark"] .rune-card-result.meso {
    background: transparent;
    border-left-color: rgba(178, 187, 237, 0.15);
}
[data-theme="dark"] .rune-reset-all { color: #d2c4ff; background: rgba(118, 88, 223, 0.2); }

.authentic-symbol-orb {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    box-shadow: none !important;
}
.authentic-symbol-orb > span { display: none; }
.authentic-symbol-card { padding: 14px; }
.authentic-symbol-card h3 { margin-top: 0; }
.authentic-heading p { font-size: 12px; }
.authentic-panel { padding: 14px; }
.authentic-world-switch { margin: 0 0 12px; }
.authentic-rune-list {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.authentic-rune-group {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.authentic-region-cards {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.authentic-region-tab {
    width: 100%;
    padding: 9px 12px;
    color: var(--text-main);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(40, 34, 82, 0.05);
    text-align: center;
    font-size: 13px;
    font-weight: 800;
}
.authentic-rune-card { width: 100%; }
.authentic-rune-card-locked {
    border-color: rgba(117, 137, 160, 0.2);
    box-shadow: 0 5px 17px rgba(40, 55, 73, 0.045);
}
.authentic-locked-badge {
    flex: 0 0 auto;
    padding: 6px 9px;
    color: #6e7f91 !important;
    background: rgba(117, 137, 160, 0.11);
    border: 1px solid rgba(117, 137, 160, 0.14);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}
[data-theme="dark"] .authentic-rune-card-locked {
    border-color: rgba(174, 190, 211, 0.18);
}
[data-theme="dark"] .authentic-locked-badge {
    color: #c2cfdf !important;
    background: rgba(154, 174, 197, 0.12);
    border-color: rgba(174, 190, 211, 0.16);
}
.authentic-region-name {
    display: block;
    margin-bottom: 2px;
    color: var(--text-muted) !important;
    font-size: 10px;
    font-weight: 800;
}
.authentic-grand-total .rune-grand-symbol-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 720px) {
    .rune-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .authentic-rune-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .rune-grand-total { grid-template-columns: 1fr; gap: 13px; }
    .rune-grand-results { grid-template-columns: minmax(0, 1.6fr) minmax(160px, 0.7fr); }
    .rune-grand-item:not(.rune-grand-symbols-panel) strong {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 500px) {
    .rune-guide-panel { align-items: flex-start; gap: 12px; }
    .rune-guide-panel p { font-size: 11px; }
    .rune-reset-all { padding: 8px 10px; font-size: 10px; }
    .rune-calc-card { padding: 14px 12px; }
    .rune-card-symbol { width: 48px; height: 48px; flex-basis: 48px; border-radius: 15px; }
    .rune-card-title h3 { font-size: 15px; }
    .rune-card-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rune-card-inputs > label:nth-child(1) { grid-column: 1; grid-row: 1; }
    .rune-card-inputs > label:nth-child(3) { grid-column: 2; grid-row: 1; }
    .rune-card-inputs > label:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
    .rune-card-results { grid-template-columns: minmax(90px, 1fr) minmax(0, 1.8fr); }
    .rune-card-result { padding: 10px; }
    .rune-card-resource-line strong,
    .rune-card-meso-line strong { font-size: 16px; }
    .rune-grand-total { padding: 16px 13px; }
    .rune-grand-results { grid-template-columns: 1fr; }
    .rune-grand-symbol-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rune-bottom-actions .rune-reset-all { min-height: 42px; }

    .rune-cards-grid { gap: 8px; }
    .rune-cards-grid .rune-calc-card { padding: 10px 8px; border-radius: 14px; }
    .rune-cards-grid .rune-card-header { gap: 5px; padding-bottom: 7px; }
    .rune-cards-grid .rune-card-symbol {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
    .rune-cards-grid .rune-card-title h3 { font-size: 11px; }
    .rune-cards-grid .rune-card-level-badge {
        padding: 4px 6px;
        font-size: 8px;
    }
    .rune-cards-grid .rune-card-inputs { margin-top: 8px; gap: 6px; }
    .rune-cards-grid .rune-card-inputs > label { gap: 4px; }
    .rune-cards-grid .rune-card-inputs > label > span { font-size: 8px; }
    .rune-cards-grid .rune-card-inputs select,
    .rune-cards-grid .rune-progress-input { height: 31px; border-radius: 8px; }
    .rune-cards-grid .rune-card-inputs select { padding: 0 4px; font-size: 10px; }
    .rune-cards-grid .rune-progress-input input { padding: 0 4px 0 7px; font-size: 10px; }
    .rune-cards-grid .rune-progress-input > small { padding-right: 6px; font-size: 8px; }
    .rune-cards-grid .rune-current-requirement { min-height: 11px; font-size: 8px; }
    .rune-cards-grid .rune-card-results {
        min-height: 44px;
        margin-top: 8px;
        grid-template-columns: minmax(52px, 0.8fr) minmax(0, 1.7fr);
        border-radius: 9px;
    }
    .rune-cards-grid .rune-card-result { padding: 6px 4px; }
    .rune-cards-grid .rune-card-resource-icon {
        width: 15px;
        height: 15px;
        flex-basis: 15px;
    }
    .rune-cards-grid .rune-card-coin-icon {
        width: 15px;
        height: 15px;
        flex-basis: 15px;
    }
    .rune-cards-grid .rune-card-resource-line,
    .rune-cards-grid .rune-card-meso-line { gap: 3px; }
    .rune-cards-grid .rune-card-resource-line strong,
    .rune-cards-grid .rune-card-meso-line strong { font-size: 10px; }
    .rune-cards-grid .rune-card-status {
        min-height: 12px;
        margin-top: 5px;
        overflow: hidden;
        font-size: 8px;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .authentic-rune-list { gap: 8px; }
    .authentic-rune-group { gap: 6px; }
    .authentic-region-cards { gap: 8px; }
    .authentic-region-tab { padding: 7px 6px; border-radius: 10px; font-size: 11px; }
    .authentic-rune-card { padding: 10px 8px; border-radius: 14px; }
    .authentic-rune-card .rune-card-header { gap: 5px; padding-bottom: 7px; }
    .authentic-rune-card .rune-card-symbol {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
    .authentic-rune-card .rune-card-title h3 { font-size: 11px; }
    .authentic-rune-card .rune-card-level-badge {
        padding: 4px 6px;
        font-size: 8px;
    }
    .authentic-rune-card .authentic-locked-badge {
        padding: 5px 6px;
        font-size: 8px;
    }
    .authentic-rune-card .rune-card-inputs { margin-top: 8px; gap: 6px; }
    .authentic-rune-card .rune-card-inputs > label { gap: 4px; }
    .authentic-rune-card .rune-card-inputs > label > span { font-size: 8px; }
    .authentic-rune-card .rune-card-inputs select,
    .authentic-rune-card .rune-progress-input { height: 31px; border-radius: 8px; }
    .authentic-rune-card .rune-card-inputs select { padding: 0 4px; font-size: 10px; }
    .authentic-rune-card .rune-progress-input input { padding: 0 4px 0 7px; font-size: 10px; }
    .authentic-rune-card .rune-progress-input > small { padding-right: 6px; font-size: 8px; }
    .authentic-rune-card .rune-current-requirement { min-height: 11px; font-size: 8px; }
    .authentic-rune-card .rune-card-results {
        min-height: 44px;
        margin-top: 8px;
        grid-template-columns: minmax(52px, 0.8fr) minmax(0, 1.7fr);
        border-radius: 9px;
    }
    .authentic-rune-card .rune-card-result { padding: 6px 4px; }
    .authentic-rune-card .rune-card-resource-icon {
        width: 15px;
        height: 15px;
        flex-basis: 15px;
    }
    .authentic-rune-card .rune-card-coin-icon {
        width: 15px;
        height: 15px;
        flex-basis: 15px;
    }
    .authentic-rune-card .rune-card-resource-line,
    .authentic-rune-card .rune-card-meso-line { gap: 3px; }
    .authentic-rune-card .rune-card-resource-line strong,
    .authentic-rune-card .rune-card-meso-line strong { font-size: 10px; }
    .authentic-rune-card .rune-card-status {
        min-height: 12px;
        margin-top: 5px;
        overflow: hidden;
        font-size: 8px;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ========================================== */
/* 布告欄：最新摘要、更新時間軸與網站說明 */
/* ========================================== */
#tab-notice {
    --notice-cyan: #14b8d4;
    --notice-purple: #7c5ce7;
    --notice-orange: #f08a42;
}

#tab-notice .notice-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 190px;
    padding: 28px 32px;
    overflow: hidden;
    background:
        radial-gradient(circle at 82% 15%, rgba(255, 255, 255, 0.7), transparent 28%),
        linear-gradient(135deg, rgba(93, 210, 248, 0.32), rgba(191, 125, 227, 0.34)),
        var(--glass-bg);
}

#tab-notice .notice-hero::before,
#tab-notice .notice-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

#tab-notice .notice-hero::before {
    width: 190px;
    height: 190px;
    right: -62px;
    top: -92px;
    border: 1px solid rgba(255, 255, 255, 0.45);
}

#tab-notice .notice-hero::after {
    width: 104px;
    height: 104px;
    right: 42px;
    bottom: -70px;
    background: rgba(255, 255, 255, 0.12);
}

#tab-notice .notice-hero-icon {
    position: relative;
    z-index: 1;
    flex: 0 0 86px;
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.42);
    box-shadow: 0 12px 30px rgba(92, 76, 168, 0.15), inset 0 1px 10px rgba(255, 255, 255, 0.55);
}

#tab-notice .notice-hero-icon img {
    width: 68px;
    height: 68px;
    object-fit: contain;
}

#tab-notice .notice-hero-content {
    position: relative;
    z-index: 1;
    min-width: 0;
}

#tab-notice .notice-hero-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.04em;
}

#tab-notice .notice-status {
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(124, 92, 231, 0.14);
    color: #6545d2;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

#tab-notice .notice-hero h2 {
    margin: 0;
    color: var(--text-main);
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.2;
    letter-spacing: -0.04em;
}

#tab-notice .notice-hero p {
    max-width: 640px;
    margin: 9px 0 14px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.65;
}

#tab-notice .notice-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

#tab-notice .notice-hero-tags span {
    padding: 5px 10px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.38);
    color: #555;
    font-size: 11px;
    font-weight: 600;
}

#tab-notice .notice-timeline-panel {
    padding: 25px 28px 22px;
    overflow: visible;
}

#tab-notice .notice-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(91, 82, 133, 0.1);
}

#tab-notice .notice-section-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--notice-purple);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

#tab-notice .notice-section-heading h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 21px;
}

#tab-notice .notice-section-heading p {
    max-width: 420px;
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.55;
    text-align: right;
}

#tab-notice .notice-timeline {
    position: relative;
    list-style: none;
    margin: 21px 0 0;
    padding: 0;
}

#tab-notice .notice-timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 10px;
    bottom: -8px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(to bottom, rgba(124, 92, 231, 0.58), rgba(20, 184, 212, 0.12));
}

#tab-notice .notice-timeline-item {
    position: relative;
    padding: 0 0 15px 34px;
}

#tab-notice .notice-timeline-item:last-child {
    padding-bottom: 0;
}

#tab-notice .notice-timeline-dot {
    position: absolute;
    z-index: 1;
    left: 1px;
    top: 16px;
    width: 16px;
    height: 16px;
    border: 4px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: #a6a0b8;
    box-shadow: 0 0 0 1px rgba(124, 92, 231, 0.18);
}

#tab-notice .notice-timeline-item.is-latest .notice-timeline-dot {
    background: var(--notice-purple);
    box-shadow: 0 0 0 5px rgba(124, 92, 231, 0.12), 0 0 15px rgba(124, 92, 231, 0.35);
}

#tab-notice .notice-release {
    padding: 15px 17px;
    border: 1px solid rgba(111, 101, 154, 0.1);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.25);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

#tab-notice .notice-release:hover {
    border-color: rgba(124, 92, 231, 0.26);
    background: rgba(255, 255, 255, 0.42);
    transform: translateY(-1px);
}

#tab-notice .is-latest .notice-release {
    border-color: rgba(124, 92, 231, 0.22);
    background: linear-gradient(110deg, rgba(93, 210, 248, 0.11), rgba(191, 125, 227, 0.13));
}

#tab-notice .notice-release header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
}

#tab-notice .notice-release time {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 750;
    letter-spacing: 0.035em;
}

#tab-notice .notice-latest-badge {
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--notice-purple);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}

#tab-notice .notice-change-list {
    display: grid;
    gap: 7px;
    list-style: none;
    margin: 0;
    padding: 0;
}

#tab-notice .notice-change-list li {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.6;
}

#tab-notice .notice-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

#tab-notice .notice-tag-new {
    background: rgba(20, 184, 212, 0.13);
    color: #0989a2;
}

#tab-notice .notice-tag-update {
    background: rgba(124, 92, 231, 0.13);
    color: #6545d2;
}

#tab-notice .notice-tag-data {
    background: rgba(240, 138, 66, 0.14);
    color: #c76826;
}

#tab-notice .notice-older {
    margin: 17px 0 0;
}

#tab-notice .notice-older > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    padding: 8px 16px;
    border: 1px solid rgba(124, 92, 231, 0.18);
    border-radius: 11px;
    background: rgba(124, 92, 231, 0.06);
    color: var(--text-main);
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
    list-style: none;
    transition: background 0.2s ease, border-color 0.2s ease;
    margin-left: 34px;
}

#tab-notice .notice-older > summary::-webkit-details-marker,
#tab-notice .notice-info-card > summary::-webkit-details-marker {
    display: none;
}

#tab-notice .notice-older > summary:hover {
    border-color: rgba(124, 92, 231, 0.36);
    background: rgba(124, 92, 231, 0.11);
}

#tab-notice .notice-older > summary > span {
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

#tab-notice .notice-older[open] > summary > span {
    transform: rotate(225deg) translate(-1px, -1px);
}

#tab-notice .notice-timeline-older {
    margin-top: 16px;
}

#tab-notice .notice-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

#tab-notice .notice-info-card {
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: var(--glass-bg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#tab-notice .notice-info-card > summary {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 12px;
    align-items: center;
    gap: 11px;
    min-height: 72px;
    padding: 12px 16px;
    color: var(--text-main);
    cursor: pointer;
    list-style: none;
}

#tab-notice .notice-info-card > summary:focus-visible,
#tab-notice .notice-older > summary:focus-visible {
    outline: 2px solid var(--notice-purple);
    outline-offset: -2px;
}

#tab-notice .notice-info-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(124, 92, 231, 0.09);
    font-size: 18px;
    overflow: hidden;
}

#tab-notice .notice-info-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#tab-notice .notice-info-card b,
#tab-notice .notice-info-card small {
    display: block;
}

#tab-notice .notice-info-card b {
    margin-bottom: 3px;
    font-size: 14px;
}

#tab-notice .notice-info-card small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

#tab-notice .notice-detail-arrow {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--text-muted);
    border-bottom: 1.5px solid var(--text-muted);
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

#tab-notice .notice-info-card[open] .notice-detail-arrow {
    transform: rotate(225deg) translate(-1px, -1px);
}

#tab-notice .notice-info-body {
    padding: 15px 18px 18px;
    border-top: 1px solid rgba(111, 101, 154, 0.1);
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.75;
}

#tab-notice .notice-info-body p {
    margin: 0 0 10px;
}

#tab-notice .notice-info-body p:last-child {
    margin-bottom: 0;
}

#tab-notice .notice-info-wish {
    font-weight: 700;
}

[data-theme="dark"] #tab-notice .notice-hero {
    background:
        radial-gradient(circle at 82% 15%, rgba(94, 209, 255, 0.13), transparent 29%),
        linear-gradient(135deg, rgba(40, 151, 208, 0.2), rgba(135, 77, 190, 0.2)) !important;
}

[data-theme="dark"] #tab-notice .notice-hero-icon {
    border-color: rgba(178, 187, 237, 0.32);
    background: rgba(12, 18, 31, 0.42);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28), inset 0 1px 10px rgba(85, 195, 255, 0.08);
}

[data-theme="dark"] #tab-notice .notice-status,
[data-theme="dark"] #tab-notice .notice-latest-badge {
    background: #8063ec;
    color: #fff !important;
}

[data-theme="dark"] #tab-notice .notice-hero-tags span {
    border-color: rgba(178, 187, 237, 0.25);
    background: rgba(17, 24, 39, 0.42);
    color: #cbd9e6 !important;
}

[data-theme="dark"] #tab-notice .notice-section-eyebrow {
    color: #a994ff !important;
}

[data-theme="dark"] #tab-notice .notice-section-heading {
    border-color: rgba(178, 187, 237, 0.16);
}

[data-theme="dark"] #tab-notice .notice-timeline-dot {
    border-color: #151c2a;
}

[data-theme="dark"] #tab-notice .notice-release {
    border-color: rgba(178, 187, 237, 0.15);
    background: rgba(10, 15, 25, 0.34);
}

[data-theme="dark"] #tab-notice .notice-release:hover {
    border-color: rgba(169, 148, 255, 0.35);
    background: rgba(22, 31, 48, 0.58);
}

[data-theme="dark"] #tab-notice .is-latest .notice-release {
    border-color: rgba(169, 148, 255, 0.27);
    background: linear-gradient(110deg, rgba(32, 145, 190, 0.11), rgba(133, 79, 183, 0.13));
}

[data-theme="dark"] #tab-notice .notice-tag-new {
    background: rgba(35, 211, 226, 0.14);
    color: #54d9e8 !important;
}

[data-theme="dark"] #tab-notice .notice-tag-update {
    background: rgba(153, 123, 255, 0.15);
    color: #b29cff !important;
}

[data-theme="dark"] #tab-notice .notice-tag-data {
    background: rgba(255, 161, 83, 0.15);
    color: #ffb372 !important;
}

[data-theme="dark"] #tab-notice .notice-older > summary {
    border-color: rgba(169, 148, 255, 0.23);
    background: rgba(124, 92, 231, 0.09);
}

[data-theme="dark"] #tab-notice .notice-info-card {
    border-color: rgba(178, 187, 237, 0.2);
    background: linear-gradient(135deg, rgba(20, 25, 35, 0.85), rgba(10, 15, 25, 0.7));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 20px rgba(85, 195, 255, 0.05);
}

[data-theme="dark"] #tab-notice .notice-info-icon {
    background: rgba(153, 123, 255, 0.13);
}

[data-theme="dark"] #tab-notice .notice-info-body {
    border-color: rgba(178, 187, 237, 0.16);
}

@media (max-width: 600px) {
    #tab-notice {
        gap: 12px;
    }

    #tab-notice .notice-hero.panel {
        min-height: 0;
        gap: 14px;
        padding: 19px 16px;
        border-radius: 16px;
    }

    #tab-notice .notice-hero-icon {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
        border-radius: 18px;
    }

    #tab-notice .notice-hero-icon img {
        width: 48px;
        height: 48px;
    }

    #tab-notice .notice-hero-meta {
        margin-bottom: 5px;
        font-size: 10px;
    }

    #tab-notice .notice-status {
        padding: 3px 7px;
        font-size: 8px;
    }

    #tab-notice .notice-hero h2 {
        font-size: 20px;
    }

    #tab-notice .notice-hero p {
        margin: 6px 0 10px;
        font-size: 11.5px;
        line-height: 1.55;
    }

    #tab-notice .notice-hero-tags {
        gap: 5px;
    }

    #tab-notice .notice-hero-tags span {
        padding: 4px 7px;
        font-size: 9px;
    }

    #tab-notice .notice-timeline-panel.panel {
        padding: 18px 12px 15px;
    }

    #tab-notice .notice-section-heading {
        display: block;
        padding: 0 3px 14px;
    }

    #tab-notice .notice-section-heading h2 {
        font-size: 18px;
    }

    #tab-notice .notice-section-heading p {
        margin-top: 5px;
        font-size: 11px;
        line-height: 1.5;
        text-align: left;
    }

    #tab-notice .notice-timeline {
        margin-top: 16px;
    }

    #tab-notice .notice-timeline::before {
        left: 7px;
    }

    #tab-notice .notice-timeline-item {
        padding: 0 0 11px 26px;
    }

    #tab-notice .notice-timeline-dot {
        left: 0;
        top: 14px;
        width: 15px;
        height: 15px;
    }

    #tab-notice .notice-release {
        padding: 12px 11px;
        border-radius: 11px;
    }

    #tab-notice .notice-release header {
        margin-bottom: 7px;
    }

    #tab-notice .notice-release time {
        font-size: 11px;
    }

    #tab-notice .notice-change-list {
        gap: 6px;
    }

    #tab-notice .notice-change-list li {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 7px;
        font-size: 11px;
        line-height: 1.55;
    }

    #tab-notice .notice-tag {
        min-height: 20px;
        padding: 2px 4px;
        font-size: 8.5px;
    }

    #tab-notice .notice-older {
        margin: 13px 0 0;
    }

    #tab-notice .notice-older > summary {
        min-height: 38px;
        font-size: 10.5px;
        margin-left: 26px;
    }

    #tab-notice .notice-timeline-older {
        margin-top: 12px;
    }

    #tab-notice .notice-info-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    #tab-notice .notice-info-card > summary {
        min-height: 64px;
        padding: 10px 13px;
    }

    #tab-notice .notice-info-body {
        padding: 13px 15px 15px;
        font-size: 11.5px;
        line-height: 1.7;
    }
}

@media (prefers-reduced-motion: reduce) {
    #tab-notice .notice-release,
    #tab-notice .notice-detail-arrow,
    #tab-notice .notice-older > summary > span {
        transition: none;
    }
}

/* ========================================================= */
/* 🚧 系統更新中：卡片禁用狀態 */
/* ========================================================= */
/*.app-card{
    opacity: 0.5; 
    cursor: not-allowed; 
    pointer-events: none; 
    filter: grayscale(80%); 
}

.updating-badge {
    display: inline-block;
    margin-top: 5px;
    font-size: 11px;
    color: #fff;
    background-color: #747d8c;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
    letter-spacing: 1px;
}


/* ========================================================= */
/* 解放進度計算機                                             */
/* ========================================================= */
#tab-liberation {
    --liberation-accent: #6f73ec;
    --liberation-pink: #e35adf;
    --liberation-panel: rgba(255, 255, 255, 0.66);
    gap: 14px;
    color: var(--text-main);
}

.liberation-version {
    width: 100%;
    margin: -3px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
}

.liberation-data-notice {
    width: 100%;
    margin: -8px 0 0;
    color: #e3263d !important;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    animation: runeVersionNoticeBreath 2.4s ease-in-out infinite;
}
[data-theme="dark"] .liberation-data-notice {
    color: #ff6978 !important;
}
@media (prefers-reduced-motion: reduce) {
    .liberation-data-notice { animation: none; opacity: 1; }
}

.liberation-hero {
    width: 100%;
    min-height: 146px;
    display: grid;
    grid-template-columns: 118px minmax(0, 1.2fr) minmax(170px, 0.72fr);
    align-items: center;
    gap: clamp(14px, 3vw, 28px);
    padding: 19px clamp(18px, 3vw, 30px);
    border: 1px solid rgba(121, 107, 205, 0.24);
    border-radius: 18px;
    background:
        radial-gradient(circle at 95% 8%, rgba(230, 143, 231, 0.32), transparent 35%),
        radial-gradient(circle at 4% 105%, rgba(103, 209, 240, 0.26), transparent 40%),
        linear-gradient(135deg, rgba(222, 246, 255, 0.93), rgba(242, 232, 255, 0.94));
    box-shadow: 0 11px 28px rgba(86, 72, 158, 0.11);
    color: var(--text-main);
}

.liberation-current-stage-visual {
    position: relative;
    width: 112px;
    height: 130px;
    overflow: hidden;
    display: grid;
    place-items: center;
    border: 2px solid rgba(121, 94, 194, 0.4);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255,255,255,0.84), rgba(222, 221, 255, 0.72));
    box-shadow: 0 8px 20px rgba(69, 45, 135, 0.18);
}
.liberation-current-stage-visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}
.liberation-current-stage-placeholder { color: #7164cf; font-family: Georgia, serif; font-size: 31px; font-weight: 800; }
.liberation-current-stage-visual strong {
    position: absolute;
    right: 7px;
    bottom: 7px;
    min-width: 42px;
    padding: 5px 7px;
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 999px;
    background: rgba(32, 24, 67, 0.78);
    box-shadow: 0 3px 9px rgba(0,0,0,0.2);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    text-align: center;
}
.liberation-progress-tile {
    --liberation-progress: 0%;
    position: relative;
    width: 112px;
    min-height: 108px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid rgba(112, 97, 216, 0.24);
    border-radius: 14px;
    background: rgba(255,255,255,0.5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 6px 16px rgba(100, 81, 188, 0.1);
}
.liberation-progress-tile span { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.liberation-progress-tile strong { color: #6257d5; font-size: 28px; line-height: 1; }
.liberation-progress-tile i { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(117,104,228,0.14); }
.liberation-progress-tile i::after { content: ''; display: block; width: var(--liberation-progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5bbde0, #796ce8, #d06bde); transition: width 0.25s ease; }

.liberation-forecast { min-width: 0; }
.liberation-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}
.liberation-kicker::before { content: '●'; color: #7568e4; font-size: 10px; }
.liberation-forecast > strong {
    display: block;
    margin: 5px 0 10px;
    color: var(--text-main);
    font-size: clamp(26px, 4vw, 39px);
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
}
.liberation-forecast-stats { display: flex; flex-wrap: wrap; gap: 9px; }
.liberation-forecast-stats span {
    min-width: 118px;
    padding: 8px 11px;
    border: 1px solid rgba(124, 109, 205, 0.16);
    border-radius: 10px;
    background: rgba(255,255,255,0.5);
    color: var(--text-muted);
    font-size: 12px;
}
.liberation-forecast-stats b { display: block; margin-top: 2px; color: #817cff; font-size: 21px; line-height: 1; }
.liberation-forecast-stats span:last-child b { color: #ff75e9; }

.liberation-total-summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 112px;
    padding: 18px;
    border: 1px solid rgba(124, 109, 205, 0.18);
    border-radius: 14px;
    background: rgba(255,255,255,0.52);
}
.liberation-total-summary > span:first-child { color: var(--text-muted); font-size: 12px; }
.liberation-total-summary strong { margin: 5px 0 7px; color: var(--text-main); font-size: 25px; line-height: 1; }
.liberation-total-summary strong small { color: var(--text-muted); font-size: 13px; font-weight: 700; }
.liberation-total-summary > span:last-child { color: #6d61c5; font-size: 12px; line-height: 1.45; }

.liberation-stage-section,
.liberation-panel {
    border: 1px solid rgba(123, 107, 188, 0.2);
    border-radius: 18px;
    background: var(--liberation-panel);
    box-shadow: 0 9px 25px rgba(76, 58, 152, 0.08);
}
.liberation-stage-section { width: 100%; padding: 16px; }
.liberation-section-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.liberation-section-heading h2 { margin: 0 0 3px; color: var(--text-main); font-size: 16px; }
.liberation-section-heading p { margin: 0; color: var(--text-muted); font-size: 12px; }
.liberation-stage-list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.liberation-stage-tab {
    min-width: 0;
    min-height: 72px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(105, 99, 154, 0.17);
    border-radius: 11px;
    background: rgba(255,255,255,0.46);
    color: var(--text-main);
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.liberation-stage-tab:hover { transform: translateY(-2px); }
.liberation-stage-tab-art { width: 34px; height: 42px; flex: 0 0 34px; overflow: hidden; display: grid; place-items: center; border-radius: 7px; background: rgba(109, 97, 194, 0.1); }
.liberation-stage-tab-art img { width: 100%; height: 100%; object-fit: cover; }
.liberation-stage-tab-art i { color: #7568ca; font-family: Georgia, serif; font-size: 14px; font-style: normal; font-weight: 800; }
.liberation-stage-tab > span:last-child { min-width: 0; display: grid; gap: 3px; text-align: left; }
.liberation-stage-tab b { color: inherit; font-size: 10px; white-space: nowrap; }
.liberation-stage-tab small { color: var(--text-muted); font-size: 9px; }
.liberation-stage-tab.is-current { border-color: rgba(114, 101, 227, 0.52); background: rgba(113, 103, 231, 0.09); }
.liberation-stage-tab.is-complete { border-color: rgba(45, 165, 139, 0.3); }
.liberation-stage-tab.is-selected { border-color: #7568e4; box-shadow: 0 5px 15px rgba(104, 88, 208, 0.2), inset 0 0 0 1px rgba(117,104,228,0.18); transform: translateY(-2px); }
.liberation-stage-preview { min-height: 168px; margin-top: 11px; padding: 10px; display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 17px; border: 1px solid rgba(113, 99, 188, 0.18); border-radius: 14px; background: linear-gradient(135deg, rgba(219,245,255,0.5), rgba(244,226,255,0.48)); }
.liberation-stage-preview-art { width: 124px; height: 146px; overflow: hidden; display: grid; place-items: center; border-radius: 11px; background: rgba(103, 91, 184, 0.1); }
.liberation-stage-preview-art img { width: 100%; height: 100%; object-fit: cover; }
.liberation-stage-preview-art span { color: #7466cf; font-family: Georgia, serif; font-size: 35px; font-weight: 800; }
.liberation-stage-preview-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.liberation-stage-preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.liberation-stage-preview-heading span { color: #6f63c4; font-size: 11px; font-weight: 800; }
.liberation-stage-preview-heading h3 { margin: 4px 0 10px; color: var(--text-main); font-size: clamp(16px, 2.5vw, 21px); line-height: 1.35; }
.liberation-stage-preview-heading > b { padding: 4px 8px; border-radius: 999px; background: rgba(117,104,228,0.11); color: #695dcb; font-size: 10px; white-space: nowrap; }
.liberation-stage-preview-heading > b[data-state="complete"] { background: rgba(43,173,143,0.12); color: #258d76; }
.liberation-stage-preview-heading > b[data-state="locked"] { background: rgba(126,128,150,0.1); color: var(--text-muted); }
.liberation-stage-preview-meta { display: flex; flex-wrap: wrap; gap: 7px 15px; color: var(--text-muted); font-size: 11px; }
.liberation-stage-preview-meta b { color: #6258cf; font-size: 14px; }
.liberation-stage-preview-progress { width: 100%; height: 8px; overflow: hidden; margin-top: 12px; border-radius: 999px; background: rgba(105,98,164,0.12); }
.liberation-stage-preview-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #50b8dd, #796ae5, #d46ddd); transition: width 0.25s ease; }
.liberation-stage-preview-copy > small { margin-top: 5px; color: var(--text-muted); font-size: 10px; text-align: right; }

.liberation-stage-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.liberation-stage-card {
    position: relative;
    min-height: 112px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(105, 99, 154, 0.16);
    border-radius: 12px;
    background: rgba(255,255,255,0.48);
    color: var(--text-muted);
    font: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.liberation-stage-card:hover { border-color: rgba(105, 97, 231, 0.42); transform: translateY(-1px); }
.liberation-stage-card:focus { outline: none; }
.liberation-stage-card:focus-visible {
    outline: none;
    border-color: #7568e4;
}
.liberation-stage-art { width: 72px; height: 94px; overflow: hidden; display: grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg, rgba(96, 77, 154, 0.13), rgba(80, 168, 213, 0.13)); }
.liberation-stage-art img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}
.liberation-stage-art.has-image {
    overflow: visible;
    border-radius: 0;
    background: transparent;
}
.liberation-stage-art.has-image img {
    filter: drop-shadow(0 4px 6px rgba(63, 45, 116, 0.12));
}
.liberation-stage-art span { color: #7568c9; font-family: Georgia, serif; font-size: 21px; font-weight: 800; }
.liberation-stage-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 3px 0; }
.liberation-stage-card .liberation-stage-number { color: #77719e; font-size: 11px; font-weight: 800; }
.liberation-stage-card strong { display: -webkit-box; overflow: hidden; color: var(--text-main); font-size: 11px; line-height: 1.38; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.liberation-stage-card small { color: var(--text-muted); font-size: 11px; }
.liberation-stage-cumulative { margin-top: auto; color: #8d89aa; font-size: 10px; }
.liberation-stage-card.is-current { border-color: rgba(105, 97, 231, 0.72); background: rgba(112, 107, 239, 0.11); box-shadow: 0 6px 17px rgba(105, 97, 231, 0.17); transform: translateY(-2px); }
.liberation-stage-card.is-current .liberation-stage-number { color: #625ce3; }
.liberation-stage-card.is-complete { border-color: rgba(54, 173, 150, 0.34); background: rgba(61, 192, 164, 0.1); }
.liberation-stage-card.is-complete::after { content: '完成'; position: absolute; right: 7px; top: 7px; padding: 2px 5px; border-radius: 999px; background: rgba(30, 144, 119, 0.88); color: #fff; font-size: 9px; font-weight: 800; }

.liberation-layout { width: 100%; display: grid; grid-template-columns: minmax(230px, 0.75fr) minmax(0, 1.65fr); gap: 14px; align-items: start; }
.liberation-panel { padding: 18px; }
.liberation-field { display: grid; gap: 6px; margin-bottom: 12px; color: var(--text-muted); font-size: 12px; font-weight: 700; }
.liberation-field em { margin-left: 4px; color: #918da8; font-style: normal; font-weight: 500; }
.liberation-field input,
.liberation-field select,
.liberation-boss-card select,
.liberation-ticket-field input {
    width: 100%;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid rgba(119, 104, 201, 0.24);
    border-radius: 10px;
    outline: none;
    background: rgba(255,255,255,0.78);
    color: var(--text-main);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.liberation-field input:focus,
.liberation-field select:focus,
.liberation-boss-card select:focus,
.liberation-ticket-field input:focus { border-color: #7568e4; box-shadow: 0 0 0 3px rgba(117,104,228,0.15); }
.liberation-check { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: var(--text-main); font-size: 13px; cursor: pointer; }
.liberation-check input,
.liberation-boss-enabled input { width: 17px; height: 17px; accent-color: #7568e4; }
.liberation-reset-btn { width: 100%; min-height: 40px; margin-top: 10px; border: 1px solid rgba(235, 82, 93, 0.42); border-radius: 10px; background: rgba(255, 237, 239, 0.72); color: #dc4554; font-weight: 800; cursor: pointer; }
.liberation-boss-legend { margin: -4px 0 12px; color: var(--text-muted); font-size: 11px; line-height: 1.55; }
.liberation-boss-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.liberation-boss-card { min-width: 0; overflow: hidden; display: grid; grid-template-columns: 92px minmax(0, 1fr); padding: 0; border: 1px solid rgba(119, 104, 181, 0.16); border-radius: 13px; background: rgba(255,255,255,0.48); }
.liberation-boss-art { position: relative; min-height: 190px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(150deg, rgba(68, 53, 111, 0.17), rgba(50, 146, 180, 0.12)); }
.liberation-boss-art::after { content: ''; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgba(20, 16, 47, 0.52)); pointer-events: none; }
.liberation-boss-art > img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.liberation-boss-art-placeholder { padding: 7px; color: #756b9d; font-size: 11px; font-weight: 800; text-align: center; }
.liberation-boss-art > b { position: absolute; z-index: 1; left: 7px; bottom: 7px; padding: 3px 7px; border: 1px solid rgba(255,255,255,0.34); border-radius: 999px; background: rgba(26, 20, 58, 0.74); color: #fff; font-size: 9px; }
.liberation-boss-body { min-width: 0; padding: 11px; }
.liberation-boss-card header { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 9px; }
.liberation-boss-card header strong { color: var(--text-main); font-size: 14px; }
.liberation-boss-card header span { color: var(--text-muted); font-size: 9px; white-space: nowrap; }
.liberation-boss-card header span b { color: #625ce3; font-size: 13px; }
.liberation-boss-controls { min-height: 40px; }
.liberation-boss-enabled { min-height: 40px; display: flex; align-items: center; gap: 7px; padding: 0 3px; color: var(--text-main); font-size: 13px; cursor: pointer; }
.liberation-ticket-repeat { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--text-main); font-size: 11px; cursor: pointer; }
.liberation-ticket-repeat input { width: 15px; height: 15px; accent-color: #7568e4; }
.liberation-ticket-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 7px; margin-top: 7px; }
.liberation-ticket-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(120, 105, 185, 0.18); border-radius: 8px; background: rgba(255,255,255,0.58); }
.liberation-ticket-icon img { max-width: 28px; max-height: 28px; image-rendering: auto; }
.liberation-ticket-icon i { color: #7a70a5; font-size: 10px; font-style: normal; font-weight: 800; }
.liberation-ticket-field { min-width: 0; display: grid; grid-template-columns: auto 42px; align-items: center; gap: 5px; color: var(--text-muted); font-size: 10px; }
.liberation-ticket-field input { min-height: 32px; padding: 0 7px; text-align: center; }
.liberation-ticket-field em { grid-column: 1 / -1; color: #9390a8; font-size: 9px; font-style: normal; white-space: nowrap; }

/* 解放頁面：總覽與設定改為兩張水平主面板 */
.liberation-journey-panel {
    width: 100%;
    display: block;
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(123, 107, 188, 0.22);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(222,246,255,0.82), rgba(246,232,255,0.84));
    box-shadow: 0 10px 27px rgba(76, 58, 152, 0.08);
}
.liberation-journey-panel .liberation-hero {
    min-height: 0;
    grid-template-columns: 76px minmax(220px, 1.05fr) minmax(285px, 0.95fr);
    gap: 13px;
    padding: 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.liberation-journey-panel .liberation-current-stage-visual { width: 76px; height: 91px; }
.liberation-journey-panel .liberation-current-stage-visual strong { right: 4px; bottom: 4px; min-width: 36px; padding: 4px 5px; font-size: 11px; }
.liberation-journey-panel .liberation-forecast > strong { margin: 4px 0 8px; font-size: clamp(26px, 3.4vw, 38px); }
.liberation-journey-panel .liberation-forecast-stats { gap: 6px; }
.liberation-journey-panel .liberation-forecast-stats span { min-width: 0; flex: 1 1 90px; padding: 6px 8px; font-size: 10px; }
.liberation-journey-panel .liberation-forecast-stats b { font-size: 17px; }
.liberation-journey-panel .liberation-total-summary {
    grid-column: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 3px 8px;
    padding: 10px 12px;
    border-radius: 11px;
}
.liberation-journey-panel .liberation-total-summary > span:first-child { font-size: 10px; }
.liberation-journey-panel .liberation-total-summary strong { margin: 0; font-size: 18px; white-space: nowrap; }
.liberation-journey-panel .liberation-total-summary strong small { font-size: 10px; }
.liberation-journey-panel .liberation-total-summary > span:last-child { grid-column: 1 / -1; min-width: 0; overflow: hidden; font-size: 10px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.liberation-journey-panel .liberation-stage-section {
    width: auto;
    padding: 18px;
    border: 0;
    border-top: 1px solid rgba(117, 102, 183, 0.16);
    border-radius: 0;
    background: rgba(255,255,255,0.26);
    box-shadow: none;
}
.liberation-journey-panel .liberation-section-heading { margin-bottom: 10px; }
.liberation-journey-panel .liberation-stage-list { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.liberation-journey-panel .liberation-stage-card { min-height: 64px; grid-template-columns: 42px minmax(0, 1fr); gap: 6px; padding: 6px; }
.liberation-journey-panel .liberation-stage-art { width: 42px; height: 52px; }
.liberation-journey-panel .liberation-stage-copy { gap: 1px; padding: 1px 0; }
.liberation-journey-panel .liberation-stage-card .liberation-stage-number,
.liberation-journey-panel .liberation-stage-card small { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.liberation-journey-panel .liberation-stage-card strong { display: block; overflow: hidden; font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.liberation-journey-panel .liberation-stage-cumulative { display: none; }
.liberation-journey-panel .liberation-stage-card small { font-size: 10px; }

.liberation-layout.liberation-workspace-panel {
    width: 100%;
    display: block;
    padding: 18px;
    border: 1px solid rgba(123, 107, 188, 0.2);
    border-radius: 18px;
    background: var(--liberation-panel);
    box-shadow: 0 9px 25px rgba(76, 58, 152, 0.08);
}
.liberation-workspace-panel .liberation-panel { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.liberation-workspace-panel .liberation-status-panel { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid rgba(109, 95, 173, 0.14); }
.liberation-workspace-panel .liberation-section-heading { margin-bottom: 10px; }
.liberation-status-controls {
    display: grid;
    grid-template-columns: minmax(130px, 1.15fr) minmax(140px, 1.05fr) minmax(150px, 1fr) auto auto minmax(130px, 0.9fr);
    align-items: end;
    gap: 10px;
}
.liberation-status-controls .liberation-field { margin: 0; }
.liberation-status-controls .liberation-check { min-height: 40px; margin: 0; padding: 0 2px; font-size: 12px; white-space: nowrap; }
.liberation-status-controls .liberation-reset-btn { min-height: 40px; margin: 0; font-size: 12px; }
.liberation-workspace-panel .liberation-boss-legend { margin: -3px 0 11px; }
.liberation-workspace-panel .liberation-boss-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.liberation-workspace-panel .liberation-boss-card { grid-template-columns: 62px minmax(0, 1fr); }
.liberation-workspace-panel .liberation-boss-art { min-height: 142px; }
.liberation-workspace-panel .liberation-boss-body { padding: 8px; }
.liberation-workspace-panel .liberation-boss-card header { margin-bottom: 6px; }
.liberation-workspace-panel .liberation-boss-card header strong { font-size: 12px; }
.liberation-workspace-panel .liberation-boss-card header span { font-size: 8px; }
.liberation-workspace-panel .liberation-boss-card header span b { font-size: 11px; }
.liberation-workspace-panel .liberation-boss-controls { min-height: 35px; }
.liberation-workspace-panel .liberation-boss-card select { min-height: 35px; padding: 0 7px; font-size: 11px; }
.liberation-workspace-panel .liberation-boss-enabled { min-height: 35px; font-size: 11px; }
.liberation-workspace-panel .liberation-ticket-repeat { margin-top: 5px; font-size: 10px; }
.liberation-workspace-panel .liberation-ticket-row { grid-template-columns: 29px minmax(0, 1fr); gap: 5px; margin-top: 5px; }
.liberation-workspace-panel .liberation-ticket-icon { width: 29px; height: 29px; }
.liberation-workspace-panel .liberation-ticket-icon img { max-width: 24px; max-height: 24px; }
.liberation-workspace-panel .liberation-ticket-field { grid-template-columns: minmax(0, 1fr) 34px; font-size: 9px; }
.liberation-workspace-panel .liberation-ticket-field input { min-height: 29px; }
.liberation-workspace-panel .liberation-ticket-field em { font-size: 8px; }

[data-theme="dark"] #tab-liberation { --liberation-panel: rgba(20, 25, 48, 0.88); }
[data-theme="dark"] .liberation-hero { background: linear-gradient(135deg, rgba(23, 53, 78, 0.96), rgba(55, 39, 84, 0.96)); border-color: rgba(133, 152, 236, 0.28); }
[data-theme="dark"] .liberation-kicker,
[data-theme="dark"] .liberation-forecast-stats span,
[data-theme="dark"] .liberation-total-summary > span:first-child,
[data-theme="dark"] .liberation-total-summary strong small { color: #aeb8cf; }
[data-theme="dark"] .liberation-forecast-stats span {
    border-color: rgba(139, 149, 226, 0.25);
    background: rgba(7, 13, 33, 0.58);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}
[data-theme="dark"] .liberation-forecast-stats b { color: #918bff; }
[data-theme="dark"] .liberation-forecast-stats span:last-child b { color: #ff78dc; }
[data-theme="dark"] .liberation-current-stage-visual,
[data-theme="dark"] .liberation-total-summary { background: rgba(9, 17, 37, 0.48); border-color: rgba(147, 153, 232, 0.28); }
[data-theme="dark"] .liberation-progress-tile span { color: #aeb8cf; }
[data-theme="dark"] .liberation-progress-tile strong { color: #9b94ff; }
[data-theme="dark"] .liberation-forecast > strong,
[data-theme="dark"] .liberation-total-summary strong { color: #f5f4ff; }
[data-theme="dark"] .liberation-total-summary > span:last-child { color: #aaa5ff; }
[data-theme="dark"] .liberation-stage-section,
[data-theme="dark"] .liberation-panel { border-color: rgba(139, 132, 226, 0.24); }
[data-theme="dark"] .liberation-stage-tab,
[data-theme="dark"] .liberation-stage-preview,
[data-theme="dark"] .liberation-stage-card,
[data-theme="dark"] .liberation-boss-card { background: rgba(10, 15, 35, 0.44); border-color: rgba(162, 157, 220, 0.18); }
[data-theme="dark"] .liberation-stage-tab.is-current { background: rgba(103, 96, 222, 0.14); border-color: rgba(133, 126, 241, 0.48); }
[data-theme="dark"] .liberation-stage-tab.is-selected { border-color: #8f86ff; box-shadow: 0 5px 17px rgba(91, 79, 220, 0.25), inset 0 0 0 1px rgba(144,134,255,0.15); }
[data-theme="dark"] .liberation-stage-preview-art { background: rgba(8, 14, 32, 0.62); }
[data-theme="dark"] .liberation-field input,
[data-theme="dark"] .liberation-field select,
[data-theme="dark"] .liberation-boss-card select,
[data-theme="dark"] .liberation-ticket-field input { background: rgba(8, 14, 32, 0.82); border-color: rgba(130, 147, 232, 0.34); color: var(--text-main); }
[data-theme="dark"] .liberation-ticket-icon { background: rgba(8, 14, 32, 0.58); border-color: rgba(130, 147, 232, 0.24); }
[data-theme="dark"] .liberation-reset-btn { background: rgba(102, 31, 43, 0.35); color: #ff909a; }
[data-theme="dark"] .liberation-journey-panel {
    border-color: rgba(133, 152, 236, 0.3);
    background: linear-gradient(135deg, rgba(20, 48, 73, 0.94), rgba(51, 35, 80, 0.94));
}
[data-theme="dark"] .liberation-journey-panel .liberation-stage-section {
    border-color: rgba(139, 132, 226, 0.22);
    background: rgba(8, 14, 32, 0.24);
}
[data-theme="dark"] .liberation-layout.liberation-workspace-panel {
    border-color: rgba(139, 132, 226, 0.24);
    background: rgba(20, 25, 48, 0.88);
}
[data-theme="dark"] .liberation-workspace-panel .liberation-status-panel { border-color: rgba(139, 132, 226, 0.2); }

@media (max-width: 980px) {
    .liberation-journey-panel .liberation-hero { grid-template-columns: 70px minmax(190px, 1fr) minmax(240px, 0.95fr); }
    .liberation-journey-panel .liberation-current-stage-visual { width: 70px; height: 84px; }
    .liberation-journey-panel .liberation-stage-list { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .liberation-status-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .liberation-status-controls .liberation-check { min-height: 36px; }
    .liberation-status-controls .liberation-reset-btn { grid-column: span 1; }
    .liberation-workspace-panel .liberation-boss-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .liberation-journey-panel .liberation-hero { grid-template-columns: 70px minmax(0, 1fr); }
    .liberation-journey-panel .liberation-total-summary { grid-column: 1 / -1; }
    .liberation-journey-panel .liberation-stage-section { border-top: 1px solid rgba(117, 102, 183, 0.16); border-left: 0; }
    .liberation-journey-panel .liberation-stage-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .liberation-status-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .liberation-status-controls .liberation-check,
    .liberation-status-controls .liberation-reset-btn { grid-column: auto; }
}

@media (max-width: 760px) {
    .liberation-hero { grid-template-columns: 105px minmax(0, 1fr); gap: 16px; min-height: 0; padding: 19px; }
    .liberation-current-stage-visual { width: 96px; height: 112px; }
    .liberation-forecast > strong { font-size: clamp(27px, 8vw, 43px); }
    .liberation-total-summary { grid-column: 1 / -1; min-height: 0; padding: 12px 14px; }
    .liberation-stage-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .liberation-layout { grid-template-columns: 1fr; }
}

@media (max-width: 470px) {
    .rune-version-notice { font-size: 11px; }
    #tab-liberation { gap: 11px; }
    .liberation-version { font-size: 11px; }
    .liberation-data-notice { font-size: 11px; }
    .liberation-hero { grid-template-columns: 82px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 16px; }
    .liberation-current-stage-visual { width: 76px; height: 90px; }
    .liberation-current-stage-visual strong { right: 4px; bottom: 4px; min-width: 34px; padding: 4px 5px; font-size: 10px; }
    .liberation-kicker { font-size: 10px; }
    .liberation-forecast > strong { margin: 4px 0 8px; font-size: 27px; }
    .liberation-forecast-stats { gap: 5px; }
    .liberation-forecast-stats span { min-width: 0; flex: 1 1 100px; padding: 6px 7px; font-size: 10px; }
    .liberation-forecast-stats b { font-size: 16px; }
    .liberation-total-summary { font-size: 11px; }
    .liberation-total-summary strong { font-size: 22px; }
    .liberation-stage-section,
    .liberation-panel { border-radius: 14px; }
    .liberation-stage-section,
    .liberation-panel { padding: 13px; }
    .liberation-stage-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .liberation-stage-card { grid-template-columns: 54px minmax(0, 1fr); min-height: 89px; gap: 7px; padding: 7px; }
    .liberation-stage-art { width: 54px; height: 73px; }
    .liberation-stage-card strong { font-size: 11px; }
    .liberation-boss-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .liberation-boss-card { display: block; padding: 0; }
    .liberation-boss-art { width: 100%; min-height: 0; height: 94px; }
    .liberation-boss-art > img { object-position: center 30%; }
    .liberation-boss-body { padding: 9px; }
    .liberation-boss-card header strong { font-size: 12px; }
    .liberation-boss-card header span { font-size: 8px; }
    .liberation-boss-card header span b { font-size: 11px; }
    .liberation-ticket-row { grid-template-columns: 30px minmax(0, 1fr); gap: 5px; }
    .liberation-ticket-icon { width: 30px; height: 30px; }
    .liberation-ticket-icon img { max-width: 25px; max-height: 25px; }
    .liberation-ticket-field { grid-template-columns: auto 34px; }
    .liberation-ticket-field em { grid-column: 1 / -1; font-size: 9px; }
}

@media (max-width: 560px) {
    .liberation-journey-panel { border-radius: 15px; }
    .liberation-journey-panel .liberation-hero { grid-template-columns: 66px minmax(0, 1fr); gap: 10px; padding: 13px; }
    .liberation-journey-panel .liberation-current-stage-visual { width: 66px; height: 80px; }
    .liberation-journey-panel .liberation-forecast > strong { margin: 2px 0 6px; font-size: 25px; }
    .liberation-journey-panel .liberation-forecast-stats span { padding: 5px 6px; font-size: 9px; }
    .liberation-journey-panel .liberation-forecast-stats b { font-size: 14px; }
    .liberation-journey-panel .liberation-total-summary { grid-template-columns: 1fr auto; gap: 3px 8px; padding: 8px 9px; }
    .liberation-journey-panel .liberation-total-summary > span:last-child { grid-column: 1 / -1; text-align: left; }
    .liberation-journey-panel .liberation-stage-section { padding: 13px; }
    .liberation-journey-panel .liberation-stage-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .liberation-journey-panel .liberation-stage-card { min-height: 89px; grid-template-columns: 54px minmax(0, 1fr); }
    .liberation-journey-panel .liberation-stage-art { width: 54px; height: 73px; }

    .liberation-layout.liberation-workspace-panel { padding: 13px; border-radius: 15px; }
    .liberation-workspace-panel .liberation-status-panel { padding-bottom: 13px; margin-bottom: 13px; }
    .liberation-status-controls { gap: 8px; }
    .liberation-status-controls .liberation-field:first-child,
    .liberation-status-controls .liberation-reset-btn { grid-column: 1 / -1; }
    .liberation-status-controls .liberation-check { min-height: 34px; font-size: 11px; }
    .liberation-workspace-panel .liberation-boss-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .liberation-workspace-panel .liberation-boss-card { display: grid; grid-template-columns: 56px minmax(0, 1fr); }
    .liberation-workspace-panel .liberation-boss-art { width: auto; min-height: 138px; height: auto; }
    .liberation-workspace-panel .liberation-ticket-field em { white-space: normal; }
}

/* 創世系統分頁與解放計算機版面整理 */
.genesis-subtabs {
    width: min(100%, 560px);
    margin: 0 auto;
    padding: 4px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    border: 1px solid rgba(120, 107, 193, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.42);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.68);
}

.genesis-subtab {
    min-width: 0;
    min-height: 38px;
    padding: 7px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.genesis-subtab:hover { color: var(--text-main); }
.genesis-subtab.is-active {
    background: linear-gradient(135deg, rgba(111, 193, 244, 0.3), rgba(211, 118, 232, 0.25));
    box-shadow: 0 4px 12px rgba(91, 82, 190, 0.16), inset 0 0 0 1px rgba(108, 100, 220, 0.26);
    color: var(--text-main);
}

.genesis-panel { display: none; width: 100%; }
.genesis-panel.is-active { display: flex; flex-direction: column; gap: 14px; }
.genesis-empty-state {
    width: 100%;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(123, 107, 188, 0.2);
    border-radius: 18px;
    background: rgba(255,255,255,0.48);
    box-shadow: 0 9px 25px rgba(76, 58, 152, 0.08);
    color: var(--text-muted);
}
.genesis-empty-state > span {
    width: 56px;
    height: 56px;
    margin-bottom: 6px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    background: linear-gradient(145deg, rgba(93, 190, 232, 0.18), rgba(193, 112, 224, 0.2));
    color: #7368d6;
    font-family: Georgia, serif;
    font-size: 21px;
    font-weight: 800;
}
.genesis-empty-state strong { color: var(--text-main); font-size: 18px; }
.genesis-empty-state p { margin: 0; font-size: 12px; }

/* 上方資訊分成三個清楚的視覺區塊，階段列只保留辨識所需資訊。 */
.liberation-journey-panel .liberation-hero {
    --liberation-progress-width: 0%;
    position: relative;
    overflow: hidden;
    grid-template-columns: 102px minmax(270px, 1.12fr) minmax(245px, 0.88fr);
    gap: 15px 18px;
    padding: 20px 20px 16px;
}
.liberation-journey-panel .liberation-hero::before {
    content: '';
    position: absolute;
    width: 190px;
    height: 190px;
    right: -75px;
    top: -105px;
    border: 28px solid rgba(184, 109, 222, 0.07);
    border-radius: 50%;
    pointer-events: none;
}
.liberation-journey-panel .liberation-current-stage-visual {
    width: 98px;
    height: 118px;
    align-self: center;
}
.liberation-journey-panel .liberation-current-stage-visual.has-image {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.liberation-journey-panel .liberation-current-stage-visual.has-image img {
    filter: drop-shadow(0 9px 12px rgba(67, 51, 145, 0.18));
}
.liberation-journey-panel .liberation-kicker {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(111, 104, 222, 0.09);
    color: #6f68b6;
    font-size: 10px;
    letter-spacing: 0.04em;
}
.liberation-journey-panel .liberation-forecast > strong { font-size: clamp(28px, 3.5vw, 39px); }
.liberation-journey-panel .liberation-forecast-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.liberation-journey-panel .liberation-forecast-stats span {
    position: relative;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
    border-color: rgba(120, 106, 201, 0.2);
    background: linear-gradient(135deg, rgba(255,255,255,0.68), rgba(255,255,255,0.38));
    font-size: 12px;
}
.liberation-journey-panel .liberation-forecast-stats b {
    display: inline;
    margin: 0;
    font-size: 19px;
    line-height: 1;
}
.liberation-journey-panel .liberation-forecast-stats span::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, #70bde5, #7d70ea);
}
.liberation-journey-panel .liberation-forecast-stats span:last-child::after {
    background: linear-gradient(90deg, #b072e6, #e777c9);
}
.liberation-journey-panel .liberation-total-summary {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    padding: 14px 18px;
    border-color: rgba(120, 104, 201, 0.24);
    background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(248,238,255,0.48));
    box-shadow: inset 4px 0 0 rgba(116, 104, 222, 0.72), 0 7px 17px rgba(79, 63, 157, 0.08);
}
.liberation-journey-panel .liberation-total-summary::after {
    content: '';
    position: absolute;
    width: 72px;
    height: 72px;
    right: -31px;
    bottom: -37px;
    border: 14px solid rgba(193, 104, 219, 0.08);
    border-radius: 50%;
}
.liberation-journey-panel .liberation-total-summary > span:first-child { font-size: 13px; }
.liberation-journey-panel .liberation-total-summary strong { font-size: 28px; }
.liberation-journey-panel .liberation-total-summary strong small { font-size: 14px; }
.liberation-journey-panel .liberation-total-summary > span:last-child {
    grid-column: auto;
    overflow: visible;
    color: #6258c6;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
    text-overflow: clip;
    white-space: normal;
}
.liberation-overall-progress {
    position: relative;
    z-index: 1;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 34px;
    align-items: center;
    gap: 10px;
    color: #79749b;
    font-size: 10px;
    font-weight: 700;
}
.liberation-overall-progress > div {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(105, 98, 164, 0.13);
    box-shadow: inset 0 1px 2px rgba(68, 54, 124, 0.08);
}
.liberation-overall-progress i {
    display: block;
    width: var(--liberation-progress-width);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #55bde2, #786ee8 54%, #dc6fd4);
    box-shadow: 0 0 9px rgba(120, 105, 231, 0.38);
    transition: width 0.28s ease;
}
.liberation-overall-progress b { color: #6b61c8; text-align: right; }
.liberation-journey-panel .liberation-stage-section { padding: 16px 20px 18px; }
.liberation-journey-panel .liberation-stage-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}
.liberation-journey-panel .liberation-stage-card {
    min-height: 68px;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding: 7px;
}
.liberation-journey-panel .liberation-stage-art { width: 44px; height: 54px; }
.liberation-journey-panel .liberation-stage-copy { justify-content: center; gap: 4px; }
.liberation-journey-panel .liberation-stage-card strong,
.liberation-journey-panel .liberation-stage-cumulative { display: none; }
.liberation-journey-panel .liberation-stage-card .liberation-stage-number {
    color: #6f63c4;
    font-size: 12px;
    font-weight: 800;
}
.liberation-journey-panel .liberation-stage-card small { font-size: 11px; }

/* 設定列保留水平閱讀，但降低重設按鈕與勾選項的視覺重量。 */
.liberation-status-controls {
    grid-template-columns: minmax(130px, 1.1fr) minmax(145px, 1fr) minmax(150px, 1fr) auto auto 120px;
    gap: 9px;
}
.liberation-status-controls .liberation-check {
    padding: 0 6px;
    border-radius: 9px;
    background: rgba(255,255,255,0.26);
}
.liberation-status-controls .liberation-reset-btn { width: 120px; }

/* BOSS 維持桌面四欄、手機兩欄，刪除每張卡片重複的輔助句。 */
.liberation-workspace-panel .liberation-boss-card { grid-template-columns: 68px minmax(0, 1fr); }
.liberation-workspace-panel .liberation-boss-art { min-height: 126px; }
.liberation-workspace-panel .liberation-boss-body { padding: 9px; }
.liberation-workspace-panel .liberation-boss-card header span {
    padding: 3px 5px;
    border-radius: 999px;
    background: rgba(110, 99, 210, 0.09);
    font-size: 11px;
}
.liberation-workspace-panel .liberation-boss-card header span b {
    font-size: 14px;
}
.liberation-workspace-panel .liberation-ticket-field em { display: none; }
.liberation-label-short { display: none; }
.liberation-workspace-panel .liberation-ticket-row {
    grid-template-columns: 29px minmax(0, 1fr);
    gap: 6px;
    margin-top: 8px;
}
.liberation-ticket-stepper {
    min-width: 0;
    min-height: 31px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 27px minmax(28px, 1fr) 27px;
    border: 1px solid rgba(120, 105, 185, 0.22);
    border-radius: 9px;
    background: rgba(255,255,255,0.6);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.liberation-ticket-stepper:focus-within {
    border-color: #7568e4;
    box-shadow: 0 0 0 3px rgba(117,104,228,0.13);
}
.liberation-ticket-stepper button {
    min-width: 0;
    padding: 0;
    border: 0;
    background: rgba(112, 100, 207, 0.08);
    color: #695dca;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
}
.liberation-ticket-stepper button:hover { background: rgba(112, 100, 207, 0.17); color: #5347bc; }
.liberation-ticket-stepper input {
    width: 100%;
    min-width: 0;
    padding: 0 2px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 11px;
    text-align: center;
}

[data-theme="dark"] .genesis-subtabs {
    border-color: rgba(139, 148, 226, 0.25);
    background: rgba(8, 14, 32, 0.5);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}
[data-theme="dark"] .genesis-subtab.is-active {
    background: linear-gradient(135deg, rgba(58, 151, 207, 0.25), rgba(155, 77, 190, 0.26));
    box-shadow: 0 4px 14px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(143, 134, 255, 0.34);
}
[data-theme="dark"] .genesis-empty-state {
    border-color: rgba(139, 132, 226, 0.24);
    background: rgba(20, 25, 48, 0.88);
}
[data-theme="dark"] .liberation-status-controls .liberation-check { background: rgba(8, 14, 32, 0.28); }
[data-theme="dark"] .liberation-workspace-panel .liberation-boss-card header span { background: rgba(128, 119, 235, 0.14); }
[data-theme="dark"] .liberation-journey-panel .liberation-kicker { background: rgba(126, 116, 235, 0.14); color: #b7b2ff; }
[data-theme="dark"] .liberation-journey-panel .liberation-forecast-stats span {
    border-color: rgba(139, 149, 226, 0.25);
    background: linear-gradient(135deg, rgba(8,14,32,0.72), rgba(18,18,43,0.52));
}
[data-theme="dark"] .liberation-journey-panel .liberation-total-summary {
    border-color: rgba(147, 153, 232, 0.28);
    background: linear-gradient(135deg, rgba(9,17,37,0.68), rgba(30,20,53,0.52));
    box-shadow: inset 4px 0 0 rgba(143, 134, 255, 0.76), 0 7px 18px rgba(0,0,0,0.16);
}
[data-theme="dark"] .liberation-overall-progress { color: #aeb8cf; }
[data-theme="dark"] .liberation-overall-progress > div { background: rgba(5,10,27,0.55); }
[data-theme="dark"] .liberation-overall-progress b { color: #aaa5ff; }
[data-theme="dark"] .liberation-ticket-stepper {
    border-color: rgba(130, 147, 232, 0.3);
    background: rgba(8, 14, 32, 0.72);
}
[data-theme="dark"] .liberation-ticket-stepper button { background: rgba(128,119,235,0.12); color: #aaa3ff; }
[data-theme="dark"] .liberation-ticket-stepper button:hover { background: rgba(128,119,235,0.23); }

@media (max-width: 980px) {
    .liberation-journey-panel .liberation-hero {
        grid-template-columns: 92px minmax(220px, 1fr) minmax(220px, 0.9fr);
        gap: 13px;
        padding: 17px;
    }
    .liberation-journey-panel .liberation-current-stage-visual { width: 88px; height: 106px; }
    .liberation-status-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .liberation-status-controls .liberation-reset-btn { width: 100%; }
}

@media (max-width: 700px) {
    .genesis-subtabs { width: 100%; }
    .genesis-subtab { min-height: 40px; padding: 7px 5px; font-size: 12px; }
    .genesis-empty-state { min-height: 260px; border-radius: 15px; }

    .liberation-journey-panel .liberation-hero {
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 11px;
        padding: 14px;
    }
    .liberation-journey-panel .liberation-current-stage-visual { width: 80px; height: 98px; }
    .liberation-journey-panel .liberation-forecast > strong { font-size: clamp(24px, 7.4vw, 30px); }
    .liberation-journey-panel .liberation-total-summary {
        grid-column: 1 / -1;
        min-height: 0;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 3px 9px;
        padding: 10px 12px;
    }
    .liberation-journey-panel .liberation-total-summary > span:first-child { grid-column: 1; font-size: 12px; }
    .liberation-journey-panel .liberation-total-summary strong { grid-column: 2; font-size: 24px; }
    .liberation-journey-panel .liberation-total-summary strong small { font-size: 13px; }
    .liberation-journey-panel .liberation-total-summary > span:last-child { grid-column: 1 / -1; font-size: 13px; }
    .liberation-overall-progress { gap: 7px; font-size: 9px; }
    .liberation-journey-panel .liberation-stage-section { padding: 13px; }
    .liberation-journey-panel .liberation-stage-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .liberation-journey-panel .liberation-stage-card {
        min-height: 66px;
        grid-template-columns: 46px minmax(0, 1fr);
    }
    .liberation-journey-panel .liberation-stage-art { width: 46px; height: 56px; }

    .liberation-status-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .liberation-status-controls .liberation-field:first-child { grid-column: 1 / -1; }
    .liberation-status-controls .liberation-check {
        min-height: 38px;
        padding: 5px 6px;
        font-size: 10px;
        white-space: normal;
    }
    .liberation-status-controls .liberation-reset-btn { grid-column: 1 / -1; width: 100%; }

    .liberation-workspace-panel .liberation-boss-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .liberation-workspace-panel .liberation-boss-card {
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr);
    }
    .liberation-workspace-panel .liberation-boss-art { width: auto; min-height: 124px; height: auto; }
    .liberation-workspace-panel .liberation-boss-body { padding: 7px; }
    .liberation-workspace-panel .liberation-boss-card header {
        display: grid;
        justify-items: start;
        gap: 3px;
        margin-bottom: 5px;
    }
    .liberation-workspace-panel .liberation-boss-card header span { padding: 3px 5px; font-size: 10px; }
    .liberation-workspace-panel .liberation-boss-card header span b { font-size: 13px; }
    .liberation-workspace-panel .liberation-boss-controls,
    .liberation-workspace-panel .liberation-boss-enabled { min-height: 33px; }
    .liberation-workspace-panel .liberation-boss-card select { min-height: 33px; padding: 0 5px; }
    .liberation-workspace-panel .liberation-label-full { display: none; }
    .liberation-workspace-panel .liberation-label-short { display: inline; }
    .liberation-workspace-panel .liberation-ticket-row { grid-template-columns: 26px minmax(0, 1fr); }
    .liberation-workspace-panel .liberation-ticket-icon { width: 26px; height: 26px; }
    .liberation-workspace-panel .liberation-ticket-icon img { max-width: 22px; max-height: 22px; }
    .liberation-workspace-panel .liberation-ticket-stepper { grid-template-columns: 21px minmax(23px, 1fr) 21px; min-height: 28px; }
    .liberation-workspace-panel .liberation-ticket-stepper button { font-size: 14px; }
    .liberation-workspace-panel .liberation-ticket-stepper input { font-size: 10px; }
}

@media (max-width: 410px) {
    .genesis-subtab { font-size: 11px; }
    .liberation-layout.liberation-workspace-panel { padding: 10px; }
    .liberation-workspace-panel .liberation-boss-list { gap: 6px; }
    .liberation-workspace-panel .liberation-boss-card { grid-template-columns: 48px minmax(0, 1fr); }
    .liberation-workspace-panel .liberation-boss-body { padding: 6px; }
    .liberation-workspace-panel .liberation-boss-card header strong { font-size: 11px; }
    .liberation-workspace-panel .liberation-ticket-stepper { grid-template-columns: 19px minmax(21px, 1fr) 19px; }
}

/* 黑魔法師四字固定單行，避免兩欄手機版只剩最後一字換行。 */
.liberation-boss-card header > strong { white-space: nowrap; }

/* 創世鍊成 */
/* 創世解放：目前狀態與每週／每月痕跡各自成為獨立面板 */
.liberation-layout.liberation-workspace-panel {
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.liberation-workspace-panel .liberation-panel,
.liberation-workspace-panel .liberation-status-panel {
    width: 100%;
    padding: 18px;
    margin: 0;
    border: 1px solid rgba(126, 110, 204, 0.2);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.58), rgba(250,247,255,0.48));
    box-shadow: 0 10px 28px rgba(72, 56, 144, 0.09);
}

[data-theme="dark"] .liberation-layout.liberation-workspace-panel {
    border: 0;
    background: transparent;
    box-shadow: none;
}

[data-theme="dark"] .liberation-workspace-panel .liberation-panel,
[data-theme="dark"] .liberation-workspace-panel .liberation-status-panel {
    border-color: rgba(139, 132, 226, 0.22);
    background: linear-gradient(135deg, rgba(20, 31, 49, 0.92), rgba(34, 27, 59, 0.9));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}

@media (max-width: 700px) {
    .liberation-layout.liberation-workspace-panel {
        padding: 0;
        gap: 12px;
        border-radius: 0;
    }

    .liberation-workspace-panel .liberation-panel,
    .liberation-workspace-panel .liberation-status-panel {
        padding: 13px;
        margin: 0;
        border-radius: 15px;
    }
}

@media (max-width: 410px) {
    .liberation-layout.liberation-workspace-panel { padding: 0; }
    .liberation-workspace-panel .liberation-panel,
    .liberation-workspace-panel .liberation-status-panel { padding: 10px; }
}

.genesis-alchemy-hero {
    width: 100%;
    padding: 22px;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(245px, 0.75fr);
    gap: 16px;
    overflow: hidden;
    border: 1px solid rgba(119, 105, 199, 0.2);
    border-radius: 20px;
    background:
        radial-gradient(circle at 96% -20%, rgba(201, 107, 225, 0.16), transparent 36%),
        radial-gradient(circle at -8% 112%, rgba(75, 189, 227, 0.14), transparent 34%),
        rgba(255,255,255,0.5);
    box-shadow: 0 10px 28px rgba(72, 56, 144, 0.09);
}
.genesis-alchemy-heading > span {
    color: #7469cf;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.13em;
}
.genesis-alchemy-heading h2 {
    margin: 5px 0 6px;
    color: var(--text-main);
    font-size: clamp(24px, 3vw, 32px);
}
.genesis-alchemy-heading p {
    max-width: 620px;
    margin: 0;
    color: #6b687b;
    font-size: 13px;
    font-weight: 550;
    line-height: 1.65;
}
.genesis-alchemy-primary {
    min-width: 0;
    padding: 15px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid rgba(123, 105, 204, 0.2);
    border-left: 4px solid #766ce3;
    border-radius: 14px;
    background: rgba(255,255,255,0.48);
}
.genesis-alchemy-primary > span { color: var(--text-muted); font-size: 11px; }
.genesis-alchemy-primary > strong {
    margin: 3px 0;
    overflow: hidden;
    color: var(--text-main);
    font-size: clamp(21px, 3vw, 28px);
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.genesis-alchemy-primary small { color: var(--text-muted); font-size: 11px; }
.genesis-alchemy-primary small b { color: #6d63d1; font-size: 15px; }
.genesis-alchemy-summary-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}
.genesis-alchemy-summary-grid > div {
    min-width: 0;
    padding: 11px 13px;
    display: grid;
    grid-template-columns: minmax(0, auto) auto;
    align-items: baseline;
    justify-content: start;
    column-gap: 4px;
    border: 1px solid rgba(119, 105, 199, 0.15);
    border-radius: 12px;
    background: rgba(255,255,255,0.46);
}
.genesis-alchemy-summary-grid span { grid-column: 1 / -1; margin-bottom: 3px; color: #69667a; font-size: 11px; font-weight: 650; }
.genesis-alchemy-summary-grid strong {
    min-width: 0;
    overflow: hidden;
    color: var(--text-main);
    font-size: clamp(17px, 2.1vw, 22px);
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.genesis-alchemy-summary-grid small { color: #747085; font-size: 10px; font-weight: 600; white-space: nowrap; }
.genesis-alchemy-summary-material {
    display: flex !important;
    align-items: center !important;
    gap: 9px;
}
.genesis-alchemy-summary-material > img {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    object-fit: contain;
    image-rendering: auto;
    filter: drop-shadow(0 4px 6px rgba(64, 43, 123, 0.18));
}
.genesis-alchemy-summary-material > div {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, auto) auto;
    align-items: baseline;
    column-gap: 4px;
}
.genesis-alchemy-summary-material > div > span { grid-column: 1 / -1; }
.genesis-alchemy-settings,
.genesis-alchemy-boss-panel { padding: 18px; }
.genesis-alchemy-settings .liberation-section-heading p,
.genesis-alchemy-boss-panel .liberation-section-heading p {
    color: #6b687b;
    font-size: 13px;
    font-weight: 550;
}
.genesis-alchemy-rate {
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid rgba(55, 165, 119, 0.25);
    border-radius: 999px;
    color: #27845d;
    background: rgba(70, 181, 127, 0.09);
    min-width: 92px;
    min-height: 38px;
    display: grid;
    place-items: center;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
}
.genesis-alchemy-controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 9px;
}
.genesis-alchemy-controls .liberation-field {
    margin: 0;
    gap: 7px;
    font-size: 13px;
}
.genesis-alchemy-controls .liberation-field input,
.genesis-alchemy-controls .liberation-field select {
    min-height: 42px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 650;
}
.genesis-alchemy-controls .liberation-check { min-height: 39px; }
.genesis-alchemy-controls .liberation-reset-btn { width: 100%; min-height: 39px; }
.genesis-alchemy-reset-mobile { display: none; }
.genesis-alchemy-reset-desktop {
    width: 100%;
    display: flex;
}
.genesis-alchemy-reset-desktop .liberation-reset-btn {
    width: 100%;
    min-height: 43px;
    margin: 0;
    border-radius: 13px;
    font-size: 13px;
}
.genesis-alchemy-level-grid {
    margin-top: 14px;
    padding-top: 14px;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px;
    border-top: 1px solid rgba(112, 98, 179, 0.13);
}
.genesis-alchemy-level {
    min-width: 0;
    min-height: 66px;
    padding: 7px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px solid rgba(115, 101, 185, 0.16);
    border-radius: 10px;
    color: var(--text-main);
    background: rgba(255,255,255,0.38);
    font: inherit;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.genesis-alchemy-level:hover { transform: translateY(-2px); border-color: rgba(112, 99, 221, 0.42); }
.genesis-alchemy-level span { color: #6c62c8; font-size: 11px; font-weight: 850; }
.genesis-alchemy-level strong { color: var(--text-main); font-size: 14px; line-height: 1.1; }
.genesis-alchemy-level small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #6f6b80;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.genesis-alchemy-level small img {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    object-fit: contain;
}
.genesis-alchemy-level.is-complete { border-color: rgba(47, 161, 132, 0.32); background: rgba(70, 190, 162, 0.1); }
.genesis-alchemy-level.is-planned { background: rgba(121, 109, 224, 0.08); }
.genesis-alchemy-level.is-target {
    border-color: #786ce6;
    background: linear-gradient(145deg, rgba(103, 193, 231, 0.15), rgba(201, 105, 226, 0.15));
    box-shadow: 0 5px 13px rgba(104, 87, 204, 0.14), inset 0 0 0 1px rgba(120,108,230,0.18);
}
.genesis-alchemy-boss-panel .liberation-boss-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.genesis-alchemy-boss-panel .liberation-boss-card { grid-template-columns: 68px minmax(0, 1fr); }
.genesis-alchemy-boss-panel .liberation-boss-art { min-height: 126px; }
.genesis-alchemy-boss-panel .liberation-boss-body { padding: 9px; }
.genesis-alchemy-boss-panel .liberation-boss-card header { margin-bottom: 6px; }
.genesis-alchemy-boss-panel .liberation-boss-card header > strong { font-size: 12px; }
.genesis-alchemy-boss-panel .liberation-boss-card header span {
    padding: 3px 5px;
    border-radius: 999px;
    background: rgba(110, 99, 210, 0.09);
    font-size: 9px;
}
.genesis-alchemy-boss-panel .liberation-boss-card header span b { font-size: 12px; }
.genesis-alchemy-boss-panel .liberation-boss-controls,
.genesis-alchemy-boss-panel .liberation-boss-enabled { min-height: 35px; }
.genesis-alchemy-boss-panel .liberation-boss-card select { min-height: 35px; padding: 0 7px; font-size: 11px; }
.genesis-alchemy-boss-panel .liberation-ticket-row { grid-template-columns: 29px minmax(0, 1fr); gap: 6px; margin-top: 8px; }
.genesis-alchemy-boss-panel .liberation-ticket-icon { width: 29px; height: 29px; }
.genesis-alchemy-boss-panel .liberation-ticket-icon img { max-width: 24px; max-height: 24px; }
.genesis-alchemy-attack-summary small { color: #7568d8; font-size: 10px; font-weight: 700; }

/* 鍊成階段資料：每階獨立玻璃資料列 */
.genesis-alchemy-table-panel { padding: 18px; }
.genesis-alchemy-table-panel .liberation-section-heading { align-items: center; }
.genesis-alchemy-table-rate {
    flex: 0 0 auto;
    align-self: center;
    padding: 6px 10px;
    border: 1px solid rgba(55, 165, 119, 0.25);
    border-radius: 999px;
    color: #27845d;
    background: rgba(70, 181, 127, 0.09);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

/* 創世鍊成石：單一兌換進度 */
.genesis-stone-panel {
    width: 100%;
    padding: 22px;
    border: 1px solid rgba(126, 110, 204, 0.2);
    border-radius: 20px;
    background:
        radial-gradient(circle at 94% -8%, rgba(197, 103, 224, 0.17), transparent 34%),
        radial-gradient(circle at -7% 106%, rgba(75, 191, 229, 0.16), transparent 32%),
        rgba(255,255,255,0.5);
    box-shadow: 0 12px 30px rgba(72, 56, 144, 0.1);
}
.genesis-stone-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.genesis-stone-heading > div:first-child > span {
    color: #7469cf;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.13em;
}
.genesis-stone-heading h2 { margin: 5px 0 5px; color: var(--text-main); font-size: clamp(24px, 3vw, 31px); }
.genesis-stone-heading p { margin: 0; color: #6b687b; font-size: 13px; font-weight: 550; }
.genesis-stone-rule {
    min-width: 112px;
    min-height: 68px;
    padding: 10px 15px;
    display: grid;
    place-content: center;
    text-align: center;
    border: 1px solid rgba(116, 105, 207, 0.2);
    border-radius: 15px;
    background: rgba(255,255,255,0.46);
}
.genesis-stone-rule strong { color: #6d63d1; font-size: 21px; line-height: 1.1; }
.genesis-stone-rule span { color: #777286; font-size: 10px; font-weight: 650; }
.genesis-stone-exchange {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 94px minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
}
.genesis-stone-material-card,
.genesis-stone-result-card {
    min-width: 0;
    min-height: 125px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-items: center;
    gap: 4px 14px;
    border: 1px solid rgba(125, 111, 197, 0.18);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(231,246,255,0.64), rgba(250,231,255,0.48));
}
.genesis-stone-material-card { cursor: text; }
.genesis-stone-material-card img,
.genesis-stone-result-card img {
    width: 58px;
    height: 58px;
    grid-row: 1 / 3;
    object-fit: contain;
    filter: drop-shadow(0 6px 8px rgba(67, 42, 121, 0.2));
}
.genesis-stone-material-card > span,
.genesis-stone-result-card > span { align-self: end; color: #6b687b; font-size: 12px; font-weight: 650; }
.genesis-stone-material-card input {
    width: 100%;
    min-width: 0;
    min-height: 43px;
    padding: 0 12px;
    border: 1px solid rgba(119, 105, 199, 0.23);
    border-radius: 11px;
    outline: 0;
    background: rgba(255,255,255,0.7);
    color: var(--text-main);
    font: inherit;
    font-size: 17px;
    font-weight: 750;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.genesis-stone-material-card input:focus { border-color: #7568e4; box-shadow: 0 0 0 3px rgba(117,104,228,0.13); }
.genesis-stone-result-card strong { align-self: start; color: var(--text-main); font-size: 18px; }
.genesis-stone-result-card strong b { color: #b650ce; font-size: 27px; }
.genesis-stone-exchange-arrow { display: grid; place-content: center; text-align: center; }
.genesis-stone-exchange-arrow span { color: #777286; font-size: 10px; font-weight: 700; }
.genesis-stone-exchange-arrow b {
    color: #786ce6;
    font-size: 36px;
    line-height: 1;
    filter: drop-shadow(0 4px 6px rgba(112, 87, 205, 0.18));
}
.genesis-stone-progress-block {
    margin-top: 14px;
    padding: 13px 15px;
    display: grid;
    grid-template-columns: auto minmax(120px, 1fr) 38px;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(125, 111, 197, 0.16);
    border-radius: 14px;
    background: rgba(255,255,255,0.38);
}
.genesis-stone-progress-copy { display: flex; align-items: baseline; gap: 8px; }
.genesis-stone-progress-copy span { color: #6b687b; font-size: 11px; font-weight: 650; }
.genesis-stone-progress-copy strong { color: var(--text-main); font-size: 14px; white-space: nowrap; }
.genesis-stone-progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(96, 92, 157, 0.13); }
.genesis-stone-progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #50bde1, #7e72e9 55%, #d05acb); transition: width 0.25s ease; }
.genesis-stone-progress-block > span { color: #6d63d1; font-size: 12px; font-weight: 800; text-align: right; }
.genesis-stone-summary { margin-top: 10px; display: grid; grid-template-columns: 1.25fr repeat(2, minmax(0, 1fr)); gap: 10px; }
.genesis-stone-summary > div {
    padding: 13px 15px;
    display: grid;
    grid-template-columns: minmax(0, auto) auto;
    align-items: baseline;
    justify-content: start;
    column-gap: 5px;
    border: 1px solid rgba(125, 111, 197, 0.16);
    border-radius: 13px;
    background: rgba(255,255,255,0.4);
}
.genesis-stone-summary span { grid-column: 1 / -1; color: #6b687b; font-size: 11px; font-weight: 650; }
.genesis-stone-summary strong { color: var(--text-main); font-size: 20px; }
.genesis-stone-summary small { color: #777286; font-size: 10px; }
.genesis-stone-summary .genesis-stone-forecast { grid-template-columns: 1fr; }
.genesis-stone-forecast strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.genesis-stone-forecast small b { color: #6d63d1; font-size: 14px; }
.genesis-stone-settings,
.genesis-stone-boss-panel { padding: 18px; }
.genesis-stone-settings .liberation-section-heading p,
.genesis-stone-boss-panel .liberation-section-heading p { color: #6b687b; font-size: 13px; font-weight: 550; }
.genesis-stone-controls {
    display: grid;
    grid-template-columns: minmax(190px, 0.75fr) minmax(360px, 1.65fr) minmax(165px, 0.65fr);
    align-items: stretch;
    gap: 10px;
}
.genesis-unified-controls {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1.85fr) minmax(230px, 1.03fr) minmax(132px, 0.52fr);
    align-items: stretch;
    gap: 10px;
}
.genesis-unified-field-group {
    min-width: 0;
    min-height: 76px;
    margin: 0;
    padding: 10px 12px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 6px;
    border: 1px solid rgba(125, 111, 197, 0.16);
    border-radius: 13px;
    background: rgba(255,255,255,0.38);
}
.genesis-unified-field-group legend {
    padding: 0;
    color: #6b687b;
    font-size: 10px;
    font-weight: 700;
}
.genesis-unified-field-group > div { display: grid; gap: 7px; }
.genesis-unified-field-group--three > div { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.genesis-unified-field-group--four > div { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr) minmax(0, 0.9fr) minmax(116px, 1.35fr); }
.genesis-unified-field {
    min-width: 0;
    min-height: 39px;
    padding: 4px 8px 5px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 2px;
    border: 1px solid rgba(119, 105, 199, 0.17);
    border-radius: 10px;
    background: rgba(255,255,255,0.54);
}
.genesis-unified-field > span { overflow: hidden; color: #777286; font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.genesis-unified-field input,
.genesis-unified-field select {
    width: 100%;
    min-width: 0;
    min-height: 22px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
}
.genesis-unified-field select { cursor: pointer; }
.genesis-unified-field-group--four .genesis-unified-field > span { font-size: 8.5px; }
.genesis-unified-field-group--four .genesis-unified-field input[type="date"] { font-size: 11px; }
.genesis-unified-field:focus-within { border-color: #7568e4; box-shadow: 0 0 0 3px rgba(117,104,228,0.11); }
.genesis-unified-controls .genesis-stone-status-option > span { display: grid; gap: 0; }
.genesis-stone-date-field,
.genesis-stone-status-group {
    min-width: 0;
    min-height: 76px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(125, 111, 197, 0.16);
    border-radius: 13px;
    background: rgba(255,255,255,0.38);
}
.genesis-stone-date-field {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 6px;
}
.genesis-stone-date-field > span,
.genesis-stone-status-group legend {
    padding: 0;
    color: #6b687b;
    font-size: 10px;
    font-weight: 700;
}
.genesis-stone-date-field input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    inline-size: 100%;
    max-inline-size: 100%;
    min-inline-size: 0;
    min-height: 39px;
    padding: 0 11px;
    border: 1px solid rgba(119, 105, 199, 0.22);
    border-radius: 10px;
    outline: 0;
    background: rgba(255,255,255,0.72);
    color: var(--text-main);
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.genesis-stone-date-field input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
}
.genesis-stone-date-field input[type="date"]::-webkit-date-and-time-value {
    min-width: 0;
    text-align: left;
}
.genesis-stone-date-field input:focus { border-color: #7568e4; box-shadow: 0 0 0 3px rgba(117,104,228,0.13); }
.genesis-stone-status-group { display: grid; grid-template-rows: auto 1fr; gap: 6px; }
.genesis-stone-status-group > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.genesis-stone-status-option {
    min-width: 0;
    min-height: 39px;
    padding: 5px 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(119, 105, 199, 0.17);
    border-radius: 10px;
    background: rgba(255,255,255,0.54);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.genesis-stone-status-option:hover { transform: translateY(-1px); border-color: rgba(117,104,228,0.35); }
.genesis-stone-status-option:has(input:checked) { border-color: rgba(117,104,228,0.45); background: linear-gradient(135deg, rgba(109,191,226,0.12), rgba(194,99,215,0.13)); }
.genesis-stone-status-option input { width: 17px; height: 17px; flex: 0 0 17px; margin: 0; accent-color: #7568e4; }
.genesis-stone-status-option > span { min-width: 0; display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.genesis-stone-status-option b { overflow: hidden; color: var(--text-main); font-size: 12px; text-overflow: ellipsis; }
.genesis-stone-status-option small { color: #777286; font-size: 9px; font-weight: 650; }
.genesis-stone-reset { width: 100%; min-height: 76px; margin: 0; border-radius: 13px; font-size: 13px; }
.genesis-stone-reset:focus { outline: 0; }
.genesis-stone-reset:focus-visible { outline: 2px solid rgba(117,104,228,0.58); outline-offset: 2px; }

/* 依設定面板本身的可用寬度換列，避免不同縮放比例下重設按鈕被擠出。 */
.liberation-status-panel,
.genesis-alchemy-settings { container-type: inline-size; }

@container (max-width: 940px) {
    .genesis-unified-controls {
        grid-template-columns: minmax(0, 1fr) 152px;
    }

    .genesis-unified-controls .genesis-unified-field-group {
        grid-column: 1 / -1;
    }

    .genesis-unified-controls .genesis-stone-status-group,
    .genesis-unified-controls .genesis-stone-reset {
        min-width: 0;
        width: 100%;
        margin: 0;
    }
}

@container (max-width: 560px) {
    .genesis-unified-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    .genesis-unified-controls .genesis-stone-status-group,
    .genesis-unified-controls .genesis-stone-reset {
        grid-column: 1 / -1;
    }
}

[data-theme="dark"] .genesis-stone-panel {
    border-color: rgba(139, 148, 226, 0.25);
    background: radial-gradient(circle at 92% 0, rgba(125,61,146,0.23), transparent 35%), radial-gradient(circle at 0 100%, rgba(32,126,154,0.2), transparent 34%), rgba(11,17,36,0.82);
}
[data-theme="dark"] .genesis-stone-heading p,
[data-theme="dark"] .genesis-stone-material-card > span,
[data-theme="dark"] .genesis-stone-result-card > span,
[data-theme="dark"] .genesis-stone-progress-copy span,
[data-theme="dark"] .genesis-stone-summary span,
[data-theme="dark"] .genesis-stone-settings .liberation-section-heading p,
[data-theme="dark"] .genesis-stone-boss-panel .liberation-section-heading p { color: #aeb7ca; }
[data-theme="dark"] .genesis-stone-rule,
[data-theme="dark"] .genesis-stone-progress-block,
[data-theme="dark"] .genesis-stone-summary > div { border-color: rgba(139,148,226,0.23); background: rgba(8,14,32,0.5); }
[data-theme="dark"] .genesis-stone-material-card,
[data-theme="dark"] .genesis-stone-result-card { border-color: rgba(139,148,226,0.25); background: linear-gradient(135deg, rgba(18,51,69,0.58), rgba(57,30,70,0.5)); }
[data-theme="dark"] .genesis-stone-material-card input { border-color: rgba(130,147,232,0.3); background: rgba(5,10,27,0.7); }
[data-theme="dark"] .genesis-stone-date-field,
[data-theme="dark"] .genesis-stone-status-group,
[data-theme="dark"] .genesis-unified-field-group { border-color: rgba(139,148,226,0.23); background: rgba(8,14,32,0.5); }
[data-theme="dark"] .genesis-stone-date-field > span,
[data-theme="dark"] .genesis-stone-status-group legend,
[data-theme="dark"] .genesis-unified-field-group legend,
[data-theme="dark"] .genesis-unified-field > span,
[data-theme="dark"] .genesis-stone-status-option small { color: #aeb7ca; }
[data-theme="dark"] .genesis-stone-date-field input,
[data-theme="dark"] .genesis-stone-status-option,
[data-theme="dark"] .genesis-unified-field { border-color: rgba(130,147,232,0.25); background: rgba(5,10,27,0.62); }
[data-theme="dark"] .genesis-stone-status-option:has(input:checked) { border-color: rgba(146,134,255,0.52); background: linear-gradient(135deg, rgba(45,121,156,0.25), rgba(112,52,130,0.24)); }

@media (max-width: 700px) {
    .genesis-stone-panel { padding: 14px; border-radius: 16px; }
    .genesis-stone-heading { align-items: flex-end; gap: 9px; }
    .genesis-stone-heading h2 { font-size: 23px; }
    .genesis-stone-heading p { font-size: 11px; line-height: 1.5; }
    .genesis-stone-rule { min-width: 84px; min-height: 57px; padding: 8px; }
    .genesis-stone-rule strong { font-size: 17px; }
    .genesis-stone-exchange { grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr); gap: 6px; }
    .genesis-stone-material-card,
    .genesis-stone-result-card { min-height: 132px; padding: 11px 9px; grid-template-columns: 1fr; grid-template-rows: 42px auto auto; justify-items: center; gap: 4px; text-align: center; }
    .genesis-stone-material-card img,
    .genesis-stone-result-card img { width: 42px; height: 42px; grid-row: auto; }
    .genesis-stone-material-card > span,
    .genesis-stone-result-card > span { align-self: auto; font-size: 9px; white-space: nowrap; }
    .genesis-stone-material-card input { min-height: 36px; padding: 0 6px; font-size: 12px; text-align: center; }
    .genesis-stone-material-card input::placeholder { font-size: 9px; }
    .genesis-stone-result-card strong { align-self: auto; font-size: 12px; }
    .genesis-stone-result-card strong b { font-size: 22px; }
    .genesis-stone-exchange-arrow span { font-size: 8px; }
    .genesis-stone-exchange-arrow b { font-size: 25px; }
    .genesis-stone-progress-block { grid-template-columns: 1fr 36px; gap: 7px; padding: 10px; }
    .genesis-stone-progress-copy { grid-column: 1 / -1; justify-content: space-between; }
    .genesis-stone-progress-track { grid-column: 1; }
    .genesis-stone-summary > div { padding: 10px; }
    .genesis-stone-summary .genesis-stone-forecast { grid-column: 1 / -1; }
    .genesis-stone-summary strong { font-size: 16px; }
    .genesis-stone-summary small { font-size: 8px; }
    .genesis-stone-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .genesis-stone-settings,
    .genesis-stone-boss-panel { padding: 10px; }
    /* 手機版設定區：避免 grid 子項以內容最小寬度撐破外層卡片。 */
    .genesis-stone-controls,
    .genesis-stone-date-field,
    .genesis-stone-status-group,
    .genesis-stone-reset {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    .genesis-stone-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .genesis-stone-date-field { grid-column: 1 / -1; min-height: 69px; }
    .genesis-stone-status-group { grid-column: 1 / -1; min-height: 69px; padding: 9px; }
    .genesis-stone-status-group > div { width: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .genesis-stone-status-option { min-height: 38px; min-width: 0; max-width: 100%; padding: 5px 7px; gap: 6px; overflow: hidden; }
    .genesis-stone-status-option > span { display: grid; gap: 0; }
    .genesis-stone-status-option b { font-size: 11px; }
    .genesis-stone-status-option small { font-size: 8px; }
    .genesis-stone-reset { grid-column: 1 / -1; min-height: 42px; }
    .genesis-unified-controls { grid-template-columns: 1fr; gap: 8px; }
    .genesis-unified-field-group,
    .genesis-unified-controls .genesis-stone-status-group,
    .genesis-unified-controls .genesis-stone-reset { grid-column: 1; }
    .genesis-unified-field-group { min-height: 0; padding: 9px; }
    .genesis-unified-field-group--three > div,
    .genesis-unified-field-group--four > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .genesis-unified-field-group--three .genesis-unified-field:first-child { grid-column: 1 / -1; }
    .genesis-unified-field { min-height: 42px; padding: 5px 7px; }
    .genesis-unified-field > span { font-size: 8px; }
    .genesis-unified-field input,
    .genesis-unified-field select { font-size: 11px; }
}

@media (min-width: 701px) and (max-width: 1080px) {
    .genesis-unified-controls { grid-template-columns: 1fr 1fr; }
    .genesis-unified-field-group { grid-column: 1 / -1; }
    .genesis-unified-controls .genesis-stone-reset { min-height: 76px; }
}
.genesis-alchemy-table-header,
.genesis-alchemy-table-row {
    display: grid;
    grid-template-columns: 92px minmax(210px, 1.35fr) minmax(145px, 0.9fr) minmax(125px, 0.78fr) minmax(105px, 0.65fr);
    align-items: center;
    gap: 10px;
}
.genesis-alchemy-table-header {
    padding: 0 14px 8px;
    color: #777286;
    font-size: 10px;
    font-weight: 750;
}
.genesis-alchemy-table-rows {
    display: grid;
    gap: 6px;
}
.genesis-alchemy-table-row {
    width: 100%;
    min-height: 50px;
    padding: 8px 14px;
    border: 1px solid rgba(119, 104, 181, 0.16);
    border-radius: 12px;
    color: var(--text-main);
    background: linear-gradient(135deg, rgba(255,255,255,0.57), rgba(255,255,255,0.31));
    box-shadow: 0 5px 14px rgba(58, 43, 119, 0.045), inset 0 1px 0 rgba(255,255,255,0.58);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.genesis-alchemy-table-row:hover {
    transform: translateY(-1px);
    border-color: rgba(112, 99, 221, 0.38);
    box-shadow: 0 7px 17px rgba(75, 58, 151, 0.08), inset 0 1px 0 rgba(255,255,255,0.68);
}
.genesis-alchemy-table-row small { display: none; }
.genesis-alchemy-table-row b {
    color: var(--text-main);
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.genesis-alchemy-table-level b {
    display: inline-grid;
    min-width: 51px;
    min-height: 28px;
    place-items: center;
    border-radius: 9px;
    color: #685fca;
    background: rgba(113, 100, 211, 0.09);
}
.genesis-alchemy-table-material > span {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #555166;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.genesis-alchemy-table-material img {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    object-fit: contain;
    filter: drop-shadow(0 3px 4px rgba(52, 37, 111, 0.16));
}
.genesis-alchemy-table-increase b { color: #6f64d0; }
.genesis-alchemy-table-row.is-complete {
    border-color: rgba(47, 161, 132, 0.3);
    background: linear-gradient(135deg, rgba(211, 249, 240, 0.52), rgba(230, 249, 247, 0.28));
}
.genesis-alchemy-table-row.is-complete .genesis-alchemy-table-level b { color: #28866c; background: rgba(53, 174, 142, 0.11); }
.genesis-alchemy-table-row.is-planned { background: linear-gradient(135deg, rgba(230, 235, 255, 0.53), rgba(248, 226, 255, 0.3)); }
.genesis-alchemy-table-row.is-target {
    border-color: #786ce6;
    background: linear-gradient(135deg, rgba(205, 239, 251, 0.56), rgba(240, 212, 249, 0.46));
    box-shadow: 0 7px 18px rgba(104, 87, 204, 0.13), inset 0 0 0 1px rgba(120,108,230,0.16);
}
.genesis-alchemy-table-row.is-target .genesis-alchemy-table-level b { color: #fff; background: linear-gradient(135deg, #6d75dc, #a65fd1); }

/* 每個痕跡面板只保留一個總開關，避免每張 BOSS 卡片增加控制項。 */
.liberation-section-heading:has(.liberation-custom-toggle) { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.liberation-custom-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 6px 10px;
    border: 1px solid rgba(117, 104, 228, 0.22);
    border-radius: 999px;
    color: #655bc4;
    background: rgba(255,255,255,0.46);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.liberation-section-heading:has(.liberation-custom-toggle) > div { min-width: 0; }
.liberation-section-heading:has(.liberation-custom-toggle) .liberation-custom-toggle {
    margin: 0 0 0 auto;
    align-self: flex-start;
}
.liberation-custom-toggle input { width: 16px; height: 16px; margin: 0; accent-color: #7568e4; }
.liberation-boss-custom-traces { display: none; width: 100%; min-width: 0; min-height: 34px; padding: 0 9px; border: 1px solid rgba(119,105,199,0.22); border-radius: 9px; background: rgba(255,255,255,0.72); color: var(--text-main); font: inherit; font-size: 12px; font-weight: 700; }
.liberation-boss-list.is-custom .liberation-boss-difficulty { display: none; }
.liberation-boss-list.is-custom .liberation-boss-custom-traces { display: block; }
[data-theme="dark"] .liberation-custom-toggle { border-color: rgba(139,132,226,0.3); color: #b8b1ff; background: rgba(8,14,32,0.42); }
[data-theme="dark"] .liberation-boss-custom-traces { border-color: rgba(130,147,232,0.3); background: rgba(5,10,27,0.7); }

@media (max-width: 700px) {
    .liberation-section-heading:has(.liberation-custom-toggle) { align-items: flex-start; }
    .liberation-custom-toggle { padding: 5px 8px; font-size: 11px; }
    .liberation-boss-custom-traces { min-height: 32px; font-size: 11px; }
}

[data-theme="dark"] .genesis-alchemy-hero {
    border-color: rgba(139, 147, 226, 0.26);
    background:
        radial-gradient(circle at 96% -20%, rgba(178, 75, 208, 0.18), transparent 36%),
        radial-gradient(circle at -8% 112%, rgba(47, 156, 204, 0.16), transparent 34%),
        rgba(13, 21, 42, 0.88);
}
[data-theme="dark"] .genesis-alchemy-primary,
[data-theme="dark"] .genesis-alchemy-summary-grid > div,
[data-theme="dark"] .genesis-alchemy-level { background: rgba(7, 13, 30, 0.5); border-color: rgba(140, 145, 224, 0.22); }
[data-theme="dark"] .genesis-alchemy-level.is-complete { background: rgba(42, 153, 124, 0.14); border-color: rgba(70, 200, 165, 0.33); }
[data-theme="dark"] .genesis-alchemy-level.is-planned { background: rgba(120, 108, 226, 0.12); }
[data-theme="dark"] .genesis-alchemy-level.is-target { background: linear-gradient(145deg, rgba(54, 146, 197, 0.18), rgba(155, 68, 189, 0.18)); border-color: #9488ff; }
[data-theme="dark"] .genesis-alchemy-rate { color: #79d4ad; background: rgba(54, 178, 126, 0.12); }
[data-theme="dark"] .genesis-alchemy-boss-panel .liberation-boss-card header span { background: rgba(128, 119, 235, 0.14); }
[data-theme="dark"] .genesis-alchemy-table-rate { color: #79d4ad; background: rgba(54, 178, 126, 0.12); border-color: rgba(84, 206, 151, 0.28); }
[data-theme="dark"] .genesis-alchemy-table-header { color: #aeb7ca; }
[data-theme="dark"] .genesis-alchemy-table-row {
    border-color: rgba(140, 145, 224, 0.19);
    background: linear-gradient(135deg, rgba(11,18,37,0.72), rgba(26,20,49,0.48));
    box-shadow: 0 6px 16px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.025);
}
[data-theme="dark"] .genesis-alchemy-table-material > span { color: #c0c7d9; }
[data-theme="dark"] .genesis-alchemy-table-level b { color: #b7b1ff; background: rgba(128,119,235,0.13); }
[data-theme="dark"] .genesis-alchemy-table-row.is-complete { border-color: rgba(68, 194, 157, 0.32); background: linear-gradient(135deg, rgba(24,92,76,0.3), rgba(10,35,41,0.4)); }
[data-theme="dark"] .genesis-alchemy-table-row.is-planned { background: linear-gradient(135deg, rgba(59,67,126,0.28), rgba(89,43,102,0.24)); }
[data-theme="dark"] .genesis-alchemy-table-row.is-target { border-color: #958aff; background: linear-gradient(135deg, rgba(43,102,136,0.34), rgba(101,48,120,0.3)); }
[data-theme="dark"] .genesis-alchemy-heading p,
[data-theme="dark"] .genesis-alchemy-settings .liberation-section-heading p,
[data-theme="dark"] .genesis-alchemy-boss-panel .liberation-section-heading p,
[data-theme="dark"] .genesis-alchemy-summary-grid span,
[data-theme="dark"] .genesis-alchemy-summary-grid small,
[data-theme="dark"] .genesis-alchemy-level small { color: #b8bfd1; }

@media (max-width: 980px) {
    .genesis-alchemy-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .genesis-alchemy-level-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .genesis-alchemy-boss-panel .liberation-boss-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .genesis-alchemy-hero { grid-template-columns: 1fr; padding: 14px; gap: 11px; border-radius: 16px; }
    .genesis-alchemy-heading h2 { font-size: 24px; }
    .genesis-alchemy-heading p { font-size: 11px; }
    .genesis-alchemy-primary { padding: 11px 13px; }
    .genesis-alchemy-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .genesis-alchemy-summary-grid > div { padding: 9px 10px; }
    .genesis-alchemy-summary-grid strong { font-size: 18px; }
    .genesis-alchemy-summary-grid > div:nth-child(2) strong { font-size: 15px; }
    .genesis-alchemy-settings,
    .genesis-alchemy-boss-panel,
    .genesis-alchemy-table-panel { padding: 13px; }
    .genesis-alchemy-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .genesis-alchemy-reset-mobile { grid-column: 1 / -1; display: block; }
    .genesis-alchemy-reset-desktop { display: none; }
    .genesis-alchemy-level-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
    .genesis-alchemy-level { min-height: 61px; padding: 5px 2px; }
    .genesis-alchemy-level strong { font-size: 13px; }
    .genesis-alchemy-level small { font-size: 9px; }
    .genesis-alchemy-boss-panel .liberation-boss-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .genesis-alchemy-boss-panel .liberation-boss-card { display: grid; grid-template-columns: 52px minmax(0, 1fr); }
    .genesis-alchemy-boss-panel .liberation-boss-art { width: auto; height: auto; min-height: 124px; }
    .genesis-alchemy-boss-panel .liberation-boss-body { padding: 7px; }
    .genesis-alchemy-boss-panel .liberation-boss-card header { display: grid; justify-items: start; gap: 3px; }
    .genesis-alchemy-boss-panel .liberation-boss-card header span { font-size: 9px; }
    .genesis-alchemy-boss-panel .liberation-label-full { display: none; }
    .genesis-alchemy-boss-panel .liberation-label-short { display: inline; }
    .genesis-alchemy-boss-panel .liberation-ticket-row { grid-template-columns: 26px minmax(0, 1fr); }

    .genesis-alchemy-table-rate { padding: 5px 8px; font-size: 10px; }
    .genesis-alchemy-table-header { display: none; }
    .genesis-alchemy-table-rows { gap: 8px; }
    .genesis-alchemy-table-row {
        min-height: 92px;
        padding: 10px;
        grid-template-columns: 68px minmax(0, 1.25fr) minmax(95px, 0.85fr);
        grid-template-areas:
            "level material meso"
            "level attack increase";
        gap: 8px 7px;
        border-radius: 13px;
    }
    .genesis-alchemy-table-row small {
        display: block;
        margin-bottom: 3px;
        color: #777286;
        font-size: 8px;
        font-weight: 650;
        white-space: nowrap;
    }
    .genesis-alchemy-table-level { grid-area: level; }
    .genesis-alchemy-table-material { grid-area: material; }
    .genesis-alchemy-table-meso { grid-area: meso; }
    .genesis-alchemy-table-attack { grid-area: attack; }
    .genesis-alchemy-table-increase { grid-area: increase; }
    .genesis-alchemy-table-level b { min-width: 54px; min-height: 29px; }
    .genesis-alchemy-table-material > span { font-size: 11px; }
    .genesis-alchemy-table-material img { width: 22px; height: 22px; flex-basis: 22px; }
    .genesis-alchemy-table-meso b { font-size: 10px; }
    .genesis-alchemy-table-row b { font-size: 11px; }
    [data-theme="dark"] .genesis-alchemy-table-row small { color: #aeb7ca; }
}

@media (max-width: 410px) {
    .genesis-alchemy-heading p { line-height: 1.5; }
    .genesis-alchemy-summary-grid strong { font-size: 16px; }
    .genesis-alchemy-summary-grid > div:nth-child(2) strong { font-size: 14px; }
    .genesis-alchemy-settings,
    .genesis-alchemy-boss-panel,
    .genesis-alchemy-table-panel { padding: 10px; }
    .genesis-alchemy-level-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .genesis-alchemy-boss-panel .liberation-boss-list { gap: 6px; }
    .genesis-alchemy-boss-panel .liberation-boss-card { grid-template-columns: 48px minmax(0, 1fr); }
    .genesis-alchemy-boss-panel .liberation-boss-body { padding: 6px; }
    .genesis-alchemy-boss-panel .liberation-boss-card header > strong { font-size: 11px; }
}

/*
    <div id="tab-home" class="tab-content active">
            <div style="text-align: center; margin: 50px auto; color: #555;">
                <h2>🚧 更新中 🚧</h2>
                <p>請稍後再回來看看！</p>
            </div>
            
        <div class="app-grid">

*/

/* ========================================== */
/* 創世解放：iOS Safari 實機相容性最終整理版 */
/* 2026-08-16                                */
/* ========================================== */

/* Safari fieldset / Grid 最小寬度修正 */
#tab-liberation .genesis-unified-field-group,
#tab-liberation .genesis-stone-status-group,
#tab-liberation .genesis-stone-controls > *,
#tab-liberation .genesis-unified-controls > *,
#tab-liberation .genesis-unified-field-group > div > *,
#tab-liberation .genesis-stone-status-group > div > * {
    min-width: 0;
    min-inline-size: 0;
}

#tab-liberation .genesis-unified-field-group > legend,
#tab-liberation .genesis-stone-status-group > legend {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    writing-mode: horizontal-tb;
}

/* iOS Safari date input：限制寬度並修正文字垂直位置 */
#tab-liberation input[type="date"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

#tab-liberation input[type="date"]::-webkit-date-and-time-value,
#tab-liberation input[type="date"]::-webkit-datetime-edit,
#tab-liberation input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    min-width: 0;
    padding-top: 0;
    padding-bottom: 0;
}

#tab-liberation .genesis-stone-date-field input[type="date"] {
    height: 39px;
    min-height: 39px;
    line-height: 39px;
}

#tab-liberation .genesis-stone-date-field input[type="date"]::-webkit-date-and-time-value,
#tab-liberation .genesis-stone-date-field input[type="date"]::-webkit-datetime-edit,
#tab-liberation .genesis-stone-date-field input[type="date"]::-webkit-datetime-edit-fields-wrapper {
    height: 100%;
    line-height: 39px;
}

/* 手機：明確鎖定可縮 Grid，避免 Safari intrinsic size 撐破卡片 */
@media (max-width: 700px) {
    #tab-liberation .genesis-stone-controls,
    #tab-liberation .genesis-unified-controls,
    #tab-liberation .genesis-unified-field-group,
    #tab-liberation .genesis-stone-status-group,
    #tab-liberation .genesis-stone-date-field,
    #tab-liberation .genesis-stone-reset {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    #tab-liberation .genesis-unified-controls {
        grid-template-columns: minmax(0, 1fr);
    }

    #tab-liberation .genesis-unified-controls > * {
        grid-column: 1 / -1;
    }

    #tab-liberation .genesis-stone-status-group > div,
    #tab-liberation .genesis-unified-field-group--three > div,
    #tab-liberation .genesis-unified-field-group--four > div {
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #tab-liberation .genesis-stone-status-option,
    #tab-liberation .genesis-stone-status-option > span,
    #tab-liberation .genesis-unified-field,
    #tab-liberation .genesis-unified-field input,
    #tab-liberation .genesis-unified-field select {
        min-width: 0;
        max-width: 100%;
    }
}

/* iPhone 16 Pro Max 橫向等中間寬度：取消原三欄硬性最小寬度 */
@media (min-width: 701px) and (max-width: 1100px) {
    #tab-liberation .genesis-stone-controls {
        grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.68fr) minmax(132px, 0.68fr);
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
}

/* iPhone X / 375px 級 Safari：避開舊版 Grid phantom track */
@media (max-width: 410px) {
    #tab-liberation #genesis-panel-liberation .liberation-layout.liberation-workspace-panel {
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
    }

    #tab-liberation #genesis-panel-liberation .liberation-workspace-panel > .liberation-status-panel,
    #tab-liberation #genesis-panel-liberation .liberation-workspace-panel > .liberation-boss-panel {
        width: 100%;
        height: auto;
        min-height: 0;
        margin-left: 0;
        margin-right: 0;
    }

    #tab-liberation #genesis-panel-liberation .liberation-workspace-panel > .liberation-status-panel {
        margin-bottom: 12px !important;
    }

    #tab-liberation #genesis-panel-liberation .liberation-workspace-panel > .liberation-boss-panel {
        margin-top: 0 !important;
    }
}
