:root {
    --primary-color: #ff4081;
    /* Pinkish red */
    --secondary-color: #ff9100;
    /* Orange */
    --accent-color: #00b0ff;
    /* Blue */
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    color: var(--dark-color);
    background-color: var(--light-color);
}

/* Top Bar */
.top-bar {
    background: linear-gradient(90deg, #b00247, var(--primary-color));
    font-size: 0.9rem;
}

/* Navbar */
.navbar-brand .fa-paw {
    color: var(--primary-color) !important;
}

.brand-text {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navbar nav link size: slightly smaller than fs-5 for better balance */
.navbar-nav .nav-link {
    font-size: 1.05rem;
    transition: color 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 100%;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 400px);
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 600px;
    background-image: url('https://picsum.photos/id/1018/1920/1080');
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    /* iOS Safari 對 fixed 有 bug，改為 scroll */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    width: 100%;
    padding: 0 16px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* Search Bar */
.search-box {
    background: white;
    padding: 20px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.search-box .form-control,
.search-box .form-select {
    border: none;
    box-shadow: none;
    background: #f1f3f5;
    border-radius: 30px;
    padding: 12px 20px;
}

.search-box .form-control:focus,
.search-box .form-select:focus {
    background: #e9ecef;
    box-shadow: 0 0 0 0.25rem rgba(255, 64, 129, 0.25);
}

.search-box .btn-search {
    background: linear-gradient(45deg, var(--secondary-color), #ff5722);
    border: none;
    border-radius: 30px;
    padding: 12px 30px;
    color: white;
    font-weight: bold;
    transition: all 0.3s;
    width: 100%;
}

.search-box .btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 145, 0, 0.5);
    color: white;
}

/* Section Titles */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title h2 {
    font-weight: 800;
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 4px;
    background: var(--primary-color);
    bottom: 0;
    left: 25%;
    border-radius: 2px;
}

.section-title p {
    color: var(--gray-color);
    margin-top: 10px;
}

/* Tour Cards */
.tour-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background: white;
    height: 100%;
}

.tour-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.tour-img-wrap {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.tour-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.tour-card:hover .tour-img-wrap img {
    transform: scale(1.1);
}

.tour-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 2;
}

.tour-content {
    padding: 20px;
}

.tour-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--dark-color);
    text-decoration: none;
    transition: color 0.3s;
}

.tour-title:hover {
    color: var(--primary-color);
}

.tour-meta {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 15px;
}

.tour-price-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.tour-price {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: 800;
}

.tour-price small {
    font-size: 0.9rem;
    color: var(--gray-color);
    font-weight: normal;
}

.btn-outline-primary-custom {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 20px;
}

.btn-outline-primary-custom:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Booking CTA Section */
.booking-cta-section {
    position: relative;
    min-height: 280px;
    background-image: url('https://picsum.photos/id/1060/1920/600');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.booking-cta-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.booking-cta-content {
    position: relative;
    z-index: 1;
    padding: 0 16px;
}

.booking-cta-title {
    font-size: 2.2rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,.6);
    letter-spacing: .05em;
}

.booking-cta-subtitle {
    font-size: 1.1rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,.5);
}

.btn-booking {
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 2px;
    letter-spacing: .08em;
    transition: background .25s, color .25s;
}

.btn-booking:hover {
    background: #fff;
    color: #2c3e50;
}

/* Feature Circle Cards for Themes */
.theme-circle {
    text-align: center;
    margin-bottom: 30px;
    display: block;
    text-decoration: none;
}

.theme-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 15px;
    position: relative;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border: 5px solid white;
    transition: all 0.3s ease;
}

