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

body {
    font-family: 'Microsoft JhengHei', '微軟正黑體', Arial, sans-serif;
    line-height: 1.6;
    color: #1A1A1A;
    background: #FFFFFF;
    min-height: 100vh;
    position: relative;
}

/* 韓國文化背景裝飾 - 現代化設計 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 71, 160, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(205, 46, 58, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

header {
    background: #FFFFFF;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border-bottom: 3px solid #0047A0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1A1A1A;
    text-decoration: none;
    display: block;
    margin-right: 2rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #0047A0 0%, #CD2E3A 100%);
    border-radius: 2px;
}

.logo:hover {
    opacity: 0.8;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #1A1A1A;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 3px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: #1A1A1A;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #0047A0 0%, #CD2E3A 100%);
    transition: width 0.3s ease;
}

.nav-links a:hover::before,
.nav-links a.active::before {
    width: 80%;
}

.nav-links a:hover,
.nav-links a.active {
    color: #0047A0;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.hero {
    text-align: center;
    color: #1A1A1A;
    padding: 4rem 2rem;
    margin-bottom: 3rem;
    background: #FFFFFF;
    border: 3px solid #0047A0;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 71, 160, 0.15);
    position: relative;
    overflow: hidden;
}

/* 韓國傳統圖案裝飾 - 現代化設計 */
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 71, 160, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(205, 46, 58, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero h1,
.hero p {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #1A1A1A;
    font-weight: 700;
    letter-spacing: 1px;
}

.hero h1::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #0047A0 0%, #CD2E3A 100%);
    margin: 1rem auto;
    border-radius: 2px;
}

.hero p {
    font-size: 1.5rem;
    color: #333;
    font-weight: 500;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.card {
    background: #FFFFFF;
    border-radius: 15px;
    padding: 2rem;
    border: 2px solid #E8E8E8;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, #0047A0 0%, #CD2E3A 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.card:hover::before {
    transform: scaleY(1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 71, 160, 0.15);
    border-color: #0047A0;
}

.card-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.card h2 {
    color: #1A1A1A;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.5rem;
}

.card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #0047A0 0%, #CD2E3A 100%);
    border-radius: 2px;
}

.exchange-rate,
.weather-info,
.wifi-info,
.cash-info,
.transport-info,
.app-info {
    text-align: center;
}

.rate-value {
    font-size: 2rem;
    font-weight: bold;
    color: #0047A0;
    margin: 0.5rem 0;
}

#swap-rate-btn,
#swap-usd-krw-btn {
    background: #0047A0;
    color: white;
}

#swap-rate-btn:hover,
#swap-usd-krw-btn:hover {
    background: #003380;
}

#swap-rate-btn:active,
#swap-usd-krw-btn:active {
    background: #002966;
}

.rate-label {
    color: #666;
    font-size: 0.9rem;
}

.temperature {
    font-size: 3rem;
    font-weight: bold;
    color: #0047A0;
    margin: 1rem 0;
}

.weather-desc {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1rem;
}

.location {
    font-size: 1.1rem;
    color: #0047A0;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.wifi-info ul,
.cash-info ul,
.transport-info ul,
.app-info ul {
    text-align: left;
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.wifi-info li,
.cash-info li,
.transport-info li,
.app-info li {
    margin: 0.5rem 0;
    color: #555;
}

.time-info {
    text-align: center;
}

.time-display {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
}

.time-label {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.time-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1A1A1A;
    margin: 0.5rem 0;
}

.time-note {
    font-size: 0.9rem;
    color: #999;
    margin-top: 1rem;
}

.preparation-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.prep-category {
    background: #F8F9FA;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #0047A0;
    border-right: 2px solid #CD2E3A;
}

.prep-category h3 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.prep-category ul {
    list-style: none;
    padding: 0;
}

.prep-category li {
    padding: 0.5rem 0;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
}

.prep-category li:last-child {
    border-bottom: none;
}

#map {
    z-index: 1;
}

.wifi-tip,
.cash-tip {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f0f0f0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #666;
}

.last-update {
    font-size: 0.85rem;
    color: #999;
    margin-top: 1rem;
}

.quick-links {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.quick-links h2 {
    color: #1A1A1A;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 1rem;
}

.quick-links h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #0047A0 0%, #CD2E3A 100%);
    border-radius: 2px;
}

.day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.day-card {
    background: #FFFFFF;
    color: #1A1A1A;
    padding: 2rem;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid #E8E8E8;
    position: relative;
    overflow: hidden;
}

.day-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #0047A0 0%, #CD2E3A 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.day-card:hover::before {
    transform: scaleX(1);
}

