/* ============================================================
   腾冲旅行攻略 — 统一样式表
   手机端优先 · 卡片式布局 · 可复用多目的地
   ============================================================ */

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f7f5f0;
  color: #2c2c2c;
  line-height: 1.7;
  font-size: 15px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #b8860b; text-decoration: none; }
a:hover { color: #8b6914; }
ul, ol { padding-left: 1.2em; }

/* ---------- 顶部导航 ---------- */
.top-nav {
  position: sticky; top: 0; z-index: 100;
  background: #2c3e2d;
  padding: 0 16px;
  display: flex; align-items: center;
  overflow-x: auto; white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.top-nav a {
  display: inline-block; padding: 14px 12px;
  color: #dcd7c6; font-size: 14px;
  transition: color .2s, background .2s;
  flex-shrink: 0;
}
.top-nav a:hover, .top-nav a.active {
  color: #fff; background: rgba(255,255,255,.1);
}
.top-nav .logo {
  font-weight: 700; font-size: 16px; color: #f5e6b8;
  margin-right: 8px; padding: 14px 12px 14px 4px;
}

/* ---------- 页面头部 ---------- */
.page-header {
  background: linear-gradient(135deg, #3d5a3e, #5a7a5b);
  color: #fff; padding: 32px 16px; text-align: center;
}
.page-header h1 { font-size: 24px; margin-bottom: 6px; }
.page-header p { font-size: 14px; opacity: .85; }

/* ---------- 容器 ---------- */
.container { max-width: 1000px; margin: 0 auto; padding: 16px; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff; border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  margin-bottom: 16px; overflow: hidden;
}
.card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-body { padding: 14px 16px; }
.card-body h3 { font-size: 17px; margin-bottom: 6px; color: #2c3e2d; }
.card-body p { font-size: 14px; color: #555; }
.card-body .tag {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 12px; margin-right: 4px; margin-bottom: 4px;
  background: #e8e3d6; color: #555;
}

/* ---------- 景点卡片（图左文右，手机端上下） ---------- */
.spot-card {
  display: flex; flex-direction: column; gap: 0;
  background: #fff; border-radius: 10px; overflow: hidden;
  margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.spot-card img {
  width: 100%; max-height: 220px; object-fit: cover;
}
.spot-card .spot-body { padding: 12px 14px; }
.spot-card .spot-body h4 { font-size: 15px; color: #2c3e2d; margin-bottom: 4px; }
.spot-card .spot-body p { font-size: 13px; color: #555; line-height: 1.6; }

@media (min-width: 640px) {
  .spot-card { flex-direction: row; }
  .spot-card img { width: 240px; max-height: 180px; flex-shrink: 0; }
}

/* ---------- 行程时间线 ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: ''; position: absolute; left: 10px; top: 4px; bottom: 4px;
  width: 2px; background: #c4b99a;
}
.timeline-item {
  position: relative; margin-bottom: 18px; padding-left: 12px;
}
.timeline-item::before {
  content: ''; position: absolute; left: -22px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: #b8860b; border: 2px solid #f7f5f0;
}
.timeline-item .day { font-weight: 700; color: #b8860b; font-size: 14px; }
.timeline-item h3 { font-size: 16px; margin: 2px 0 4px; }
.timeline-item p { font-size: 13px; color: #666; }
.timeline-item .badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px;
  font-size: 11px; color: #fff; margin-right: 4px;
}
.badge-green { background: #4a7a4b; }
.badge-orange { background: #c4903d; }
.badge-blue { background: #4a7a9b; }
.badge-purple { background: #7b5a8b; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 12px 0; }
table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 480px;
}
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f0ece3; font-weight: 600; color: #333; }
tr:hover { background: #f9f7f2; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 10px 24px; border-radius: 8px;
  font-size: 14px; font-weight: 600; text-align: center;
  border: none; cursor: pointer; transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: #b8860b; color: #fff; }
.btn-primary:hover { background: #9e7209; color: #fff; }
.btn-secondary { background: #e8e3d6; color: #444; }
.btn-secondary:hover { background: #ddd6c4; }
.btn-block { display: block; width: 100%; }

/* ---------- 长图攻略入口（5按钮） ---------- */
.guide-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin: 16px 0;
}
.guide-grid .guide-btn {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 6px;
  padding: 20px 12px; border-radius: 10px;
  background: #fff; border: 2px solid #e8e3d6;
  font-size: 14px; font-weight: 600; color: #333;
  cursor: pointer; transition: all .2s;
  text-align: center; min-height: 80px;
}
.guide-grid .guide-btn:hover { border-color: #b8860b; background: #fdfaf0; }
.guide-grid .guide-btn .icon { font-size: 28px; }
.guide-grid .guide-btn.parent {
  grid-column: 1 / -1; background: linear-gradient(135deg, #b8860b, #d4a84b);
  color: #fff; border-color: #b8860b; font-size: 16px; min-height: 100px;
}
.guide-grid .guide-btn.parent:hover { opacity: .92; }

/* ---------- 图片弹窗（Lightbox）支持双指缩放 ---------- */
.lightbox {
  display: none; position: fixed; z-index: 999;
  left: 0; top: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,.95); overflow: auto;
  touch-action: pinch-zoom; /* 确保触屏双指缩放生效 */
  -webkit-overflow-scrolling: touch;
}
.lightbox.active { display: block; }
.lightbox img {
  display: block;
  width: 100%;          /* 默认撑满屏幕宽度 */
  height: auto;
  margin: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  /* 用户双指缩放后可以自由滚动查看 */
}
/* 桌面端鼠标悬停时显示手型提示 */
.lightbox img { cursor: zoom-in; }
.lightbox img:active { cursor: grabbing; }
.lightbox .close-btn {
  position: fixed; top: 12px; right: 16px;
  font-size: 36px; color: #fff; cursor: pointer;
  background: rgba(0,0,0,.5); width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; z-index: 1000;
  touch-action: manipulation; /* 触屏点击不缩放 */
}

/* ---------- 实用信息 ---------- */
.info-section { margin-bottom: 24px; }
.info-section h2 {
  font-size: 18px; color: #2c3e2d;
  padding-bottom: 8px; margin-bottom: 12px;
  border-bottom: 2px solid #e0d9c8;
}
.checklist { list-style: none; padding: 0; }
.checklist li {
  padding: 6px 0 6px 24px; position: relative; font-size: 14px;
  border-bottom: 1px solid #f0ece3;
}
.checklist li::before {
  content: '☐'; position: absolute; left: 0; top: 6px;
  font-size: 16px; color: #b8860b;
}
.checklist li.checked::before { content: '☑'; }

/* ---------- 折叠面板 ---------- */
.accordion { margin: 12px 0; }
.accordion-item { border: 1px solid #e8e3d6; border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.accordion-header {
  padding: 12px 14px; background: #f9f7f2; cursor: pointer;
  font-weight: 600; font-size: 15px; color: #2c3e2d;
  display: flex; justify-content: space-between; align-items: center;
  user-select: none;
}
.accordion-header::after {
  content: '+'; font-size: 18px; color: #b8860b; transition: transform .2s;
}
.accordion-item.open .accordion-header::after { content: '−'; }
.accordion-body { padding: 0 14px; max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.accordion-item.open .accordion-body { max-height: 1200px; padding: 12px 14px; }

/* 拖拽排序手柄 */
.drag-handle { cursor: grab; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.accordion-item.dragging { opacity: 0.4; }
.accordion-item.drag-over { border: 2px dashed #b8860b; }

/* ---------- 页脚 ---------- */
.footer {
  background: #2c3e2d; color: #aaa; text-align: center;
  padding: 24px 16px; font-size: 12px; margin-top: 32px;
}
.footer a { color: #dcd7c6; }

/* ---------- 响应式微调 ---------- */
@media (min-width: 640px) {
  body { font-size: 16px; }
  .page-header { padding: 48px 24px; }
  .page-header h1 { font-size: 30px; }
  .container { padding: 24px; }
  .guide-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .container { padding: 32px; }
  .guide-grid { grid-template-columns: 1fr 1fr 1fr; }
  .guide-grid .guide-btn.parent { grid-column: 1 / -1; }
}
