:root {
    --bg-color: #f8f9fa;
    --text-color: #333;
    --primary-color: #007bff;
    --sidebar-width: 350px;
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

    /* Brand Colors */
    --color-711: #F58025;
    /* 7-11 Orange (Approx) */
    --color-fm: #00A0E9;
    /* FamilyMart Blue */
    --color-hl: #EB1C24;
    /* Hi-Life Red */
    --color-ok: #DA291C;
    /* OK Red */
    --color-px: #1D4E89;
    /* PX Mart Blue */
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans TC', sans-serif;
    overflow: hidden;
    background-color: var(--bg-color);
    color: var(--text-color);
}

#app {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

#map {
    flex-grow: 1;
    height: 100%;
    z-index: 1;
    position: relative;
}

#locate-btn {
    position: absolute;
    bottom: 30px;
    right: 10px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: background 0.2s;
}

#locate-btn:hover {
    background: #f4f4f4;
}

#locate-btn.loading {
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* 村里名稱標籤 */
.village-label {
    background: rgba(255, 255, 255, 0.85);
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    border-radius: 3px;
}

.village-label::before {
    display: none;
    /* 隱藏箭頭 */
}

#sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--sidebar-bg);
    box-shadow: var(--shadow);
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    position: absolute;
    left: 0;
    top: 0;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
    overflow-y: auto;
    min-width: 280px;
    max-width: 800px;
}

#sidebar.collapsed {
    transform: translateX(calc(-100% + 40px));
}

#sidebar.collapsed .header,
#sidebar.collapsed .tab-nav,
#sidebar.collapsed .tab-content,
#sidebar.collapsed #stats-panel,
#sidebar.collapsed .controls {
    opacity: 0;
    pointer-events: none;
}

#sidebar-toggle {
    position: fixed;
    left: var(--sidebar-width);
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 28px;
    height: 56px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
    z-index: 1002;
    transition: left 0.3s ease;
}

#sidebar-toggle:hover {
    background: #f0f0f0;
}

/* sidebar-toggle 位置由 JS 動態控制 */

/* 拖曳分隔條 */
#resize-handle {
    position: fixed;
    top: 0;
    width: 8px;
    height: 100%;
    cursor: ew-resize;
    background: transparent;
    z-index: 1001;
}

#resize-handle:hover,
#resize-handle.dragging {
    background: var(--primary-color);
}

/* 舊的 toggle-sidebar 已不使用，改用 sidebar-toggle */
#toggle-sidebar {
    display: none !important;
}

/* Typography */
h1 {
    font-size: 1.5rem;
    margin: 0 0 5px 0;
    color: #2c3e50;
}

.header p {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    color: #666;
}

.header .update-date {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 5px;
}

.header .auto-update-note {
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 15px;
    font-style: italic;
}

h3 {
    font-size: 1.1rem;
    margin: 15px 0 10px 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

/* Controls */
.layer-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: #666;
}

.toggle-btn:hover {
    background: #e0e0e0;
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--primary-color), #764ba2);
    color: white;
}

.toggle-btn .toggle-icon {
    font-size: 1.2rem;
}

.brand-filters {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brand-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    color: #333;
}

.brand-btn:hover {
    transform: translateX(3px);
    background: #e5e5e5;
}

.brand-btn.active[data-brand="0"] {
    background: linear-gradient(135deg, #fff5eb, #ffe4cc);
    color: #c04000;
    border-left: 4px solid #ff6600;
}

.brand-btn.active[data-brand="1"] {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    color: #047857;
    border-left: 4px solid #10b981;
}

.brand-btn.active[data-brand="2"] {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #b91c1c;
    border-left: 4px solid #ef4444;
}

.brand-btn.active[data-brand="3"] {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #b45309;
    border-left: 4px solid #f59e0b;
}

.brand-btn.active[data-brand="4"] {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    color: #6d28d9;
    border-left: 4px solid #8b5cf6;
}

.brand-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    background: white;
    padding: 2px;
}

.brand-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.brand-count {
    font-weight: bold;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.3);
    padding: 3px 10px;
    border-radius: 10px;
}

/* Stats Panel */
.stats-panel {
    background: #f1f3f5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    min-height: 150px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: bold;
}

/* 排名卡片 */
.ranking-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.ranking-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 10px 6px;
    border-radius: 8px;
    text-align: center;
    border-left: 3px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ranking-card:nth-child(1) {
    border-left-color: #e74c3c;
}

.ranking-card:nth-child(1) .ranking-value {
    color: #e74c3c;
}

.ranking-card:nth-child(2) {
    border-left-color: #3498db;
}

.ranking-card:nth-child(2) .ranking-value {
    color: #3498db;
}

.ranking-card:nth-child(3) {
    border-left-color: #27ae60;
}

