/* ============================================
   牛马日历 - 官网主页 样式表
   设计语言：暖橙点睛 + 大留白 + 内容为王
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #ff9500;
  --accent: #ff6b6b;
  --gradient-brand: linear-gradient(135deg, #ff9500 0%, #ff6b6b 100%);
  --bg-warm: #fff3e0;
  --bg-page: #ffffff;
  --bg-soft: #f8f9fa;
  --text-primary: #111827;
  --text-body: #333333;
  --text-muted: #6b7280;
  --border: #eeeeee;
  --success: #4caf50;
  --info: #2196f3;

  --nav-height: 80px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-body);
  background: var(--bg-page);
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ============================================
   1. 顶部导航
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-page);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}

.nav.scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: none;
  padding-inline: 40px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-brand .nav-logo {
  width: 55px;
  height: 55px;
  border-radius: 8px;
  flex-shrink: 0;
}

.nav-brand .brand-text {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.nav-brand .brand-name {
  font-size: clamp(20px, 4.5vw, 28px);
  font-weight: 900;
  letter-spacing: 0.2em;
  text-align: justify;
  text-align-last: justify;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  white-space: nowrap;
  filter: drop-shadow(0 2px 6px rgba(255, 149, 0, 0.25));
}

.nav-brand .brand-slogan {
  font-family: 'Ma Shan Zheng', 'KaiTi', 'STKaiti', '楷体', cursive;
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 400;
  color: #666;
  line-height: 1;
  letter-spacing: 1px;
  white-space: nowrap;
  text-align: left;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 15px;
  color: var(--text-muted);
  position: relative;
  padding-bottom: 6px;
  transition: color 0.2s ease;
}

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

.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* 汉堡菜单按钮 */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  z-index: 1100;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 移动端抽屉 */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-page);
  z-index: 1050;
  padding: 88px 32px 32px;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer .mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mobile-drawer .mobile-nav-links a {
  font-size: 18px;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.mobile-drawer .mobile-nav-links a.active {
  color: var(--primary);
  font-weight: 600;
}

/* 遮罩 */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.show {
  display: block;
  opacity: 1;
}

/* ============================================
   2. Hero 区
   ============================================ */
.hero {
  min-height: 85vh;
  min-height: min(85vh, 620px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 40px) 32px 40px;
  position: relative;
}

.hero-content {
  max-width: 960px;
  padding-inline: 12px;
}

/* Hero 标题组：主标题 + 副标题堆叠居中 */
.hero-heading {
  display: block;
  text-align: center;
}

.hero-title {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 22px);
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.6;
  white-space: nowrap;
  text-align: center;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.hero-actions .btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #ffffff;
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 149, 0, 0.25);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 149, 0, 0.25);
}

/* 三按钮等宽，直接下载按钮略窄作为备用入口 */
.hero-actions .btn,
.download-actions .btn {
  min-width: 220px;
  justify-content: center;
}

.hero-actions .btn.btn-outline,
.download-actions .btn.btn-outline {
  min-width: 176px;
}

.btn .btn-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 4px;
}

.btn-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.hero-version {
  margin-top: 32px;
  font-size: 13px;
  color: var(--text-muted);
}

/* 下滑箭头 */
.scroll-arrow {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.2s ease;
  animation: scroll-bounce 2s ease-in-out infinite;
}

.scroll-arrow:hover {
  opacity: 1;
  color: var(--primary);
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ============================================
   3-5. 功能区块
   ============================================ */
.section {
  padding: 100px 0;
}

.section-warm {
  background: var(--bg-warm);
}

.feature-row {
  display: flex;
  align-items: center;
  gap: 80px;
}

.feature-row.reverse {
  flex-direction: row-reverse;
}

.feature-text {
  flex: 0 0 50%;
}

.feature-image {
  flex: 0 0 50%;
}

.feature-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 24px;
}

.feature-desc {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-body);
}

.feature-desc p {
  margin-bottom: 12px;
}

.feature-desc p:last-child {
  margin-bottom: 0;
}

/* 图片占位区 */
.img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 15px;
}

/* ============================================
   6. 打赏区
   ============================================ */
#donate {
  text-align: center;
}

#donate .donate-heading {
  text-align: center;
}

