/**
 * 乡村农貌展示网站 - 样式文件
 * 首页：古代酒店向导牌风格
 */

:root {
  --green: #4a7a5a;
  --green-dark: #3a5a4a;
  --red: #8a5a5a;
  --red-dark: #6a4a4a;
  --brown: #7a5c30;
  --brown-dark: #5a3c10;
  --paper: #FAF8F3;
  --paper-dark: #F0EDE5;
  --text: #3D3630;
  --text-light: #6B635A;
  --text-muted: #9A9285;
  --metal: #7a7a7a;
  --metal-dark: #4a4a4a;
  --wood: #8B6914;
  --wood-dark: #5D4408;
  --flag-red: #C84B31;
  --flag-red-dark: #A33D26;
  --font-display: 'Ma Shan Zheng', cursive;
  --font-body: 'Noto Serif SC', serif;
  --nav-h: 52px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; touch-action: manipulation; }
body { font-family: var(--font-body); background: var(--paper); color: var(--text); }

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

.content {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.page {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}

.page.active { display: flex; }

/* ==================== 首页背景 ==================== */
.home-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-bg-image {
  position: absolute;
  inset: 0;
  background: center/cover;
}

.home-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0,0,0,0.5) 0%,
    rgba(0,0,0,0.3) 50%,
    rgba(0,0,0,0.4) 100%
  );
}

