/* ============================================================
   导航栏、卡片、模态框与地图组件
   保持小程序国风水墨 × 田园乡土风格，Premium 网页版
   ============================================================ */

/* ===== 顶部导航栏（小程序 .topbar 风格） ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(245, 239, 224, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

/* 品牌 logo（与小程序 .brand-mark 方形渐变呼应） */
.header-brand img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ink-green), var(--ink-green-2));
  border: none;
  box-shadow: 0 3px 10px rgba(47, 74, 60, 0.25);
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: 1px;
}

.brand-tagline {
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 1.5px;
  margin-top: 1px;
}

/* ===== 桌面端导航 ===== */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 4px;
}

.desktop-nav-link {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  font-weight: 500;
  letter-spacing: 0.5px;
  position: relative;
}

.desktop-nav-link:hover {
  color: var(--ink-green-2);
  background: rgba(47, 74, 60, 0.06);
}

.desktop-nav-link.active {
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--ink-green), var(--ink-green-2));
  box-shadow: 0 4px 12px rgba(47, 74, 60, 0.2);
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }
}

/* ===== 顶部快捷操作 ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 购物车按钮（与小程序 .cart-entry 一致） */
.header-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 16px;
  color: var(--ink);
  transition: all var(--transition-base);
}

.header-icon-btn:hover {
  background: var(--paper-3);
  border-color: var(--ink-3);
}

/* 购物车徽标（与小程序 .cart-badge / .badge 一致） */
.badge-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--cinnabar);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ===== 移动端底部 TabBar ===== */
.mobile-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--tabbar-height);
  background: rgba(245, 239, 224, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 768px) {
  .mobile-tabbar {
    display: none;
  }
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-3);
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.25s ease;
  position: relative;
}

.tab-item.active {
  color: var(--ink-green-2);
  font-weight: 600;
}

.tab-icon {
  font-size: 18px;
}

.tab-label {
  font-size: 11px;
}

/* ===== Hero 首页横幅（与小程序 .hero 水墨山水风格保持一致） ===== */
.hero-card {
  position: relative;
  background: linear-gradient(180deg, rgba(47, 74, 60, 0.9) 0%, rgba(26, 46, 35, 0.95) 60%, var(--paper) 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 32px 24px 28px;
  margin-top: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-height: 220px;
}

/* 背景水墨山峦叠影 */
.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url('../images/ink/mountains-far.png') no-repeat bottom center / 100% auto,
    url('../images/ink/cloud.png') no-repeat 20% 30% / 50% auto;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* 四角框饰（与小程序 .frame-corner 一致） */
.hero-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(246, 236, 216, 0.25);
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}

.hero-badge {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(47, 74, 60, 0.55);
  border: 1px solid rgba(246, 236, 216, 0.35);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 11px;
  margin-bottom: 14px;
  letter-spacing: 1px;
  color: #f6ecd8;
}

.hero-title {
  position: relative;
  z-index: 2;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  letter-spacing: 4px;
  color: #fffaf0;
  text-shadow: 0 2px 12px rgba(20, 18, 12, 0.5);
}

.hero-desc {
  position: relative;
  z-index: 2;
  font-size: 13px;
  color: rgba(255, 250, 240, 0.85);
  line-height: 1.6;
  max-width: 500px;
  margin-bottom: 18px;
}

.hero-actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Hero 按钮覆盖（与小程序 .hero-btn-solid / .hero-btn-ghost 一致） */
.hero-actions .btn-primary {
  background: linear-gradient(135deg, var(--cinnabar), #b5482c);
  box-shadow: var(--shadow-glow-cinnabar);
}

.hero-actions .btn-secondary {
  background: rgba(255, 250, 240, 0.14);
  color: #fffaf0;
  border: 1.5px solid rgba(255, 250, 240, 0.5);
}

.hero-actions .btn-secondary:hover {
  background: rgba(255, 250, 240, 0.22);
}

/* ===== 金刚区快捷导航 ===== */
.quick-nav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.quick-nav-item {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

/* 卡片纸张纹理底纹（与小程序 .card::after 一致） */
.quick-nav-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../images/ink/wave.png') repeat;
  background-size: 80px 10px;
  opacity: 0.04;
  pointer-events: none;
}

.quick-nav-item:hover {
  transform: translateY(-3px);
  border-color: var(--ink-green-2);
  box-shadow: var(--shadow-md);
}

.quick-nav-icon {
  font-size: 26px;
}

.quick-nav-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.5px;
}

/* ===== 智慧村长推荐卡片 ===== */
.chief-spotlight-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.chief-spotlight-card:hover {
  border-color: var(--ink-green-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 与小程序 .ai-float-ball 一致的头像风格 */
.chief-spotlight-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(246, 236, 216, 0.9);
  background: linear-gradient(160deg, #e8f0e6, #b9cdbb);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(47, 74, 60, 0.25);
  object-fit: cover;
}

.chief-spotlight-info {
  flex: 1;
}

.chief-spotlight-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chief-spotlight-text {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.5;
}

/* ===== 统计数据条（与小程序 .stats 一致，分隔竖线风格） ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.stat-card {
  padding: 16px 8px;
  text-align: center;
  position: relative;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* 与小程序 .stat + .stat::before 竖线分隔一致 */
.stat-card + .stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
}

.stat-num {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-green-2);
}

