/* ============================
   YanTravel - 全球景点推荐
   ============================ */

/* CSS 变量 */
:root {
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2745;
  --bg-input: #1a1a2e;
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: #27273a;
  --accent-1: #06b6d4;
  --accent-2: #8b5cf6;
  --accent-3: #f59e0b;
  --gradient-1: linear-gradient(135deg, #06b6d4, #8b5cf6);
  --gradient-2: linear-gradient(135deg, #f59e0b, #ef4444);
  --gradient-3: linear-gradient(135deg, #10b981, #06b6d4);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --nav-height: 64px;
  --container-max: 1200px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 浅色主题 */
.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f1f5f9;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --border-color: #e4e4e7;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

/* 基础重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================
   导航栏
   ============================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(15, 15, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background var(--transition);
}

.light-theme .navbar {
  background: rgba(248, 250, 252, 0.85);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
}

.logo-icon { font-size: 1.4rem; }

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
  background: var(--bg-card);
}

.theme-toggle:hover {
  transform: scale(1.1);
  background: var(--bg-card-hover);
}

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  min-width: 220px;
}

.search-box:focus-within {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.search-icon { font-size: 0.9rem; }

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  width: 100%;
  font-family: inherit;
}

.search-box input::placeholder { color: var(--text-muted); }

.search-shortcut {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 2px 6px;
  background: var(--bg-card);
  border-radius: 4px;
  font-weight: 600;
}

/* ============================
   Hero 区域
   ============================ */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 60px) 20px 60px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(6, 182, 212, 0.12), transparent),
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(139, 92, 246, 0.12), transparent),
    radial-gradient(ellipse 40% 40% at 50% 80%, rgba(245, 158, 11, 0.06), transparent);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 30px 30px;
}

.light-theme .hero-pattern {
  background-image: radial-gradient(rgba(0,0,0,0.05) 1px, transparent 1px);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 700px;
}

.hero-title {
  margin-bottom: 20px;
}

.title-gradient {
  display: block;
  font-size: 3.5rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
  animation: fadeInUp 0.8s ease;
}

.title-sub {
  display: block;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 8px;
  animation: fadeInUp 0.8s ease 0.1s both;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 36px;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  animation: fadeInUp 0.8s ease 0.3s both;
}

.stat-item { text-align: center; }

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ============================
   过滤栏
   ============================ */
.filter-section {
  padding: 24px 0;
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
  background: rgba(15, 15, 26, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}

.light-theme .filter-section {
  background: rgba(248, 250, 252, 0.9);
}

.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  transition: all var(--transition);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-1);
}

.filter-btn.active {
  color: #fff;
  background: var(--gradient-1);
  border-color: transparent;
}

/* ============================
   景点列表
   ============================ */
.spots-section {
  padding: 60px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.spots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* 景点卡片 */
.spot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: default;
  animation: fadeInUp 0.5s ease both;
}

.spot-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: var(--shadow-lg);
}

.spot-cover {
  height: 180px;
  position: relative;
  overflow: hidden;
}

.spot-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.spot-card:hover .spot-cover-img {
  transform: scale(1.05);
}

.spot-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.spot-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.spot-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  backdrop-filter: blur(10px);
}

.badge-nature { background: rgba(16, 185, 129, 0.8); }
.badge-history { background: rgba(139, 92, 246, 0.8); }
.badge-city { background: rgba(6, 182, 212, 0.8); }
.badge-island { background: rgba(245, 158, 11, 0.8); }
.badge-culture { background: rgba(239, 68, 68, 0.8); }
.badge-adventure { background: rgba(234, 88, 12, 0.8); }

.spot-region-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
}

.spot-body {
  padding: 18px 20px;
}

.spot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
}

.spot-name {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.spot-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-3);
  white-space: nowrap;
  margin-left: 12px;
  flex-shrink: 0;
}

.spot-location {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.spot-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spot-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.spot-meta {
  display: flex;
  gap: 16px;
}

.spot-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================
   随机推荐
   ============================ */
.random-section {
  padding: 60px 0;
}

.random-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.random-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 4px;
  background: var(--gradient-1);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.random-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.random-name {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  min-height: 2.2em;
  transition: all var(--transition);
}

.random-location {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.random-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 16px;
  min-height: 2.6em;
}

.random-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 28px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.random-btn {
  padding: 14px 32px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-1);
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.random-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(6, 182, 212, 0.45);
}

.random-btn:active {
  transform: translateY(0);
}

/* ============================
   区域浏览
   ============================ */
.regions-section {
  padding: calc(var(--nav-height) + 40px) 0 60px;
}

.regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.region-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
  cursor: pointer;
}

.region-card:hover {
  transform: translateY(-3px);
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: var(--shadow-lg);
}

.region-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.region-flag {
  font-size: 2.4rem;
  line-height: 1;
}

.region-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.region-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.region-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.region-spots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.region-spot-tag {
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: all var(--transition);
}

.region-spot-tag:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

/* ============================
   关于页面
   ============================ */
.about-section {
  padding: calc(var(--nav-height) + 60px) 0 60px;
}

.about-card {
  max-width: 650px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  text-align: center;
}

.about-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.about-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.gradient-text {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.about-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 36px;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 36px;
  text-align: left;
}

.feature-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.feature-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }

.feature-item h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-item p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.about-footer {
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.about-footer p { color: var(--text-muted); font-size: 0.9rem; }

.about-note {
  margin-top: 8px;
  font-size: 0.82rem !important;
}

/* ============================
   空状态
   ============================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 16px; display: block; }

/* ============================
   页脚
   ============================ */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 0 24px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.footer-logo {
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-links a:hover { color: var(--accent-1); }

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ============================
   动画
   ============================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.loading {
  animation: pulse 1.5s ease infinite;
}

/* ============================
   响应式
   ============================ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  
  .title-gradient { font-size: 2.4rem; }
  .title-sub { font-size: 1rem; }
  
  .hero-stats { gap: 28px; }
  .stat-num { font-size: 1.5rem; }
  
  .spots-grid { grid-template-columns: 1fr; }
  .regions-grid { grid-template-columns: 1fr; }
  
  .search-box { min-width: 160px; }
  
  .about-features { grid-template-columns: 1fr; }
  .about-card { padding: 32px 24px; }
  
  .random-card { padding: 32px 24px; }
  .random-name { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .search-box { min-width: 120px; }
  .search-shortcut { display: none; }
  .spot-cover { height: 150px; }
  .footer-content { flex-direction: column; gap: 16px; }
}

/* ============================
   滚动条
   ============================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* 选中状态 */
::selection {
  background: rgba(6, 182, 212, 0.3);
  color: var(--text-primary);
}