.theme-circle:hover .theme-img {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.theme-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.theme-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-circle:hover .theme-overlay {
    background: rgba(0, 0, 0, 0.1);
}

.theme-title {
    font-weight: 800;
    font-size: 1.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.theme-circle p {
    color: var(--dark-color);
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 15px;
    transition: color 0.3s;
}

.theme-circle:hover p {
    color: var(--primary-color);
}

/* Footer override */
.site-footer a {
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: var(--primary-color) !important;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Utilities */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.text-primary-custom {
    color: var(--primary-color) !important;
}

@media (max-width: 768px) {

    /* Hero 縮小高度，移除 fixed 附著效果 */
    .hero-section {
        height: 420px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* 搜尋框在手機版圓角改小一點，避免 overflow */
    .search-box {
        padding: 16px;
        border-radius: 20px;
        margin: 0 -8px;
    }

    .search-box .row>div {
        margin-bottom: 10px;
    }

    .theme-img {
        width: 150px;
        height: 150px;
    }

    /* Navbar 展開時字體大小正常化 */
    .navbar-nav {
        font-size: 1rem !important;
    }

    .navbar-nav .nav-item {
        padding: 0 !important;
    }

    /* 行程查詢頁 hero 縮小高度 */
    .hero-section-blue {
        height: 240px;
    }

    .hero-section-blue .hero-title {
        font-size: 2.2rem;
    }

    .hero-section-blue .hero-subtitle {
        font-size: 0.95rem;
    }
}

/* =============================================
   行程查詢頁 — 藍色主題
   ============================================= */

/* Blue theme variables for search page */
:root {
    --blue-primary: #1565C0;
    --blue-secondary: #1976D2;
    --blue-light: #42A5F5;
    --blue-accent: #E3F2FD;
    --blue-dark: #0D47A1;
}

/* Hero Banner — Blue */
.hero-section-blue {
    position: relative;
    height: 320px;
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-secondary) 50%, var(--blue-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.hero-section-blue::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 60%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 40%);
    animation: rotateBg 20s linear infinite;
}

@keyframes rotateBg {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hero-section-blue .hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-section-blue .hero-title {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
}

.hero-section-blue .hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Toast-icon floating bubbles in hero */
.hero-bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-bubbles span {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    animation: floatUp 8s ease-in-out infinite;
}

@keyframes floatUp {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: .4;
    }

    50% {
        transform: translateY(-30px) scale(1.05);
        opacity: .15;
    }
}

/* ---- Search Panel ---- */
.search-panel-tour {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(21, 101, 192, 0.12);
    padding: 2rem;
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

.search-panel-tour .nav-tabs {
    border-bottom: 2px solid #e8f0fe;
    margin-bottom: 1.5rem;
}

.search-panel-tour .nav-tabs .nav-link {
    border: none;
    color: #666;
    font-weight: 600;
    padding: 0.7rem 1.5rem;
    border-radius: 10px 10px 0 0;
    transition: all .2s;
}

.search-panel-tour .nav-tabs .nav-link.active {
    color: var(--blue-primary);
    background: var(--blue-accent);
    border-bottom: 3px solid var(--blue-primary);
}

.search-panel-tour .nav-tabs .nav-link:hover:not(.active) {
    color: var(--blue-secondary);
    background: #f5f9ff;
}

/* Form controls in search panel */
.search-panel-tour .form-select,
.search-panel-tour .form-control {
    border-radius: 10px;
    border-color: #d0e3f8;
    padding: 0.65rem 1rem;
}

.search-panel-tour .form-select:focus,
.search-panel-tour .form-control:focus {
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 0.2rem rgba(21, 101, 192, .15);
}

.btn-blue-search {
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-light));
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.65rem 2rem;
    font-weight: 700;
    transition: all .3s;
    box-shadow: 0 4px 15px rgba(21, 101, 192, .3);
}

.btn-blue-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(21, 101, 192, .4);
    color: white;
}

/* ---- Interactive Mini Calendar ---- */
.mini-calendar {
    user-select: none;
}

.mini-calendar .cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--blue-primary);
    margin-bottom: 0.6rem;
}

.mini-calendar .cal-header button {
    background: none;
    border: none;
    color: var(--blue-primary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 6px;
}

.mini-calendar table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 3px;
}

.mini-calendar th {
    text-align: center;
    font-size: 0.75rem;
    color: #888;
    padding-bottom: 4px;
}

.mini-calendar td {
    text-align: center;
}

.mini-calendar .cal-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 0.85rem;
    cursor: default;
    color: #ccc;
}

.mini-calendar .cal-day.has-tour {
    cursor: pointer;
    color: var(--blue-dark);
    font-weight: 600;
    background: var(--blue-accent);
    transition: all .2s;
}

