:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --accent: #e67e22;
    --accent-light: #f39c12;
    --bg: #f8f6f3;
    --card-bg: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --text-muted: #bdc3c7;
    --border: #ecf0f1;
    --success: #27ae60;
    --danger: #e74c3c;
    --info: #3498db;
    --shadow: 0 2px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 16px;
    --radius-sm: 10px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: 80px;
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    max-height: 900px;
    background: linear-gradient(135deg, #0f3443 0%, #34e89e 100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 24px 60px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: var(--hero-bg-image, none);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.3;
    z-index: 0;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(15,52,67,0.95), transparent);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: white;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.hero h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero-subtitle {
    font-size: 15px;
    opacity: 0.85;
    font-weight: 300;
    margin-bottom: 24px;
}

.hero-meta { display: flex; gap: 20px; flex-wrap: wrap; }

.hero-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.9;
}

.hero-meta-item svg { width: 16px; height: 16px; opacity: 0.8; }

.hero-scroll-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

/* ===== Day Navigation ===== */
.day-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(248,246,243,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.day-nav::-webkit-scrollbar { display: none; }

.day-nav-inner {
    display: flex;
    gap: 8px;
    padding: 0 16px;
    min-width: max-content;
}

.day-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    background: transparent;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 72px;
}

.day-nav-item span:first-child {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.day-nav-item span:last-child {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}

.day-nav-item.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(26,82,118,0.3);
}

.day-nav-item.active span:last-child { opacity: 0.85; }

.day-nav-item.upcoming {
    border-color: var(--border);
    color: var(--text-muted);
}

/* ===== Section Styles ===== */
.section { padding: 24px 16px; }

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.section-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.section-title {
    font-family: 'Noto Serif SC', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
}

.section-desc {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ===== Train Card ===== */
.train-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.train-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.train-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.train-number {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.train-duration {
    font-size: 13px;
    color: var(--text-light);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 6px;
}

.train-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
}

.train-station { text-align: center; flex: 1; }

.train-station .time {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.train-station .name {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
}

.train-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.train-arrow-line {
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    position: relative;
}

.train-arrow-line::after {
    content: '';
    position: absolute;
    right: -2px; top: -4px;
    width: 0; height: 0;
    border-left: 8px solid var(--accent);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.train-arrow span { font-size: 11px; color: var(--text-muted); }

.train-seat {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    font-size: 13px;
    color: var(--text-light);
}

.train-seat svg { width: 16px; height: 16px; color: var(--accent); }

/* ===== Hotel Card ===== */
.hotel-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hotel-banner {
    height: 140px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: flex-end;
    padding: 16px;
    position: relative;
}

.hotel-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

.hotel-banner-content {
    position: relative;
    z-index: 1;
    color: white;
}

.hotel-banner-content h3 {
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

.hotel-info { padding: 16px; }

.hotel-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-light);
}

.hotel-detail svg {
    width: 16px;
    height: 16px;
    color: var(--primary-light);
    flex-shrink: 0;
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px; top: 8px; bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-light), var(--accent), var(--primary));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -28px; top: 4px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--primary-light);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-dot-inner {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--primary-light);
}

.timeline-item.active .timeline-dot {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(230,126,34,0.2);
}

.timeline-item.active .timeline-dot-inner { background: var(--accent); }

/* ===== Spot Card ===== */
.spot-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.spot-card:active { transform: scale(0.98); }

.spot-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
}

.spot-content { padding: 16px; }

