/* ===== 基礎設定 ===== */
:root {
    /* 主色調 */
    --primary: #ff6b35;
    --primary-light: #ff8c5a;
    --primary-dark: #e55a2b;

    /* 背景色 */
    --bg-dark: #0f0f1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.1);

    /* 文字色 */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);

    /* 漸層 */
    --gradient-primary: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    --gradient-bg: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);

    /* 陰影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(255, 107, 53, 0.3);

    /* 圓角 */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    /* 動畫 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gradient-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== 動態背景 ===== */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.floating-emoji {
    position: absolute;
    font-size: 3rem;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.floating-emoji:nth-child(1) {
    left: 5%;
    top: 10%;
    animation-delay: 0s;
}

.floating-emoji:nth-child(2) {
    left: 85%;
    top: 15%;
    animation-delay: 2s;
}

/* 返回連結 */
.back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    transition: color var(--transition-normal);
}

.back-link:hover {
    color: var(--primary);
}

.floating-emoji:nth-child(3) {
    left: 15%;
    top: 60%;
    animation-delay: 4s;
}

.floating-emoji:nth-child(4) {
    left: 75%;
    top: 70%;
    animation-delay: 6s;
}

.floating-emoji:nth-child(5) {
    left: 45%;
    top: 85%;
    animation-delay: 8s;
}

.floating-emoji:nth-child(6) {
    left: 90%;
    top: 50%;
    animation-delay: 10s;
}

.floating-emoji:nth-child(7) {
    left: 25%;
    top: 30%;
    animation-delay: 12s;
}

.floating-emoji:nth-child(8) {
    left: 60%;
    top: 40%;
    animation-delay: 14s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-30px) rotate(10deg);
    }

    50% {
        transform: translateY(0) rotate(0deg);
    }

    75% {
        transform: translateY(20px) rotate(-10deg);
    }
}

/* ===== 容器 ===== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===== 標題區 ===== */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 900;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.title-emoji {
    font-size: 0.9em;
    -webkit-text-fill-color: initial;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ===== 步驟區 ===== */
.step-section {
    margin-bottom: 2.5rem;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: var(--shadow-glow);
}

.step-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* ===== 預算卡片 ===== */
.budget-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .budget-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .budget-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 框金欸特殊樣式 */
.budget-ultimate {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(251, 191, 36, 0.1) 100%);
    border-color: rgba(234, 179, 8, 0.3);
}

.budget-ultimate:hover {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.3) 0%, rgba(251, 191, 36, 0.2) 100%);
    border-color: rgba(234, 179, 8, 0.5);
}

.budget-ultimate.active {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.4) 0%, rgba(251, 191, 36, 0.3) 100%);
    border-color: #eab308;
    box-shadow: 0 0 30px rgba(234, 179, 8, 0.4);
}

.budget-card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.budget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.budget-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.budget-card.active {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.budget-card.active::before {
    opacity: 0.2;
}

.budget-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.budget-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.budget-range {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== 料理類型 ===== */
.cuisine-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .cuisine-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cuisine-btn {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.cuisine-btn:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.cuisine-btn.active {
    border-color: var(--primary);
    background: rgba(255, 107, 53, 0.2);
    box-shadow: var(--shadow-glow);
}

/* 隨機按鈕特殊樣式 */
.cuisine-random {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    border-color: rgba(147, 51, 234, 0.3);
}

.cuisine-random:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.3) 0%, rgba(236, 72, 153, 0.3) 100%);
    border-color: rgba(147, 51, 234, 0.5);
}

.cuisine-random.active {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.4) 0%, rgba(236, 72, 153, 0.4) 100%);
    border-color: #9333ea;
    box-shadow: 0 0 30px rgba(147, 51, 234, 0.3);
}

.cuisine-emoji {
    font-size: 2rem;
}

.cuisine-name {
    font-size: 1rem;
    font-weight: 500;
}

/* 自訂料理輸入 */
.custom-cuisine-container {
    margin-top: 1.5rem;
    text-align: center;
}

.custom-cuisine-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.custom-cuisine-input-wrapper {
    display: flex;
    gap: 0.75rem;
    max-width: 500px;
    margin: 0 auto;
}

.custom-cuisine-input {
    flex: 1;
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-normal);
}

.custom-cuisine-input::placeholder {
    color: var(--text-muted);
}

.custom-cuisine-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.custom-cuisine-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.custom-cuisine-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

@media (max-width: 480px) {
    .custom-cuisine-input-wrapper {
        flex-direction: column;
    }

    .custom-cuisine-btn {
        justify-content: center;
    }
}

