/* ===================================================================
   AI 行程神隊友 — 結構化逐日卡片樣式（ai-go.php / member_center.php 共用）
   依賴變數（缺省時 fallback）：--primary #0073e6、--accent #f59e0b
   =================================================================== */
.trip-render {
  --tr-primary: var(--primary, #0073e6);
  --tr-accent:  var(--accent, #f59e0b);
  --tr-ink:     #0f172a;
  --tr-muted:   #64748b;
  --tr-line:    #e8eef8;
  --tr-soft:    #f8fafc;
}

/* ── 重點確認卡 ── */
.tr-confirm {
  margin-bottom: 22px; border: 1px solid var(--tr-line); border-radius: 16px;
  background: #fff; overflow: hidden; box-shadow: 0 6px 20px rgba(2,6,23,.04);
}
.tr-confirm-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 18px;
  border-bottom: 1px solid var(--tr-line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--tr-primary) 7%, #fff), #fff);
}
.tr-confirm-head i { color: var(--tr-primary); }
.tr-confirm-head h3 { margin: 0; font-size: 1rem; font-weight: 900; color: var(--tr-ink); }
.tr-confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 10px; }
.tr-confirm-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; transition: background .2s; }
.tr-confirm-item:hover { background: var(--tr-soft); }
.tr-confirm-item i {
  font-size: 15px; color: var(--tr-primary); height: 36px; width: 36px; min-width: 36px; border-radius: 10px;
  background: color-mix(in srgb, var(--tr-primary) 11%, #fff); display: flex; align-items: center; justify-content: center;
}
.tr-confirm-item b { display: block; font-size: .78rem; font-weight: 700; color: var(--tr-muted); margin-bottom: 2px; }
.tr-confirm-item span { font-size: .94rem; font-weight: 600; color: #1e293b; line-height: 1.6; }
@media (max-width: 576px) { .tr-confirm-grid { grid-template-columns: 1fr; } }

/* ── 進度條 ── */
.trip-progress { margin: 4px 0 18px; }
.trip-progress-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .86rem; font-weight: 800; color: var(--tr-ink); margin-bottom: 8px;
}
.trip-progress-head .tp-count { color: var(--tr-primary); }
.trip-progress-track {
  height: 8px; border-radius: 999px; background: #eef2f8; overflow: hidden;
}
.trip-progress-bar {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--tr-primary), #4aa3ff);
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

/* ── 日卡（手風琴）── */
.tr-days { display: flex; flex-direction: column; gap: 16px; }
.tr-day {
  border: 1px solid var(--tr-line); border-radius: 16px; overflow: hidden;
  background: #fff; box-shadow: 0 4px 14px rgba(2,6,23,.04);
  transition: box-shadow .25s, border-color .25s;
}
.tr-day.active { border-color: color-mix(in srgb, var(--tr-primary) 35%, var(--tr-line)); box-shadow: 0 8px 26px rgba(2,6,23,.07); }
.tr-day-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tr-primary) 6%, #fff), #fff);
  transition: background .25s;
}
.tr-day.active .tr-day-head { background: linear-gradient(135deg, color-mix(in srgb, var(--tr-primary) 13%, #fff), #fff); }
.tr-day-badge {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--tr-primary), #005bb5); color: #fff; line-height: 1;
}
.tr-day-badge small { font-size: .56rem; font-weight: 700; opacity: .85; letter-spacing: .06em; }
.tr-day-badge b { font-size: 1.15rem; font-weight: 900; margin-top: 2px; }
.tr-day-titles { flex: 1; min-width: 0; }
.tr-day-titles h3 { margin: 0; font-size: 1.02rem; font-weight: 900; color: var(--tr-ink); line-height: 1.35; }
.tr-day-titles .tr-day-area { font-size: .8rem; color: var(--tr-muted); font-weight: 600; margin-top: 2px; display: inline-flex; align-items: center; gap: 5px; }
.tr-day-toggle { color: var(--tr-primary); transition: transform .25s; flex-shrink: 0; }
.tr-day.active .tr-day-toggle { transform: rotate(180deg); }
.tr-day-body { max-height: 0; overflow: hidden; transition: max-height .45s cubic-bezier(.4,0,.2,1); }
.tr-day.active .tr-day-body { max-height: 12000px; }
.tr-day-inner { padding: 6px 16px 18px; }

/* ── 區段標題 ── */
.tr-sec { margin-top: 18px; }
.tr-sec:first-child { margin-top: 8px; }
.tr-sec-h {
  display: flex; align-items: center; gap: 9px; margin: 0 0 12px;
  font-size: .96rem; font-weight: 900; color: var(--tr-ink);
}
.tr-sec-h i { color: var(--tr-primary); width: 26px; height: 26px; border-radius: 8px;
  background: color-mix(in srgb, var(--tr-primary) 11%, #fff);
  display: inline-flex; align-items: center; justify-content: center; font-size: .82rem; }

/* ── 速覽 ── */
.tr-summary {
  background: var(--tr-soft); border: 1px solid var(--tr-line); border-radius: 12px;
  padding: 12px 14px; color: #475569; font-size: .92rem; line-height: 1.7;
}

/* ── 飯店卡 ── */
.tr-hotel {
  border: 1px solid var(--tr-line); border-radius: 14px; padding: 14px 16px;
  background: linear-gradient(135deg, #fffdf8, #fff);
}
.tr-hotel-name { font-weight: 900; color: var(--tr-ink); font-size: 1rem; }
.tr-hotel-name small { font-weight: 600; color: var(--tr-muted); margin-left: 6px; font-size: .82rem; }
.tr-hotel-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tr-hotel-feat { margin-top: 10px; color: #475569; font-size: .9rem; line-height: 1.65; }
.tr-hotel-hint { margin-top: 8px; font-size: .8rem; color: #b45309; display: inline-flex; align-items: center; gap: 6px; }

/* ── chip / badge 共用 ── */
.tr-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; font-size: .78rem; font-weight: 700;
  background: #eef3ff; color: #1d4ed8; border: 1px solid #dbe6ff; text-decoration: none;
}
.tr-chip.amber { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.tr-chip.gray  { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.tr-chip.green { background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.tr-chip.map   { background: #fff; color: var(--tr-primary); border-color: #cfe3ff; }
a.tr-chip.map:hover { background: #eff6ff; }
.tr-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ── 景點時間軸 ── */
.tr-spots { position: relative; margin: 0; padding: 0; list-style: none; }
.tr-spot { position: relative; padding: 0 0 18px 28px; }
.tr-spot:last-child { padding-bottom: 2px; }
.tr-spot::before {
  content: ""; position: absolute; left: 4px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: #fff; border: 3px solid var(--tr-primary); z-index: 1;
}
.tr-spot::after {
  content: ""; position: absolute; left: 9px; top: 18px; bottom: -2px; width: 2px; background: var(--tr-line);
}
.tr-spot:last-child::after { display: none; }
.tr-spot-time {
  display: inline-block; font-size: .76rem; font-weight: 800; color: var(--tr-primary);
  background: color-mix(in srgb, var(--tr-primary) 9%, #fff); border-radius: 7px; padding: 2px 8px; margin-bottom: 6px;
}
.tr-spot-name { font-weight: 900; color: var(--tr-ink); font-size: .98rem; }
.tr-spot-name small { font-weight: 600; color: var(--tr-muted); margin-left: 6px; font-size: .8rem; }
.tr-spot-highlight { margin-top: 6px; color: #334155; font-size: .92rem; line-height: 1.7; }
.tr-spot-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; align-items: center; }
.tr-nearby { margin-top: 9px; font-size: .82rem; color: var(--tr-muted); }
.tr-nearby b { color: #475569; font-weight: 700; margin-right: 4px; }

/* ── 飛哥 TIPS ── */
.tr-tip {
  position: relative; margin-top: 10px; padding: 11px 14px 11px 40px;
  background: var(--tr-soft); border: 1px solid var(--tr-line); border-radius: 10px;
  color: #475569; font-size: .88rem; line-height: 1.65;
}
.tr-tip::before {
  content: "\f0eb"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; left: 14px; top: 11px; color: var(--tr-accent);
}

/* ── 餐飲卡 ── */
.tr-meals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tr-meal {
  border: 1px solid var(--tr-line); border-radius: 12px; padding: 12px 14px; background: #fff;
}
.tr-meal-slot {
  font-size: .74rem; font-weight: 800; color: var(--tr-accent); text-transform: uppercase; letter-spacing: .04em;
}
.tr-meal-name { font-weight: 900; color: var(--tr-ink); margin-top: 3px; }
.tr-meal-name small { font-weight: 600; color: var(--tr-muted); font-size: .8rem; margin-left: 5px; }
.tr-meal-dish { margin-top: 5px; color: #475569; font-size: .88rem; line-height: 1.6; }
.tr-meal-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

/* ── 交通 ── */
.tr-transit-notes { color: #334155; font-size: .92rem; line-height: 1.7; }
.tr-legs { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tr-leg {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  background: var(--tr-soft); border: 1px solid var(--tr-line); border-radius: 10px; padding: 8px 11px; font-size: .84rem;
}
.tr-leg .tr-leg-route { font-weight: 800; color: var(--tr-ink); display: inline-flex; align-items: center; gap: 6px; }
.tr-leg .tr-leg-route i { color: var(--tr-muted); font-size: .72rem; }
.tr-leg .tr-leg-tag { color: var(--tr-muted); }

/* ── 骨架載入 ── */
.tr-skel-card { padding: 18px; }
.tr-skel { background: linear-gradient(90deg,#f1f5f9 25%,#e8eef8 37%,#f1f5f9 63%);
  background-size: 400% 100%; animation: trSkel 1.3s ease infinite; border-radius: 8px; }
.tr-skel.line { height: 13px; margin: 8px 0; }
.tr-skel.w70 { width: 70%; } .tr-skel.w40 { width: 40%; } .tr-skel.w90 { width: 90%; }
@keyframes trSkel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* 失敗的天 */
.tr-day.failed .tr-day-head { background: linear-gradient(135deg,#fef2f2,#fff); }
.tr-day-retry {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid #fca5a5; background: #fff; color: #dc2626; border-radius: 9px;
  padding: 7px 14px; font-weight: 700; font-size: .85rem; font-family: inherit;
}
.tr-day-retry:hover { background: #fef2f2; }

@media (max-width: 576px) {
  .tr-meals { grid-template-columns: 1fr; }
  .tr-day-inner { padding: 6px 12px 14px; }
  .tr-day-head { padding: 12px 13px; }
}
