/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 標題樣式 */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: none;
}

header p {
    font-size: 1.1rem;
    color: #a0aec0;
    opacity: 1;
}



/* 主要內容區域 */
main {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 配置區域網格 */
.calculator-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 配置區塊 */
.config-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.config-section h2 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.config-group {
    margin-bottom: 15px;
}

.config-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e2e8f0;
}

.config-group select,
.config-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.config-group select:focus,
.config-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.config-group select option {
    background: #2d3748;
    color: white;
    padding: 8px;
}

/* 針對不同瀏覽器的下拉選單樣式 */
.config-group select::-ms-expand {
    display: none;
}

/* 儀器詞條配置中的下拉選單 */
.main-stat select,
.sub-stat select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 30px;
}

.main-stat select option,
.sub-stat select option {
    background: #2d3748;
    color: white;
    padding: 4px;
}

/* 確保所有select元素都有正確的背景色 */
select {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

select option {
    background-color: #2d3748 !important;
    color: white !important;
}

/* 針對Firefox的特殊處理 */
@-moz-document url-prefix() {
    select {
        background-color: rgba(255, 255, 255, 0.1) !important;
        color: white !important;
    }
    
    select option {
        background-color: #2d3748 !important;
        color: white !important;
    }
}

/* 儀器選擇 */
.relic-selection {
    display: flex;
    gap: 18px;
}

.relic-select {
    flex: 1;
    min-width: 140px;
    max-width: 180px;
    width: 180px;
    font-size: 16px;
    padding: 10px 12px;
}

/* 儀器詞條配置 */
.relic-stats-section {
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
}

.relic-stats-section h2 {
    color: #ffd700;
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
}

.relic-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.relic-piece {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.relic-piece:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.relic-piece h3 {
    color: #ffd700;
    margin: 0;
    text-align: center;
    font-size: 1.2rem;
}

.main-stat {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.main-stat label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e2e8f0;
}

.main-stat select,
.main-stat input {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.main-stat select:disabled,
.main-stat input:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: #a0aec0;
    cursor: not-allowed;
}

.sub-stats h4 {
    color: #e2e8f0;
    margin-bottom: 12px;
    font-size: 1rem;
}

.sub-stat {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.sub-stat select {
    flex: 2;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.sub-stat input {
    flex: 1;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* 計算按鈕 */
.calculate-section {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
}

.calculate-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

/* 結果顯示 */
.results-section {
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
}

.results-section h2 {
    color: #ffd700;
    margin-bottom: 25px;
    font-size: 1.5rem;
    text-align: center;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-left: 4px solid #ffd700;
}

.result-card h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #a0aec0;
    opacity: 1;
}

.damage-value {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: none;
}

/* 詳細數據 */
.stats-breakdown {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-breakdown h3 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.stat-label {
    font-weight: 600;
    color: #e2e8f0;
}

.stat-value {
    font-weight: bold;
    color: #ffd700;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .relic-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .relic-selection {
        flex-direction: column;
    }
    
    .sub-stat {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sub-stat select,
    .sub-stat input {
        flex: none;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section {
    animation: fadeIn 0.5s ease-out;
}

/* 載入狀態 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 設定區域 */
.settings-section {
    background: #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #444;
}

.settings-section h3 {
    color: #fff;
    margin: 0 0 15px 0;
    font-size: 18px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.setting-item label {
    color: #ccc;
    font-size: 14px;
    min-width: 150px;
}

.setting-item select {
    background: #3a3a3a;
    color: #fff;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    flex: 1;
    max-width: 200px;
}

.setting-item select:focus {
    outline: none;
    border-color: #007acc;
}

.setting-item select option {
    background: #3a3a3a;
    color: #fff;
}

/* 設定彈窗美化與放大 */
.settings-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    justify-content: center;
    align-items: center;
}
.settings-modal.open {
    display: flex;
}
.settings-modal-content {
    background: #232323;
    border-radius: 28px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.85);
    display: flex;
    min-width: 600px;
    min-height: 420px;
    max-width: 98vw;
    max-height: 96vh;
    overflow: hidden;
}
.settings-modal-sidebar {
    background: #181818;
    width: 160px;
    display: flex;
    flex-direction: column;
    padding: 36px 0 36px 0;
    border-right: 1.5px solid #333;
}
.settings-modal-sidebar-item {
    color: #bbb;
    padding: 18px 32px;
    font-size: 18px;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    border-radius: 0 16px 16px 0;
}
.settings-modal-sidebar-item.active {
    color: #fff;
    background: #232323;
    border-left: 4px solid #007acc;
}
.settings-modal-main {
    flex: 1;
    padding: 48px 48px 32px 48px;
    position: relative;
    display: flex;
    flex-direction: column;
}
.settings-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 36px;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}
.settings-modal-close:hover {
    color: #fff;
}
.settings-modal-main h2 {
    color: #fff;
    font-size: 28px;
    margin-bottom: 28px;
    margin-top: 0;
    letter-spacing: 1px;
    font-weight: 700;
}
.settings-section-modal {
    margin-top: 18px;
}
.settings-section-modal .setting-item {
    margin-bottom: 28px;
}
.settings-section-modal label {
    color: #ccc;
    font-size: 17px;
    min-width: 180px;
}
.settings-section-modal select {
    background: #2a2a2a;
    color: #fff;
    border: 1.5px solid #444;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 17px;
    margin-left: 12px;
}
.settings-section-modal select:focus {
    outline: none;
    border-color: #007acc;
}
.settings-section-modal select option {
    background: #2a2a2a;
    color: #fff;
}

/* 設定中的刷新按鈕 */
.refresh-data-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 5px;
}

.refresh-data-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(45deg, #5a67d8, #6b46c1);
}

.refresh-data-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 6px rgba(102, 126, 234, 0.3);
}

.refresh-data-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.refresh-data-btn .refresh-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.refresh-data-btn:hover .refresh-icon {
    transform: rotate(180deg);
}

.refresh-data-btn.loading .refresh-icon {
    animation: spin 1s linear infinite;
}

/* 浮動設定按鈕美化 */
.floating-settings-btn {
    position: fixed;
    right: 40px;
    bottom: 40px;
    z-index: 1001;
    background: linear-gradient(135deg, #232323 70%, #007acc 100%);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 32px;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.floating-settings-btn:hover {
    background: linear-gradient(135deg, #333 60%, #0099ff 100%);
    box-shadow: 0 10px 32px rgba(0,0,0,0.7);
    transform: scale(1.08);
}
.floating-settings-btn svg {
    width: 36px;
    height: 36px;
    display: block;
}

/* 角色配置區獨立一行並加大間距 */
.character-config-section {
    width: 100%;
    display: block;
    margin-bottom: 36px;
}
.character-config-flex {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}
.calculator-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.config-section:not(.character-config-section) {
    margin-bottom: 24px;
}

/* 角色配置區優化 */
.character-select-block {
    min-width: 220px;
}
.character-info-block {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    background: #232323;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    padding: 18px 24px;
    gap: 24px;
    min-width: 320px;
    max-width: 420px;
}
.character-avatar-wrap {
    width: 88px;
    height: 88px;
    border-radius: 12px;
    overflow: hidden;
    background: #181818;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}
.character-avatar {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    background: #222;
}
.character-info-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 15px;
    color: #eee;
}
.character-info-list .info-label {
    color: #7ecfff;
    font-weight: 500;
    margin-right: 4px;
}

/* 角色配置卡片優化 */
.character-config-card, .lightcone-config-card {
    max-width: 580px !important;
    width: 100%;
    padding: 32px 40px;
    background: #232323;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    margin-bottom: 32px;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
}
.character-config-main {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}
.character-config-form {
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    flex-shrink: 0;
}
.character-config-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    min-width: 0;
    flex: 1;
    max-width: 400px;
}
.character-avatar {
    width: 140px;
    height: 140px;
    border-radius: 18px;
    object-fit: cover;
    background: #181818;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.character-info-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 17px;
    color: #eee;
    min-width: 180px;
    width: 100%;
    align-items: flex-start;
}
.info-row {
    display: flex;
    gap: 10px;
    align-items: center;
    line-height: 1.7;
}
.info-label {
    color: #7ecfff;
    font-weight: 500;
    min-width: 44px;
    font-size: 1em;
}

/* 光錐配置卡片優化 */
.lightcone-config-card {
    background: #232323;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 32px 40px;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    max-width: 700px;
    width: 100%;
}
.lightcone-config-main {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}
.lightcone-config-form {
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    flex-shrink: 0;
}
.lightcone-config-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    min-width: 0;
    flex: 1;
    max-width: 400px;
}
.lightcone-avatar {
    width: 140px;
    height: 173px;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.lightcone-info-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 17px;
    color: #eee;
    min-width: 180px;
    width: 100%;
    align-items: flex-start;
}
.lightcone-desc {
    color: #b6e3ff;
    font-size: 16px;
    margin-top: 10px;
    line-height: 1.7;
    white-space: pre-line;
    width: 100%;
    word-break: break-all;
}
@media (max-width: 900px) {
    .character-config-card, .lightcone-config-card {
        max-width: 100%;
        padding: 16px 4px;
    }
    .character-config-main, .lightcone-config-main {
        gap: 16px;
    }
    .character-config-info, .lightcone-config-info {
        max-width: 100%;
    }
    .lightcone-avatar {
        width: 100px;
        height: 124px;
    }
}

/* 敵人配置卡片 */
.enemy-config-card {
    background: #232323;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 28px 32px;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    max-width: 580px;
    width: 100%;
}
.enemy-config-main {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    flex-wrap: wrap;
}
.enemy-config-form {
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

/* 弱點選擇器 */
.weakness-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}
.weakness-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
.weakness-checkbox {
    display: none;
}
.weakness-text {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}
.weakness-checkbox:checked + .weakness-text {
    border-color: currentColor;
    box-shadow: 0 0 15px currentColor, 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

/* 弱點顏色 */
.weakness-text.physical {
    color: #ffffff;
}
.weakness-text.quantum {
    color: #60a5fa;
}
.weakness-text.imaginary {
    color: #fbbf24;
}
.weakness-text.ice {
    color: #67e8f9;
}
.weakness-text.wind {
    color: #22c55e;
}
.weakness-text.fire {
    color: #ef4444;
}
.weakness-text.lightning {
    color: #a855f7;
}

/* 角色和光錐配置並排佈局 */
.character-config-card {
    background: #232323;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 28px 32px;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    max-width: 500px;
    width: 100%;
}
.lightcone-config-card {
    background: #232323;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 28px 32px;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    max-width: 500px;
    width: 100%;
}

/* 配置卡片容器 */
.config-cards-container {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 1200px) {
    .config-cards-container {
        flex-direction: column;
        align-items: center;
    }
    .character-config-card,
    .lightcone-config-card {
        max-width: 580px;
    }
}

@media (max-width: 600px) {
    .enemy-config-main {
        flex-direction: column;
        gap: 18px;
    }
    .enemy-config-card {
        padding: 16px 8px;
    }
    .weakness-selector {
        gap: 8px;
    }
    .weakness-text {
        padding: 6px 12px;
        font-size: 13px;
    }
    .config-cards-container {
        gap: 16px;
    }
    .character-config-card,
    .lightcone-config-card {
        padding: 16px 8px;
    }
}

/* 儀器敘述與圖片區塊 */
.instrument-info-block {
    display: flex;
    flex-direction: row;
    gap: 32px;
    align-items: flex-start;
    margin-top: 24px;
    background: #232323;
    border-radius: 16px;
    padding: 24px 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
/* 儀器圖片容器 */
.instrument-img-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

/* 外圈儀器圖片 */
.outer-relic-imgs {
    display: flex;
    flex-direction: row;
    gap: 18px;
    align-items: center;
    justify-content: center;
}

/* 內圈儀器圖片 */
.inner-relic-imgs {
    display: flex;
    flex-direction: row;
    gap: 18px;
    align-items: center;
    justify-content: center;
}

/* 儀器圖片樣式 */
.outer-relic-imgs img,
.inner-relic-imgs img {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    object-fit: cover;
    background: #181818;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transition: transform 0.2s ease;
}

.outer-relic-imgs img:hover,
.inner-relic-imgs img:hover {
    transform: scale(1.05);
}
.instrument-desc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 16px;
    color: #e0eaff;
    min-width: 220px;
}
.instrument-desc-title {
    color: #ffd700;
    font-weight: 600;
    margin-right: 8px;
}
@media (max-width: 900px) {
    .instrument-info-block {
        flex-direction: column;
        gap: 18px;
        padding: 12px 8px;
    }
    .instrument-img-container {
        gap: 12px;
    }
    .outer-relic-imgs,
    .inner-relic-imgs {
        gap: 10px;
    }
    .outer-relic-imgs img,
    .inner-relic-imgs img {
        width: 70px;
        height: 70px;
    }
    .instrument-desc-list {
        font-size: 15px;
    }
}

/* 儀器配置卡片風格 */
.instrument-config-card {
    background: #232323;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 32px 40px;
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    max-width: 580px;
    width: 100%;
}
.instrument-config-main {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}
.instrument-config-form {
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    flex-shrink: 0;
}
@media (max-width: 900px) {
    .instrument-config-card {
        max-width: 100%;
        padding: 16px 4px;
    }
    .instrument-config-main {
        gap: 16px;
    }
}

/* 命途不匹配警示 */
.path-mismatch-warning {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.5);
    border-radius: 5px;
    color: #ff6b6b;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    animation: warningPulse 2s infinite;
}

@keyframes warningPulse {
    0% {
        background: rgba(220, 53, 69, 0.2);
        border-color: rgba(220, 53, 69, 0.5);
    }
    50% {
        background: rgba(220, 53, 69, 0.3);
        border-color: rgba(220, 53, 69, 0.7);
    }
    100% {
        background: rgba(220, 53, 69, 0.2);
        border-color: rgba(220, 53, 69, 0.5);
    }
}

/* 通知訊息樣式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    z-index: 10000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-success {
    background: linear-gradient(45deg, #10b981, #059669);
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.notification-error {
    background: linear-gradient(45deg, #ef4444, #dc2626);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.notification-info {
    background: linear-gradient(45deg, #3b82f6, #2563eb);
    border: 1px solid rgba(59, 130, 246, 0.5);
}

@media (max-width: 600px) {
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* 推薦/重要/次要選項樣式 */
.option-recommended {
    color: #ffd700 !important;
    font-weight: bold !important;
}

.option-important {
    color: #ffd700 !important;
    font-weight: bold !important;
}

.option-secondary {
    color: #4a9eff !important;
    font-weight: 600 !important;
}

/* 儀器評分樣式 */
.relic-rating {
    margin-bottom: 10px;
    font-size: 13px;
    color: #ffd700;
    font-weight: 600;
    text-align: center;
    padding: 4px 8px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.rating-value {
    font-weight: bold;
    color: #ffd700;
}

/* 數值容器和分解顯示 */
.stat-value-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    position: relative;
}

.stat-value-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.stat-breakdown {
    font-size: 0.75em;
    opacity: 0.8;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
}

.stat-breakdown .base-value {
    color: #ffffff;
}

.stat-breakdown .bonus-value {
    color: #00d4ff;
}

.stat-breakdown .penalty-value {
    color: #ff6b6b;
}

/* 儀器片段頭部和隨機按鈕 */
.relic-piece-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.relic-piece-header h3 {
    margin: 0;
}

.random-buttons {
    display: flex;
    gap: 5px;
}

.random-btn {
    background: linear-gradient(45deg, #4a9eff, #00d4ff);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.random-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.random-btn:active {
    transform: scale(0.95);
}

.lucky-random-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4a);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.lucky-random-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.4);
}

.lucky-random-btn:active {
    transform: scale(0.95);
}

.super-lucky-random-btn {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d, #6bcf7f, #4d9de0, #e15759, #ff9ff3);
    background-size: 300% 300%;
    animation: rainbow 2s ease infinite;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.super-lucky-random-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.4);
    animation-duration: 1s;
}