.ranking-card:nth-child(3) .ranking-value {
    color: #27ae60;
}

.ranking-card:nth-child(4) {
    border-left-color: #9b59b6;
}

.ranking-value {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 2px;
}

.ranking-label {
    font-size: 0.8rem;
    color: #333;
    font-weight: 500;
}

.ranking-sub {
    font-size: 0.65rem;
    color: #888;
    margin-top: 2px;
}

/* 側邊欄排名卡片 2x2 布局 */
.sidebar-ranking-cards {
    grid-template-columns: repeat(2, 1fr);
}

/* 可點擊的側邊欄排名卡片 */
.ranking-card.clickable-sidebar-rank {
    cursor: pointer;
    transition: all 0.2s ease;
}

.ranking-card.clickable-sidebar-rank:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 合計行樣式 */
.stat-total {
    font-weight: 600;
    color: #333;
}

.village-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.placeholder {
    color: #888;
    text-align: center;
    margin-top: 40px;
    font-style: italic;
}

/* Legend */
.legend {
    margin-top: auto;
    padding-top: 20px;
}

.gradient-bar {
    height: 10px;
    background: linear-gradient(to right, #1a9850, #66bd63, #a6d96a, #d9ef8b, #fee08b, #fdae61, #f46d43, #d73027);
    border-radius: 5px;
    margin-bottom: 5px;
    /* 綠色（高密度/低PPS）-> 紅色（低密度/高PPS） */
}

.labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #666;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    font-size: 0.8rem;
    color: #666;
}

.data-sources h5 {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #333;
}

.data-sources ul {
    margin: 0 0 15px 0;
    padding-left: 18px;
}

.data-sources li {
    margin-bottom: 4px;
    line-height: 1.4;
}

.author-info {
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.author-info p {
    margin: 4px 0;
}

.disclaimer {
    margin: 10px 0;
    padding: 10px;
    background: #fff9e6;
    border-radius: 6px;
    line-height: 1.5;
    font-size: 0.75rem;
    color: #856404;
}

.disclaimer p {
    margin: 0;
}

.author-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.author-info a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #sidebar {
        width: 100%;
        height: 50%;
        top: auto;
        bottom: 0;
        left: 0;
        transform: translateY(0);
        border-radius: 12px 12px 0 0;
    }

    #sidebar.collapsed {
        transform: translateY(100%);
    }

    #toggle-sidebar {
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        display: block;
    }
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    background: #e9ecef;
    padding: 5px;
    border-radius: 8px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* County List */
.county-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.county-summary h3 {
    color: white;
    border: none;
    margin: 0 0 10px 0;
}

.county-summary .stat-row {
    color: rgba(255, 255, 255, 0.9);
}

.county-summary .stat-value {
    color: white;
}

.county-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    max-height: none;
    overflow-y: visible;
}

.county-category-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    padding: 8px 0 4px 0;
    margin-top: 10px;
    border-bottom: 1px solid #e9ecef;
    grid-column: 1 / -1;
    /* 橫跨整列 */
}

.county-category-title:first-child {
    margin-top: 0;
}

.county-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.county-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.county-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}

.county-card-content {
    flex: 1;
    min-width: 0;
}

.county-card .county-name {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.county-card .county-info {
    font-size: 0.75rem;
    color: #666;
}

.county-card .arrow {
    display: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 80%;
    min-width: 400px;
    max-width: 900px;
    height: 90vh;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* 使用 JavaScript 處理調整大小 */
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.5);
    color: white;
}

