:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --muted:#6b7280;
  --text:#0f172a;
  --accent:#2dd4bf;
  --accent2:#60a5fa;
  --danger:#f59e0b;
  --line:#e5e7eb;
}

*{box-sizing:border-box;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
}

/* =========================
   Header
========================= */
.app-header{
  position:sticky; top:0; z-index:10;
  padding:14px 16px;
  background:linear-gradient(180deg,#ffffff,#f6f8fb);
  border-bottom:1px solid var(--line);
}
.title{font-size:20px; font-weight:800; letter-spacing:.2px;}
.subtitle{font-size:12px; color:var(--muted); margin-top:2px;}

.app{padding:14px 14px 28px;}
.page{display:flex; flex-direction:column; gap:12px;}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:12px;
  box-shadow:0 8px 22px rgba(15,23,42,.08);
}

.section-title{
  font-size:15px; font-weight:900; margin-bottom:8px;
}

/* =========================
   ✅ 頁面 Topbar
========================= */
.page-topbar{
  display:flex;
  align-items:center;
  gap:10px;
}
.back-home-btn{
  border:none;
  background:#eef2ff;
  color:var(--text);
  padding:7px 10px;
  border-radius:10px;
  font-weight:900;
  cursor:pointer;
  border:1px solid var(--line);
}
.page-title{
  font-size:16px;
  font-weight:900;
}

/* =========================
   ✅ Home 首頁（時尚白底）
========================= */
.home-page{gap:14px;}

.hero-card{
  padding:0;
  overflow:hidden;
  position:relative;
  border-radius:18px;
  border:1px solid var(--line);
  box-shadow:0 10px 26px rgba(15,23,42,.10);
}
.hero-img{
  width:100%;
  height:190px;
  object-fit:cover;
  display:block;
}
.hero-overlay{
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.05) 55%, rgba(0,0,0,0));
  padding:14px;
  color:#fff;
}
.hero-title{
  font-size:18px;
  font-weight:900;
}
.hero-subtitle{
  font-size:13px;
  opacity:.9;
  margin-top:3px;
}

.home-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}
.home-btn{
  background:#ffffff;
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px 8px;
  color:var(--text);
  cursor:pointer;
  display:grid;
  gap:6px;
  justify-items:center;
  box-shadow:0 6px 16px rgba(15,23,42,.06);
  transition:.12s transform ease, .12s box-shadow ease;
}
.home-btn:active{ transform:scale(.97); }
.home-btn-icon{ font-size:22px; }
.home-btn-text{ font-size:13px; font-weight:900; }

/* =========================
   Modal（白底）
========================= */
.modal-overlay{
  position:fixed; inset:0;
  background:rgba(15,23,42,.45);
  display:flex; align-items:center; justify-content:center;
  z-index:9999;
}
.modal{
  width:min(92vw, 760px);
  max-height:88vh;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  display:flex; flex-direction:column;
  overflow:hidden;
}
.modal-head{
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 12px;
  background:#f8fafc;
  border-bottom:1px solid var(--line);
}
.modal-title{ font-weight:900; font-size:14px; }
.modal-close{
  border:none; background:transparent; color:var(--text);
  font-size:18px; cursor:pointer; font-weight:900;
}
.modal-body{
  padding:10px;
  overflow:auto;
}
.modal-img{
  width:100%;
  border-radius:10px;
}
.modal-iframe{
  width:100%;
  height:70vh;
  border:none;
  border-radius:10px;
}
/* ✅ PDF embed 需要的高度 */
.modal-embed{
  width:100%;
  height:70vh;
  border:none;
  border-radius:10px;
}
.modal-download{
  display:inline-block;
  margin-top:10px;
  padding:10px 12px;
  border-radius:10px;
  background:var(--accent2);
  color:white;
  font-weight:900;
  text-decoration:none;
}

/* =========================
   行程 / 探索 / 航班 / 飯店
========================= */
.day-title{display:flex; flex-direction:column; gap:2px; margin-bottom:8px;}
/* ✅ 日期放大＆更明顯 */
.day-date{
  font-size:15px;
  font-weight:900;
  color:var(--text);
  letter-spacing:.3px;
}
.day-name{
  font-size:17px;
  font-weight:900;
}

.timeline{display:flex; flex-direction:column; gap:8px;}
.tl-row{
  display:grid; grid-template-columns:72px 1fr; gap:8px; align-items:start;
  padding:8px; border-radius:12px; background:#f8fafc;
  border:1px solid var(--line);
}
.tl-time{color:var(--muted); font-size:12px; padding-top:2px;}
.tl-text{font-size:14px; line-height:1.4;}
.tl-place{font-size:12px; color:var(--accent); margin-top:2px; font-weight:800;}
.tl-note{font-size:12px; color:var(--danger); margin-top:4px; font-weight:800;}
.tl-map{display:inline-block; margin-top:6px; color:var(--accent2); text-decoration:none; font-size:12px;}

