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

        body {
            font-family: 'Microsoft JhengHei', 'Noto Sans TC', 'PingFang TC', 'Segoe UI', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .container {
            max-width: 1600px;
            width: 100%;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        }

        h1 {
            text-align: center;
            color: #667eea;
            margin-bottom: 30px;
            font-size: 2.5em;
            font-weight: 600;
        }

        .wheel-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin-bottom: 40px;
        }

        .wheel-wrapper {
            position: relative;
            width: 500px;
            height: 500px;
            margin: 20px auto;
        }

        .wheel {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 8px solid #333;
            position: relative;
            overflow: hidden;
            box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
            transition: transform 7s cubic-bezier(0.17, 0.67, 0.12, 0.99);
            transform-origin: center center;
        }

        .wheel-spinning {
            transition: transform 7s cubic-bezier(0.17, 0.67, 0.12, 0.99);
        }

        .wheel-sector {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        .wheel-sector-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform-origin: 0 0;
            font-weight: bold;
            color: #fff;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7), -1px -1px 2px rgba(0, 0, 0, 0.7);
            white-space: nowrap;
            pointer-events: none;
        }

        .pointer {
            position: absolute;
            top: -20px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 20px solid transparent;
            border-right: 20px solid transparent;
            border-top: 40px solid #ff4757;
            z-index: 10;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
        }

        .result-card {
            margin: 30px 0;
            background: white;
            border-radius: 15px;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
            overflow: hidden;
            position: relative;
        }

        .result-card.hidden {
            display: none;
        }

        .result-header {
            text-align: center;
            padding: 30px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            position: relative;
            overflow: hidden;
        }

        .result-content {
            display: flex;
            position: relative;
            gap: 0;
        }

        .result-map-container {
            position: relative;
            flex: 1 1 60%;
            height: 600px;
            background: #e0e0e0;
            min-height: 600px;
            min-width: 300px;
        }

        .result-map {
            width: 100%;
            height: 100%;
            border: none;
        }

        .resizer {
            width: 4px;
            background: #667eea;
            cursor: col-resize;
            position: relative;
            flex-shrink: 0;
            transition: background 0.2s ease;
        }

        .resizer:hover {
            background: #764ba2;
        }

        .resizer::before {
            content: '';
            position: absolute;
            left: -2px;
            top: 0;
            width: 8px;
            height: 100%;
            cursor: col-resize;
        }

        .resizer.dragging {
            background: #764ba2;
        }

        .result-info {
            padding: 0;
            background: #f8f9fa;
            flex: 1 1 40%;
            height: 600px;
            min-height: 600px;
            min-width: 300px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        /* 標籤頁樣式 */
        .tabs-container {
            display: flex;
            background: white;
            border-bottom: 2px solid #e0e0e0;
            overflow-x: auto;
        }

        .tab-button {
            flex: 1;
            padding: 15px 20px;
            background: transparent;
            border: none;
            border-bottom: 3px solid transparent;
            cursor: pointer;
            font-size: 1em;
            font-weight: 600;
            color: #666;
            transition: all 0.3s ease;
            white-space: nowrap;
            min-width: 120px;
        }

        .tab-button:hover {
            background: rgba(102, 126, 234, 0.1);
            color: #667eea;
        }

        .tab-button.active {
            color: #667eea;
            border-bottom-color: #667eea;
            background: rgba(102, 126, 234, 0.05);
        }

        .tab-content {
            flex: 1;
            overflow-y: auto;
            padding: 30px;
            display: none;
        }

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

        .tab-content h3 {
            color: #667eea;
            margin-bottom: 15px;
            font-size: 1.3em;
        }

        .tab-content h4 {
            color: #667eea;
            margin-bottom: 15px;
            font-size: 1.2em;
        }

        .tab-content p {
            color: #555;
            line-height: 1.8;
            font-size: 1em;
            text-align: justify;
            margin-bottom: 20px;
        }

        .vegetarian-shops {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }

        .vegetarian-shops h4 {
            color: #667eea;
            margin-bottom: 15px;
            font-size: 1.2em;
        }

        .attractions-section {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }

        .attractions-section h4 {
            color: #667eea;
            margin-bottom: 15px;
            font-size: 1.2em;
        }

        .accommodations-section {
            margin-top: 0;
            padding-top: 0;
            border-top: none;
        }

        .accommodations-section h4 {
            color: #667eea;
            margin-bottom: 15px;
            font-size: 1.2em;
        }

        .shop-list {
            list-style: none;
            padding: 0;
        }

        .shop-item {
            background: white;
            padding: 12px 15px;
            margin-bottom: 10px;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s ease;
        }

        .shop-item:hover {
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
            transform: translateY(-2px);
        }

        .shop-name {
            font-weight: 600;
            color: #333;
            font-size: 1em;
        }

        .shop-rating {
            color: #ffa502;
            font-size: 0.9em;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .loading-shops {
            text-align: center;
            color: #999;
            padding: 20px;
            font-style: italic;
        }

        .no-shops {
            text-align: center;
            color: #999;
            padding: 20px;
        }

        .attractions-section {
            margin-top: 30px;
            padding-top: 20px;
            border-top: 2px solid #e0e0e0;
        }

        .attractions-section h4 {
            color: #667eea;
            margin-bottom: 15px;
            font-size: 1.2em;
        }

        .attraction-list {
            list-style: none;
            padding: 0;
        }

        .attraction-item {
            background: white;
            padding: 12px 15px;
            margin-bottom: 10px;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s ease;
        }

        .attraction-item:hover {
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
            transform: translateY(-2px);
        }

        .attraction-name {
            font-weight: 600;
            color: #333;
            font-size: 1em;
        }

        .attraction-rating {
            color: #ffa502;
            font-size: 0.9em;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .loading-attractions {
            text-align: center;
            color: #999;
            padding: 20px;
            font-style: italic;
        }

        .no-attractions {
            text-align: center;
            color: #999;
            padding: 20px;
        }

        .accommodations-section {
            margin-top: 30px;
            padding-top: 20px;
            border-top: 2px solid #e0e0e0;
        }

        .accommodations-section h4 {
            color: #667eea;
            margin-bottom: 15px;
            font-size: 1.2em;
        }

        .accommodation-list {
            list-style: none;
            padding: 0;
        }

        .accommodation-item {
            background: white;
            padding: 12px 15px;
            margin-bottom: 10px;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s ease;
        }

        .accommodation-item:hover {
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
            transform: translateY(-2px);
        }

        .accommodation-name {
            font-weight: 600;
            color: #333;
            font-size: 1em;
        }

        .accommodation-rating {
            color: #ffa502;
            font-size: 0.9em;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .loading-accommodations {
            text-align: center;
            color: #999;
            padding: 20px;
            font-style: italic;
        }

        .no-accommodations {
            text-align: center;
            color: #999;
            padding: 20px;
        }

        @media (max-width: 768px) {
            .result-content {
                flex-direction: column;
            }
            
            .resizer {
                width: 100%;
                height: 4px;
                cursor: row-resize;
            }
            
            .resizer::before {
                left: 0;
                top: -2px;
                width: 100%;
                height: 8px;
                cursor: row-resize;
            }
            
            .result-map-container {
                flex: 1 1 auto;
                min-width: auto;
            }
            
            .result-info {
                flex: 1 1 auto;
                min-width: auto;
                height: 500px;
                min-height: 500px;
            }
            
            .tabs-container {
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
            
            .tab-button {
                padding: 12px 15px;
                font-size: 0.9em;
                min-width: 100px;
            }
            
            .tab-content {
                padding: 20px;
            }
            
            .settings-toggle-btn {
                top: 20px;
                width: 45px;
                height: 45px;
                font-size: 1.3em;
            }
            
            .settings-panel {
                width: 100%;
                right: -100%;
            }
            
            .container {
                max-width: 100%;
                padding: 20px;
            }
        }

        .fireworks-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            overflow: hidden;
        }

        .firework {
            position: absolute;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            animation: firework-explode 0.5s ease-out forwards;
        }

        @keyframes firework-explode {
            0% {
                transform: scale(1);
                opacity: 1;
            }
            100% {
                transform: scale(0);
                opacity: 0;
            }
        }

        .firework-particle {
            position: absolute;
            width: 4px;
            height: 4px;
            border-radius: 50%;
            animation: particle-fly 1s ease-out forwards;
        }

        @keyframes particle-fly {
            0% {
                transform: translate(0, 0) scale(1);
                opacity: 1;
            }
            100% {
                transform: translate(var(--dx), var(--dy)) scale(0);
                opacity: 0;
            }
        }

        .button {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 15px 40px;
            font-size: 1.2em;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
            font-weight: 600;
        }

        .button:hover {
            transform: translateY(-2px);
            box-shadow: 0 7px 20px rgba(102, 126, 234, 0.6);
        }

        .button:active {
            transform: translateY(0);
        }

        .button:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .history-section {
            margin-top: 40px;
            padding: 20px;
            background: rgba(248, 249, 250, 0.8);
            border-radius: 15px;
        }

        .history-title {
            font-size: 1.5em;
            color: #667eea;
            margin-bottom: 20px;
            font-weight: 600;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .history-actions {
            display: flex;
            gap: 10px;
        }

        .btn-delete {
            background: #ff4757;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.9em;
            transition: all 0.3s ease;
        }

        .btn-delete:hover {
            background: #ff3838;
            transform: translateY(-1px);
        }

        .btn-delete-all {
            background: #ff6348;
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.9em;
            transition: all 0.3s ease;
        }

        .btn-delete-all:hover {
            background: #ff4757;
            transform: translateY(-1px);
        }

        .btn-delete-item {
            background: #ff6b81;
            color: white;
            border: none;
            padding: 5px 12px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.85em;
            transition: all 0.3s ease;
            margin-right: 5px;
        }

        .btn-delete-item:hover {
            background: #ff4757;
        }

        .btn-load-item {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 5px 12px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.85em;
            transition: all 0.3s ease;
            box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
        }

        .btn-load-item:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
        }

        .history-table th:last-child,
        .history-table td:last-child {
            text-align: center;
        }

        .history-table {
            width: 100%;
            border-collapse: collapse;
            background: white;
            border-radius: 10px;
            overflow: hidden;
        }

        .history-table th,
        .history-table td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #e0e0e0;
        }

        .history-table th {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            font-weight: 600;
        }

        .history-table tr:hover {
            background: rgba(102, 126, 234, 0.1);
        }

        .history-table tr:last-child td {
            border-bottom: none;
        }

        .stats {
            text-align: center;
            margin: 20px 0;
            color: #666;
            font-size: 1.1em;
        }

        .api-key-section {
            background: rgba(248, 249, 250, 0.8);
            padding: 20px;
            border-radius: 15px;
            margin-bottom: 30px;
            border: 1px solid #e0e0e0;
        }

        .api-key-title {
            font-size: 1.2em;
            color: #667eea;
            margin-bottom: 15px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .api-key-form {
            display: flex;
            gap: 10px;
            align-items: center;
            flex-wrap: wrap;
        }

        .api-key-input {
            flex: 1;
            min-width: 300px;
            padding: 12px 15px;
            border: 2px solid #e0e0e0;
            border-radius: 8px;
            font-size: 1em;
            transition: all 0.3s ease;
        }

        .api-key-input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        .btn-save-api {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1em;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        }

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

        .btn-clear-api {
            background: #ff6b81;
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1em;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .btn-clear-api:hover {
            background: #ff4757;
            transform: translateY(-2px);
        }

        .api-key-status {
            margin-top: 10px;
            font-size: 0.9em;
            color: #666;
        }

        .api-key-status.success {
            color: #2ed573;
        }

        .api-key-status.error {
            color: #ff4757;
        }

        .api-key-help {
            margin-top: 10px;
            font-size: 0.85em;
            color: #999;
            line-height: 1.6;
        }

        .api-key-help a {
            color: #667eea;
            text-decoration: none;
        }

        .api-key-help a:hover {
            text-decoration: underline;
        }

        /* API 設定面板樣式 */
        .settings-panel {
            position: fixed;
            top: 0;
            right: -450px;
            width: 450px;
            height: 100vh;
            background: white;
            box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
            z-index: 2000;
            transition: right 0.3s ease;
            overflow-y: auto;
            padding: 0;
        }

        .settings-panel.open {
            right: 0;
        }

        .settings-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .settings-header h2 {
            margin: 0;
            font-size: 1.5em;
            font-weight: 600;
        }

        .settings-close-btn {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.5em;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }

        .settings-close-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: rotate(90deg);
        }

        .settings-content {
            padding: 30px;
        }

        .settings-section {
            margin-bottom: 30px;
        }

        .settings-section-title {
            font-size: 1.2em;
            color: #667eea;
            margin-bottom: 15px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .settings-toggle-btn {
            position: fixed;
            top: 80px;
            right: 20px;
            z-index: 1500;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.5em;
            box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .settings-toggle-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
        }

        .settings-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1500;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .settings-overlay.show {
            opacity: 1;
            visibility: visible;
        }

        .api-key-section {
            background: rgba(248, 249, 250, 0.8);
            padding: 20px;
            border-radius: 15px;
            margin-bottom: 30px;
            border: 1px solid #e0e0e0;
            display: none;
        }

        .api-key-section.in-settings {
            display: block;
            margin-bottom: 0;
        }

/* 簡化轉盤：中央站名 */
.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    height: 55%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.97);
    border: 4px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    padding: 16px;
    text-align: center;
}

.wheel-center-label {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 6px;
}

.wheel-center-station {
    font-size: 1.6em;
    font-weight: 700;
    color: #667eea;
    line-height: 1.3;
    word-break: break-all;
}

.wheel-center-city {
    font-size: 0.95em;
    color: #666;
    margin-top: 6px;
}

@media (max-width: 768px) {
    .wheel-wrapper {
        width: min(90vw, 400px);
        height: min(90vw, 400px);
    }

    .wheel-center-station {
        font-size: 1.3em;
    }
}

/* Phase 3/4 UI */
.progress-track {
    width: 100%;
    max-width: 500px;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    margin: 10px auto;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
}
.rule-hint {
    font-size: 0.85em;
    color: #888;
    margin-top: 8px;
}
.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}
.button-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: none;
}
.button-secondary:hover {
    background: rgba(102, 126, 234, 0.1);
}
.btn-share, .btn-export {
    margin-top: 12px;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: rgba(255,255,255,0.25);
    color: white;
    cursor: pointer;
    font-size: 0.9em;
}
.btn-export {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.poi-info { flex: 1; }
.poi-name { font-weight: 600; color: #333; }
.poi-address { font-size: 0.85em; color: #999; margin-top: 4px; }
.poi-distance { font-size: 0.8em; color: #667eea; font-weight: normal; }
.poi-map-link { display: inline-block; margin-top: 6px; font-size: 0.8em; color: #667eea; }
.poi-rating { color: #ffa502; min-width: 70px; text-align: right; }
.fallback-box { text-align: center; padding: 20px; }
.fallback-link {
    display: inline-block; padding: 10px 20px; margin-top: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white; text-decoration: none; border-radius: 20px;
}
.loading-text { text-align: center; color: #999; padding: 20px; font-style: italic; }
.settings-note { font-size: 0.9em; color: #666; line-height: 1.7; }
.status-box { background: #f8f9fa; padding: 15px; border-radius: 10px; font-size: 0.9em; }
.shop-item, .attraction-item, .accommodation-item {
    display: flex; justify-content: space-between; align-items: flex-start;
    background: white; padding: 12px 15px; margin-bottom: 10px;
    border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.08);
}
