/* 长青公益 - 主样式文件 */
/* 设计风格：温暖、克制、公益属性，绿色主调 #5B8C5A，米纸色背景 #F7F3E8，铜色强调 #B87333，Noto Serif SC 字体 */

/* 变量定义 */
:root {
  --paper: #F7F3E8;
  --ink: #4A3B2C;
  --copper: #B87333;
  --mist: #DCD3C6;
  --calm-green: #5B8C5A;
  --light-green: #E8F0E8;
  --shadow: 0 4px 16px rgba(0,0,0,0.04);
  --shadow-hover: 0 8px 28px rgba(0,0,0,0.08);
}

/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif", "PingFang SC", "Microsoft YaHei", serif;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== 导航栏 ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(247, 243, 232, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--mist);
  padding: 1rem 1.5rem;
  width: 100%;
}

.navbar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.navbar-brand {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--calm-green);
  letter-spacing: 0.08em;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.navbar-brand:hover {
  opacity: 0.9;
}

.navbar-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.navbar-links a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.navbar-links a:hover,
.navbar-links a.current {
  border-bottom-color: var(--calm-green);
  color: var(--calm-green);
}

/* ===== 主体容器 ===== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}

/* ===== 页头 ===== */
header {
  text-align: center;
  padding: 3rem 0 2.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--mist);
}

header h1 {
  font-size: 2.8rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--calm-green);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

header .subtitle {
  font-size: 1rem;
  color: #6B5A4A;
  letter-spacing: 0.1em;
  font-weight: 300;
}

/* ===== 区块标题 ===== */
.section-title {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.12em;
  margin: 3rem 0 1.5rem;
  position: relative;
  scroll-margin-top: 1rem;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 2px;
  background: var(--calm-green);
  margin: 0.8rem auto 0;
}

/* ===== 引言语录 ===== */
.quote-block {
  text-align: center;
  padding: 2rem 0;
  font-size: 1.15rem;
  color: #5B5B5B;
  font-style: italic;
  letter-spacing: 0.06em;
  line-height: 2;
  border-bottom: 1px solid var(--mist);
  margin-bottom: 1.5rem;
}

/* ===== 卡片 ===== */
.card {
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 20px;
  padding: 2rem 2.2rem;
  margin-bottom: 1.8rem;
  transition: box-shadow 0.3s, transform 0.2s;
  box-shadow: var(--shadow);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card h2 {
  font-size: 1.4rem;
  color: var(--calm-green);
  margin-bottom: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.card h3 {
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 0.6rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card p {
  color: var(--ink);
  font-weight: 300;
  line-height: 1.7;
}

/* ===== 故事标签 ===== */
.story-tags {
  margin-bottom: 0.8rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.story-tag {
  display: inline-block;
  font-size: 0.78rem;
  background: var(--light-green);
  color: var(--calm-green);
  padding: 0.25rem 0.8rem;
  border-radius: 20px;
  letter-spacing: 0.04em;
  font-weight: 500;
  white-space: nowrap;
}

/* ===== 服务列表 ===== */
.service-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.8rem;
}

.service-list li {
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.service-list li::before {
  content: '· ';
  color: var(--calm-green);
  font-weight: bold;
  margin-right: 0.5rem;
}

/* ===== 图片占位容器 ===== */
.story-image,
.activity-image {
  width: 100%;
  height: 240px;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--light-green);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--mist);
}

.story-image img,
.activity-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
  opacity: 0;
}

.story-image img.loaded,
.activity-image img.loaded {
  opacity: 1;
}

.img-loading {
  position: absolute;
  color: var(--calm-green);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

/* ===== 活动展示网格 ===== */
.activity-gallery {
  display: grid;
  gap: 1.5rem;
}

.activity-item {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  align-items: start;
}

.activity-info h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.activity-info p {
  font-size: 0.95rem;
  color: #6B5A4A;
  line-height: 1.6;
}

/* ===== 召唤按钮 ===== */
.cta-area {
  text-align: center;
  padding: 3rem 0 2rem;
}

.cta-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: var(--calm-green);
  color: #fff;
  text-decoration: none;
  border-radius: 40px;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  transition: all 0.2s;
  box-shadow: 0 6px 20px rgba(91, 140, 90, 0.25);
  border: none;
  cursor: pointer;
}

.cta-btn:hover {
  background: #4A7A49;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(91, 140, 90, 0.35);
}

/* ===== 页脚 ===== */
footer {
  text-align: center;
  padding: 2.5rem 1.5rem;
  margin-top: 2rem;
  border-top: 1px solid var(--mist);
  font-size: 0.85rem;
  color: #6B5A4A;
  line-height: 2;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

footer a {
  color: var(--calm-green);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

footer a:hover {
  text-decoration: underline;
}

footer .disclaimer {
  max-width: 600px;
  margin: 0.8rem auto 0;
  font-size: 0.8rem;
  color: #8A7A6A;
  line-height: 1.7;
  font-style: italic;
}

/* ===== 聊天悬浮按钮 ===== */
.chat-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: var(--calm-green);
  color: #fff;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(91, 140, 90, 0.3);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  text-decoration: none;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 6px 20px rgba(91, 140, 90, 0.3); }
  50% { box-shadow: 0 6px 20px rgba(91, 140, 90, 0.6); }
  100% { box-shadow: 0 6px 20px rgba(91, 140, 90, 0.3); }
}

.chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(91, 140, 90, 0.4);
  animation: none;
}

/* ===== 聊天窗口 ===== */
.chat-window {
  position: fixed;
  bottom: 5rem;
  right: 2rem;
  width: 380px;
  height: 500px;
  background: var(--paper);
  border: 1px solid var(--mist);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  z-index: 10001;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-header {
  background: var(--calm-green);
  color: #fff;
  padding: 0.9rem 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.chat-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0.8;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.chat-header button:hover {
  background: rgba(255,255,255,0.1);
  opacity: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 0;
  scroll-behavior: smooth;
}

.chat-msg {
  max-width: 85%;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--calm-green);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--mist);
  border-bottom-left-radius: 4px;
}

.chat-input-area {
  display: flex;
  padding: 0.8rem;
  border-top: 1px solid var(--mist);
  gap: 0.6rem;
  flex-shrink: 0;
  background: var(--paper);
}

.chat-input-area input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--mist);
  border-radius: 20px;
  outline: none;
  font-size: 0.9rem;
  background: #fff;
  font-family: inherit;
  transition: border-color 0.2s;
}

