/* ========== 基础重置 ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #ccfbf1;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --header-h: 48px;
  --nav-h: 56px;
  --banner-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom));
}

body.has-banner-ad {
  padding-bottom: calc(var(--nav-h) + var(--banner-h) + var(--safe-bottom));
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
}

/* ========== 顶部 ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--primary);
  color: #fff;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
}

.logo {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ========== 主内容 ========== */
.page-content {
  padding-top: calc(var(--header-h) + 8px);
  padding-left: 12px;
  padding-right: 12px;
  min-height: calc(100vh - var(--header-h) - var(--nav-h));
}

/* ========== Hero ========== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0891b2 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 20px;
  margin-bottom: 20px;
  text-align: center;
}

.hero h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.hero p {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* ========== Section ========== */
.section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.1rem;
  margin-bottom: 12px;
  padding-left: 4px;
  border-left: 3px solid var(--primary);
}

/* ========== 目的地卡片 ========== */
.dest-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.dest-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dest-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
}

.dest-card:active {
  transform: scale(0.98);
}

.dest-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.dest-card-body {
  padding: 12px 14px;
}

.dest-tag {
  display: inline-block;
  font-size: 0.7rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.dest-card-body h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.dest-card-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========== 详情页 ========== */
.detail-hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.detail-hero img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.detail-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: #fff;
}

.detail-hero-overlay h1 {
  font-size: 1.4rem;
  margin-top: 4px;
}

.guide-detail-summary {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.guide-detail-hero h1 {
  font-size: 1.2rem;
  line-height: 1.4;
}

.detail-body {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.detail-desc {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.guide-block h3 {
  margin-bottom: 8px;
}

.guide-text {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

/* ========== 攻略列表 ========== */
.guide-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-item {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
}

.guide-item:active {
  transform: scale(0.98);
}

.guide-cover {
  width: 100px;
  min-width: 100px;
  height: 100px;
  object-fit: cover;
}

.guide-item-body {
  flex: 1;
  padding: 12px 12px 12px 0;
}

.guide-cat {
  font-size: 0.7rem;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 20px;
}

.guide-item h3 {
  font-size: 0.95rem;
  margin: 8px 0 4px;
}

.guide-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ========== 工具 ========== */
.tool-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tool-shortcut {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.tool-shortcut:active {
  background: var(--primary-light);
}

.tool-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tool-tab {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.85rem;
  cursor: pointer;
}

.tool-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tool-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.tool-form label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.tool-form input,
.tool-form select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.result-card {
  padding: 12px;
  background: var(--bg);
  border-radius: 8px;
}

.result-card h4 {
  margin-bottom: 8px;
}

.hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.visa-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visa-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  width: 100%;
  text-align: center;
}

.btn:active {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-reward {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  margin-top: 8px;
}

.btn-back {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  margin-top: 16px;
}

/* ========== 编辑推荐 / 原生广告预留位 ========== */
.native-ad-slot {
  margin: 4px 0;
}

.promo-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.promo-card-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.promo-card-body {
  padding: 12px 14px;
}

.promo-tag {
  display: inline-block;
  font-size: 0.7rem;
  background: #fef3c7;
  color: #b45309;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.promo-card-body h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.promo-card-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* 原生广告渲染后样式 */
.native-ad-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.ad-label {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.65rem;
  background: rgba(0,0,0,0.5);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 1;
}

.native-ad-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.native-ad-body {
  padding: 10px 12px;
}

.native-ad-title {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.native-ad-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ========== Banner 广告容器 ========== */
.banner-ad-container {
  position: fixed;
  bottom: calc(var(--nav-h) + var(--safe-bottom));
  left: 0;
  right: 0;
  z-index: 90;
  display: none;
}

.banner-ad-container:not(:empty) {
  display: block;
  min-height: var(--banner-h);
}

/* ========== 底部导航 ========== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 4px 0;
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  font-size: 1.2rem;
}

/* ========== 隐私弹窗 ========== */
.privacy-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.privacy-modal.show {
  display: flex;
}

.privacy-dialog {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 20px;
  max-width: 400px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.privacy-dialog h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.privacy-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.privacy-content ul {
  padding-left: 18px;
  margin: 10px 0;
}

.privacy-content li {
  margin-bottom: 6px;
}

.privacy-actions {
  display: flex;
  gap: 10px;
}

.privacy-actions .btn {
  flex: 1;
}

/* ========== 横屏提示（Banner 不支持横屏） ========== */
@media (orientation: landscape) and (max-height: 500px) {
  .banner-ad-container {
    display: none;
  }
}
