/* =============================================
   CSS 變數 & 全域重置
   ============================================= */
:root {
    --primary-gold: #ffd700;
    --bg-dark: #1a1a1a;
    --bg-card: #252525;
    --text-light: #e0e0e0;
    --danger-red: #8b0000;
    --warning-orange: #ff8c00;
    --success-green: #28a745;
    --border-color: #444;
    --bg-input: #2a2a2a;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}
html {
    --scrollbar-bg: #111;
    --scrollbar-thumb: #444;
}

::-webkit-scrollbar {
    width: 12px !important;
    height: 12px !important;
    display: block !important; 
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-bg) !important;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb) !important;
    border-radius: 10px !important;
    border: 2px solid var(--scrollbar-bg) !important;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-gold) !important;
}

body {
    -webkit-overflow-scrolling: touch; 
}

body {
    color: var(--text-light);
    padding: 15px;
    overflow-x: hidden;
    background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url('images/icons/背景.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: var(--bg-dark);
}

/* =============================================
   版面骨架
   ============================================= */
header {
    text-align: center;
    margin-bottom: 25px;
}
h1 { 
    font-size: 1.5rem; 
    color: var(--primary-gold); 
    margin-bottom: 10px; 
}
.hidden      { display: none !important; }

footer {
    margin-top: 50px;
    padding: 40px 20px;
    background-color: #111;
    border-top: 1px solid var(--primary-gold);
    text-align: center;
}
.copyright, .website-author { font-size: 12px; color: #666; margin-top: 5px; }
.website-author:hover        { color: var(--primary-gold); }

/* =============================================
   載入 & 動畫
   ============================================= */
.loading-spinner {
    position: fixed;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border: 4px solid #333;
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    animation: spin 1s linear infinite;
    z-index: 2000;
}

@keyframes spin    { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes flash {
    0%   { background-color: #28a745; transform: scale(1); }
    50%  { background-color: #6fbf4c; transform: scale(1.02); }
    100% { background-color: #2a6b2f; transform: scale(1); }
}

.flash-green { animation: flash 0.4s ease-in-out; }

/* =============================================
   表單元素
   ============================================= */
input,
select,
.custom-select-trigger {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    line-height: 1.4;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: white;
    cursor: pointer;
    box-sizing: border-box;
    appearance: none;
    transition: outline 0.2s;
}

input:focus,
select:focus,
.custom-select-trigger:focus {
    outline: 2px solid var(--primary-gold);
    border-color: transparent;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23aaa'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

/* =============================================
   搜尋 & 篩選列
   ============================================= */
.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto 30px;
}

.search-wrapper { position: relative; width: 100%; }
#searchInput   { padding-right: 35px; }

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
}
.clear-search-btn:hover { color: #fff; }

.filter-stats {
    text-align: center;
    font-size: 13px;
    color: var(--primary-gold);
    margin-top: 8px;
}

/* =============================================
   自訂下拉元件
   ============================================= */
.custom-select {
    position: relative;
    width: 100%;
    cursor: pointer;
}

.custom-select-trigger {
    position: relative;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 36px 12px 36px;
    font-size: 16px;
    line-height: 1.4;
    color: white;
    cursor: pointer;
    transition: outline 0.2s;
}

.custom-select-trigger .selected-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.custom-select-trigger .arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #aaa;
    transition: transform 0.2s;
}

.custom-select.open .custom-select-trigger .arrow {
    transform: translateY(-50%) rotate(180deg);
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.custom-select.open .custom-select-dropdown {
    display: block;
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.custom-option img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.custom-option span {
    flex: 1;
}

.custom-option:hover      { background: #3a3a3a; }
.custom-option.selected   { background: #3a3a3a; border-left: 3px solid var(--primary-gold); }

/* =============================================
   卡牌數值徽章
   ============================================= */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.stat {
    font-size: 11px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    color: #fff;
}
.vol   { background-color: #2b5797; }
.cal   { background-color: #b91d47; }
.guard { background-color: #e3a21a; color: #000; }
.star  { background-color: #7e3878; }

/* =============================================
   卡牌標籤
   ============================================= */
.tag {
    display: inline-block;
    font-size: 10px;
    background: #444;
    color: #bbb;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin: 2px;
}

.symbol-tag {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    background: #5c4033;
    color: #ffcc99;
    padding: 4px 10px !important;
    border-radius: var(--radius-sm);
    margin: 2px;
    font-size: 13px !important;
    font-weight: bold;
    line-height: 1 !important;
}
.symbol-tag img {
    display: block !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

/* =============================================
   卡牌網格
   ============================================= */
.gallery,
.pool-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .gallery,
    .pool-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    text-align: center;
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-5px); border-color: var(--primary-gold); }

.card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 6px;
    object-fit: cover;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}
.card img[data-loaded="true"] { animation: none; background: #333; }

.card h3 {
    font-size: 14px;
    margin-bottom: 8px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================
   骨架螢幕
   ============================================= */
.skeleton-img {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

.skeleton-line {
    height: 12px;
    background: #2a2a2a;
    margin: 8px 0;
    border-radius: var(--radius-sm);
}
.skeleton-line.short { width: 60%; margin: 0 auto; }

.gallery-skeleton {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    transition: opacity 0.3s;
}

/* =============================================
   效果 Modal
   ============================================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: #2a2a2a;
    padding: 25px;
    border-radius: 15px;
    width: 100%;
    max-width: 400px;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--primary-gold);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #888;
}

.effect-text {
    background: var(--bg-dark);
    padding: 15px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-gold);
    margin-top: 15px;
    line-height: 1.6;
}

.inline-symbol-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 4px;
    display: inline-block;
    object-fit: contain;
}

/* =============================================
   手機浮動篩選 & 抽屜
   ============================================= */
.mobile-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-gold);
    color: black;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 900;
}

.mobile-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-top: 2px solid var(--primary-gold);
    padding: 20px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s;
}
.mobile-drawer.open { transform: translateY(0); }

.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}
.drawer-backdrop.open { display: block; }

/* =============================================
   新手引導提示
   ============================================= */
.tour-toast {
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: rgba(0,0,0,0.9);
    border-left: 4px solid var(--primary-gold);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--primary-gold);
    font-size: 14px;
    z-index: 1100;
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.tour-toast button {
    background: var(--primary-gold);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    color: #000;
}

/* =============================================
   教團進度條
   ============================================= */
.stat-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin: 5px 0;
}
.stat-bar .bar {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.stat-bar .bar div {
    height: 100%;
    background: var(--primary-gold);
    width: 0%;
    transition: width 0.2s;
}

/* =============================================
   圖示按鈕
   ============================================= */
.add-icon-btn {
    background: none;
    border: none;
    color: var(--success-green);
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.1s;
}
.add-icon-btn:hover    { transform: scale(1.1); }
.add-icon-btn:disabled { color: #666; cursor: not-allowed; transform: none; }

.clear-category {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-left: 8px;
    color: #aaa;
}
.clear-category:hover { color: var(--danger-red); }

/* =============================================
   組牌器佈局
   ============================================= */
.deck-builder-container {
    display: flex;
    gap: 15px;
    margin: 0 auto;
    padding: 10px;
    overflow-x: hidden;
}

.deck-list-section {
    flex: 0 0 260px;
    background-color: var(--bg-dark);
    border: 1px solid var(--primary-gold);
    border-radius: var(--radius-md);
    padding: 12px;
    overflow-y: auto;
    max-height: calc(100vh - 30px);
}

.deck-pool-section {
    flex: 1;
    background-color: var(--bg-dark);
    padding: 10px;
    border-radius: var(--radius-md);
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .deck-builder-container { flex-direction: column; }
    .deck-list-section      { max-height: none; flex: none; width: 100%; }
}

/* 牌組插槽清單 */
.slot-list {
    list-style: none;
    margin-bottom: 20px;
    min-height: 50px;
    background-color: #111;
    border-radius: 5px;
}
.slot-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5px;
    border-bottom: 1px solid #333;
    position: relative;
    overflow: hidden;
}
.slot-list li span  { cursor: pointer; flex: 1; color: #ccc; }
.slot-list li button {
    background: var(--danger-red);
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
}

/* 滑動刪除背景 */
.swipe-bg {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 80px;
    background: var(--danger-red);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transform: translateX(100%);
    transition: transform 0.2s;
    z-index: 0;
}
.slot-list li.swiping .swipe-bg {
    transform: translateX(0);
}

/* =============================================
   組牌器按鈕
   ============================================= */
.button-group {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}
.btn-clear-deck-only,
.btn-reset-rule {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: bold;
    cursor: pointer;
}
.btn-clear-deck-only { background: #555; color: #fff; }
.btn-reset-rule      { background: #6c3483; color: #fff; }

.btn-apply-rule,
.btn-clear-deck,
.btn-export-deck,
.btn-export-image,
.btn-import-deck {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: bold;
    cursor: pointer;
}
.btn-apply-rule  { background: var(--primary-gold); color: #000; }
.btn-clear-deck  { background: var(--danger-red);   color: #fff; }
.btn-export-deck { background: #2b5797;              color: #fff; }
.btn-export-image{ background: #9b59b6;              color: #fff; }
.btn-import-deck { background: #6c757d;              color: #fff; }

.deck-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

/* =============================================
   警告訊息
   ============================================= */
.limit-warning {
    background: rgba(255, 80, 80, 0.2);
    border-left: 4px solid #ff4444;
    padding: 8px 12px;
    margin: 10px 0;
    font-size: 13px;
    color: #ff8888;
    border-radius: var(--radius-sm);
}
.limit-warning.warning-over {
    background: rgba(255, 140, 0, 0.2);
    border-left-color: var(--warning-orange);
    color: #ffaa66;
}

/* =============================================
   空狀態
   ============================================= */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #aaa;
    grid-column: 1 / -1;
}
.empty-state i { font-size: 48px; margin-bottom: 10px; color: #555; }
.empty-state button {
    margin-top: 15px;
    background: var(--primary-gold);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
}

/* =============================================
   規則選擇 Modal
   ============================================= */
.rule-modal-content  { text-align: center; max-width: 480px; }
.rule-modal-options  { display: flex; gap: 16px; margin-bottom: 20px; }

.rule-option-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 12px;
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--text-light);
    transition: border-color 0.2s, background 0.2s;
}
.rule-option-btn:hover { border-color: var(--primary-gold); background: #2a2a2a; }

.rule-option-title { font-size: 18px; font-weight: bold; color: var(--primary-gold); }
.rule-option-sub   { font-size: 14px; font-weight: bold; color: #fff; margin: 5px 0; display: block; }
.rule-option-desc  { font-size: 12px; color: #ccc; line-height: 1.5; display: block; }

@media (max-width: 480px) { .rule-modal-options { flex-direction: column; } }

/* =============================================
   牌組管理器
   ============================================= */
.deck-manager {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #444;
}
.deck-manager h4 { font-size: 14px; margin-bottom: 8px; color: var(--primary-gold); }

.deck-manager-input { display: flex; gap: 8px; margin-bottom: 10px; }
.deck-manager-input input { flex: 1; padding: 6px; font-size: 12px; }

.btn-small {
    background: #444;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-small:hover { background: var(--primary-gold); color: #000; }

.saved-decks-list { display: flex; flex-direction: column; gap: 5px; }

.saved-deck-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.saved-deck-item button          { background: none; border: none; color: #aaa; cursor: pointer; margin-left: 5px; }
.saved-deck-item button:hover    { color: var(--primary-gold); }

/* =============================================
   Footer 連結
   ============================================= */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}
.footer-btn {
    text-decoration: none;
    color: var(--primary-gold);
    border: 1px solid var(--primary-gold);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.footer-btn:hover {
    background-color: var(--primary-gold);
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* =========================================
   QA 常見問題樣式
   ========================================= */
.qa-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    animation: fadeIn 0.3s ease;
}

.qa-category {
    margin-bottom: 35px;
}

.qa-category-title {
    text-align: center;
    color: var(--primary-gold);
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.qa-category-title::before {
    content: "";
    flex: 1;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='16' viewBox='0 0 30 16'%3E%3Cpath d='M0,8 Q7.5,0 15,8 T30,8' fill='none' stroke='%23ffd700' stroke-width='1.5'/%3E%3Cpath d='M0,8 Q7.5,16 15,8 T30,8' fill='none' stroke='%23ffd700' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: right center;
    max-width: 250px; 
    opacity: 0.8;
    -webkit-mask-image: linear-gradient(to right, transparent, black);
    mask-image: linear-gradient(to right, transparent, black);
}

.qa-category-title::after {
    content: "";
    flex: 1;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='16' viewBox='0 0 30 16'%3E%3Cpath d='M0,8 Q7.5,0 15,8 T30,8' fill='none' stroke='%23ffd700' stroke-width='1.5'/%3E%3Cpath d='M0,8 Q7.5,16 15,8 T30,8' fill='none' stroke='%23ffd700' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: left center;
    max-width: 250px; 
    opacity: 0.8;
    -webkit-mask-image: linear-gradient(to left, transparent, black);
    mask-image: linear-gradient(to left, transparent, black);
}
.qa-faction-icon {
    height: 28px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.qa-item {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: border-color 0.3s;
}
.qa-item:hover { border-color: #555; }

.qa-question {
    padding: 16px;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2a2a2a;
    font-size: 15px;
    user-select: none;
}
.qa-question i { color: var(--primary-gold); transition: transform 0.3s ease; }

.qa-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: #ccc;
    line-height: 1.6;
    font-size: 14px;
    background: #1e1e1e;
}

.qa-item.active { border-color: var(--primary-gold); }
.qa-item.active .qa-question { color: var(--primary-gold); }
.qa-item.active .qa-question i { transform: rotate(180deg); }
.qa-item.active .qa-answer {
    padding: 16px;
    max-height: 1000px; 
    border-top: 1px solid #333;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   分頁
   ========================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 20px 0;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}
.pagination button,
.pagination select {
    padding: 6px 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.pagination button.active {
    background: var(--primary-gold);
    color: black;
}
.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination select {
    width: auto;
}

/* 拖曳視覺回饋 */
.sortable-ghost {
    opacity: 0.4;
    background: #444;
    border: 2px dashed var(--primary-gold);
}

.sortable-chosen {
    background: #3a3a3a;
}

.custom-select-trigger img {
    display: none;
}

.custom-select-trigger {
    padding-left: 12px !important; /* 將左邊距調回 12px，與右邊對稱 */
}

.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none; 
}

.slider {
    width: 34px;
    height: 18px;
    background-color: #444;
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}

.slider:before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background-color: var(--primary-gold);
}

input:checked + .slider:before {
    transform: translateX(16px);
    background-color: #000;
}

input:checked ~ .label-text {
    color: var(--primary-gold);
    font-weight: bold;
}
/* =============================================
   Toast 提示訊息系統
   ============================================= */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(37, 37, 37, 0.95);
    color: var(--text-light);
    padding: 12px 24px;
    border-radius: 25px;
    border: 1px solid var(--primary-gold);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(5px);
    animation: toastIn 0.3s ease forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-success { border-color: var(--success-green); color: var(--success-green); }
.toast.toast-error { border-color: var(--danger-red); color: var(--danger-red); }
.toast.toast-warning { border-color: var(--warning-orange); color: var(--warning-orange); }

.toast.fade-out { opacity: 0; transform: translateY(-20px); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* =============================================
   Modal 導航按鈕
   ============================================= */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: var(--primary-gold);
    border: 2px solid var(--primary-gold);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 1001; 
}
.nav-btn:hover { background: var(--primary-gold); color: #000; transform: translateY(-50%) scale(1.1); }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; border-color: #555; color: #555; }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

@media (max-width: 600px) {
    .nav-btn { top: auto; bottom: 20px; transform: none; width: 40px; height: 40px; font-size: 18px; }
    .nav-btn:hover { transform: scale(1.1); }
    .prev-btn { left: 20%; }
    .next-btn { right: 20%; }
}
/* =============================================
   活動篩選標籤
   ============================================= */
.active-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 5px;
}
.active-tag {
    background: #333;
    border: 1px solid var(--primary-gold);
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.active-tag i { cursor: pointer; color: #aaa; transition: color 0.2s; }
.active-tag i:hover { color: var(--danger-red); }
/* =============================================
   黏性工具列
   ============================================= */
.sticky-toolbar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(8px);
    padding: 15px;
    margin: -15px -15px 15px -15px;
    border-bottom: 2px solid var(--primary-gold); /* 加粗底線，增強分隔感 */
    display: flex;
    flex-direction: column;
    align-items: center; /* 讓內容置中 */
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

/* 讓按鈕區塊跟搜尋框一樣寬 */
.sticky-toolbar .mode-switch {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 500px; 
}

.mode-btn {
    flex: 1; 
    padding: 10px 5px;
    background: var(--bg-input);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    border-color: var(--primary-gold);
    background: #333;
}

.mode-btn.active {
    background: var(--primary-gold);
    color: #000;
    border-color: var(--primary-gold);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

.sticky-toolbar .search-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.sticky-toolbar input {
    background-color: #222;
    border: 1px solid var(--border-color);
}
.sticky-toolbar input:focus {
    border-color: transparent;
    outline: 2px solid var(--primary-gold);
}