.day-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 71, 160, 0.2);
    border-color: #0047A0;
}

.day-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.day-card p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Day page styles */
.day-header {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.day-header h1 {
    color: #1A1A1A;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.day-header .date {
    color: #666;
    font-size: 1.2rem;
}

.schedule-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.schedule-section h2 {
    color: #1A1A1A;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 700;
    border-bottom: 3px solid #0047A0;
    padding-bottom: 0.5rem;
    position: relative;
}

.schedule-section h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 30%;
    height: 3px;
    background: #CD2E3A;
}

.schedule-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #F8F9FA;
    border-radius: 10px;
    border-left: 4px solid #0047A0;
    border-right: 2px solid #CD2E3A;
    transition: all 0.3s ease;
}

.schedule-item:hover {
    background: #FFFFFF;
    box-shadow: 0 4px 15px rgba(0, 71, 160, 0.1);
}

.time {
    font-weight: bold;
    color: #1A1A1A;
    font-size: 1.2rem;
    min-width: 100px;
    position: relative;
    padding-left: 1rem;
    display: flex;
    align-items: center;
    align-self: center;
}

.time::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: linear-gradient(180deg, #0047A0 0%, #CD2E3A 100%);
    border-radius: 2px;
}

.activity {
    flex: 1;
}

.activity h3 {
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.activity p {
    color: #666;
    line-height: 1.8;
}

.activity .location {
    color: #0047A0;
    font-weight: bold;
    margin-top: 0.5rem;
}

.tips-section {
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.tips-section h4 {
    color: #f57c00;
    margin-bottom: 0.5rem;
}

footer {
    background: #FFFFFF;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    color: #666;
    border-top: 3px solid #0047A0;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    width: 30%;
    height: 3px;
    background: #CD2E3A;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #0047A0;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.footer-links a:hover {
    color: #FFFFFF;
    background: linear-gradient(135deg, #0047A0 0%, #CD2E3A 100%);
}

.instagram-link {
    transition: color 0.3s ease;
}

.instagram-link:hover {
    color: #E4405F !important;
}

.instagram-link:hover span:first-child {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.next-day-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 71, 160, 0.4) !important;
}

.next-day-btn:active {
    transform: translateY(0);
}

.add-schedule-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 71, 160, 0.4) !important;
}

.add-schedule-btn:active {
    transform: translateY(0);
}

.time-option-btn:hover {
    background: #F0F0F0 !important;
    border-color: #0047A0 !important;
}