.mini-calendar .cal-day.has-tour:hover,
.mini-calendar .cal-day.has-tour.selected {
    background: var(--blue-primary);
    color: white;
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(21, 101, 192, .4);
}

.mini-calendar .cal-day.today {
    border: 2px solid var(--blue-light);
}

/* ---- Result Calendar (Mode 1) ---- */
.result-calendar {
    width: 100%;
    border-collapse: separate;
    border-spacing: 6px;
}

.result-calendar th {
    text-align: center;
    padding: 8px;
    color: var(--blue-primary);
    font-weight: 700;
    font-size: 0.9rem;
}

.result-calendar td {
    text-align: center;
    vertical-align: top;
    padding: 0;
}

.result-calendar .rc-day {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all .2s;
    cursor: default;
    color: #ccc;
}

.result-calendar .rc-day.active-date {
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-light));
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(21, 101, 192, .35);
    transform: scale(1.05);
}

.result-calendar .rc-day.active-date:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 18px rgba(21, 101, 192, .5);
}

.result-calendar .rc-day .rc-weekday {
    font-size: 0.6rem;
    opacity: .8;
}

/* ---- Tour Result Cards (horizontal layout) ---- */
.tour-result-card {
    display: flex;
    align-items: stretch;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .07);
    overflow: hidden;
    transition: all .3s ease;
    margin-bottom: 1rem;
    border: 1px solid #f0f4ff;
}

.tour-result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(21, 101, 192, .15);
    border-color: #c5d8f8;
}

/* Code block: wraps letter + date on the left side of each result card */
/* Note: .chip-X class is also applied here (for mobile full-width background),
   but on desktop we override back to transparent — chip itself provides the colour */
.tour-code-block {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 72px;
    flex-shrink: 0;
    background: transparent !important;
    /* chip-X on parent only used on mobile */
}

/* Code chip on left */
.tour-code-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-width: 72px;
    font-size: 2rem;
    font-weight: 900;
    color: white;
    letter-spacing: -1px;
    padding: 0 10px;
}

/* Date label below the code chip -- desktop: visible bottom strip */
.tour-card-date {
    background: rgba(0, 0, 0, .22);
    color: white;
    font-size: 0.8rem;
    font-weight: 800;
    text-align: center;
    padding: 6px 8px;
    white-space: nowrap;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.chip-A {
    background: linear-gradient(180deg, #1565C0, #1976D2);
}

.chip-B {
    background: linear-gradient(180deg, #6A1B9A, #8E24AA);
}

.chip-C {
    background: linear-gradient(180deg, #00838F, #00ACC1);
}

.chip-D {
    background: linear-gradient(180deg, #2E7D32, #43A047);
}

.chip-E {
    background: linear-gradient(180deg, #E65100, #FB8C00);
}

.tour-result-body {
    flex: 1;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tour-result-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.tour-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.82rem;
    color: #666;
    margin-bottom: 0.3rem;
}

/* Early departure badge */
.badge-early {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #1a237e, #3949AB);
    color: white;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(26, 35, 126, .3);
}

.tour-dates-available {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 0.4rem;
}

.date-chip {
    background: var(--blue-accent);
    color: var(--blue-dark);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tour-result-actions {
    display: flex;
    align-items: center;
    padding: 1rem;
    gap: 8px;
    flex-direction: column;
    justify-content: center;
}

.btn-tour-detail {
    background: var(--blue-accent);
    color: var(--blue-primary);
    border: 1.5px solid #c5d8f8;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    transition: all .2s;
}

.btn-tour-detail:hover {
    background: var(--blue-primary);
    color: white;
    border-color: var(--blue-primary);
}

.btn-tour-book {
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-light));
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    transition: all .2s;
    box-shadow: 0 3px 10px rgba(21, 101, 192, .3);
}

.btn-tour-book:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(21, 101, 192, .45);
    color: white;
}

/* ---- Detail Modal ---- */
.modal-tour-detail .modal-header {
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-secondary));
    color: white;
    border-radius: 16px 16px 0 0;
}

.modal-tour-detail .modal-header .btn-close {
    filter: invert(1);
}

.modal-tour-detail .modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 60px rgba(21, 101, 192, .2);
}

.boarding-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.boarding-table th {
    background: var(--blue-accent);
    color: var(--blue-dark);
    padding: 8px 12px;
    font-weight: 700;
    border: 1px solid #d0e3f8;
}

.boarding-table td {
    padding: 8px 12px;
    border: 1px solid #eef4ff;
    vertical-align: middle;
}

.boarding-table tr:nth-child(even) td {
    background: #f8fbff;
}

.time-badge-early {
    display: inline-block;
    background: #1a237e;
    color: white;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 0.8rem;
    font-weight: 700;
}

.time-badge-normal {
    display: inline-block;
    background: #1565C0;
    color: white;
    border-radius: 4px;
    padding: 1px 7px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ---- Result section heading ---- */
.result-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--blue-accent);
}