/* ==================== 向导牌 ==================== */
.guide-board {
  position: absolute;
  left: 8vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 竖棍 */
.guide-pole {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.guide-pole-top {
  width: 18px;
  height: 18px;
  background: radial-gradient(circle at 35% 35%, #888, #555 60%, #333);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 2;
}

.guide-pole-body {
  width: 10px;
  height: 55vh;
  max-height: 400px;
  min-height: 280px;
  background: linear-gradient(90deg, #4a3a10, #7a6020 30%, #9a8030 50%, #7a6020 70%, #4a3a10);
  box-shadow: 2px 0 8px rgba(0,0,0,0.3);
}

.guide-pole-foot {
  width: 30px;
  height: 12px;
  background: linear-gradient(180deg, #5a4a20, #3a2a10);
  border-radius: 2px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

/* 横棍 */
.guide-beam {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
  cursor: pointer;
}

.guide-beam-top {
  width: 12px;
  height: 12px;
  background: radial-gradient(circle at 50% 50%, #666, #333);
  border-radius: 50%;
}

.guide-beam-bar {
  width: 130px;
  height: 36px;
  background: linear-gradient(180deg, #8a7030, #5a4410 50%, #3a2808);
  border-radius: 2px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
}

.guide-beam-bar:hover,
.guide-beam:active {
  filter: brightness(1.1);
}

.guide-beam-link {
  color: #fff;
  font-size: 0.72rem;
  font-family: var(--font-body);
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  white-space: nowrap;
  text-align: center;
  line-height: 1.4;
  display: block;
  pointer-events: none;
}

.guide-beam-bottom {
  display: none;
}

/* 竖旗 */
.guide-flag {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.guide-flag-top {
  width: 8px;
  height: 8px;
  background: radial-gradient(circle at 35% 35%, #888, #444);
  border-radius: 50%;
  margin-bottom: -2px;
  z-index: 2;
}

.guide-flag-body {
  width: 90px;
  background: linear-gradient(180deg, var(--flag-red), var(--flag-red-dark));
  border-radius: 4px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow:
    0 4px 15px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.15),
    inset 0 -1px 0 rgba(0,0,0,0.2);
  border: 1px solid rgba(0,0,0,0.2);
  position: relative;
}

.guide-flag-body::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #e06040, #a03020);
  border-radius: 4px 0 0 4px;
}

.guide-flag-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: transparent;
}

.guide-flag-title:hover {
  background: rgba(255,255,255,0.15);
  transform: scale(1.05);
}

.guide-flag-title:active {
  transform: scale(0.98);
}

.guide-flag-cn {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  letter-spacing: 0.05em;
}

.guide-flag-en {
  font-size: 0.5rem;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
}

.guide-flag-bottom {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid var(--flag-red-dark);
  margin-top: -1px;
}

/* ==================== 右侧说明区域 ==================== */
.guide-desc-area {
  position: absolute;
  right: 10vw;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 280px;
  max-width: 40vw;
  min-width: 200px;
}

.guide-desc-default {
  text-align: center;
  color: rgba(255,255,255,0.6);
  font-family: var(--font-display);
  padding: 2rem 1rem;
  line-height: 1.8;
}

.guide-desc-default p:first-child {
  font-size: 1.4rem;
  letter-spacing: 0.15em;
}

.guide-desc-default p:last-child {
  font-size: 1rem;
  letter-spacing: 0.2em;
  opacity: 0.7;
}

.guide-desc-content {
  display: none;
  background: rgba(255,255,255,0.92);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  animation: descFadeIn 0.3s ease;
}

.guide-desc-content.show {
  display: block;
}

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

.guide-desc-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brown);
}

.guide-desc-subtitle {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.guide-desc-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.guide-desc-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(0,0,0,0.1);
}

/* ==================== 首页底部 ==================== */
.page-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.35rem;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  z-index: 20;
}

.page-footer .icp {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.7);
  padding: 0.1rem 0.4rem;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  text-decoration: none;
}

.page-footer a.icp:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
}

/* ==================== 分页 ==================== */
.page-header {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem 0.4rem;
  text-align: center;
  background: var(--paper);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.05rem;
}

.page-header p {
  font-size: 0.65rem;
  color: var(--text-light);
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 0.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

.grid-item {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.grid-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.grid-item-info {
  padding: 0.35rem;
}

.grid-item-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0.04rem;
}

.grid-item-desc {
  font-size: 0.6rem;
  color: var(--text-light);
  line-height: 1.3;
}

.culture-list {
  padding-bottom: 0.5rem;
}

.culture-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 0.35rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.culture-season {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--brown);
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.culture-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.02rem;
}

.culture-desc {
  font-size: 0.62rem;
  color: var(--text-light);
}

/* 底部Tab */
.tab-nav {
  flex-shrink: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--nav-h);
  background: var(--paper);
  border-top: 1px solid rgba(0,0,0,0.06);
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.04rem;
  padding: 0.2rem 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.2s;
  min-width: 46px;
}

.tab-btn.active { color: var(--brown); }

.tab-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.tab-btn span {
  font-size: 0.52rem;
  font-family: var(--font-body);
}

/* 动画 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page.active .grid-item,
.page.active .culture-item {
  animation: fadeIn 0.3s ease-out backwards;
}

.page.active .grid-item:nth-child(1), .page.active .culture-item:nth-child(1) { animation-delay: 0.03s; }
.page.active .grid-item:nth-child(2), .page.active .culture-item:nth-child(2) { animation-delay: 0.06s; }
.page.active .grid-item:nth-child(3), .page.active .culture-item:nth-child(3) { animation-delay: 0.09s; }
.page.active .grid-item:nth-child(4), .page.active .culture-item:nth-child(4) { animation-delay: 0.12s; }

/* 桌面 */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
  .culture-list { max-width: 420px; margin: 0 auto; }
  .guide-desc-area { width: 350px; }
  .guide-flag-cn { font-size: 1.15rem; }
  .guide-flag-en { font-size: 0.55rem; }
}

/* 移动端适配 */
@media (max-width: 480px) {
  .guide-board {
    left: 5vw;
  }
  .guide-pole-body {
    height: 45vh;
    min-height: 240px;
  }
  .guide-beam {
    top: -18px;
  }
  .guide-beam-bar {
    width: 100px;
    height: 30px;
    padding: 4px 8px;
  }
  .guide-beam-link {
    font-size: 0.6rem;
  }
  .guide-flag-body {
    width: 75px;
    padding: 10px 6px;
    gap: 8px;
  }
  .guide-flag-cn {
    font-size: 0.9rem;
  }
  .guide-desc-area {
    right: 5vw;
    width: 45vw;
    min-width: 150px;
  }
  .guide-desc-default p:first-child {
    font-size: 1.1rem;
  }
  .guide-desc-content {
    padding: 1rem;
  }
  .guide-desc-title {
    font-size: 1.1rem;
  }
}

/* 移动端安全区域适配 */
@supports (padding: env(safe-area-inset-bottom)) {
  .tab-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: auto;
    min-height: var(--nav-h);
  }
}
