/* ============================================
   麻阳苗乡暖心家园 - 主样式表
   设计理念：大字体、大图标、高对比度、极简适配乡村使用
   ============================================ */

/* === CSS 变量（色彩体系·苗乡暖色调） === */
:root {
  --color-primary: #A0522D;        /* 主色·赭石棕 */
  --color-primary-dark: #6B3410;   /* 深棕 */
  --color-primary-light: #C4956A;  /* 浅棕 */
  --color-accent: #C41E3A;         /* 强调色·中国红 */
  --color-accent-hover: #A01830;   /* 深红 */
  --color-gold: #B8860B;           /* 苗绣金 */
  --color-bg: #FFF8F0;             /* 背景·暖奶油 */
  --color-bg-alt: #F5EDE3;         /* 背景·亚麻暖 */
  --color-card: #FFFFFF;           /* 卡片白 */
  --color-text: #333333;           /* 正文 */
  --color-text-light: #666666;     /* 辅助文字 */
  --color-text-dark: #1A1A1A;      /* 标题 */
  --color-border: #E0D5C7;         /* 边框 */
  --color-success: #2E7D32;        /* 成功绿 */
  --color-warning: #E65100;        /* 警示橙 */
  --color-miao-pink: #E8B4B8;      /* 苗乡粉 */
  --color-miao-blue: #4A7B9D;      /* 苗乡蓝靛 */

  --font-xl: 1.5rem;     /* 24px - 大标题 */
  --font-lg: 1.25rem;    /* 20px - 板块标题 */
  --font-md: 1.125rem;   /* 18px - 正文 */
  --font-sm: 1rem;       /* 16px - 辅助文字 */
  --font-xs: 0.875rem;   /* 14px - 注释 */

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);

  --max-width: 1200px;
  --header-height: 64px;
}

/* === 全局重置 === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: var(--font-md);
  line-height: 1.8;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === 无障碍大字体模式 === */
body.large-font {
  font-size: 1.25rem;
}

/* === 顶部导航栏 === */
.top-header {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
  padding: 0 1rem;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
  font-size: var(--font-lg);
  font-weight: 700;
  white-space: nowrap;
}

.header-logo .logo-icon {
  font-size: 2rem;
}

.header-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-nav a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-sm);
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.header-nav a:hover,
.header-nav a.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

/* === 首页·英雄区 === */
.hero-section {
  background: linear-gradient(160deg, #6B3410 0%, #8B5A2B 30%, #A0522D 60%, #C4956A 100%);
  color: #fff;
  text-align: center;
  padding: 3rem 1.5rem 3.5rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5 L35 25 L55 30 L35 35 L30 55 L25 35 L5 30 L25 25 Z' fill='rgba(255,255,255,0.04)'/%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.hero-section > * {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-subtitle {
  font-size: var(--font-lg);
  margin-bottom: 0.5rem;
  opacity: 0.95;
  font-weight: 500;
}

.hero-slogan {
  font-size: var(--font-md);
  opacity: 0.8;
  margin-bottom: 1.5rem;
  font-style: italic;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  font-size: var(--font-sm);
  border: 1px solid rgba(255,255,255,0.3);
}

/* === 通用板块容器 === */
.section {
  padding: 2.5rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.section-title {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--color-primary-dark);
  text-align: center;
  margin-bottom: 0.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 0.5rem auto 0;
  border-radius: 3px;
}

.section-desc {
  text-align: center;
  color: var(--color-text-light);
  margin-bottom: 2rem;
  font-size: var(--font-sm);
}

/* === 快捷入口导航卡片 === */
.quick-nav {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  padding: 0 0.5rem;
}

.quick-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0.5rem;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--color-text-dark);
  transition: all 0.3s;
  border: 2px solid transparent;
  text-align: center;
  min-height: 120px;
}

.quick-nav-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.quick-nav-card .nav-icon {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.quick-nav-card .nav-label {
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--color-primary-dark);
}

.quick-nav-card .nav-hint {
  font-size: var(--font-xs);
  color: var(--color-text-light);
  margin-top: 0.25rem;
}

/* 紧急求助按钮特殊样式 */
.quick-nav-card.emergency {
  background: linear-gradient(135deg, #fff5f5, #ffe8e8);
  border-color: var(--color-accent);
  animation: pulse-border 2s infinite;
}

.quick-nav-card.emergency .nav-icon {
  font-size: 3rem;
}

.quick-nav-card.emergency .nav-label {
  color: var(--color-accent);
  font-size: var(--font-lg);
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--color-accent); }
  50% { border-color: #ff6b6b; }
}