.time-option-btn.active {
    background: linear-gradient(135deg, #0047A0 0%, #CD2E3A 100%) !important;
    color: white !important;
    border-color: transparent !important;
}

.delete-schedule-btn:hover {
    background: #c0392b !important;
    transform: scale(1.1);
}

.schedule-item.user-added {
    animation: slideIn 0.3s ease;
}

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

/* 新增行程模態框樣式 - 確保在 header 之上 */
.schedule-modal {
    z-index: 2000 !important;
}

.schedule-modal .modal-content {
    position: relative;
    z-index: 2001;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    /* Mobile Dashboard 模式 - 緊湊的 2 列佈局 */
    .info-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .card {
        padding: 1rem 0.75rem;
        border-radius: 10px;
        min-height: auto;
    }

    .card-icon {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }

    .card h2 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    /* 匯率卡片 - 更緊湊 */
    .exchange-rate .rate-value {
        font-size: 1.3rem !important;
        margin: 0.3rem 0 !important;
    }

    .exchange-rate .rate-label {
        font-size: 0.75rem !important;
    }

    .exchange-rate button {
        padding: 0.2rem 0.5rem !important;
        font-size: 0.7rem !important;
    }

    .exchange-rate .last-update {
        font-size: 0.65rem !important;
        margin-top: 0.5rem !important;
    }

    .exchange-rate .reference {
        font-size: 0.6rem !important;
    }

    /* 天氣卡片 - 更緊湊 */
    .weather-info .temperature {
        font-size: 1.5rem !important;
    }

    .weather-info .weather-desc {
        font-size: 0.85rem !important;
    }

    .weather-info .temperature-range {
        font-size: 0.8rem !important;
    }

    .weather-info .tomorrow-weather {
        margin-top: 0.75rem !important;
        padding-top: 0.75rem !important;
    }

    .weather-info .tomorrow-weather .temperature {
        font-size: 1.2rem !important;
    }

    .weather-info .last-update {
        font-size: 0.65rem !important;
    }

    .weather-info .reference {
        font-size: 0.6rem !important;
    }

    /* 時間卡片 - 更緊湊 */
    .time-info .time-value {
        font-size: 1.2rem !important;
    }

    .time-info .time-label {
        font-size: 0.8rem !important;
    }

    .time-info .time-note {
        font-size: 0.7rem !important;
        margin-top: 0.5rem !important;
    }

    /* 聯絡資訊卡片 - 更緊湊 */
    .contact-info p {
        font-size: 0.9rem !important;
    }

    .contact-info ul li {
        font-size: 0.8rem !important;
        margin-bottom: 0.5rem !important;
    }

    .contact-info a {
        font-size: 1.1rem !important;
    }

    /* 交通資訊卡片 - 更緊湊 */
    .transport-info p,
    .transport-info li {
        font-size: 0.8rem !important;
    }

    /* 新聞卡片 - 更緊湊 */
    .news-info p {
        font-size: 0.8rem !important;
    }

    .news-info a {
        font-size: 0.85rem !important;
    }

    .preparation-list {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        gap: 0;
        z-index: 999;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 1rem 2rem;
        border-radius: 0;
        width: 100%;
    }

    .schedule-item {
        flex-direction: column;
    }

    .time {
        min-width: auto;
    }

    nav {
        position: relative;
        padding: 1.5rem 1.5rem;
    }
    
    .logo {
        margin-right: 1.5rem;
        margin-bottom: 0.75rem;
    }

    main {
        padding: 0 1rem;
    }

    /* Hero 區域在 mobile 上更緊湊 */
    .hero {
        padding: 2rem 1rem;
        margin-bottom: 1.5rem;
    }

    /* Quick links 區域更緊湊 */
    .quick-links {
        margin-bottom: 1.5rem;
    }

    .quick-links h2 {
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }

    /* 地圖區域在 mobile 上更小 */
    #map {
        height: 300px !important;
    }

    /* Day grid 在 mobile 上使用 2 列 */
    .day-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .day-card {
        padding: 1rem 0.75rem;
    }

    .day-card h3 {
        font-size: 1.1rem;
    }

    .day-card p {
        font-size: 0.85rem;
    }
}

/* 返回頁首按鈕 */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0047A0 0%, #CD2E3A 100%);
    color: white;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 71, 160, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    opacity: 0;
    transform: translateY(20px);
}

.scroll-to-top.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, #003380 0%, #B0252E 100%);
    box-shadow: 0 6px 20px rgba(0, 71, 160, 0.5);
    transform: translateY(-3px);
}

.scroll-to-top:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    /* 移動版模態框樣式 - 避免被 header 遮擋 */
    .schedule-modal {
        align-items: flex-start !important;
        padding-top: 80px !important;
        overflow-y: auto !important;
    }

    .schedule-modal .modal-content {
        margin-top: 0 !important;
        max-height: calc(100vh - 100px) !important;
    }
}

