:root {
    --primary: #276EF1;
    --primary-glow: rgba(39, 110, 241, 0.4);
    --bg-dark: #0a0c10;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-green: #10b981;
    --accent-purple: #a855f7;
    --accent-orange: #f97316;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(at 0% 0%, rgba(39, 110, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    padding: 1.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

h1 {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

p.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.input-section {
    display: grid;
    gap: 1.25rem;
}

.input-group {
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 0.8rem 0.8rem 0.8rem 2.8rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-wrapper select {
    padding: 0.8rem 0.8rem 0.8rem 0.8rem;
    appearance: none;
    cursor: pointer;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: rgba(0, 0, 0, 0.5);
}

.input-icon {
    position: absolute;
    left: 0.9rem;
    font-size: 1rem;
    opacity: 0.6;
    pointer-events: none;
}

.quick-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 4px;
    border-radius: 18px;
    margin-bottom: 1.75rem;
    border: 1px solid var(--border-glass);
    position: sticky;
    top: 20px;
    z-index: 1000;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Activities Section */
.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.month-divider {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    opacity: 0.8;
    padding: 1.5rem 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.month-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
}

.dome-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dome-header-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    background: rgba(39, 110, 241, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dome-event-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 0.75rem;
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.dome-event-card:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.dome-event-badge {
    min-width: 50px;
    height: 50px;
    background: rgba(39, 110, 241, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.dome-event-badge .month {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary);
}

.dome-event-badge .day {
    font-size: 1.1rem;
    font-weight: 800;
}

.dome-event-badge .weekday {
    font-size: 0.6rem;
    opacity: 0.5;
}

.dome-event-info {
    flex: 1;
}

.dome-event-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: inline-block;
    margin-right: 0.5rem;
}

.venue-tag {
    font-size: 0.65rem;
    font-weight: 800;
    opacity: 0.9;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.venue-tag.big-dome {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
}

.venue-tag.small-dome {
    color: #fb923c;
    background: rgba(251, 146, 60, 0.1);
}

.venue-tag.xinzhuang {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.venue-tag.xz-gym {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.venue-tag.linkou {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.venue-tag.north-flow {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.1);
}

.venue-tag.zepp {
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.1);
}

.venue-tag.twtc {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.venue-tag.tainex {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.venue-tag.keelung {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
}

.venue-tag.tianmu {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.venue-tag.ticc {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
}

.venue-tag.taipei-run {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.venue-tag.taoyuan {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.1);
}

.venue-tag.wugu {
    color: #d946ef;
    background: rgba(217, 70, 239, 0.1);
}

.dome-date-chip {
    font-size: 0.6rem;
    padding: 3px 8px;
    border-radius: 6px;
    margin-right: 4px;
    margin-bottom: 3px;
    font-weight: 700;
    display: inline-block;
}

/* 每個場次用不同顏色循環 */
.dome-event-multi .dome-date-chip:nth-child(1) {
    background: rgba(39, 110, 241, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(39, 110, 241, 0.3);
}

.dome-event-multi .dome-date-chip:nth-child(2) {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.dome-event-multi .dome-date-chip:nth-child(3) {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.dome-event-multi .dome-date-chip:nth-child(4) {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.dome-event-multi .dome-date-chip:nth-child(5) {
    background: rgba(236, 72, 153, 0.2);
    color: #f9a8d4;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.dome-event-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    padding-left: 0.2rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.dome-event-multi {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.venue-directory {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 1rem 0 1.5rem 0;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    border-left: 2px solid var(--primary);
}

.venue-dir-item {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.venue-dir-item:hover {
    color: var(--primary);
}

.venue-dir-item.active {
    color: white;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.venue-dir-item::after {
    content: '·';
    margin-left: 12px;
    color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

.venue-dir-item:last-child::after {
    content: '';
}

/* Fuel Info Section */
.fuel-grid {
    display: grid;
    gap: 1.25rem;
    margin-top: 1rem;
}

.fuel-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.fuel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.fuel-card.cpc::before {
    background: #e11d48;
}

.fuel-card.fpi::before {
    background: #0ea5e9;
}

.fuel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.fuel-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fuel-update {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.price-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.price-item {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.price-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.price-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.price-unit {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.6;
}

.price-trend {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

.trend-even {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.btn-chip {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.results-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.vehicle-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 0.75rem 0.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vehicle-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.vehicle-card.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.v-icon {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
}

.v-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    text-align: center;
}

.v-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
}

.vehicle-card.active .v-label {
    color: white;
}

.total-display {
    background: linear-gradient(135deg, rgba(39, 110, 241, 0.1) 0%, rgba(39, 110, 241, 0.05) 100%);
    border: 1px solid var(--primary);
    border-radius: 16px;
    padding: 0.75rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.total-display::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0.3;
    pointer-events: none;
}

.total-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

.total-amount {
    font-size: 2.4rem;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.total-currency {
    font-size: 1.2rem;
    vertical-align: super;
    margin-right: 0.2rem;
}

.driver-takehome {
    margin-top: 0.1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-green);
}

.details-breakdown {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.action-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn {
    padding: 1rem;
    border-radius: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-secondary.active {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
}

.region-chips {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.region-chips::-webkit-scrollbar {
    display: none;
}

.chip {
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
}

.chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
}

#detailedRegionGroup {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        border-radius: 24px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .vehicle-grid {
        gap: 0.4rem;
    }

    .v-price {
        font-size: 0.9rem;
    }

    .total-amount {
        font-size: 2.5rem;
    }
}
