:root{
  --bg: #0b0d12;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.08);
  --text: rgba(255,255,255,0.95);
  --muted: rgba(255,255,255,0.75);
  --faint: rgba(255,255,255,0.55);
  --border: rgba(255,255,255,0.12);
  --shadow: 0 16px 50px rgba(0,0,0,0.45);
  --shadow2: 0 10px 30px rgba(0,0,0,0.35);
  --radius: 18px;
  --radius2: 24px;
  --max: 1120px;
  --focus: rgba(165, 243, 252, 0.55);
  --accent: rgba(56, 189, 248, 0.9);
  --accent2: rgba(244, 114, 182, 0.85);
  --ok: rgba(52, 211, 153, 0.85);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  /* Modal 專用背景色 */
  --modal-bg: rgba(17, 24, 39, 0.98); 
}

[data-theme="light"]{
  --bg: #f6f7fb;
  --panel: rgba(0,0,0,0.04);
  --panel2: rgba(0,0,0,0.06);
  --text: rgba(0,0,0,0.92);
  --muted: rgba(0,0,0,0.70);
  --faint: rgba(0,0,0,0.52);
  --border: rgba(0,0,0,0.10);
  --shadow: 0 18px 50px rgba(0,0,0,0.10);
  --shadow2: 0 10px 30px rgba(0,0,0,0.08);
  --focus: rgba(59, 130, 246, 0.35);
  
  /* Modal 專用背景色 (純白) */
  --modal-bg: #ffffff;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  background: radial-gradient(1200px 800px at 20% 10%, rgba(56,189,248,0.18), transparent 55%),
              radial-gradient(1200px 800px at 80% 0%, rgba(244,114,182,0.16), transparent 55%),
              radial-gradient(900px 700px at 50% 110%, rgba(52,211,153,0.12), transparent 60%),
              var(--bg);
  color:var(--text);
  line-height:1.55;
}

a{ color:inherit; }
strong{ font-weight:700; color: var(--text); }

.container{
  width:min(var(--max), calc(100% - 40px));
  margin:0 auto;
}

.skip-link{
  position:absolute;
  left:-9999px;
  top:10px;
  background:var(--panel2);
  border:1px solid var(--border);
  padding:10px 12px;
  border-radius:12px;
  z-index: 100;
}
.skip-link:focus{ left:12px; outline:3px solid var(--focus); }

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter: blur(12px);
  background: linear-gradient(to bottom, rgba(0,0,0,0.65), rgba(0,0,0,0.2));
  border-bottom:1px solid var(--border);
}
[data-theme="light"] .topbar{
  background: linear-gradient(to bottom, rgba(255,255,255,0.85), rgba(255,255,255,0.65));
}

.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 0;
  gap:14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand__mark{
  width:38px;height:38px;
  display:grid;place-items:center;
  border-radius:14px;
  background: linear-gradient(145deg, rgba(56,189,248,0.25), rgba(244,114,182,0.18));
  border:1px solid var(--border);
  box-shadow: var(--shadow2);
}
.brand__title{ font-weight:800; letter-spacing:0.2px; }
.brand__subtitle{ font-size:12px; color:var(--muted); margin-top:1px; }

.topbar__actions{ display:flex; gap:10px; }

.btn{
  border:1px solid var(--border);
  background: var(--panel);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:8px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); background: var(--panel2); border-color: rgba(255,255,255,0.22); }
[data-theme="light"] .btn:hover{ border-color: rgba(0,0,0,0.18); }
.btn:active{ transform: translateY(0); }
.btn:focus{ outline:3px solid var(--focus); outline-offset:2px; }
.btn--ghost{ background: transparent; }
.btn__text{ font-weight:650; font-size:14px; }

.hero{
  padding:28px 0 10px;
}
.hero__inner{
  display:grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap:18px;
  align-items:stretch;
}
@media (max-width: 960px){
  .hero__inner{ grid-template-columns: 1fr; }
}

.hero__copy{
  padding:22px;
  border-radius: var(--radius2);
  background: linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  overflow:hidden;
  position:relative;
}
.hero__copy:before{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(700px 260px at 20% 0%, rgba(56,189,248,0.23), transparent 60%),
              radial-gradient(700px 260px at 80% 0%, rgba(244,114,182,0.18), transparent 60%);
  pointer-events:none;
  opacity:0.8;
}

.hero__title{
  position:relative;
  margin:0 0 10px;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing:0.2px;
}
.hero__lead{
  position:relative;
  margin:0 0 16px;
  color:var(--muted);
  font-size:15.5px;
}
.hero__hint{ color:var(--faint); }

/* =========================================
   Toolbar & Inputs (Fixed)
   ========================================= */
