/* 旅行日誌風：單欄、細線分欄、襯線數字；配色取自夜空藍色系中的玫瑰粉／法國藍／深藍 */
:root {
  --bg: #F5F4F1;
  --surface: #FFFFFF;
  --ink: #1E2537;
  --navy: #0C3782;
  --blue: #5491C0;
  --blush: #EBD1DA;
  --blush-soft: #F7ECF0;
  --blue-soft: #E6EEF6;
  --line: #DCDAD4;
  --muted: #7C8090;
  --serif: "Cormorant Garamond", "Noto Serif TC", Georgia, serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-weight: 300; font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-block: 0 calc(84px + env(safe-area-inset-bottom, 0px));
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.3; text-wrap: balance; }
p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 1.5px solid var(--blue); outline-offset: 3px; }
.wrap { max-width: 680px; margin: 0 auto; }
svg { display: block; }
.num { font-family: var(--serif); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--serif); letter-spacing: .18em; text-transform: uppercase; font-size: 12px; color: var(--muted); }

/* 頂欄 */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--bg);
  margin: 0 calc(-1 * max(20px, env(safe-area-inset-right, 0px))) 0 calc(-1 * max(20px, env(safe-area-inset-left, 0px)));
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; height: 60px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand .eyebrow { color: var(--ink); white-space: nowrap; }
.brand .slash { color: var(--line); font-family: var(--serif); }
.brand .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); font-size: 14px; letter-spacing: .08em; padding-bottom: 2px; border-bottom: 1px solid transparent; }
.nav a.on { color: var(--navy); border-bottom-color: var(--navy); }
.menu-btn { display: none; margin-left: auto; width: 40px; height: 40px; place-items: center; }
.menu-btn svg { width: 24px; height: 24px; }
.menu-btn path { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; transition: transform .25s, opacity .2s; transform-origin: 12px 12px; }
.menu-open .menu-btn .bar1 { transform: rotate(45deg) translateY(5px); }
.menu-open .menu-btn .bar2 { opacity: 0; }
.menu-open .menu-btn .bar3 { transform: rotate(-45deg) translateY(-5px); }
@media (max-width: 599px) {
  .menu-btn { display: grid; }
  .brand .eyebrow { letter-spacing: .12em; font-size: 11.5px; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 6px max(20px, env(safe-area-inset-right, 0px)) 10px max(20px, env(safe-area-inset-left, 0px)); }
  .menu-open .nav { display: flex; }
  /* 選單打開時的藍色遮罩：掛在 body、層級低於 topbar(9)，頂欄與選單維持原色 */
  .menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(12, 55, 130, .55); z-index: 8; }
  .nav a { font-size: 17px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .nav a.on { color: var(--navy); }
}