.spot-title{font-size:15px; font-weight:900;}
.spot-desc{color:var(--muted); font-size:13px; margin:6px 0 8px; line-height:1.5;}
.spot-subtitle{
  font-size:13px;
  color:var(--accent);
  margin-top:4px;
  margin-bottom:6px;
  font-weight:900;
}
.spot-map{color:var(--accent2); text-decoration:none; font-size:12px;}
.spot-card img{
  width:100%; border-radius:12px; margin-top:8px; border:1px solid var(--line);
}
.chip{
  display:inline-block; font-size:11px; padding:3px 8px; border-radius:999px;
  background:#f1f5f9; border:1px solid var(--line); color:var(--muted);
  margin-bottom:6px;
}

.flight-row, .hotel-row{
  padding:10px; border-radius:12px; background:#f8fafc;
  border:1px solid var(--line); margin-top:8px;
}

.flight-top{display:flex; justify-content:space-between; align-items:center;}
.flight-no{font-size:15px; font-weight:900;}
.flight-airline{font-size:12px; color:var(--muted);}
.flight-mid{display:flex; justify-content:space-between; margin-top:6px; font-size:14px;}
.flight-bot{display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; font-size:12px; color:var(--muted);}
.pnr{margin-top:6px; font-size:12px; color:var(--accent); font-weight:800;}

.hotel-name{font-size:15px; font-weight:900;}
.hotel-addr{font-size:12px; color:var(--muted); margin-top:4px;}
.hotel-meta{font-size:12px; color:var(--muted); margin-top:6px; display:grid; gap:2px;}
.hotel-note{font-size:12px; color:var(--danger); margin-top:6px; font-weight:800;}

.muted{color:var(--muted); font-size:12px;}

/* =========================
   Files 檔案頁（白底）
========================= */
.files-box{display:grid; gap:8px;}
.files-input{
  width:100%;
  padding:10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
}
.files-name-input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  font-size:14px;
  outline:none;
}
.files-save-btn{
  border:none; border-radius:12px;
  padding:10px; font-size:14px;
  font-weight:900; color:white;
  background:var(--accent);
  cursor:pointer;
}
.files-hint{line-height:1.5;}

.file-list{display:grid; gap:8px; margin-top:8px;}
.file-item-row{
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:6px;
  align-items:center;
  padding:8px 10px;
  border-radius:12px;
  background:#f8fafc;
  border:1px solid var(--line);
}
.file-item-title{font-weight:900; font-size:14px;}
.file-item-meta{font-size:12px;}
.file-open-btn{
  border:none; border-radius:10px;
  padding:6px 8px; font-weight:900;
  background:var(--accent2); color:white; cursor:pointer;
}
.file-del-btn{
  border:none; border-radius:10px;
  padding:6px 8px; font-weight:900;
  background:#ef4444; color:white; cursor:pointer;
}

/* =========================
   Weather 7日天氣（白底）
========================= */
.weather-box{display:grid; gap:8px;}
.weather-row{
  display:grid; grid-template-columns:1fr auto; gap:8px;
}
.weather-select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  font-size:14px;
}
.weather-btn{
  border:none; border-radius:12px;
  padding:10px 12px; font-size:14px;
  font-weight:900; color:white;
  background:var(--accent2);
  cursor:pointer;
}
.weather-list{display:grid; gap:8px; margin-top:6px;}
.weather-item{
  padding:10px;
  border-radius:12px;
  background:#f8fafc;
  border:1px solid var(--line);
  display:grid; gap:4px;
}
.weather-date{font-weight:900;}
.weather-desc{font-size:14px;}
.weather-temp{font-size:14px;}
.weather-rain{font-size:12px;}

/* =========================
   Map Search（白底）
========================= */
.map-box{display:grid; gap:8px;}
.map-input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  font-size:14px;
  outline:none;
}
.map-btn{
  border:none;
  border-radius:12px;
  padding:10px;
  font-size:14px;
  font-weight:900;
  color:white;
  background:var(--accent2);
  cursor:pointer;
}

/* =========================
   Currency 錢幣頁（海島叢林風）
   ========================= */

.currency-box{
  margin-top:8px;
  display:grid;
  gap:14px;
  padding:14px 12px 16px;
  border-radius:18px;
  border:1px solid var(--line);
  background:
    radial-gradient(circle at 0% 0%, #ecfdf5 0, #eff6ff 45%, #ffffff 100%);
  box-shadow:0 10px 24px rgba(15,23,42,.08);
}

.currency-two{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  gap:10px;
  align-items:flex-end;
}

.currency-col{
  display:grid;
  gap:6px;
}

.currency-label{
  font-size:12px;
  font-weight:900;
  letter-spacing:.3px;
  color:var(--accent);
}

.currency-input{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.9);
  font-size:15px;
  font-weight:700;
  outline:none;
  transition:
    .12s border-color ease,
    .12s box-shadow ease,
    .12s background-color ease;
}

.currency-input::placeholder{
  color:#cbd5f5;
  font-weight:400;
}

.currency-input:focus{
  border-color:var(--accent2);
  box-shadow:0 0 0 1px rgba(59,130,246,.25);
  background:#fff;
}