.stat-label {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 3px;
}

/* ===== 四古文化卡片（与小程序 .culture-item 一致） ===== */
.culture-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 768px) {
  .culture-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.culture-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-card);
  position: relative;
}

/* 与小程序 .card::after 纸纹一致 */
.culture-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../images/ink/wave.png') repeat;
  background-size: 80px 10px;
  opacity: 0.03;
  pointer-events: none;
  border-radius: var(--radius-md);
}

.culture-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.culture-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  position: relative;
}

.culture-info {
  padding: 12px 14px 14px;
}

.culture-name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 4px;
}

.culture-desc {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 商品卡片（与小程序 .p-card 一致） ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

.product-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  position: relative;
}

.product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../images/ink/wave.png') repeat;
  background-size: 80px 10px;
  opacity: 0.03;
  pointer-events: none;
  border-radius: var(--radius-md);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* 商品标签（与小程序 .p-tag 一致 — 朱砂半透明） */
.product-tag-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(166, 66, 42, 0.88);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  z-index: 2;
  letter-spacing: 0.5px;
}

.product-cover {
  width: 100%;
  height: 150px;
  object-fit: cover;
  cursor: pointer;
  position: relative;
}

.product-details {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  z-index: 1;
}

.product-name {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 4px;
  cursor: pointer;
}

.product-subtitle {
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 8px;
}

.product-price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 8px;
}

/* 价格颜色（与小程序 .price = cinnabar 一致） */
.product-price {
  color: var(--cinnabar);
  font-weight: 700;
  font-size: 18px;
}

.product-price small {
  font-size: 12px;
  font-weight: normal;
}

.product-sales {
  font-size: 11px;
  color: var(--ink-3);
}

.product-btn-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* ===== 故事列表（与小程序 .story-card 一致） ===== */
.stories-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.story-item-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.story-item-card:hover {
  border-color: var(--ink-green-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.story-cover {
  width: 95px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.story-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.story-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.story-intro {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 地图导览 ===== */
.map-page-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.map-filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.map-filter-bar::-webkit-scrollbar {
  display: none;
}

/* 分类胶囊（与小程序 .cat-chip / .cat-active 一致） */
.filter-chip {
  flex-shrink: 0;
  padding: 7px 18px;
  border-radius: var(--radius-full);
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--transition-base);
  font-weight: 500;
}

.filter-chip.active {
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--ink-green), var(--ink-green-2));
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(47, 74, 60, 0.2);
}

.filter-chip:hover:not(.active) {
  border-color: var(--ink-green-3);
  color: var(--ink-green-2);
}

.interactive-map-box {
  position: relative;
  width: 100%;
  height: 380px;
  background: var(--paper-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
  .interactive-map-box {
    height: 480px;
  }
}

.map-svg-canvas {
  width: 100%;
  height: 100%;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  z-index: 10;
}

.map-marker:hover, .map-marker.active {
  transform: translate(-50%, -115%) scale(1.15);
  z-index: 20;
}

.marker-bubble {
  background: var(--ink-green);
  color: #f6ecd8;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 4px;
}

.map-marker.active .marker-bubble {
  background: var(--cinnabar);
}

.marker-point {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--ink-green);
  margin: 0 auto;
}

.map-marker.active .marker-point {
  border-top-color: var(--cinnabar);
}

.spot-detail-drawer {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-md);
  margin-top: 12px;
}

/* ===== 模态弹窗（与小程序 .popup 底部圆角弹层一致） ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 12, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-box {
  background: var(--paper-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  max-width: 540px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 1px;
}

.modal-close {
  background: var(--paper);
  border: none;
  font-size: 18px;
  color: var(--ink-2);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--paper-3);
  color: var(--ink);
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--paper);
}

/* ===== 产品身份证（与小程序 .idcard-popup 一致） ===== */
.idcard-box {
  background: var(--paper);
  border: 1px dashed var(--pot-brown);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 14px 0;
  font-size: 12px;
  position: relative;
}

/* 角落香气装饰（与小程序 .aroma-corner 呼应） */
.idcard-box::before {
  content: "";
  position: absolute;
  right: 6px;
  top: 4px;
  width: 42px;
  height: 42px;
  background: url('../images/ink/aroma.png') no-repeat center / contain;
  opacity: 0.35;
  pointer-events: none;
}

.idcard-row {
  margin-bottom: 8px;
  display: flex;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}

.idcard-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* 标签颜色（与小程序 .idcard-label = pot-brown 一致） */
.idcard-label {
  color: var(--pot-brown);
  font-weight: 600;
  width: 75px;
  flex-shrink: 0;
  font-size: 12px;
}

.idcard-val {
  color: var(--ink);
  flex: 1;
  line-height: 1.6;
}
