/* ── planner.css — AI 行程规划器 ──────────────── */

/* ── 浮动按钮 ─────────────────────────────────── */
.planner-fab {
  position: fixed;
  bottom: 6.5rem;
  right: 1.5rem;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  background: rgba(110, 74, 47, 0.88);
  border: 1px solid rgba(139, 90, 43, 0.3);
  border-radius: 999px;
  color: rgba(245, 236, 218, 0.9);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform 260ms cubic-bezier(0.2,0.7,0.25,1),
              box-shadow 260ms, background 200ms;
}
.planner-fab:hover {
  transform: translateY(-2px);
  background: rgba(110, 74, 47, 0.96);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}
.planner-fab:active { transform: scale(0.96); }
.planner-fab svg { opacity: 0.7; flex-shrink: 0; }

/* ── 面板容器 ─────────────────────────────────── */
.planner-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(18, 25, 36, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms;
}
.planner-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.planner-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 101;
  width: min(440px, 96vw);
  height: 100vh;
  background: #faf8f5;
  box-shadow: -8px 0 40px rgba(0,0,0,0.18);
  transform: translateX(100%);
  transition: transform 380ms cubic-bezier(0.22, 0.9, 0.36, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.planner-panel.open {
  transform: translateX(0);
}

/* ── 面板头部 ─────────────────────────────────── */
.planner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(139, 90, 43, 0.12);
  background: linear-gradient(180deg, #faf8f5, #f5ecda);
  flex-shrink: 0;
}
.planner-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #6e4a2f;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.planner-header h2 svg { opacity: 0.6; }
.planner-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid rgba(139, 90, 43, 0.15);
  border-radius: 8px; color: #8b5a2b; cursor: pointer;
  transition: background 200ms, border-color 200ms;
}
.planner-close:hover {
  background: rgba(139, 90, 43, 0.08);
  border-color: rgba(139, 90, 43, 0.3);
}

/* ── 面板内容（可滚动） ───────────────────────── */
.planner-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
}

/* ── 表单区 ───────────────────────────────────── */
.planner-form { display: flex; flex-direction: column; gap: 1.2rem; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #6e4a2f;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.form-label svg { opacity: 0.5; }

/* 天数滑块 */
.days-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.days-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #e7d6ba;
  border-radius: 3px;
  outline: none;
}
.days-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  background: #d4a04a;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(212,160,74,0.4);
  transition: transform 150ms;
}
.days-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.days-slider::-moz-range-thumb {
  width: 20px; height: 20px;
  background: #d4a04a;
  border: none; border-radius: 50%;
  cursor: pointer;
}
.days-value {
  min-width: 38px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #6e4a2f;
}

/* 下拉选择 */
.form-select {
  padding: 0.55rem 0.8rem;
  background: #fff;
  border: 1px solid #e7d6ba;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  color: #2c1810;
  outline: none;
  cursor: pointer;
  transition: border-color 200ms;
}
.form-select:focus { border-color: #d4a04a; }

/* 偏好多选芯片 */
.pref-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.pref-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.75rem;
  background: #fff;
  border: 1px solid #e7d6ba;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.78rem;
  color: #8a7560;
  cursor: pointer;
  transition: all 200ms;
  user-select: none;
}
.pref-chip svg { width: 14px; height: 14px; opacity: 0.5; transition: opacity 200ms; }
.pref-chip.active {
  background: #6e4a2f;
  border-color: #6e4a2f;
  color: #f5ecda;
}
.pref-chip.active svg { opacity: 0.8; }
.pref-chip:hover:not(.active) {
  border-color: #d4a04a;
  color: #6e4a2f;
}

/* 生成按钮 */
.planner-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem;
  background: linear-gradient(135deg, #8b5a2b, #6e4a2f);
  border: none;
  border-radius: 12px;
  color: #f5ecda;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 200ms, box-shadow 200ms;
}
.planner-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(110, 74, 47, 0.35);
}
.planner-submit:active { transform: scale(0.98); }
.planner-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.planner-submit svg { flex-shrink: 0; }

/* ── 加载状态 ─────────────────────────────────── */
.planner-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 1rem;
  text-align: center;
}
.planner-loading.visible { display: flex; }
.planner-loading p {
  font-size: 0.85rem;
  color: #8a7560;
}