.currency-input.small{
  max-width:120px;
  font-size:14px;
  font-weight:600;
}

.swap-btn{
  border:none;
  width:40px;
  height:40px;
  border-radius:999px;
  background:radial-gradient(circle at 30% 20%, #22c55e, #0ea5e9);
  color:#fff;
  font-size:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 10px 20px rgba(15,23,42,.30);
  cursor:pointer;
  transform:translateY(4px);
  transition:.15s transform ease, .15s box-shadow ease;
}

.swap-btn:active{
  transform:translateY(6px) scale(.96) rotate(90deg);
  box-shadow:0 6px 15px rgba(15,23,42,.25);
}

.currency-rate{
  display:inline-flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  padding:8px 10px;
  border-radius:999px;
  background:rgba(15,118,110,.05);
  border:1px dashed rgba(15,118,110,.4);
  font-size:13px;
}

.currency-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.currency-btn{
  border:none;
  border-radius:999px;
  padding:10px 12px;
  font-size:14px;
  font-weight:900;
  color:#fff;
  background:linear-gradient(135deg, #16a34a, #22c55e);
  cursor:pointer;
  box-shadow:0 6px 16px rgba(22,163,74,.40);
  transition:.12s transform ease, .12s box-shadow ease, .12s opacity ease;
}

.currency-btn.alt{
  background:linear-gradient(135deg, #0ea5e9, #22c55e);
}

.currency-btn:active{
  transform:translateY(1px) scale(.98);
  box-shadow:0 3px 10px rgba(15,23,42,.30);
}

.currency-hint{
  margin-top:4px;
  font-size:11px;
  opacity:.8;
}

.currency-hint::before{
  content:"🌏 ";
}

/* =========================
   Notes 筆記頁（旅行手帳風）
   ========================= */

.notes-box{
  margin-top:8px;
  display:grid;
  gap:10px;
  padding:14px 12px 16px;
  border-radius:18px;
  border:1px solid var(--line);
  background:linear-gradient(135deg,
    rgba(251,244,245,.9),
    rgba(239,246,255,.95));
  box-shadow:0 10px 24px rgba(15,23,42,.07);
}

.notes-textarea{
  width:100%;
  min-height:130px;
  border-radius:16px;
  border:1px solid var(--line);
  padding:10px 12px;
  font-size:14px;
  line-height:1.5;
  resize:vertical;
  outline:none;
  background:#fffdf7;
  /* 淡淡的橫線感 */
  background-image:linear-gradient(
    to bottom,
    rgba(226,232,240,.9) 1px,
    transparent 1px
  );
  background-size:100% 26px;
}

.notes-textarea:focus{
  border-color:var(--accent2);
  box-shadow:0 0 0 1px rgba(59,130,246,.20);
  background-color:#ffffff;
}

.notes-photo-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

/* input 改成隱藏，由按鈕觸發 click() */
.notes-photo-input{
  display:none;
}

.notes-btn{
  border:none;
  border-radius:999px;
  padding:8px 14px;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
  background:linear-gradient(135deg, #f97316, #facc15);
  color:#fff;
  box-shadow:0 6px 14px rgba(248,113,113,.4);
  transition:.12s transform ease, .12s box-shadow ease, .12s opacity ease;
}

.notes-btn.photo{
  background:linear-gradient(135deg, #0ea5e9, #22c55e);
}

.notes-btn:active{
  transform:translateY(1px) scale(.98);
  box-shadow:0 3px 10px rgba(15,23,42,.25);
}

/* 照片預覽區 */
.photo-preview{
  min-height:40px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.photo-thumb{
  position:relative;
  width:72px;
  height:72px;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 4px 10px rgba(15,23,42,.25);
}

.photo-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.thumb-del{
  position:absolute;
  top:4px;
  right:4px;
  border:none;
  border-radius:999px;
  width:20px;
  height:20px;
  font-size:12px;
  background:rgba(15,23,42,.75);
  color:#fff;
  cursor:pointer;
}

/* 已儲存的筆記列表 */
.notes-list{
  display:grid;
  gap:10px;
  margin-top:4px;
}

.notes-item{
  padding:10px 10px 12px;
  border-radius:14px;
  background:#ffffff;
  border:1px solid var(--line);
  box-shadow:0 6px 16px rgba(15,23,42,.06);
}

.notes-time{
  font-size:12px;
  color:var(--muted);
  margin-bottom:4px;
}

.note-del-btn{
  float:right;
  border:none;
  border-radius:999px;
  padding:4px 8px;
  font-size:11px;
  font-weight:800;
  background:#fee2e2;
  color:#b91c1c;
  cursor:pointer;
}

.notes-content{
  font-size:14px;
  line-height:1.5;
  margin-top:2px;
}

.notes-gallery{
  margin-top:6px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.notes-gallery img{
  width:72px;
  height:72px;
  border-radius:10px;
  object-fit:cover;
  border:1px solid rgba(148,163,184,.6);
}