.toolbar{
  position:relative;
  display:grid;
  grid-template-columns: 1.3fr 0.7fr 0.7fr;
  gap:16px;
  margin-top:24px;
  background: transparent;
  border: none;
  padding: 0;
}
@media (max-width: 720px){
  .toolbar{ grid-template-columns: 1fr; }
}

.field{ display:flex; flex-direction:column; gap:8px; }
.field__label{
  font-size:13px;
  color:var(--muted);
  letter-spacing:0.5px;
  font-weight: 600;
  margin-left: 4px;
}

/* 輸入框樣式 */
.input,.select{
  border:1px solid var(--border);
  border-radius: 16px;
  padding:12px 16px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  color:var(--text);
  outline:none;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 14px;
}

[data-theme="light"] .input,
[data-theme="light"] .select{
  background: rgba(255,255,255,0.6);
  border-color: rgba(0,0,0,0.1);
}

.input:hover, .select:hover{
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
}
[data-theme="light"] .input:hover, 
[data-theme="light"] .select:hover{
  background: rgba(255,255,255,0.9);
}

.input:focus, .select:focus{ 
  outline:none;
  border-color: var(--accent);
  background: rgba(255,255,255,0.15);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

/* ✅ 修正重點：強制設定 option 背景色與文字顏色 */
.select option {
    background-color: #17171f; /* 深色背景 */
    color: #ffffff;            /* 白色文字 */
}

/* 淺色模式下 option 的修正 */
[data-theme="light"] .select option {
    background-color: #ffffff;
    color: #0f172a;
}

.toolbar__meta{
  grid-column: 1 / -1;
  margin-top:4px;
  font-size:12.5px;
  color:var(--faint);
  margin-left: 4px;
}

/* =========================================
   End Toolbar
   ========================================= */

.hero__card{
  padding:22px;
  border-radius: var(--radius2);
  background: linear-gradient(145deg, rgba(0,0,0,0.18), rgba(255,255,255,0.03));
  border:1px solid var(--border);
  box-shadow: var(--shadow2);
}
[data-theme="light"] .hero__card{
  background: linear-gradient(145deg, rgba(255,255,255,0.7), rgba(255,255,255,0.45));
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius: 999px;
  background: rgba(56,189,248,0.18);
  border:1px solid rgba(56,189,248,0.25);
  color: rgba(224, 242, 254, 0.95);
  font-weight:700;
  font-size:12px;
  margin-bottom:10px;
}
[data-theme="light"] .pill{
  color: rgba(2,132,199,0.95);
  background: rgba(56,189,248,0.16);
  border-color: rgba(56,189,248,0.25);
}
.hero__cardTitle{ margin:0 0 10px; font-size:16px; letter-spacing:0.2px; }
.hero__list{ margin:0; padding-left:18px; color:var(--muted); font-size:13.5px; }
.hero__small{ margin:12px 0 0; color:var(--faint); font-size:12.5px; }

.grid{
  padding:18px 0 34px;
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:16px;
}
@media (max-width: 960px){ .grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px){ .grid{ grid-template-columns: 1fr; } }

.card{
  border-radius: var(--radius2);
  border:1px solid var(--border);
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  overflow:hidden;
  box-shadow: var(--shadow2);
  display:flex;
  flex-direction:column;
  min-height: 470px;
  transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
[data-theme="light"] .card{
  background: linear-gradient(145deg, rgba(255,255,255,0.82), rgba(255,255,255,0.55));
}
.card:hover{
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.22);
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
}
[data-theme="light"] .card:hover{ border-color: rgba(0,0,0,0.14); }

.media{
  position:relative;
  aspect-ratio: 16 / 10;
  background: rgba(255,255,255,0.06);
  overflow:hidden;
}
.media__img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  filter: saturate(1.05) contrast(1.02);
  transform: scale(1.02);
  opacity:0;
  transition: opacity .25s ease;
}
.media__img.is-loaded{ opacity:1; }
.media__shade{
  position:absolute;
  inset:0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), transparent 60%);
  pointer-events:none;
}
.badges{
  position:absolute;
  left:12px;
  bottom:12px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  z-index:2;
}
.badge{
  font-size:12px;
  font-weight:700;
  padding:6px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.30);
  color: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
}
.badge--ok{ border-color: rgba(52,211,153,0.28); background: rgba(52,211,153,0.16); }