/* === 通用卡片组件 === */
.card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  transition: all 0.3s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title .card-icon {
  font-size: 1.5rem;
}

.card-body {
  color: var(--color-text);
  font-size: var(--font-md);
  line-height: 1.8;
}

/* === 功能列表 === */
.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  list-style: none;
}

.feature-item {
  background: var(--color-card);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-primary-light);
  transition: all 0.3s;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.feature-item:hover {
  border-left-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.feature-item .fi-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.feature-item .fi-content h4 {
  font-size: var(--font-md);
  color: var(--color-primary-dark);
  margin-bottom: 0.25rem;
}

.feature-item .fi-content p {
  font-size: var(--font-sm);
  color: var(--color-text-light);
  line-height: 1.6;
}

/* === 按钮系统 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-size: var(--font-md);
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  min-height: 48px;  /* 触屏友好 */
  min-width: 48px;
  line-height: 1.4;
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

.btn-secondary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(160, 82, 45, 0.3);
}

.btn-secondary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

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

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: var(--font-lg);
  min-height: 56px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* === 页脚 === */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 2rem 1.5rem;
  margin-top: auto;
  font-size: var(--font-sm);
}

.site-footer .footer-brand {
  font-size: var(--font-lg);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.site-footer .footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}

.site-footer .footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer .footer-links a:hover {
  color: #fff;
}

/* === 子页·Banner === */
.page-banner {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.page-banner .banner-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.page-banner h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-banner p {
  font-size: var(--font-md);
  opacity: 0.9;
}

/* === 面包屑导航 === */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: var(--font-sm);
  color: var(--color-text-light);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .sep {
  color: var(--color-border);
}

/* === 标签页切换 === */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: none;
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--color-text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 48px;
}

.tab-btn:hover {
  color: var(--color-primary);
}

.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* === 一键拨号按钮 === */
.call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--color-success);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: var(--font-md);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  min-height: 48px;
}

.call-btn:hover {
  background: #1B5E20;
  transform: scale(1.05);
}

/* === 留言表单 === */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--color-text-dark);
  margin-bottom: 0.5rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-md);
  font-family: inherit;
  background: var(--color-card);
  color: var(--color-text);
  transition: border-color 0.2s;
  min-height: 48px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(160, 82, 45, 0.1);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* === 相册网格 === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery-item {
  aspect-ratio: 4/3;
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--color-text-light);
  border: 2px dashed var(--color-border);
  transition: all 0.3s;
  cursor: pointer;
  overflow: hidden;
}

.gallery-item:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

/* === 响应式设计 === */
@media (max-width: 768px) {
  :root {
    --font-xl: 1.35rem;
    --font-lg: 1.15rem;
    --font-md: 1.05rem;
  }

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

  .quick-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .quick-nav-card {
    padding: 1rem 0.25rem;
    min-height: 100px;
  }

  .quick-nav-card .nav-icon {
    font-size: 2rem;
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-primary-dark);
    flex-direction: column;
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
  }

  .header-nav.open {
    display: flex;
  }

  .menu-toggle {
    display: block;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tabs {
    gap: 0.25rem;
  }

  .tab-btn {
    padding: 0.6rem 1rem;
    font-size: var(--font-sm);
  }
}

@media (max-width: 480px) {
  .quick-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .quick-nav-card .nav-icon {
    font-size: 1.6rem;
  }

  .quick-nav-card .nav-label {
    font-size: var(--font-sm);
  }

  .section {
    padding: 1.5rem 1rem;
  }
}

/* === 辅助类 === */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* 无障碍：字体大小切换按钮 */
.font-size-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.font-size-toggle:hover {
  background: var(--color-primary-dark);
  transform: scale(1.1);
}

/* 滚动到顶部按钮 */
.scroll-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 5rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.scroll-top-btn.visible {
  display: flex;
}

.scroll-top-btn:hover {
  background: var(--color-accent-hover);
  transform: scale(1.1);
}

/* 通知/公告横幅 */
.notice-bar {
  background: linear-gradient(90deg, #FFF3CD, #FFE69C);
  border-left: 4px solid var(--color-warning);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-weight: 500;
  font-size: var(--font-md);
}

/* 数字徽标 */
.badge {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: var(--font-xs);
  font-weight: 600;
}

/* 分隔线 */
.divider {
  border: none;
  border-top: 2px solid var(--color-border);
  margin: 2rem 0;
}