.super-lucky-random-btn:active {
    transform: scale(0.95);
}

@keyframes rainbow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.random-info-btn {
    background: linear-gradient(45deg, #666, #888);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.random-info-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(136, 136, 136, 0.4);
}

.random-info-btn:active {
    transform: scale(0.95);
}

/* 強化次數指示器 */
.enhancement-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    margin-right: 5px;
    flex-shrink: 0;
}

.enhancement-indicator.enhancement-zero {
    background: transparent;
    color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.enhancement-indicator.enhancement-important {
    background: #ffd700;
    color: #000;
}

.enhancement-indicator.enhancement-normal {
    background: #4a9eff;
    color: #fff;
}

/* 選中的重要副詞條樣式 */
.sub-stat select.selected-important,
.sub-stat-type.selected-important,
.relic-piece .sub-stat select.selected-important {
    background: rgba(255, 215, 0, 0.15) !important;
    color: #ffd700 !important;
    border: 2px solid #ffd700 !important;
    font-weight: bold !important;
}

.sub-stat select.selected-secondary,
.sub-stat-type.selected-secondary,
.relic-piece .sub-stat select.selected-secondary {
    background: rgba(74, 158, 255, 0.15) !important;
    color: #4a9eff !important;
    border: 2px solid #4a9eff !important;
    font-weight: bold !important;
}

.sub-stat-type-with-indicator {
    display: flex;
    align-items: center;
}

/* 隨機資訊模態窗口 */
.random-info-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.random-info-modal.open {
    display: flex;
    justify-content: center;
    align-items: center;
}

.random-info-modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    position: relative;
}

