/* East Canada 行程表 - 簡潔配色 */
:root {
    --bg-page: #f0f2f5;
    --bg-card: #ffffff;
    --bg-muted: #f7f8fa;
    --border: #e2e5eb;
    --border-strong: #d1d5db;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --accent: #4a6fa5;
    --accent-soft: rgba(74, 111, 165, 0.12);
    --header-bg: #fafbfc;
    --nav-bg: rgba(255, 255, 255, 0.96);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: var(--bg-page);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    scroll-behavior: smooth;
}

/* 頂部僅保留淡色區塊，無動畫／極光 */
.aurora-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(180deg, #e8ecf2 0%, transparent 100%);
    z-index: -1;
    opacity: 0.6;
}

.header {
    position: relative;
    padding: 15px 12px 22px;
    text-align: center;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
}

.title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}

/* (removed) total-cost / cost-label / cost-amount */

/* 頁首路線總覽（手機優先）：取代原本 Trip/East Canada 2026 小卡 */
.route-overview {
    margin: 8px auto 0;
    padding: 8px 12px;
    max-width: 760px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text);
    text-align: left;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.paid-summary {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    margin: 8px 0;
    display: inline-block;
}

.paid-label {
    display: inline;
    font-size: 12px;
    color: var(--text-secondary);
    margin-right: 8px;
}