/* ===== 外送搜尋入口按鈕 ===== */
.delivery-entry-section {
    margin-top: -0.5rem;
    margin-bottom: 0.5rem;
}

.delivery-entry-btn {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(255, 183, 77, 0.15) 100%);
    border: 2px solid rgba(255, 107, 53, 0.4);
    border-radius: var(--radius-xl);
    padding: 1.25rem 2rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
}

.delivery-entry-btn:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.35) 0%, rgba(255, 183, 77, 0.25) 100%);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(255, 107, 53, 0.3);
}

.delivery-entry-icon {
    font-size: 1.75rem;
}

.delivery-entry-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.delivery-entry-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform var(--transition-normal);
}

.delivery-entry-btn:hover .delivery-entry-arrow {
    transform: translateX(5px);
}

/* 外送區塊關閉按鈕 */
.delivery-section .step-header {
    position: relative;
}

.delivery-close-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.delivery-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

/* ===== 外送平台區塊 ===== */
.delivery-section {
    margin-top: -0.5rem;
    margin-bottom: 2.5rem;
}

.delivery-hint {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.delivery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.delivery-btn {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.delivery-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.delivery-btn:not(:disabled):hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.delivery-logo {
    font-size: 1.5rem;
}

.delivery-name {
    font-weight: 600;
}

/* Uber Eats 綠色主題 */
.uber-btn {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.15) 0%, rgba(6, 214, 160, 0.08) 100%);
    border-color: rgba(0, 200, 83, 0.3);
}

.uber-btn:not(:disabled):hover {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.25) 0%, rgba(6, 214, 160, 0.15) 100%);
    border-color: rgba(0, 200, 83, 0.6);
    box-shadow: 0 8px 30px rgba(0, 200, 83, 0.3);
}

/* Foodpanda 粉色主題 */
.foodpanda-btn {
    background: linear-gradient(135deg, rgba(255, 45, 108, 0.15) 0%, rgba(255, 107, 157, 0.08) 100%);
    border-color: rgba(255, 45, 108, 0.3);
}

.foodpanda-btn:not(:disabled):hover {
    background: linear-gradient(135deg, rgba(255, 45, 108, 0.25) 0%, rgba(255, 107, 157, 0.15) 100%);
    border-color: rgba(255, 45, 108, 0.6);
    box-shadow: 0 8px 30px rgba(255, 45, 108, 0.3);
}

@media (max-width: 480px) {
    .delivery-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 篩選功能 ===== */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.filter-select option {
    background: #1a1a2e;
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-normal);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

.toggle-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* 外送搜尋載入動畫 */
.delivery-loading {
    text-align: center;
    padding: 2rem;
    margin-top: 1.5rem;
}

.delivery-loading p {
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* 外送搜尋結果 */
.delivery-results {
    margin-top: 1.5rem;
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.delivery-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.delivery-results-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.delivery-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* 外送餐廳卡片 */
.delivery-restaurant-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-normal);
}

.delivery-restaurant-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.delivery-restaurant-rank {
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.delivery-restaurant-rank.top-3 {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
}

.delivery-restaurant-info {
    flex: 1;
    min-width: 0;
}

.delivery-restaurant-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.delivery-restaurant-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.delivery-restaurant-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #fbbf24;
    font-size: 0.9rem;
}

.delivery-restaurant-price {
    color: #4ade80;
    font-size: 0.9rem;
    font-weight: 500;
}

.delivery-restaurant-platform {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.delivery-restaurant-platform.uber {
    background: rgba(0, 200, 83, 0.2);
    color: #00c853;
}

.delivery-restaurant-platform.foodpanda {
    background: rgba(255, 45, 108, 0.2);
    color: #ff2d6c;
}

/* 無結果提示 */
.delivery-no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* 外送卡片新增樣式 */
.delivery-card .restaurant-image-placeholder {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.2) 0%, rgba(255, 107, 53, 0.1) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    flex-shrink: 0;
}

.delivery-price-badge {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.delivery-time-badge {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.delivery-results-list .restaurant-card {
    margin-bottom: 1rem;
}

.delivery-results-list .restaurant-card:last-child {
    margin-bottom: 0;
}

/* ===== 距離滑桿 ===== */
.distance-slider-container {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

/* 地點選擇 */
.location-selection {
    margin-bottom: 1.5rem;
}

.location-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.location-tab {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.location-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.location-tab.active {
    background: rgba(255, 107, 53, 0.2);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* 地區選擇下拉 */
.region-select-container {
    margin-bottom: 0.75rem;
}

.region-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    transition: all var(--transition-normal);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
}

.region-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.region-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.region-select option {
    background: #1a1a2e;
    color: var(--text-primary);
    padding: 0.5rem;
}

.region-select optgroup {
    background: #0f0f1a;
    color: var(--primary);
    font-weight: 600;
}

/* 智慧地點搜尋 */
.location-search-container {
    margin-bottom: 0.75rem;
}

.autocomplete-wrapper {
    position: relative;
}

.location-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-normal);
}

.location-search-input::placeholder {
    color: var(--text-muted);
}

.location-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-results.show {
    display: block;
}

.autocomplete-item {
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: rgba(255, 107, 53, 0.15);
}

.autocomplete-item-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.autocomplete-item-text {
    flex: 1;
}

.autocomplete-item-main {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.autocomplete-item-sub {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.autocomplete-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
}

.search-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.location-input-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.location-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-normal);
}

.location-input::placeholder {
    color: var(--text-muted);
}

.location-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.location-search-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.location-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.location-search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.location-status {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.location-status.success {
    color: #4ade80;
}

.location-status.error {
    color: #f87171;
}

.distance-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0;
}

@media (max-width: 480px) {
    .location-tabs {
        flex-direction: column;
    }

    .location-input-container {
        flex-direction: column;
    }
}

.distance-display {
    text-align: center;
    margin-bottom: 1.5rem;
}

.distance-value {
    font-size: 4rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.distance-unit {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

.distance-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.distance-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: transform var(--transition-fast);
}

.distance-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.distance-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow-glow);
}

.distance-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== 搜尋按鈕 ===== */
.search-section {
    text-align: center;
    margin-top: 2rem;
}

.search-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-xl);
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.search-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
}

