        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }

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

        .container h1 {
            font-size: 2.5em;
            margin-bottom: 10px;
            text-align: center;
            display: flex;
            justify-content: center; /* 水平置中 */
            align-items: center;     /* 垂直置中 */
            gap: 10px;               /* 圖片與文字間距 */
        }


        header {
            /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
            background: #322258;
            color: white;
            padding: 10px 0;
            margin-bottom: 10px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        header h1 {
            text-align: center;
            font-size: 2em;
            margin-bottom: 10px;
        }

        .logo {
            width: 48px;
            height: 48px;
            flex-shrink: 0;
            background: rgba(255,255,255,0.4); /* 半透明白 */
            border-radius: 50%;
            padding: 4px;
            display: inline-block;
            vertical-align: middle;
            
        }


        header p {
            text-align: center;
            opacity: 0.9;
        }

        .main-content {
            display: block; /* 原本 grid 改掉 */
        }

        .search-panel {
            background: white;
            padding: 25px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            height: fit-content;
            position: sticky;
            top: 20px;
        }

        .form-group {
            margin-bottom: 10px;
        }

        .form-group label {
/*            display: block;
            font-weight: 600;
            margin-bottom: 8px;
            color: #555;*/
            margin-bottom: 4px;
            font-size: 14px;
        }

        .form-group input[type="text"],
        .form-group input[type="number"] {
            width: 100%;
            padding: 10px;
            border: 2px solid #e0e0e0;
            border-radius: 5px;
            font-size: 14px;
            transition: border-color 0.3s;
        }

        .form-group input:focus {
            outline: none;
            border-color: #667eea;
        }

        .checkbox-group,
        .radio-group {
            gap: 4px; /* 原本 8px */
        }


        .checkbox-group label,
        .radio-group label {
            padding: 2px 4px;
            font-size: 13px;
            cursor: pointer;
        }


        .checkbox-group input[type="checkbox"] {
            margin-right: 6px;
            cursor: pointer;
        }


        .radio-group input[type="radio"] {
            margin-right: 6px;
            cursor: pointer;
        }

        .btn {
            width: 100%;
            padding: 12px;
            /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
            background: #322258;
            color: white;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: transform 0.2s;
        }

        .btn:hover {
            transform: translateY(-2px);
        }

        .btn-secondary {
            background: #6c757d;
        }

        .results-panel {
            background: white;
            padding: 25px;
            border-radius: 10px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }

        .results-header {
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #e0e0e0;
        }

        .results-count {
            font-size: 18px;
            font-weight: 600;
            color: #667eea;
        }

        .results-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 16px;
        }

        .button-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }



        @media (max-width: 1200px) {
            .results-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        @media (max-width: 768px) {
            .results-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        .pill-card {
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            padding: 15px;
            transition: all 0.3s;
        }

        .pill-card:hover {
            border-color: #667eea;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
            transform: translateY(-3px);
        }


        .pill-image {
            width: 100%;
            height: 200px;
            object-fit: contain;
            background: #f8f9fa;
            border-radius: 5px;
            margin-bottom: 10px;
        }

        .pill-info h3 {
            font-size: 16px;
            color: #333;
            margin-bottom: 8px;
        }

        .pill-info p {
            font-size: 14px;
            color: #666;
            margin: 4px 0;
        }

        .pill-attributes {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 10px;
        }

        .attribute-tag {
            background: #e7ecf5;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            color: #555;
        }



        .info-panel {
            background: #fff3cd;
            border-left: 4px solid #ffc107;
            padding: 20px;
            border-radius: 5px;
            margin-top: 30px;
        }

        .info-panel h3 {
            color: #3d2f05;
            margin-bottom: 10px;
        }

        .info-panel p {
            color: #3d2f05;
            margin: 5px 0;
            font-size: 14px;
        }

        .info-panel li {
            color: #3d2f05;
            margin: 3px 0;
            font-size: 14px;
        }

        .no-results {
            grid-column: 1 / -1;
            width: 100%;
            text-align: center;
            padding: 40px;
            color: #999;
        }

        .loading {
            text-align: center;
            padding: 40px;
            color: #667eea;
            font-size: 18px;
        }

        .search-panel {
            position: static;
            padding: 12px 16px;
            margin-bottom: 20px;
        }



        @media (max-width: 1024px) {
            .main-content {
                grid-template-columns: 1fr;
            }

            .search-panel {
                position: static;
            }
        }

        @media (max-width: 768px) {
            .checkbox-group,
            .radio-group {
                grid-template-columns: 1fr;
            }
        }

/* 4. 文字顯示優化 */
        .pill-info h3 a { color: #2d3748; text-decoration: none; border-bottom: 1px solid #667eea; }
        .pill-info p { font-size: 13px; margin: 2px 0; }

/* 5. 顯示更多按鈕 */
        .load-more-container { text-align: center; margin: 30px 0; }
        
        /* 7. 懸浮 Home 鍵 */
        .floating-home {
            position: fixed; bottom: 20px; right: 20px;
            width: 50px; height: 50px; background: #667eea; color: white;
            border-radius: 50%; display: flex; align-items: center; justify-content: center;
            text-decoration: none; box-shadow: 0 4px 10px rgba(0,0,0,0.3); z-index: 1000;
        }




        /* 小卡片切換按鈕 */
.img-switcher {
    position: absolute;
    bottom: 5px;
    right: 5px;
    display: flex;
    gap: 4px;
}
.img-switcher button {
    background: rgba(50, 34, 88, 0.7);
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
}
.img-switcher button:hover {
    background: #667eea;
}

img {
    
    cursor: pointer;
}

#imageModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
}

/* Modal 導航按鈕 */
.modal-content-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
}

.nav-btn {
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 30px;
    padding: 16px;
    cursor: pointer;
    position: absolute;
    z-index: 1001;
}
#prevBtn { left: 10px; font-size: 24px; }
#nextBtn { right: 10px; font-size: 24px; }
#closeBtn { 
    top: 0px; 
    right: 30px; 
    position: absolute; 
    font-size: 40px; 
    color: white;
    cursor: pointer;

}
.nav-btn:hover { background: rgba(0,0,0,0.8); }


.pill-image-container {
    position: relative; 
    width: 100%;
    height: 200px; /* 建議給固定高度或維持原本設定 */
    background: #f8f9fa;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* 防止圖片或按鈕溢出邊界 */
}

/* 切換按鈕容器 */
.img-switcher {
    position: absolute;
    bottom: 8px;      /* 距離底部 8px */
    right: 8px;       /* 距離右側 8px */
    display: flex;
    gap: 4px;         /* 按鈕間距 */
    z-index: 10;      /* 確保在圖片上方 */
}

/* .img-switcher button {
    background: rgba(50, 34, 88, 0.8); /* 稍微深一點的顏色 */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: background 0.2s;
} */

/* 基礎按鈕樣式 */
.img-switcher button {
    background: rgba(255, 255, 255, 0.6);
    color: #322258;
    border: 1px solid #322258;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

/* 當前選中按鈕的樣式 */
.img-switcher button.active {
    background: #322258;
    color: white;
    font-weight: bold;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}


.img-switcher button:hover {
    background: #667eea;
}