:root {
  --bg-base: #f5f7ff;
  --card-bg: #ffffff;
  --card-border: rgba(99, 102, 241, 0.08);
  --primary: #6366f1;
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --accent-soft: #ecfeff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --glow: rgba(99, 102, 241, 0.15);
  --shadow-sm: 0 1px 3px rgba(99, 102, 241, 0.06);
  --shadow-md: 0 4px 20px rgba(99, 102, 241, 0.08);
  --shadow-lg: 0 12px 40px rgba(99, 102, 241, 0.12);
  --radius: 20px;
  --font-main: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
    "Segoe UI Symbol", "Noto Color Emoji";
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* SVG 图标通用样式 */
.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  display: inline-block;
  vertical-align: -0.125em;
  margin-right: 6px;
}

.icon-lg {
  width: 1.5em;
  height: 1.5em;
  fill: currentColor;
}

.icon-sm {
  width: 0.8em;
  height: 0.8em;
  margin-left: 8px;
  margin-right: 0;
}

/* ========================
   Hero 区
   ======================== */
.hero {
  position: relative;
  padding: 80px 20px 60px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 40%, #faf5ff 80%, #fefce8 100%);
}

.hero-bg::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-bg::after {
  content: "";
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 36px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 36px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(99, 102, 241, 0.15);
}

.hero-scroll {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  color: var(--text-main);
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.hero-scroll:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 6px 20px var(--glow);
}

.hero-scroll .icon-sm {
  transition: transform 0.3s ease;
}

.hero-scroll:hover .icon-sm {
  transform: translateX(4px);
}

/* ========================
   卡片网格
   ======================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* 卡片主体 */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.2);
}

.card:hover::before {
  opacity: 1;
}

/* 推荐卡片 */
.card.featured::before {
  opacity: 1;
}

/* 卡片头部 */
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid rgba(99, 102, 241, 0.06);
  padding-bottom: 14px;
}

.card-top h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-right: 10px;
}

.price-tag {
  text-align: right;
  white-space: nowrap;
}

.currency {
  font-size: 0.85rem;
  color: var(--primary);
  vertical-align: top;
  font-weight: 600;
}

.amount {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.period {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
}

/* 信息网格 */
.grid-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 8px;
}

.info-item {
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.info-item .icon {
  color: var(--accent);
  opacity: 0.9;
}

/* 标签 */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  background: var(--accent-soft);
  color: #0e7490;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid rgba(6, 182, 212, 0.1);
}

/* 按钮 */
.btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn .icon-sm {
  transition: transform 0.3s ease;
}

.btn:hover {
  box-shadow: 0 6px 20px var(--glow);
  filter: brightness(1.05);
}

.btn:hover .icon-sm {
  transform: translateX(4px);
}

/* ========================
   滚动动画
   ======================== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================
   页脚
   ======================== */
footer {
  background: linear-gradient(180deg, var(--bg-base) 0%, #eef2ff 100%);
  border-top: 1px solid rgba(99, 102, 241, 0.06);
  padding: 40px 20px;
  text-align: center;
  margin-top: auto;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.disclaimer {
  background: rgba(245, 158, 11, 0.06);
  color: #92400e;
  padding: 16px;
  border-radius: 14px;
  font-size: 0.85rem;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(245, 158, 11, 0.12);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 14px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links a:hover {
  color: var(--primary);
}

.copyright {
  color: var(--text-light);
  font-size: 0.8rem;
}

/* ========================
   返回顶部
   ======================== */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

#back-to-top .icon {
  margin-right: 0;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  background: var(--secondary);
  transform: translateY(-3px);
}

/* ========================
   加载动画
   ======================== */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 50%, #faf5ff 100%);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  width: 80%;
  max-width: 300px;
}

.plane-animation {
  font-size: 3rem;
  margin-bottom: 20px;
  color: var(--primary);
  animation: pulse-fly 2s infinite ease-in-out;
}

.plane-animation .icon-lg {
  width: 1em;
  height: 1em;
  fill: var(--primary);
}

@keyframes pulse-fly {
  0% { transform: scale(1) translateY(0); opacity: 0.8; }
  50% { transform: scale(1.1) translateY(-10px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 0.8; }
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 1px;
}

#progress-text {
  color: var(--primary);
  font-weight: 700;
  display: inline-block;
  width: 40px;
  text-align: left;
}

.progress-container {
  width: 100%;
  height: 6px;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  background-size: 200% 100%;
  border-radius: 10px;
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  animation: gradient-move 2s linear infinite;
  box-shadow: 0 0 10px var(--glow);
}

@keyframes gradient-move {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ========================
   Toast 提示
   ======================== */
.refresh-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #fff;
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: var(--text-main);
  padding: 12px 24px;
  border-radius: 50px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.refresh-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.refresh-toast .icon {
  color: var(--primary);
  margin-right: 0;
  font-size: 1.2em;
}

/* ========================
   搜索/筛选栏
   ======================== */
.toolbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 8px;
}

.toolbar-inner {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box:focus-within {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.search-box .icon {
  color: var(--text-light);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--text-main);
  font-family: var(--font-main);
}

.search-box input::placeholder {
  color: var(--text-light);
}

.sort-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
}

.sort-box:hover,
.sort-box:focus-within,
.sort-box.open {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.sort-box .icon {
  color: var(--primary);
  flex-shrink: 0;
}

.custom-select {
  flex: 1;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.88rem;
  color: var(--text-main);
  font-family: var(--font-main);
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}

.select-arrow {
  transition: transform 0.3s ease;
  color: var(--text-light);
}

.sort-box.open .select-arrow {
  transform: rotate(180deg);
}

.select-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sort-box.open .select-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.select-option {
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  text-align: center;
}

.select-option:hover {
  background: rgba(99, 102, 241, 0.06);
  color: var(--text-main);
}

.select-option.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  font-weight: 600;
}

.result-count {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 500;
}

/* ========================
   价格高亮角标
   ======================== */
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-badge-budget {
  display: inline-block;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

/* ========================
   加载占位
   ======================== */
.loading-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ========================
   移动端适配
   ======================== */
@media (max-width: 768px) {
  .hero {
    padding: 60px 16px 40px;
  }

  .hero-title {
    font-size: 1.9rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .hero-stats {
    gap: 16px;
  }

  .stat-num {
    font-size: 1.25rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .toolbar {
    padding: 0 16px 8px;
  }

  .toolbar-inner {
    flex-direction: column;
    gap: 10px;
  }

  .search-box,
  .sort-box {
    width: 100%;
  }

  .container {
    padding: 0 16px 40px;
  }

  .card-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    padding: 20px;
  }

  .disclaimer {
    font-size: 0.8rem;
    text-align: left;
  }

  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  .refresh-toast {
    top: 15px;
    width: 90%;
    justify-content: center;
    font-size: 0.88rem;
  }
}