.random-info-modal-sidebar {
    width: 200px;
    background: #0f0f0f;
    border-right: 1px solid #333;
    padding: 20px 0;
}

.random-info-modal-sidebar-item {
    padding: 15px 20px;
    cursor: pointer;
    color: #ccc;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.random-info-modal-sidebar-item:hover {
    background: #252525;
    color: #fff;
}

.random-info-modal-sidebar-item.active {
    background: #1a1a1a;
    color: #00d4ff;
    border-left-color: #00d4ff;
}

.random-info-modal-main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    position: relative;
}

.random-info-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #ccc;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.random-info-modal-close:hover {
    background: #333;
    color: #fff;
}

.random-info-modal-main h2 {
    color: #00d4ff;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    padding-right: 50px;
}

.random-info-section-modal {
    color: #fff;
}

.random-mode-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.random-mode-item {
    background: #252525;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #333;
}

.random-mode-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.random-mode-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.random-mode-icon.normal {
    background: linear-gradient(45deg, #4a9eff, #00d4ff);
}

.random-mode-icon.lucky {
    background: linear-gradient(45deg, #ffd700, #ffed4a);
}

.random-mode-icon.super {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d, #6bcf7f, #4d9de0, #e15759, #ff9ff3);
    background-size: 300% 300%;
    animation: rainbow 2s ease infinite;
}

.random-mode-item h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

.random-mode-item p {
    margin: 0;
    color: #ccc;
    line-height: 1.5;
}

.probability-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.probability-mode {
    background: #252525;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #333;
}

.probability-mode h3 {
    color: #00d4ff;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
}

.probability-details h4 {
    color: #ffd700;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 16px;
}

.probability-details h4:first-child {
    margin-top: 0;
}

.probability-details ul {
    margin: 0 0 10px 0;
    padding-left: 20px;
}

.probability-details li {
    color: #ccc;
    margin-bottom: 5px;
    line-height: 1.4;
}

.value-ranges {
    margin-top: 20px;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #444;
}

.value-ranges h5 {
    color: #00d4ff;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 14px;
}

.value-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.value-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #0f0f0f;
    border-radius: 4px;
    border: 1px solid #333;
}

.value-row .stat-name {
    color: #fff;
    font-weight: 600;
    min-width: 80px;
}

.value-row .values {
    color: #ccc;
    font-family: monospace;
    font-size: 13px;
}

@media (max-width: 768px) {
    .random-info-modal-content {
        width: 95%;
        max-height: 95vh;
        flex-direction: column;
    }
    
    .random-info-modal-sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        padding: 10px 0;
        border-right: none;
        border-bottom: 1px solid #333;
        flex-shrink: 0;
    }
    
    .random-info-modal-sidebar-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        flex-shrink: 0;
        min-width: 120px;
        text-align: center;
    }
    
    .random-info-modal-sidebar-item.active {
        border-left: none;
        border-bottom-color: #00d4ff;
    }
    
    .random-info-modal-main {
        padding: 15px;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .random-info-modal-main h2 {
        font-size: 20px;
    }
    
    .value-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .value-row .stat-name {
        min-width: auto;
    }
    
    .random-buttons {
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .random-btn, .lucky-random-btn, .super-lucky-random-btn, .random-info-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .random-mode-info {
        gap: 15px;
    }
    
    .random-mode-item {
        padding: 15px;
    }
    
    .probability-content {
        gap: 20px;
    }
    
    .probability-mode {
        padding: 15px;
    }
    
    .probability-details ul {
        padding-left: 15px;
    }
    
    .value-table {
        overflow-x: auto;
    }
}

/* 光錐選擇按鈕 */
.lightcone-select-btn, .character-select-btn, .relic-select-btn {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.lightcone-select-btn:hover, .character-select-btn:hover, .relic-select-btn:hover {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.15);
}

.lightcone-select-btn:focus, .character-select-btn:focus, .relic-select-btn:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}