.card__body{
  padding:14px 14px 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  flex:1;
}
.card__title{
  margin:0;
  font-size:18px;
  letter-spacing:0.2px;
}
.card__meta{
  color:var(--muted);
  font-size:13px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.meta-dot::before{
  content:"•";
  margin:0 8px 0 0;
  opacity:0.6;
}
.card__summary{
  margin:0;
  color:var(--muted);
  font-size:14px;
}
.tagrow{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.tag{
  font-size:12px;
  padding:6px 10px;
  border-radius: 999px;
  background: var(--panel);
  border:1px solid var(--border);
  color:var(--faint);
}
.card__actions{
  margin-top:auto;
  display:flex;
  gap:10px;
}
.btn--primary{
  background: linear-gradient(145deg, rgba(56,189,248,0.25), rgba(244,114,182,0.18));
  border-color: rgba(56,189,248,0.28);
}
.btn--primary:hover{ border-color: rgba(56,189,248,0.42); }
.btn--mini{
  padding:10px 12px;
  border-radius: 14px;
  justify-content:center;
  flex:1;
}

.empty{
  border:1px dashed var(--border);
  border-radius: var(--radius2);
  padding:28px;
  background: var(--panel);
  display:grid;
  place-items:center;
  text-align:center;
  box-shadow: var(--shadow2);
}
.empty__icon{ font-size:28px; margin-bottom:8px; }
.empty__title{ font-weight:800; margin-bottom:4px; }
.empty__text{ color:var(--muted); }

.footer{
  border-top:1px solid var(--border);
  padding:16px 0 20px;
  background: rgba(0,0,0,0.12);
}
[data-theme="light"] .footer{ background: rgba(255,255,255,0.55); }
.footer__inner{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  flex-wrap:wrap;
}
.footer__title{ font-weight:800; }
.footer__desc{ color:var(--muted); font-size:12.5px; }
.footer__right{ display:flex; gap:8px; flex-wrap:wrap; }
.footer__tag{
  font-size:12px;
  color:var(--faint);
  border:1px solid var(--border);
  background: var(--panel);
  padding:6px 10px;
  border-radius: 999px;
}

/* =========================================
   Modal
   ========================================= */
.modal::backdrop{
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-theme="light"] .modal::backdrop{
  background: rgba(0,0,0,0.6);
}

.modal{
  border:none;
  padding:0;
  background: transparent;
}

.modal__frame{
  width:min(920px, calc(100vw - 24px));
  margin: 8vh auto;
  border-radius: var(--radius2);
  border:1px solid var(--border);
  background: var(--modal-bg);
  box-shadow: 0 24px 80px rgba(0,0,0,0.65);
  position:relative;
  overflow:hidden;
}

.modal__frame--wide{ width:min(1100px, calc(100vw - 24px)); }

.modal__close{
  position:absolute;
  top:10px; right:10px;
  width:38px; height:38px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,0.2);
  color:var(--text);
  cursor:pointer;
  z-index: 10;
}
[data-theme="light"] .modal__close {
  background: rgba(0,0,0,0.05);
}
.modal__close:focus{ outline:3px solid var(--focus); outline-offset:2px; }

.modal__body{
  padding:18px;
  background: transparent;
}
.modal__header{
  padding:6px 6px 14px;
}
.modal__title{
  margin:0 0 6px;
  font-size:18px;
  letter-spacing:0.2px;
  color: var(--text);
}
.modal__sub{
  margin:0;
  color:var(--muted);
  font-size:13.5px;
}

.details{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:16px;
}
@media (max-width: 900px){
  .details{ grid-template-columns: 1fr; }
}
.details__img{
  width:100%;
  border-radius: var(--radius2);
  border:1px solid var(--border);
  background: var(--panel);
  overflow:hidden;
  aspect-ratio: 16/10;
}
.details__img img{
  width:100%; height:100%;
  object-fit:cover;
  display:block;
}
.details__right{ display:flex; flex-direction:column; gap:12px; }
.details__kicker{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
  color:var(--muted);
  font-size:13px;
}

.details__name{
  margin:0;
  font-size:24px;
  letter-spacing:0.2px;
  color: var(--text);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
[data-theme="light"] .details__name{
  text-shadow: none;
}

.details__text{
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height: 1.6;
}

.details__right h3.modal__title {
    color: var(--text);
    font-weight: 700;
    margin-top: 12px;
}

.details__list{
  margin:0;
  padding-left:18px;
  color:var(--muted);
  font-size:13.5px;
  line-height: 1.6;
}
.details__cta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:auto;
}
.linkbtn{
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: var(--panel);
}
.linkbtn:hover{ background: var(--panel2); }
.linkbtn:focus{ outline:3px solid var(--focus); outline-offset:2px; }

.code{
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  padding:14px;
  border-radius: var(--radius2);
  border:1px solid var(--border);
  background: rgba(0,0,0,0.85);
  overflow:auto;
  white-space: pre;
  color: #e2e8f0;
}
[data-theme="light"] .code{
  background: #f1f5f9;
  color: #0f172a;
}

/* ====== Travel Inspiration Panel ====== */
.hero__cardDesc{
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13.5px;
}

.chips{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin: 10px 0 14px;
}

.chip{
  appearance:none;
  border:1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding:10px 12px;
  border-radius: 999px;
  cursor:pointer;
  font-weight:700;
  font-size:12.5px;
  letter-spacing:0.1px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.chip:hover{
  transform: translateY(-1px);
  background: var(--panel2);
  border-color: rgba(255,255,255,0.22);
}
[data-theme="light"] .chip:hover{
  border-color: rgba(0,0,0,0.16);
}
.chip:focus{
  outline:3px solid var(--focus);
  outline-offset:2px;
}

.hero__cardActions{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
  margin: 6px 0 14px;
}
@media (max-width: 960px){
  .hero__cardActions{ grid-template-columns: 1fr; }
}

.btn--wide{
  width:100%;
  justify-content:center;
}

.miniPanel{
  border:1px solid var(--border);
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border-radius: var(--radius2);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow2);
}

.miniPanel__title{
  font-weight:800;
  letter-spacing:0.2px;
  margin-bottom:8px;
}

.miniList{
  margin:0;
  padding-left:18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}
.miniList strong{ color: var(--text); }

/* ====== Quick Chips ====== */
.quickstart__chips{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.quickstart__hint{
  margin-top:8px;
  font-size:12.5px;
  color:var(--faint);
}

.quickstart__chips .chip,
.quickchip{
  appearance:none;
  border:1px solid var(--border);
  background: var(--panel);
  color:var(--text);
  padding:10px 12px;
  border-radius: 999px;
  cursor:pointer;
  font-weight:800;
  font-size:12.5px;
  letter-spacing:0.1px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.quickstart__chips .chip:hover,
.quickchip:hover{
  transform: translateY(-1px);
  background: var(--panel2);
  border-color: rgba(255,255,255,0.22);
}

[data-theme="light"] .quickstart__chips .chip:hover,
[data-theme="light"] .quickchip:hover{
  border-color: rgba(0,0,0,0.16);
}

.quickstart__chips .chip:focus,
.quickchip:focus{
  outline:3px solid var(--focus);
  outline-offset:2px;
}

.chip.is-active{
  border-color: rgba(56,189,248,0.42);
  background: linear-gradient(145deg, rgba(56,189,248,0.22), rgba(244,114,182,0.14));
}

/* =========================================
   Theme tokens + Background Handling
   ========================================= */

/* Dark (default) */
:root{
  --bg: #070a0f;
  --bg1: rgba(56,189,248,0.16);
  --bg2: rgba(244,114,182,0.14);
  --bg3: rgba(52,211,153,0.10);

  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);
  --faint: rgba(255,255,255,0.56);

  --panel: rgba(17,24,39,0.78);
  --panel2: rgba(17,24,39,0.62);
  --border: rgba(255,255,255,0.14);
  --focus: rgba(56,189,248,0.55);
}

/* Light */
html[data-theme="light"],
body[data-theme="light"]{
  --bg: #f6f7fb;
  --bg1: rgba(59,130,246,0.18);
  --bg2: rgba(236,72,153,0.14);
  --bg3: rgba(34,197,94,0.12);

  --text: rgba(15,23,42,0.92);
  --muted: rgba(15,23,42,0.70);
  --faint: rgba(15,23,42,0.55);

  --panel: rgba(255,255,255,0.80);
  --panel2: rgba(255,255,255,0.62);
  --border: rgba(15,23,42,0.14);
  --focus: rgba(59,130,246,0.45);
}

html, body { height: 100%; }

body{
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 700px at 20% 15%, var(--bg1), rgba(0,0,0,0) 55%),
    radial-gradient(1000px 650px at 85% 30%, var(--bg2), rgba(0,0,0,0) 60%),
    radial-gradient(900px 600px at 65% 90%, var(--bg3), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0) 45%, rgba(0,0,0,0.10));
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

.hero, main, .footer, .container { background: transparent; }

/* 元件顏色綁定 */
.topbar{ background: var(--panel); border-bottom: 1px solid var(--border); }
.hero__copy, .hero__card, .card{
  background: var(--panel);
  border: 1px solid var(--border);
}

/* 修正輸入框背景，確保在透明 Toolbar 上清楚可見 */
.select, .input{
  border: 1px solid var(--border);
}

.hero__lead, .hero__cardDesc, .quickstart__hint, .miniList, .card__summary{
  color: var(--muted);
}

/* Noise texture */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events:none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}
html[data-theme="light"] body::before,
body[data-theme="light"]::before{
  opacity: 0.03;
  mix-blend-mode: multiply;
}