.chat-input-area input:focus {
  border-color: var(--calm-green);
}

.chat-input-area button {
  padding: 0.6rem 1.4rem;
  background: var(--calm-green);
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background 0.2s;
  white-space: nowrap;
}

.chat-input-area button:hover {
  background: #4A7A49;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  /* 导航栏适配 */
  .navbar {
    padding: 0.8rem 1rem;
  }
  
  .navbar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }
  
  .navbar-links {
    justify-content: center;
    gap: 1rem;
    font-size: 0.85rem;
  }
  
  /* 头部适配 */
  header h1 {
    font-size: 2rem;
    letter-spacing: 0.1em;
  }
  
  header .subtitle {
    font-size: 0.9rem;
  }
  
  /* 卡片适配 */
  .container {
    padding: 2rem 1rem 3rem;
  }
  
  .card {
    padding: 1.5rem;
    border-radius: 16px;
  }
  
  /* 活动项目适配 */
  .activity-item {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .story-image,
  .activity-image {
    height: 200px;
  }
  
  /* 聊天窗口适配 */
  .chat-window {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 1rem;
    height: 60vh;
    border-radius: 16px;
  }
  
  .chat-fab {
    right: 1rem;
    bottom: 1rem;
  }
  
  /* 服务列表适配 */
  .service-list {
    grid-template-columns: 1fr;
  }
  
  /* 文字大小调整 */
  .section-title {
    font-size: 1.2rem;
  }
  
  .quote-block {
    font-size: 1rem;
    padding: 1.5rem 0;
  }
  
  .chat-msg {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  .navbar-links {
    font-size: 0.8rem;
    gap: 0.8rem;
  }
  
  header h1 {
    font-size: 1.8rem;
  }
  
  .card h2 {
    font-size: 1.2rem;
  }
  
  .card h3 {
    font-size: 1rem;
  }
  
  .cta-btn {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
  }
  
  .story-image,
  .activity-image {
    height: 180px;
  }
  
  .chat-window {
    height: 70vh;
  }
  
  .chat-header {
    padding: 0.7rem 1rem;
  }
  
  .chat-input-area {
    padding: 0.6rem;
  }
  
  .chat-input-area input {
    padding: 0.5rem 0.8rem;
  }
  
  .chat-input-area button {
    padding: 0.5rem 1rem;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  .chat-fab {
    width: 60px;
    height: 60px;
  }
  
  .navbar-links a {
    padding: 0.5rem 0;
  }
  
  .chat-msg {
    padding: 0.8rem 1rem;
  }
  
  .cta-btn {
    padding: 1rem 2.2rem;
  }
}