.paid-amount {
    display: inline;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.trip-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.date {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    padding: 8px 14px;
    background: var(--bg-muted);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.main-content {
    padding: 12px 10px 16px;
    max-width: 760px;
    margin: 0 auto;
}

.trip-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.nested-trip-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.nested-trip-card .day-section {
    border: 0;
    margin-bottom: 0;
}

.nested-trip-card .card-content {
    padding: 0;
}

.card-header {
    background: var(--bg-muted);
    padding: 12px 16px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    position: static;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.4;
}

.card-header .map-link {
    font-size: 12px;
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
    padding: 4px 8px;
    background: var(--accent-soft);
    border-radius: 6px;
    border: 1px solid var(--border);
    width: fit-content;
    font-weight: 500;
}

.card-header .map-link:hover {
    background: rgba(74, 111, 165, 0.18);
}

.date-range {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    white-space: normal;
    align-self: flex-start;
    max-width: 100%;
    line-height: 1.35;
}

.card-content {
    padding: 0;
}

.timeline-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.timeline-item:last-child {
    border-bottom: none;
}

.timeline-item.optional {
    background: rgba(245, 158, 11, 0.06);
    border-left: 3px solid #d97706;
}

.time {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-top: 8px;
    margin-bottom: 8px;
    display: block;
    background: var(--bg-muted);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    width: auto;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
}

.day-section {
    margin-bottom: 16px;
    border-radius: 0;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.day-section:last-child {
    margin-bottom: 0;
}

.day-header {
    background: var(--bg-muted);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-header .subtitle-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
}

.day-header .subtitle-row .day-subtitle,
.day-header .subtitle-row .map-link {
    height: auto;
    min-height: 32px;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 100%;
    max-width: 100%;
    white-space: normal;
    text-align: left;
}

.day-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.day-subtitle {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* 住宿：接在行程列下方，不用獨立色塊外框，與 day 內其他區塊一致 */
.day-hotel {
    font-size: 13px;
    font-weight: 400;
    color: var(--text);
    margin-top: 0;
    padding: 12px 12px 14px;
    background: var(--bg-muted);
    border: none;
    border-radius: 0;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.day-hotel a {
    word-break: break-word;
    overflow-wrap: anywhere;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.day-hotel a:active {
    opacity: 0.85;
}

/* 飯店名稱後的房型／早餐等說明：獨立一行，層級比飯店名稱略輕 */
.day-hotel-meta {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.day-activities {
    padding: 0;
}

.day-activities .timeline-item {
    padding: 10px 12px;
}

/* 一日遊：日期列維持原格式，下方行程時間橫排、無分隔線 */
.day-tour-card .day-activities > .timeline-item:first-child {
    border-bottom: 1px solid var(--border);
}

.day-tour-card .day-activities > .timeline-item:not(:first-child) {
    border-bottom: none;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 16px;
}

.day-tour-card .day-activities > .timeline-item:not(:first-child) .time {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    flex: 0 0 auto;
    min-width: 72px;
    max-width: 38%;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.45;
}

.day-tour-card .day-activities > .timeline-item:not(:first-child) .activity {
    flex: 1;
    min-width: 0;
}

.day-tour-card .day-activities > .timeline-item:not(:first-child) .activity-title {
    margin-bottom: 4px;
    font-size: 14px;
}

.day-tour-card .day-activities > .timeline-item:not(:first-child):last-child {
    padding-bottom: 12px;
}

.activity-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.activity-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.flight-number {
    color: var(--accent);
    font-weight: 600;
}

.map-link {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 10px;
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.map-link:hover {
    background: var(--accent-soft);
}

.day-header .subtitle-row .map-link {
    margin: 0;
    margin-top: 0;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-top: 1px solid var(--border);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    gap: 2px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 7px 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    flex: 1 1 0;
    min-width: 0;
    border-radius: 8px;
}

.nav-btn.active {
    color: var(--accent);
    background: var(--accent-soft);
}

.nav-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.nav-text {
    font-size: 9.5px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

.nav-text-sub {
    font-size: 8.5px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.15;
    margin-top: 1px;
    max-width: 92px;
    white-space: normal;
}

.nav-btn.active .nav-text-sub {
    color: var(--accent);
}

.language-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.lang-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.lang-btn:hover {
    background: var(--bg-muted);
}

.lang-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.45);
}

.modal-content {
    background: var(--bg-card);
    margin: 8px auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    width: calc(100vw - 16px);
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* 文件密碼 Modal：小一點、置中 */
#docAuthModal .modal-content {
    max-width: 420px;
    width: calc(100vw - 28px);
    margin: 18vh auto;
}

.modal-header {
    background: var(--bg-muted);
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 11px 11px 0 0;
}

.modal-header h2 {
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.close {
    color: var(--text-secondary);
    font-size: 26px;
    font-weight: 400;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text);
}

.modal-body {
    padding: 16px;
}

.map-container {
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.embedded-map {
    width: 100%;
    height: 500px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.embedded-map iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px 8px 0 0;
}

.hotels-list {
    background: var(--bg-muted);
    padding: 24px;
    text-align: center;
    border-radius: 0 0 8px 8px;
}

.hotels-list h3 {
    color: var(--text);
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 600;
}

.hotels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 600px;
}

.hotel-marker {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.hotel-marker:hover {
    border-color: var(--border-strong);
}

.hotel-icon {
    font-size: 22px;
    color: var(--accent);
}

.hotel-info {
    text-align: left;
    flex: 1;
}

.hotel-info strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.hotel-info span {
    color: var(--text-secondary);
    font-size: 13px;
}

.google-maps-btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border: none;
}

.google-maps-btn:hover {
    opacity: 0.92;
    color: #fff;
}

.route-info {
    background: var(--bg-muted);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.route-info h3 {
    color: var(--text);
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 600;
}

.route-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.route-info li {
    color: var(--text);
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    line-height: 1.5;
}

.route-info li:last-child {
    border-bottom: none;
}

.route-info strong {
    color: var(--text);
    font-weight: 600;
}

.reminder-list {
    list-style: none;
    margin: 0;
    padding: 2px 0;
    display: grid;
    gap: 10px;
}

.reminder-list li {
    background: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.reminder-list strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

.reminder-list .hl-red {
    white-space: nowrap;
}

.hl-red {
    color: #b91c1c;
    font-weight: 800;
}

.paid-checkbox {
    margin-left: 8px;
    transform: scale(1.2);
    cursor: pointer;
    accent-color: var(--accent);
}

.paid-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

.activity-desc:has(.paid-checkbox:checked)::after {
    content: " Paid";
    color: #b45309;
    font-weight: 500;
    margin-left: 4px;
}