.search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-btn:active:not(:disabled) {
    transform: translateY(0);
}

.search-icon {
    font-size: 1.5rem;
}

.location-hint {
    margin-top: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.location-hint.success {
    color: #4ade80;
}

.location-hint.error {
    color: #f87171;
}

/* ===== 結果區 ===== */
.results-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 載入動畫 */
.loading-container {
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* AI 推薦 */
.ai-recommendation {
    background: linear-gradient(145deg, rgba(255, 107, 53, 0.15) 0%, rgba(247, 147, 30, 0.05) 100%);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ai-icon {
    font-size: 1.5rem;
}

.ai-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-content {
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
}

/* 搜尋摘要 */
.search-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
}

.budget-tag {
    background: rgba(255, 107, 53, 0.2);
    color: var(--primary-light);
}

.cuisine-tag {
    background: rgba(147, 51, 234, 0.2);
    color: #c084fc;
}

.distance-tag {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.result-count {
    color: var(--text-muted);
}

.result-count span {
    color: var(--primary);
    font-weight: 700;
}

/* 餐廳列表 */
.restaurant-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.restaurant-card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    display: flex;
}

@media (max-width: 640px) {
    .restaurant-card {
        flex-direction: column;
    }
}

.restaurant-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.restaurant-rank {
    width: 80px;
    min-height: 100%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
}

@media (max-width: 640px) {
    .restaurant-rank {
        width: 100%;
        min-height: 50px;
        font-size: 1.5rem;
    }
}

.restaurant-rank.top-3 {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
}

.restaurant-content {
    flex: 1;
    display: flex;
    padding: 1.25rem;
    gap: 1.25rem;
}

@media (max-width: 640px) {
    .restaurant-content {
        flex-direction: column;
    }
}

.restaurant-image {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .restaurant-image {
        width: 100%;
        height: 180px;
    }
}

.restaurant-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.restaurant-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.restaurant-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #fbbf24;
    font-size: 1rem;
}

.star.empty {
    color: rgba(255, 255, 255, 0.2);
}

.rating-number {
    font-weight: 600;
    color: var(--primary);
}

.rating-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.restaurant-distance {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.restaurant-address {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.restaurant-status {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-open {
    color: #4ade80;
}

.status-closed {
    color: #f87171;
}

.restaurant-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn.primary {
    background: var(--gradient-primary);
    color: white;
}

.action-btn.primary:hover {
    box-shadow: var(--shadow-glow);
}

.action-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* 無結果 */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-muted);
}

/* ===== 頁尾 ===== */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer strong {
    color: var(--primary);
}

/* ===== 響應式調整 ===== */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .hero {
        padding: 2rem 0 1.5rem;
    }

    .title {
        flex-direction: column;
    }

    .step-section {
        margin-bottom: 2rem;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }
}