.result-section-header h4 {
    margin: 0;
    color: var(--blue-primary);
    font-weight: 800;
}

.result-count-badge {
    background: var(--blue-primary);
    color: white;
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 0.82rem;
    font-weight: 700;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #aaa;
}

.empty-state i {
    font-size: 3.5rem;
    color: #d0e3f8;
    margin-bottom: 1rem;
    display: block;
}

@media (max-width: 576px) {
    .hero-section-blue .hero-title {
        font-size: 1.8rem;
    }

    /* 手機版卡片改為上下排列 */
    .tour-result-card {
        flex-direction: column;
    }

    /* 代碼欄在手機版橫向滿版 — 背景色橫跨整張卡片 */
    .tour-code-block {
        min-width: unset;
        flex-direction: row;
        min-height: 60px;
        width: 100%;
        padding: 0;
        flex-shrink: 0;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        background: transparent !important;
        /* 由下方個別 chip 規則覆蓋 */
    }

    /* 手機版各行程顏色 — tour-code-block 帶 chip-X class 時顯示滿版背景色 */
    .tour-code-block.chip-A {
        background: linear-gradient(90deg, #1565C0, #1976D2) !important;
    }

    .tour-code-block.chip-B {
        background: linear-gradient(90deg, #6A1B9A, #8E24AA) !important;
    }

    .tour-code-block.chip-C {
        background: linear-gradient(90deg, #00838F, #00ACC1) !important;
    }

    .tour-code-block.chip-D {
        background: linear-gradient(90deg, #2E7D32, #43A047) !important;
    }

    .tour-code-block.chip-E {
        background: linear-gradient(90deg, #E65100, #FB8C00) !important;
    }

    /* 手機版：chip 本身背景透明，讓 tour-code-block 的 chip-X 背景色顯示 */
    .tour-code-chip {
        min-width: unset;
        min-height: unset;
        flex: unset;
        width: 70px;
        height: 60px;
        border-radius: 0;
        font-size: 2.2rem;
        padding: 0;
        background: transparent !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 手機版日期：chip 右方同列，垂直置中 */
    .tour-card-date {
        font-size: 0.9rem;
        padding: 0 16px 0 4px;
        border-radius: 0;
        background: transparent;
        writing-mode: horizontal-tb;
        color: rgba(255, 255, 255, 0.92);
        font-weight: 700;
        letter-spacing: 0.5px;
        display: flex;
        align-items: center;
        white-space: nowrap;
    }

    /* 手機版多日遊：日期欄 flex:1 填滿剩餘空間，水平大字顯示起訖日 */
    .multi-tour-card .tour-card-date {
        flex: 1;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 2px;
        font-size: 1.05rem;
        /* ← 大幅放大，與「2日」接近大小 */
        font-weight: 900;
        padding: 0 10px;
        background: transparent;
        letter-spacing: 0;
        line-height: 1.1;
    }

    /* 手機版：起訖日水平 inline 顯示 */
    .multi-tour-card .mdate-from,
    .multi-tour-card .mdate-to {
        display: inline;
        white-space: nowrap;
        font-size: 1.05rem;
    }

    /* 手機版：隱藏 ↓，改由 ::before 顯示 ─ */
    .multi-tour-card .mdate-sep {
        display: inline;
        font-size: 0;
        /* 隱藏原本 ↓ 文字 */
    }

    .multi-tour-card .mdate-sep::before {
        content: ' ─ ';
        font-size: 1rem;
        opacity: 0.85;
        font-weight: 700;
    }

    .tour-result-actions {
        flex-direction: row;
        padding: 0.5rem 1rem 1rem;
    }

    .search-panel-tour {
        margin-top: -30px;
        padding: 1.2rem;
    }

    /* 行程搜尋標籤在手機版換行對齊 */
    .search-panel-tour .nav-tabs .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }

    /* 月曆結果行事曆縮小 */
    .result-calendar .rc-day {
        width: 36px;
        height: 36px;
        font-size: 0.78rem;
    }

    /* 結果 count badge 縮小 */
    .result-section-header {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ---- Keyword Search ---- */
.keyword-input {
    border-radius: 10px;
    border-color: #d0e3f8;
    padding: 0.65rem 2.8rem 0.65rem 1rem;
    font-size: 0.95rem;
    transition: border-color .2s, box-shadow .2s;
}

.keyword-input:focus {
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 0.2rem rgba(21, 101, 192, .15);
}

/* Clear (×) button */
.keyword-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #bbb;
    color: white;
    font-size: 0.7rem;
    cursor: pointer;
    z-index: 5;
    transition: background .2s;
    line-height: 1;
}

.keyword-clear:hover {
    background: #999;
}

/* Suggestion dropdown */
.keyword-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid #d0e3f8;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(21, 101, 192, .15);
    z-index: 200;
    overflow: hidden;
}

.kw-suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid #f0f6ff;
}

.kw-suggest-item:last-child {
    border-bottom: none;
}

.kw-suggest-item:hover {
    background: var(--blue-accent);
}

/* Code dot (small square) */
.kw-code-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
}

.kw-suggest-text {
    flex: 1;
    min-width: 0;
}

.kw-suggest-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kw-suggest-desc {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kw-suggest-item mark {
    background: #fff3cd;
    color: #b85c00;
    border-radius: 2px;
    padding: 0 1px;
    font-weight: 700;
}

.kw-arrow {
    color: #bbb;
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: color .15s, transform .15s;
}

.kw-suggest-item:hover .kw-arrow {
    color: var(--blue-primary);
    transform: translateX(3px);
}

/* OR divider */
.keyword-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #aaa;
    font-size: 0.78rem;
    margin: 4px 0 0;
}

.keyword-divider::before,
.keyword-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8f0fe;
}

.keyword-divider span {
    white-space: nowrap;
    padding: 0 4px;
}

/* =============================================
   超小螢幕 (< 400px) 額外修正
   ============================================= */
@media (max-width: 400px) {

    /* Hero 再縮小一些 */
    .hero-section {
        height: 360px;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    /* 搜尋框在超小螢幕下改為更扁平 */
    .search-box {
        border-radius: 14px;
        margin: 0 -12px;
    }

    /* 主題圓形圖小螢幕縮到 120px */
    .theme-img {
        width: 120px;
        height: 120px;
    }

    .theme-title {
        font-size: 1.1rem;
    }

    /* TourSearch 行程卡片標題字體縮小 */
    .tour-result-title {
        font-size: 0.92rem;
    }

    .tour-result-meta {
        font-size: 0.75rem;
    }

    /* 行程查詢 hero 縮小 */
    .hero-section-blue {
        height: 220px;
    }

    .hero-section-blue .hero-title {
        font-size: 1.5rem;
    }

    /* 搜尋 panel 邊距縮小 */
    .search-panel-tour {
        margin-top: -20px;
        padding: 1rem;
    }

    /* Tab 標籤在超小螢幕縮小字體 */
    .search-panel-tour .nav-tabs .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.82rem;
    }
}

/* =============================================
   一日遊 / 多日遊 切換按鈕
   ============================================= */
.tour-type-switch {
    display: flex;
    gap: 10px;
    background: #f0f4ff;
    border-radius: 14px;
    padding: 6px;
    width: fit-content;
}

.tour-type-btn {
    border: none;
    background: transparent;
    padding: 8px 22px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--blue-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
}

.tour-type-btn.active {
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-secondary));
    color: white;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.28);
}