.route-loader {
  width: 40px; height: 40px;
  border: 3px solid #e7d6ba;
  border-top-color: #d4a04a;
  border-radius: 50%;
  animation: planSpin 0.8s linear infinite;
}
@keyframes planSpin { to { transform: rotate(360deg); } }

/* ── 时间轴结果 ───────────────────────────────── */
.planner-result { display: none; }
.planner-result.visible { display: block; }

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.result-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #6e4a2f;
}
.result-redo {
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  background: none;
  border: 1px solid #e7d6ba;
  border-radius: 999px;
  font-family: inherit; font-size: 0.72rem; color: #8a7560;
  cursor: pointer; transition: all 200ms;
}
.result-redo:hover { border-color: #d4a04a; color: #6e4a2f; }

/* 时间轴 */
.timeline {
  position: relative;
  padding-left: 1.6rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, #d4a04a, #e7d6ba);
  border-radius: 1px;
}

.timeline-day {
  position: relative;
  margin-bottom: 1.5rem;
}
.timeline-day:last-child { margin-bottom: 0; }

.day-marker {
  position: absolute;
  left: -1.6rem;
  top: 0;
  width: 14px; height: 14px;
  background: #d4a04a;
  border: 2px solid #faf8f5;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(212,160,74,0.3);
}

.day-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #d4a04a;
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.day-spots {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* 景点卡片 */
.spot-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  background: #fff;
  border: 1px solid rgba(231, 214, 186, 0.6);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 200ms, box-shadow 200ms, transform 200ms;
}
.spot-card:hover {
  border-color: #d4a04a;
  box-shadow: 0 2px 10px rgba(212,160,74,0.15);
  transform: translateX(2px);
}

.spot-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.spot-icon.nature { background: rgba(96,192,232,0.15); color: #4a8ab0; }
.spot-icon.culture { background: rgba(212,160,74,0.15); color: #b8860b; }
.spot-icon.food { background: rgba(232,116,58,0.15); color: #c85a20; }

.spot-info { flex: 1; min-width: 0; }
.spot-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #2c1810;
}
.spot-meta {
  font-size: 0.7rem;
  color: #8a7560;
  margin-top: 0.1rem;
}

.spot-delete {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: #ccc; border-radius: 6px;
  transition: color 200ms, background 200ms;
  flex-shrink: 0;
}
.spot-delete:hover { color: #c0392b; background: rgba(192,57,43,0.08); }

/* 交通提示 */
.transport-hint {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0 0.25rem 0.5rem;
  font-size: 0.68rem;
  color: #b0a08a;
}
.transport-hint svg { opacity: 0.5; }

/* 贴士区 */
.plan-tips {
  margin-top: 1rem;
  padding: 0.8rem;
  background: rgba(212,160,74,0.08);
  border-radius: 10px;
  border-left: 3px solid #d4a04a;
}
.plan-tips-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #d4a04a;
  margin-bottom: 0.35rem;
}
.plan-tips ul {
  list-style: none;
  padding: 0;
}
.plan-tips li {
  font-size: 0.75rem;
  color: #8a7560;
  line-height: 1.5;
  padding-left: 0.8rem;
  position: relative;
}
.plan-tips li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.5em;
  width: 4px; height: 4px;
  background: #d4a04a;
  border-radius: 50%;
}

/* ── 地图路线 SVG ─────────────────────────────── */
.route-svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 18;
}
.route-path {
  fill: none;
  stroke: #d4a04a;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 8 4;
  filter: drop-shadow(0 1px 3px rgba(212,160,74,0.4));
}
.route-path-animate {
  animation: routeDraw 2s ease forwards;
}
@keyframes routeDraw {
  from { stroke-dashoffset: 2000; }
  to   { stroke-dashoffset: 0; }
}

.route-marker {
  fill: #d4a04a;
  stroke: #faf8f5;
  stroke-width: 2;
}

/* ── 响应式 ───────────────────────────────────── */
@media (max-width: 768px) {
  .planner-fab {
    bottom: 5.5rem;
    right: 1rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.75rem;
  }
  .planner-panel { width: 100vw; }
}