/* 光錐選擇模態窗口 */
.lightcone-modal, .character-modal, .relic-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightcone-modal.open, .character-modal.open, .relic-modal.open {
    opacity: 1;
    visibility: visible;
}

.lightcone-modal-content, .character-modal-content, .relic-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lightcone-modal-header, .character-modal-header, .relic-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.lightcone-modal-header h2, .character-modal-header h2, .relic-modal-header h2 {
    color: #ffd700;
    font-size: 1.5rem;
    margin: 0;
}

.lightcone-modal-close, .character-modal-close, .relic-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightcone-modal-close:hover, .character-modal-close:hover, .relic-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.lightcone-modal-body, .character-modal-body, .relic-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

/* 篩選器 */
.lightcone-filters, .character-filters, .relic-filters {
    margin-bottom: 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h3 {
    color: #ffd700;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.path-selector, .star-selector, .element-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.path-option, .star-option, .element-option {
    cursor: pointer;
    user-select: none;
}

.path-checkbox, .star-checkbox, .character-star-checkbox, .character-path-checkbox, .character-element-checkbox {
    display: none;
}

.path-text, .star-text, .element-text {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.path-text:hover, .star-text:hover, .element-text:hover {
    background: rgba(255, 255, 255, 0.2);
}

.path-checkbox:checked + .path-text,
.star-checkbox:checked + .star-text,
.character-star-checkbox:checked + .star-text,
.character-path-checkbox:checked + .path-text,
.character-element-checkbox:checked + .element-text {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* 命途顏色 */
.path-text.destruction { border-color: #ff6b6b; }
.path-checkbox:checked + .path-text.destruction { background: #ff6b6b; border-color: #ff6b6b; }

.path-text.hunt { border-color: #4ecdc4; }
.path-checkbox:checked + .path-text.hunt { background: #4ecdc4; border-color: #4ecdc4; }

.path-text.erudition { border-color: #a855f7; }
.path-checkbox:checked + .path-text.erudition { background: #a855f7; border-color: #a855f7; }

.path-text.harmony { border-color: #ffd700; }
.path-checkbox:checked + .path-text.harmony { background: #ffd700; border-color: #ffd700; color: #000; }

.path-text.nihility { border-color: #8b5cf6; }
.path-checkbox:checked + .path-text.nihility { background: #8b5cf6; border-color: #8b5cf6; }

.path-text.preservation { border-color: #10b981; }
.path-checkbox:checked + .path-text.preservation { background: #10b981; border-color: #10b981; }

.path-text.abundance { border-color: #06d6a0; }
.path-checkbox:checked + .path-text.abundance { background: #06d6a0; border-color: #06d6a0; }

.path-text.remembrance { border-color: #ff69b4; }
.path-checkbox:checked + .path-text.remembrance { background: #ff69b4; border-color: #ff69b4; }

/* 角色篩選命途顏色 */
.character-path-checkbox:checked + .path-text.destruction { background: #ff6b6b; border-color: #ff6b6b; }
.character-path-checkbox:checked + .path-text.hunt { background: #4ecdc4; border-color: #4ecdc4; }
.character-path-checkbox:checked + .path-text.erudition { background: #a855f7; border-color: #a855f7; }
.character-path-checkbox:checked + .path-text.harmony { background: #ffd700; border-color: #ffd700; color: #000; }
.character-path-checkbox:checked + .path-text.nihility { background: #8b5cf6; border-color: #8b5cf6; }
.character-path-checkbox:checked + .path-text.preservation { background: #10b981; border-color: #10b981; }
.character-path-checkbox:checked + .path-text.abundance { background: #06d6a0; border-color: #06d6a0; }
.character-path-checkbox:checked + .path-text.remembrance { background: #ff69b4; border-color: #ff69b4; }

/* 屬性顏色 */
.element-text.physical { border-color: #c0c0c0; }
.character-element-checkbox:checked + .element-text.physical { background: #c0c0c0; border-color: #c0c0c0; color: #000; }

.element-text.fire { border-color: #ff6b47; }
.character-element-checkbox:checked + .element-text.fire { background: #ff6b47; border-color: #ff6b47; }

.element-text.ice { border-color: #4fc3f7; }
.character-element-checkbox:checked + .element-text.ice { background: #4fc3f7; border-color: #4fc3f7; }

.element-text.lightning { border-color: #9c27b0; }
.character-element-checkbox:checked + .element-text.lightning { background: #9c27b0; border-color: #9c27b0; }

.element-text.wind { border-color: #4caf50; }
.character-element-checkbox:checked + .element-text.wind { background: #4caf50; border-color: #4caf50; }

.element-text.quantum { border-color: #3f51b5; }
.character-element-checkbox:checked + .element-text.quantum { background: #3f51b5; border-color: #3f51b5; }

.element-text.imaginary { border-color: #ffeb3b; }
.character-element-checkbox:checked + .element-text.imaginary { background: #ffeb3b; border-color: #ffeb3b; color: #000; }

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.filter-clear-btn, .filter-all-btn, .character-filter-clear-btn, .character-filter-all-btn, .lightcone-remove-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.filter-clear-btn:hover, .filter-all-btn:hover, .character-filter-clear-btn:hover, .character-filter-all-btn:hover, .lightcone-remove-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightcone-remove-btn {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.lightcone-remove-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}

/* 光錐網格 */
.lightcone-grid, .character-grid, .relic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.lightcone-card, .character-card, .relic-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.lightcone-card:hover, .character-card:hover, .relic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: #667eea;
}

.lightcone-card.selected, .character-card.selected, .relic-card.selected {
    border-color: #4fc3f7;
    background: rgba(79, 195, 247, 0.15);
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.3);
}

.lightcone-card.signature-weapon {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.lightcone-card.signature-weapon.selected {
    border-color: #4fc3f7;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.15), rgba(255, 107, 107, 0.1));
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.3);
}

.lightcone-card.recommended-weapon {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.lightcone-card.recommended-weapon.selected {
    border-color: #4fc3f7;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.15), rgba(255, 215, 0, 0.1));
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.3);
}

.signature-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff6b6b;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 1;
}

.recommend-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ffd700;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 1;
}

.lightcone-card.lower-tier-weapon {
    border-color: #4a90e2;
    background: rgba(74, 144, 226, 0.1);
}

.lightcone-card.lower-tier-weapon.selected {
    border-color: #4fc3f7;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.15), rgba(74, 144, 226, 0.1));
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.3);
}

.lower-tier-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #4a90e2;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 1;
}

.lightcone-image, .character-image {
    width: 80px;
    height: 99px;
    border-radius: 8px;
    margin: 0 auto 10px;
    object-fit: cover;
}

.lightcone-name, .character-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
    line-height: 1.3;
}

.lightcone-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.character-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.character-info-left {
    display: flex;
    align-items: center;
    gap: 5px;
}

.lightcone-path {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.lightcone-path.destruction { background: rgba(255, 107, 107, 0.2); color: #ff6b6b; }
.lightcone-path.hunt { background: rgba(78, 205, 196, 0.2); color: #4ecdc4; }
.lightcone-path.erudition { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.lightcone-path.harmony { background: rgba(255, 215, 0, 0.2); color: #ffd700; }
.lightcone-path.nihility { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.lightcone-path.preservation { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.lightcone-path.abundance { background: rgba(6, 214, 160, 0.2); color: #06d6a0; }
.lightcone-path.remembrance { background: rgba(255, 105, 180, 0.2); color: #ff69b4; }

.lightcone-stars, .character-stars {
    color: #ffd700;
}

.character-path {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.character-path.destruction { background: rgba(255, 107, 107, 0.2); color: #ff6b6b; }
.character-path.hunt { background: rgba(78, 205, 196, 0.2); color: #4ecdc4; }
.character-path.erudition { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.character-path.harmony { background: rgba(255, 215, 0, 0.2); color: #ffd700; }
.character-path.nihility { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.character-path.preservation { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.character-path.abundance { background: rgba(6, 214, 160, 0.2); color: #06d6a0; }
.character-path.remembrance { background: rgba(255, 105, 180, 0.2); color: #ff69b4; }

.character-element {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    font-size: 10px;
    color: white;
}

.character-element img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .lightcone-modal-content, .character-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .lightcone-modal-body, .character-modal-body {
        padding: 15px;
    }
    
    .lightcone-filters, .character-filters {
        padding: 15px;
    }
    
    .lightcone-grid, .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .lightcone-card, .character-card {
        padding: 12px;
    }
    
    .lightcone-image, .character-image {
        width: 60px;
        height: 74px;
    }
    
        .path-selector, .star-selector, .element-selector {
        gap: 8px;
    }

    .path-text, .star-text, .element-text {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 儀器選擇特有樣式 */
.relic-type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.relic-type-option {
    cursor: pointer;
    user-select: none;
}

.relic-type-checkbox {
    display: none;
}

.relic-type-text {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.relic-type-text:hover {
    background: rgba(255, 255, 255, 0.2);
}

.relic-type-checkbox:checked + .relic-type-text {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.relic-selection-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #ffd700;
}

.relic-selection-info p {
    margin: 0 0 10px 0;
    color: #ffd700;
    font-weight: 600;
}

.selected-relics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selected-outer-relics, .selected-inner-relic {
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    min-width: 80px;
}

.selected-outer-list, .selected-inner-list {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    flex: 1;
}

.relic-card.recommended-relic {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.relic-card.recommended-relic.selected {
    border-color: #4fc3f7;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.15), rgba(255, 215, 0, 0.1));
    box-shadow: 0 0 15px rgba(79, 195, 247, 0.3);
}

.relic-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    margin: 0 auto 10px;
    object-fit: cover;
}

.relic-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
    line-height: 1.3;
}

.relic-info {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.relic-type {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.2);
}

.filter-clear-btn, .filter-all-btn, .relic-filter-clear-btn, .relic-filter-all-btn, .relic-clear-selection-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.relic-clear-selection-btn {
    background: rgba(255, 107, 107, 0.2);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.relic-clear-selection-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}

/* 統計詳細信息按鈕樣式 */
.stat-info-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffd700;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
}

.stat-info-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
}

.stat-info-btn:active {
    background: rgba(255, 215, 0, 0.3);
}

/* 統計詳細信息模態窗口樣式 */
.stat-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.stat-info-modal.open {
    display: flex;
}

.stat-info-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 600px;
    max-height: 80vh;
    width: 90%;
    overflow: hidden;
    position: relative;
}

.stat-info-modal-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info-modal-header h3 {
    color: #ffd700;
    margin: 0;
    font-size: 1.3rem;
}

.stat-info-modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.stat-info-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffd700;
}

.stat-info-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.stat-info-modal-body::-webkit-scrollbar {
    width: 8px;
}

.stat-info-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.stat-info-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.stat-info-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* 統計來源項目樣式 */
.stat-source-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.stat-source-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 215, 0, 0.3);
}

.stat-source-label {
    color: #e2e8f0;
    font-size: 14px;
    flex: 1;
}

.stat-source-value {
    color: #ffd700;
    font-weight: bold;
    font-size: 14px;
    margin-left: 10px;
}

.stat-source-value.positive {
    color: #4ade80;
}

.stat-source-value.negative {
    color: #f87171;
}

/* 統計總計樣式 */
.stat-total {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-total-label {
    color: #ffd700;
    font-weight: bold;
    font-size: 16px;
}

.stat-total-value {
    color: #ffd700;
    font-weight: bold;
    font-size: 18px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .stat-info-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .stat-info-modal-header {
        padding: 15px;
    }
    
    .stat-info-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .stat-info-modal-body {
        padding: 15px;
        max-height: 65vh;
    }
    
    .stat-info-btn {
        width: 18px;
        height: 18px;
        font-size: 11px;
        margin-left: 6px;
    }
    
    .stat-source-item {
        padding: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .stat-source-value {
        margin-left: 0;
        align-self: flex-end;
    }
}