.tour-type-btn:not(.active):hover {
    background: rgba(21, 101, 192, 0.08);
}

/* =============================================
   多日遊天數色塊 chip-multi-X
   ============================================= */
.chip-multi-2 {
    background: linear-gradient(180deg, #E65100, #F57C00);
    /* 橘色 2日 */
}

.chip-multi-3 {
    background: linear-gradient(180deg, #6A1B9A, #8E24AA);
    /* 紫色 3日 */
}

.chip-multi-4 {
    background: linear-gradient(180deg, #1B5E20, #388E3C);
    /* 深綠 4日 */
}

/* 手機版 chip-multi-X block 橫向背景色 */
@media (max-width: 576px) {
    .tour-code-block.chip-multi-2 {
        background: linear-gradient(90deg, #E65100, #F57C00) !important;
    }

    .tour-code-block.chip-multi-3 {
        background: linear-gradient(90deg, #6A1B9A, #8E24AA) !important;
    }

    .tour-code-block.chip-multi-4 {
        background: linear-gradient(90deg, #1B5E20, #388E3C) !important;
    }
}

/* 多日遊 chip 內的天數數字 */
.multi-days-num {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1;
}

.multi-days-unit {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.85;
    margin-top: 2px;
}

/* 多日遊卡片日期範圍：桌面版——chip 下方，垂直排列起→↓→訖 */
.multi-tour-card .tour-card-date {
    font-size: 0.72rem;
    padding: 5px 4px;
    background: rgba(0, 0, 0, .22);
    color: white;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 桌面版：起訖日各一行，↓ 分隔 */
.mdate-from,
.mdate-to {
    display: block;
    white-space: nowrap;
}

.mdate-sep {
    display: block;
    line-height: 1;
    opacity: 0.7;
    font-size: 0.65rem;
}

/* 多日遊左側欄加寬，容納日期文字 */
.multi-tour-card .tour-code-block {
    min-width: 88px;
}

/* 住宿 badge */
.badge-multi-tag {
    background: linear-gradient(135deg, #E65100, #F57C00);
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-right: 6px;
}

/* 結果分類小標題（一日遊 / 多日遊）*/
.result-section-label {
    color: var(--blue-secondary);
    font-size: 0.9rem;
    font-weight: 800;
    border-left: 4px solid var(--blue-secondary);
    padding-left: 10px;
    margin-bottom: 12px;
}

/* 多日遊 Modal header 漸層 */
.modal-header-multi {
    color: white;
}

.modal-header-multi.multi-2 {
    background: linear-gradient(135deg, #E65100, #F57C00);
}

.modal-header-multi.multi-3 {
    background: linear-gradient(135deg, #6A1B9A, #8E24AA);
}

.modal-header-multi.multi-4 {
    background: linear-gradient(135deg, #1B5E20, #388E3C);
}

/* 多日遊 Modal info bar */
.multi-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: #f8f9ff;
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid #e8f0fe;
    font-size: 0.88rem;
    font-weight: 600;
    color: #333;
}

.multi-info-bar span {
    display: flex;
    align-items: center;
}

.multi-info-bar i {
    color: var(--blue-secondary);
}

/* ---- Booking Modal & Bus Seat Grid ---- */
.bus-container {
    background: #f8f9fa;
    border: 3px solid #dee2e6;
    border-radius: 40px;
    padding: 30px 20px;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

.bus-seat-grid {
    display: grid;
    /* 5 columns: A(左), B(左), C(走道), D(右), E(右) */
    grid-template-columns: repeat(5, 55px);
    gap: 12px;
}

.bus-seat {
    width: 55px;
    height: 55px;
    border-radius: 8px;
    background-color: #ffffff;
    border: 2px solid #adb5bd;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    color: #495057;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), inset 0 -4px 0 rgba(0, 0, 0, 0.05);
    /* 增加立體感 */
    position: relative;
    overflow: hidden;
    padding: 2px;
}

/* 座椅內文字不要被遮擋 */

.bus-seat:hover:not(.occupied):not(.forbidden) {
    transform: translateY(-2px);
    border-color: var(--blue-primary);
    box-shadow: 0 6px 12px rgba(21, 101, 192, 0.2), inset 0 -4px 0 rgba(0, 0, 0, 0.05);
}

.bus-seat.selected {
    background-color: var(--blue-primary);
    color: white;
    border-color: var(--blue-secondary);
    box-shadow: 0 4px 8px rgba(21, 101, 192, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.2);
}

.bus-seat.selected::after {
    background-color: rgba(255, 255, 255, 0.2);
}

.bus-seat.occupied {
    background-color: #e9ecef;
    color: #ced4da;
    border-color: #e9ecef;
    cursor: not-allowed;
    box-shadow: none;
}

.bus-seat.occupied::after {
    display: none;
}

.bus-seat.forbidden {
    background-color: #ffcdd2;
    /* 淡淡的禁止紅 */
    color: #d32f2f;
    border-color: #ef9a9a;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.8;
}

.bus-seat.forbidden::before {
    content: '\\f05e';
    /* FontAwesome ban icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    font-size: 1.5rem;
    color: rgba(211, 47, 47, 0.3);
    z-index: 0;
}

.bus-seat.forbidden::after {
    display: none;
}


.bus-empty-space {
    width: 55px;
    height: 55px;
}

/* Legend markers */
.seat-legend {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    margin-right: 8px;
    border: 2px solid #adb5bd;
}

.seat-legend.available {
    background-color: #ffffff;
}

.seat-legend.selected {
    background-color: var(--blue-primary);
    border-color: var(--blue-secondary);
}

.seat-legend.occupied {
    background-color: #e9ecef;
    border-color: #e9ecef;
}

.passenger-item {
    transition: all 0.3s ease;
    border-left: 4px solid var(--blue-primary) !important;
}

/* 針對小螢幕手機的自適應座位縮放 */
@media (max-width: 480px) {
    .bus-container {
        width: 100%;
        padding: 15px 10px;
        overflow-x: hidden;
    }

    .bus-seat-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    .bus-seat,
    .bus-empty-space {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        font-size: 0.65rem;
        padding: 2px 0;
        border-radius: 6px;
    }

    .bus-seat.forbidden::before {
        font-size: 1.2rem;
    }
}

.passenger-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
}

/* =============================================
   Alert Modal — 前台
   (moved from _Layout.cshtml)
   ============================================= */
.modal-alert .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-alert .modal-body {
    text-align: center;
    padding: 2.5rem 2rem;
}

.alert-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    margin: 0 auto 1.25rem;
}

.alert-icon.fa-check {
    background: #e8f5e9;
    color: #2e7d32;
}

.alert-icon.fa-exclamation {
    background: #fff8e1;
    color: #f57c00;
}

.alert-icon.fa-times {
    background: #fdecea;
    color: #c62828;
}

.modal-alert h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.5rem;
}

.modal-alert #alertContent {
    font-size: 0.92rem;
    color: #6c757d;
    white-space: pre-line;
}

.modal-alert .g-3 {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* =============================================
   TourDetail 頁面樣式
   (moved from TourDetail.cshtml)
   ============================================= */
.tour-hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    margin-top: -60px;
    overflow: hidden;
}

.tour-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
    z-index: 1;
}

.tour-hero-content {
    position: relative;
    z-index: 2;
    padding-bottom: 3rem;
    width: 100%;
}

.tour-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.booking-card {
    border-radius: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.sticky-sidebar {
    position: sticky;
    top: 100px;
    z-index: 10;
}

.highlight-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--blue-primary);
    margin-bottom: 1.5rem;
}

.itinerary-timeline {
    position: relative;
    padding-left: 2rem;
    margin-top: 1.5rem;
}

.itinerary-timeline::before {
    content: '';
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 6px;
    width: 3px;
    background-color: #e9ecef;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 5px;
    left: -2rem;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--blue-primary);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.2);
}

.timeline-time {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--blue-secondary);
    margin-bottom: 0.25rem;
}

@media (max-width: 576px) {
    .tour-hero-title {
        font-size: 1.8rem;
    }
}