.donate-heading-line1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.donate-heading-line2 {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.4;
}

.donate-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 60px;
}

.donate-card {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.donate-card:hover {
  border-color: var(--primary);
  transform: scale(1.08);
  box-shadow: inset 0 0 0 1px var(--primary), 0 8px 24px rgba(255, 149, 0, 0.12);
}

.donate-card.selected {
  border-color: var(--primary);
  background: var(--bg-warm);
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 1px var(--primary), 0 8px 24px rgba(255, 149, 0, 0.12);
}

.donate-card .card-icon {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 8px;
}

.donate-card .card-amount {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.donate-card .card-label {
  font-size: 14px;
  color: var(--text-muted);
}

/* ============================================
   7. 立即下载区
   ============================================ */
#download {
  text-align: center;
}

#download .section-title {
  font-size: 40px;
  font-weight: 700;
  color: var(--text-primary);
}

#download .download-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

#download .btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ============================================
   8. 作者信息栏
   ============================================ */
.author-row {
  display: flex;
  align-items: center;
  gap: 60px;
}

.author-info {
  flex: 0 0 60%;
}

.author-info p {
  font-size: 15px;
  color: var(--text-body);
  margin-bottom: 8px;
  line-height: 1.6;
}

.author-info p:first-child {
  font-size: 18px;
  color: var(--text-primary);
  font-weight: 600;
}

.author-qr {
  flex: 0 0 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.qr-placeholder {
  width: 160px;
  height: 160px;
  background: #f0f0f0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 13px;
}

.qr-label {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================
   9. 页脚
   ============================================ */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.footer a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

/* ============================================
   Responsive: Tablet (768px - 1023px)
   ============================================ */
@media (max-width: 1023px) {
  .container {
    padding: 0 24px;
    max-width: 90%;
  }

  .nav .container {
    padding-inline: 28px;
    max-width: none;
  }

  .hero-subtitle {
    font-size: clamp(15px, 2vw, 20px);
  }

  .feature-row {
    gap: 40px;
  }

  .feature-title {
    font-size: 26px;
  }

  #download .section-title {
    font-size: 32px;
  }

  .donate-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .author-row {
    gap: 40px;
  }
}

/* ============================================
   Responsive: Mobile (< 768px)
   ============================================ */
@media (max-width: 767px) {
  .container {
    padding: 0 16px;
    max-width: 100%;
  }

  .nav .container {
    padding-inline: 16px;
    max-width: none;
  }

  /* 导航 */
  .nav-links {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-drawer {
    display: block;
  }

  /* Hero */
  .hero {
    min-height: 80vh;
    padding-top: calc(var(--nav-height) + 24px);
  }

  .hero-title {
    font-size: clamp(24px, 7vw, 32px);
  }

  .hero-subtitle {
    font-size: clamp(14px, 4vw, 18px);
    margin-top: 12px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
  }

  .hero-actions .btn-wrapper {
    width: 100%;
    max-width: 320px;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }

  .hero-version {
    margin-top: 24px;
  }

  /* 功能区块 */
  .section {
    padding: 60px 0;
  }

  .feature-row,
  .feature-row.reverse {
    flex-direction: column;
    gap: 32px;
  }

  .feature-text,
  .feature-image {
    flex: 1 1 100%;
  }

  .feature-title {
    font-size: 24px;
  }

  .feature-desc {
    font-size: 15px;
  }

  /* 打赏 */
  .donate-heading-line1 {
    font-size: 22px;
  }
  .donate-heading-line2 {
    font-size: 15px;
  }

  .donate-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 40px;
  }

  .donate-card.card-custom {
    grid-column: span 2;
  }

  .donate-card {
    padding: 24px 12px;
  }

  .donate-card .card-amount {
    font-size: 22px;
  }

  /* 下载 */
  #download .section-title {
    font-size: 28px;
  }

  #download .download-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
  }

  #download .btn-wrapper {
    width: 100%;
    max-width: 320px;
  }

  /* 作者 */
  .author-row {
    flex-direction: column;
    gap: 32px;
    text-align: center;
  }

  .author-info,
  .author-qr {
    flex: 1 1 100%;
  }

  .author-qr {
    align-items: center;
  }
}