/* 底部頁籤 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; background: var(--surface); border-top: 1px solid var(--line);
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.tabbar .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.tabbar a { text-decoration: none; color: var(--muted); font-size: 11px; letter-spacing: .06em; display: grid; justify-items: center; gap: 4px; }
.tabbar a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--navy); }
@media (min-width: 600px) { .tabbar { display: none; } body { padding-bottom: 60px; } }

/* 版面 */
.view { padding-block: 28px 8px; }
.sec { padding-block: 26px; border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.sec-head h2 { font-size: 20px; font-weight: 400; letter-spacing: .04em; }
.sec-head .eyebrow { margin-left: auto; }

/* 首頁 */
.hero { padding-block: 18px 30px; }
.hero-art { aspect-ratio: 2 / 1; overflow: hidden; border-radius: 6px; background: var(--blue-soft); margin-bottom: 22px; }
.hero-art video, .hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero .eyebrow { margin-bottom: 14px; }
.hero h1 { font-family: var(--serif); font-size: 44px; font-weight: 500; letter-spacing: .02em; line-height: 1.05; color: var(--navy); }
.hero h1 .thin { display: block; font-size: 22px; font-weight: 400; color: var(--muted); letter-spacing: .12em; margin-top: 6px; }
.hero .zh { font-size: 18px; margin-top: 14px; }
.hero .dates { font-family: var(--serif); font-size: 17px; letter-spacing: .08em; color: var(--muted); margin-top: 6px; }
.countdown { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cd { padding: 16px 8px; text-align: center; border-left: 1px solid var(--line); }
.cd:first-child { border-left: 0; }
.cd b { display: block; font-family: var(--serif); font-size: 42px; font-weight: 500; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.cd span { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.cd-note { margin-top: 12px; font-size: 13px; color: var(--muted); text-align: center; }
.flight { padding: 18px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.flight:last-child { border-bottom: 0; }
.flight .ap small { display: block; font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.flight .ap .t { font-family: var(--serif); font-size: 34px; font-weight: 500; line-height: 1.1; color: var(--navy); }
.flight .ap .t sup { font-size: 13px; color: var(--blue); }
.flight .ap.r { text-align: right; }
.flight .mid { text-align: center; color: var(--muted); font-size: 12px; align-self: center; }
.flight .mid svg { width: 60px; height: 20px; margin: 0 auto 4px; stroke: var(--blue); fill: none; stroke-width: 1.3; }
.flight .meta { grid-column: 1 / -1; display: flex; gap: 14px; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.flight .meta .dir { color: var(--navy); }

/* 行程 */
.day-strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * max(20px, env(safe-area-inset-right, 0px))) 0 calc(-1 * max(20px, env(safe-area-inset-left, 0px))); padding: 2px max(20px, env(safe-area-inset-right, 0px)) 12px max(20px, env(safe-area-inset-left, 0px)); }
.day-strip::-webkit-scrollbar { display: none; }
.day-btn { flex: none; width: 68px; padding: 10px 4px 9px; text-align: center; color: var(--muted); background: var(--surface); border-radius: 6px; }
.day-btn b { display: block; font-family: var(--serif); font-size: 24px; font-weight: 500; line-height: 1.1; color: var(--navy); }
.day-btn small { display: block; font-size: 11px; letter-spacing: .04em; line-height: 1.5; }
.day-btn small:first-of-type { margin-top: 4px; }
.day-btn[aria-selected="true"] { background: var(--navy); color: rgba(255,255,255,.85); }
.day-btn[aria-selected="true"] b { color: #fff; }
.day-head { padding: 22px 0 8px; display: flex; align-items: baseline; gap: 12px; }
.day-head .d { font-family: var(--serif); font-size: 30px; font-weight: 500; color: var(--navy); }
.day-head .city { font-size: 18px; }
.day-head .date { margin-left: auto; font-family: var(--serif); color: var(--muted); letter-spacing: .08em; white-space: nowrap; }
.meals { display: flex; gap: 0; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.meals div { flex: 1; min-width: 0; padding: 8px 10px 8px 0; }
.meals div + div { padding-left: 10px; border-left: 1px solid var(--line); }
.meals b { display: block; font-weight: 400; letter-spacing: .1em; font-size: 11px; }
.meals span { color: var(--ink); font-size: 13px; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl-item { display: grid; grid-template-columns: 52px 1fr; gap: 0 12px; padding: 20px 0; border-bottom: 1px solid var(--line); position: relative; }
.tl-item .slot { font-family: var(--serif); font-size: 15px; color: var(--muted); letter-spacing: .04em; padding-top: 2px; position: relative; }
.tl-item .slot::after { content: ""; position: absolute; right: -9px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.tl-item.visit .slot::after, .tl-item.walk .slot::after { background: var(--navy); }
.tl-item.photo .slot::after { background: var(--blush); outline: 1px solid var(--navy); outline-offset: -1px; }
.tl-item.meal .slot::after { background: var(--blue); }
.tl-item.hotel .slot::after { background: var(--ink); }
.tl-item .body { min-width: 0; }
.tl-item .cat { font-size: 12px; color: var(--muted); letter-spacing: .06em; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.tl-item .cat .mk { color: var(--navy); }
.tl-item .cat .tr { color: var(--blue); }
.tl-item h3 { font-size: 19px; font-weight: 400; margin-top: 4px; }
.tl-item p { font-size: 14px; color: var(--muted); margin-top: 6px; }
.tl-item.move { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.tl-item.move h3 { font-size: 15px; color: var(--muted); font-weight: 300; margin-top: 0; }
.tl-item.move .cat { color: var(--blue); }
.day-nav { display: flex; justify-content: space-between; padding: 18px 0 4px; }
.day-nav button { color: var(--navy); font-size: 14px; letter-spacing: .08em; }
.day-nav button[disabled] { color: var(--line); }

.extras { margin-top: 40px; padding-top: 6px; }
.extras .sec-head { margin-bottom: 12px; }
details { background: var(--surface); padding: 0 18px; margin-bottom: 10px; }
summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 15px 0; font-size: 15px; font-weight: 400; color: var(--navy); }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; width: 8px; height: 8px; border-right: 1.3px solid var(--navy); border-bottom: 1.3px solid var(--navy); transform: rotate(45deg); transition: transform .25s; margin-right: 4px; }
details[open] summary::after { transform: rotate(-135deg); }
details[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 14px; }
/* 行李／行前準備：收合區塊內的清單 */
details.x-list { padding-bottom: 18px; margin-bottom: 14px; }
details.x-list summary > span:first-child { font-size: 17px; }
details.x-list summary .num { margin-left: auto; margin-right: 14px; }
details.x-list .progress { margin-top: 0; }
details.x-list .group-title:first-child { padding-top: 0; }
.dl { padding: 0 0 18px; display: grid; gap: 12px; }
.dl .row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.dl .row span:last-child { font-family: var(--serif); color: var(--muted); white-space: nowrap; }
.opt { padding: 0 0 14px; }
.opt b { font-weight: 400; display: block; font-size: 16px; }
.opt .price { font-family: var(--serif); color: var(--navy); font-size: 15px; letter-spacing: .04em; }
.opt p { font-size: 13px; color: var(--muted); }

/* 清單 */
.progress { height: 2px; background: var(--line); margin: 10px 0 20px; }
.progress i { display: block; height: 100%; background: var(--navy); width: 0; transition: width .4s; }
.group-title { font-size: 12px; letter-spacing: .14em; color: var(--muted); padding: 18px 0 6px; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.check-item input[type=checkbox] { appearance: none; width: 22px; height: 22px; border-radius: 50%; border: 1.3px solid var(--navy); margin: 0; flex: none; display: grid; place-items: center; background: var(--surface); }
.check-item input[type=checkbox]:checked { background: var(--navy); }
.check-item input[type=checkbox]:checked::after { content: ""; width: 9px; height: 5px; border-left: 1.6px solid #fff; border-bottom: 1.6px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.check-item .lbl { flex: 1; min-width: 0; font-size: 15px; }
.check-item.done .lbl { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.check-item .where { font-size: 12px; color: var(--blue); letter-spacing: .06em; flex: none; }
.check-item .del { color: var(--line); font-size: 20px; line-height: 1; flex: none; padding: 0 4px; }
.check-item .del:hover { color: var(--muted); }
.add-row { display: flex; gap: 14px; align-items: end; padding-top: 16px; }
.add-row input[type=text] { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--navy); background: transparent; padding: 6px 0; font-size: 15px; }
.add-row input.where-in { flex: 0 1 84px; }
.add-row button { color: var(--navy); font-size: 13px; letter-spacing: .14em; padding-bottom: 6px; border-bottom: 1px solid transparent; }
.add-row button:hover { border-bottom-color: var(--navy); }
.two-col { display: grid; gap: 30px; }
@media (min-width: 600px) { .two-col { grid-template-columns: 1fr 1fr; } }
.list-head { font-size: 16px; letter-spacing: .06em; padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.empty { font-size: 13px; color: var(--muted); padding: 12px 0; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 6px 18px; font-size: 13px; letter-spacing: .08em; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; }

/* 動畫：淡入上移 */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.anim .day-panel.enter { animation: rise .35s ease-out; }
.anim .view { animation: rise .3s ease-out; }
body:not(.anim) * { animation: none !important; transition: none !important; }
html:has(body:not(.anim)) { scroll-behavior: auto; }

/* 項目動作：照片／鉛筆 */
.tl-item .hd { display: flex; align-items: flex-start; gap: 10px; margin-top: 4px; }
.tl-item .hd h3 { margin-top: 0; flex: 1; min-width: 0; }
.acts { display: flex; gap: 2px; flex: none; margin-top: -2px; }
.act { width: 32px; height: 32px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; }
.act svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.act:hover, .act:focus-visible { color: var(--navy); background: var(--blue-soft); }
.tl-item.move .act { width: 28px; height: 28px; }
.day-head .act { margin-left: 2px; align-self: center; }
.note { margin-top: 10px; padding: 10px 14px; background: var(--blush-soft); color: var(--ink); font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; position: relative; }
.note::before { content: "✎"; position: absolute; right: 10px; top: 4px; font-size: 12px; color: var(--muted); }
.day-panel > .note { margin: 0 0 18px; }
.note-edit { margin-top: 10px; }
.day-panel > .note-edit { margin: 0 0 18px; }
.note-edit textarea { width: 100%; display: block; border: 0; border-bottom: 1px solid var(--navy); background: var(--surface); padding: 10px 12px; font-size: 15px; line-height: 1.6; resize: vertical; min-height: 72px; }
.note-acts { display: flex; gap: 18px; padding-top: 8px; }
.note-acts button { font-size: 13px; letter-spacing: .14em; color: var(--navy); border-bottom: 1px solid transparent; }
.note-acts button:hover { border-bottom-color: var(--navy); }
.note-acts .cancel { color: var(--muted); }
.note-acts .clear { color: #9A4B5E; margin-left: auto; }

/* 燈箱 */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(100vw - 24px, 720px); width: 100%; margin: auto; }
.lightbox::backdrop { background: rgba(12, 55, 130, .72); }
.lb-box { background: var(--bg); padding: 14px 16px 16px; }
.lb-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; }
.lb-title { font-size: 16px; font-weight: 400; color: var(--navy); flex: 1; min-width: 0; }
.lb-close { width: 32px; height: 32px; display: grid; place-items: center; color: var(--ink); }
.lb-close svg, .lb-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lb-stage { position: relative; background: var(--blue-soft); }
.lb-stage img { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.lb-nav[hidden] { display: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: rgba(12, 55, 130, .55); border-radius: 50%; }
.lb-nav.prev { left: 8px; } .lb-nav.prev svg { transform: rotate(180deg); }
.lb-nav.next { right: 8px; }
.lb-cap { font-size: 14px; margin-top: 10px; }
.lb-cap:empty { display: none; }

/* 記帳 */
.exp-form { display: grid; gap: 14px; padding-bottom: 8px; }
.exp-form input[type=text], .exp-form input[type=number], .exp-form select { border: 0; border-bottom: 1px solid var(--navy); background: transparent; padding: 6px 0; font-size: 15px; min-width: 0; border-radius: 0; }
.exp-form input[type=text] { width: 100%; }
.exp-row { display: flex; gap: 14px; align-items: end; }
.exp-row .amt { flex: 1 1 110px; display: flex; align-items: baseline; gap: 4px; min-width: 0; }
.exp-row .amt .cur { font-family: var(--serif); font-size: 18px; color: var(--navy); }
.exp-row .amt input { width: 100%; }
.exp-row select { flex: 0 1 110px; appearance: none; -webkit-appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230C3782' stroke-width='1.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0 center / 16px; padding-right: 20px; color: var(--ink); }
.exp-row button { color: var(--navy); font-size: 13px; letter-spacing: .14em; padding-bottom: 6px; border-bottom: 1px solid transparent; flex: none; }
.exp-row button:hover { border-bottom-color: var(--navy); }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.exp-list { list-style: none; margin: 18px 0 0; padding: 0; }
.exp-item { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.exp-item .cat { font-size: 11px; letter-spacing: .08em; color: var(--blue); white-space: nowrap; }
.exp-item .lbl { font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.exp-item .amt { text-align: right; display: grid; line-height: 1.3; }
.exp-item .amt b { font-weight: 500; font-size: 17px; color: var(--navy); }
.exp-item .amt small { font-size: 12px; color: var(--muted); }
.exp-item .del { color: var(--line); font-size: 20px; line-height: 1; padding: 0 4px; }
.exp-item .del:hover { color: var(--muted); }
.exp-list .empty { padding: 20px 0; color: var(--muted); font-size: 14px; }
.exp-total { margin-top: 22px; background: var(--surface); padding: 16px 18px 14px; }
.exp-total .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.exp-total .row.main { font-size: 15px; padding: 6px 0; }
.exp-total .row.main b { font-weight: 500; font-size: 24px; color: var(--navy); }
.exp-total .row.main + .row.main { border-top: 1px solid var(--line); }
.exp-total .row.rate { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.link { color: var(--navy); font-size: 12px; letter-spacing: .12em; border-bottom: 1px solid transparent; white-space: nowrap; }
.link:hover { border-bottom-color: var(--navy); }
.rate-form[hidden] { display: none; }
.rate-form { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: baseline; margin-top: 12px; font-size: 14px; }
.rate-form input { width: 90px; border: 0; border-bottom: 1px solid var(--navy); background: transparent; padding: 4px 0; font-size: 15px; font-family: var(--serif); }
.rate-form button[type=submit] { color: var(--navy); font-size: 13px; letter-spacing: .14em; border-bottom: 1px solid transparent; }
.rate-form button[type=submit]:hover { border-bottom-color: var(--navy); }
.tabbar .wrap { grid-template-columns: repeat(5, 1fr); }

/* 密碼鎖 */
.keybox { border: 0; padding: 0; background: transparent; width: min(100vw - 40px, 360px); margin: auto; }
.keybox::backdrop { background: var(--navy); }
.keybox form { background: var(--bg); padding: 26px 24px 24px; display: grid; gap: 10px; }
.keybox h2 { font-size: 18px; color: var(--navy); }
.key-msg { font-size: 13px; color: var(--muted); }
.keybox input { border: 0; border-bottom: 1px solid var(--navy); background: transparent; padding: 8px 0; font-size: 17px; letter-spacing: .2em; margin-top: 8px; }
.keybox button { justify-self: end; color: var(--navy); font-size: 13px; letter-spacing: .14em; border-bottom: 1px solid var(--navy); margin-top: 6px; }