.spot-tag-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.spot-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.spot-tag.heritage { background: #ffeaa7; color: #d68910; }
.spot-tag.culture { background: #dfe6e9; color: #636e72; }
.spot-tag.nature { background: #dff9fb; color: #22a6b3; }
.spot-tag.free { background: #e8f8f5; color: #27ae60; }
.spot-tag.landmark { background: #fce4ec; color: #c0392b; }

.spot-name {
    font-family: 'Noto Serif SC', serif;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.spot-desc {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s ease;
}

.spot-desc.expanded { -webkit-line-clamp: unset; }

.spot-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--primary-light);
    margin-top: 8px;
    cursor: pointer;
    font-weight: 500;
    border: none;
    background: none;
    padding: 4px 0;
}

.spot-toggle svg {
    width: 14px; height: 14px;
    transition: transform 0.3s ease;
}

.spot-toggle.expanded svg { transform: rotate(180deg); }

.spot-tips {
    margin-top: 12px;
    padding: 12px;
    background: #fff9e6;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.spot-tips-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.spot-tips-list {
    list-style: none;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.8;
}

.spot-tips-list li::before { content: '- '; color: var(--accent); }

/* ===== Walk Card ===== */
.walk-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(52,152,219,0.06);
    border-radius: var(--radius-sm);
    margin: 12px 0;
    border: 1px dashed rgba(52,152,219,0.2);
}

.walk-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(52,152,219,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.walk-info { flex: 1; }
.walk-label { font-size: 12px; color: var(--text-light); }
.walk-detail { font-size: 13px; font-weight: 500; color: var(--text); }

/* ===== Transport Options ===== */
.transport-options {
    margin: 12px 0;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 12px;
    border: 1px solid var(--border);
}

.transport-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.transport-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.transport-option:last-child { border-bottom: none; }

.transport-option-icon {
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.transport-option-info { flex: 1; color: var(--text-light); }
.transport-option-dist { font-size: 12px; color: var(--text-muted); }

.transport-recommend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    background: rgba(230,126,34,0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* ===== Day Section ===== */
.day-section { display: none; }

.day-section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.day-header { padding: 24px 16px 8px; }

.day-date {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.day-route {
    font-size: 14px;
    color: var(--text-light);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.day-route-arrow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ===== Upcoming Day Placeholder ===== */
.upcoming-placeholder {
    text-align: center;
    padding: 60px 24px;
}

.upcoming-placeholder-icon {
    margin-bottom: 16px;
    opacity: 0.4;
}

.upcoming-placeholder h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 20px;
    color: var(--text);
    margin-bottom: 8px;
}

.upcoming-placeholder p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 280px;
    margin: 0 auto;
}

/* ===== Dinner Card ===== */
.dinner-card {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    border-radius: var(--radius);
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.dinner-card::before {
    content: '';
    position: absolute;
    top: -20px; right: -20px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.dinner-card h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.dinner-card p { font-size: 13px; opacity: 0.9; line-height: 1.6; }

/* ===== Night View Card ===== */
.night-card {
    background: linear-gradient(135deg, #2c3e50 0%, #4a69bd 100%);
    border-radius: var(--radius);
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
}

.night-card h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.night-card p { font-size: 13px; opacity: 0.9; line-height: 1.6; }

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 40px 16px 20px;
    color: var(--text-muted);
    font-size: 12px;
}

.footer-divider {
    width: 40px; height: 2px;
    background: var(--border);
    margin: 0 auto 12px;
    border-radius: 2px;
}

/* ===== Bottom Tab Bar ===== */
.bottom-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 200;
}

.bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    border: none;
    background: none;
}

.bottom-bar-item.active { color: var(--primary); }
.bottom-bar-item svg { width: 22px; height: 22px; }

/* ===== Overview Panel ===== */
.overview-panel { display: none; padding: 16px; }

.overview-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.overview-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
}

.overview-card h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 16px;
    margin-bottom: 12px;
}

.overview-stat {
    display: flex;
    justify-content: space-around;
    text-align: center;
    gap: 8px;
}

.overview-stat-item { flex: 1; }

.overview-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.overview-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== Map ===== */
.map-container { display: none; padding: 16px; }

.map-container.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 12px 0;
}

.map-legend-item {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.map-legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Leaflet overrides */
.custom-marker { background: transparent !important; border: none !important; }

.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}

.leaflet-popup-content {
    margin: 12px 16px !important;
    font-family: 'Noto Sans SC', sans-serif !important;
    font-size: 14px !important;
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
    body {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: -1px 0 0 var(--border), 1px 0 0 var(--border);
        min-height: 100vh;
    }
    .bottom-bar {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
}

/* ===== Loading Animation ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--primary);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden { opacity: 0; visibility: hidden; }

.loading-text {
    font-family: 'Noto Serif SC', serif;
    font-size: 24px;
    margin-top: 20px;
    animation: pulse 1.5s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-dots { display: flex; gap: 8px; margin-top: 12px; }

.loading-dots span {
    width: 8px; height: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    animation: dotBounce 1.4s ease infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== Scroll to top ===== */
.scroll-top {
    position: fixed;
    bottom: 80px; right: 16px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 150;
}

.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top svg { width: 20px; height: 20px; }