.modal-header {
    background: linear-gradient(135deg, #5f72bd 0%, #9b59b6 50%, #667eea 100%);
    color: white;
    padding: 30px;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0 0 20px 0;
    font-size: 1.8rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-header .summary-stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.modal-header .summary-stat {
    text-align: left;
}

.modal-header .summary-stat .value {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-header .summary-stat .label {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 4px;
}

/* 區域排名卡片（在 modal header 內） */
.town-ranking-cards {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.town-ranking-card {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
}

.town-ranking-card .rank-label {
    opacity: 0.8;
}

.town-ranking-card .rank-value {
    font-weight: bold;
}

.town-ranking-card .rank-total {
    opacity: 0.6;
    font-size: 0.75rem;
}

/* 可點擊的排名卡片 */
.town-ranking-card.clickable-rank {
    cursor: pointer;
    transition: all 0.2s ease;
}

.town-ranking-card.clickable-rank:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

/* 排名表 */
.ranking-table-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.ranking-table {
    background: #f8f9fa;
    border-radius: 8px;
}

.ranking-table-header {
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    padding: 12px 15px;
    background: #e9ecef;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

.ranking-table-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background 0.2s;
}

.ranking-table-row:hover {
    background: #e9ecef;
}

.ranking-table-row:last-child {
    border-bottom: none;
}

.ranking-table-row.highlight {
    background: #e3f2fd;
    font-weight: 600;
}

.ranking-table-row .rank-num {
    color: #666;
    font-weight: bold;
}

.ranking-table-row .rank-name {
    font-weight: 500;
}

.ranking-table-row .rank-data {
    color: var(--primary-color);
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.town-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.town-list-header h4 {
    margin: 0;
    font-size: 1rem;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.sort-controls label {
    color: #666;
}

.sort-controls select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.85rem;
    cursor: pointer;
}

.sort-controls select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.town-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.town-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border: 1px solid #e9ecef;
}

.town-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.town-card .town-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 1rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

.town-card .town-info {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 4px;
}

.town-card .town-pps {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-top: 6px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: #e9ecef;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.back-btn:hover {
    background: #dee2e6;
}

/* 模態框內的返回按鈕 */
.modal-header .back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    margin-bottom: 10px;
}

.modal-header .back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 品牌統計區塊 */
.brand-stats {
    margin-bottom: 20px;
}

.brand-stats h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}

/* 模態框品牌統計按鈕 */
.brand-grid-modal {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.brand-stat-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    border-bottom: 3px solid #ccc;
    text-align: center;
}

.brand-stat-btn:hover {
    transform: translateY(-2px);
    background: #e5e5e5;
}

.brand-stat-btn.active {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.brand-stat-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    background: white;
    padding: 2px;
}

.brand-stat-name {
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.2;
}

.brand-stat-count {
    font-weight: bold;
    font-size: 0.9rem;
}

.brand-stat {
    background: #f8f9fa;
    padding: 10px 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.brand-stat.clickable {
    cursor: pointer;
}

.brand-stat.clickable:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.brand-stat.active {
    background: #e3f2fd;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.brand-stat.clear-filter {
    background: #fff3e0;
    cursor: pointer;
    justify-content: center;
}

.brand-stat.clear-filter:hover {
    background: #ffe0b2;
}

.brand-stat.clear-filter .brand-name {
    color: #e65100;
    font-weight: 500;
}

.brand-name {
    font-size: 0.85rem;
    color: #555;
}

.brand-count {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
}

/* 村里列表區塊 */
.village-section {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.village-section h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    flex-shrink: 0;
}

.village-table {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
    min-height: 150px;
    overflow-y: auto;
}

.village-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 10px 15px;
    background: #e9ecef;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    position: sticky;
    top: 0;
}

.village-header.sortable .sort-col {
    cursor: pointer;
    transition: color 0.2s;
}

.village-header.sortable .sort-col:hover {
    color: var(--primary-color);
}

.village-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 8px 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.village-row:last-child {
    border-bottom: none;
}

/* 排名標籤 */
.rank-badge {
    display: inline-block;
    background: #e9ecef;
    color: #666;
    font-size: 0.7rem;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 4px;
    font-weight: normal;
}

.rank-badge.clickable-rank-badge {
    cursor: pointer;
    transition: all 0.2s ease;
}

.rank-badge.clickable-rank-badge:hover {
    background: var(--primary-color);
    color: white;
}

.village-row:hover {
    background: #e9ecef;
}

.village-row.clickable {
    cursor: pointer;
}

.village-row.clickable:hover {
    background: #dfe6ed;
    transform: translateX(3px);
    transition: all 0.2s ease;
}

/* 店家列表區塊 */
.stores-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    margin-bottom: 20px;
}

.stores-section h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.stores-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 100px;
    overflow-y: auto;
}

.store-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.store-brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background: white;
    padding: 2px;
    border: 1px solid #e9ecef;
}

.store-brand {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    white-space: nowrap;
}

.store-name {
    font-size: 0.95rem;
    color: #333;
}

/* 操作按鈕 */
.action-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: center;
}

.locate-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.locate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* 店家詳細資訊卡片 */
.store-item-detail {
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ddd;
}

.store-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.store-address {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #555;
}

.store-services {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #888;
    line-height: 1.4;
}

.map-link {
    margin-left: auto;
    font-size: 0.8rem;
    color: #667eea;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f0f2ff;
    transition: all 0.2s ease;
}

.map-link:hover {
    background: #667eea;
    color: white;
}

/* 服務項目容器與展開按鈕 */
.store-services-container {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #888;
    line-height: 1.4;
}

.services-preview,
.services-full {
    display: inline;
}

.services-preview.hidden,
.services-full.hidden {
    display: none;
}

.expand-services-btn {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 0.75rem;
    color: #667eea;
    background: #f0f2ff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.expand-services-btn:hover {
    background: #667eea;
    color: white;
}

.expand-services-btn.expanded {
    background: #e9ecef;
    color: #666;
}