/* ===========================================================
   StoryEAST — 全站共享样式（header / footer / 语言切换 / 全球站弹窗）
   以 download.html 为基准提取。修改此文件即对 5 个页面同时生效。
   =========================================================== */

:root {
  --cinnabar: #c0392b;
  --cinnabar-dark: #922b21;
  --gold: #d4a843;
  --gold-light: #f0d48a;
  --ink: #1a1a1a;
  --ink-light: #2c2c2c;
  --cream: #f5f0e8;
  --parchment: #ede5d4;
  --parchment-dark: #e0d5be;
}

/* ===========================================================
   HEADER
   =========================================================== */
header {
  background: var(--ink);
  color: var(--gold);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
header .logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  justify-self: start;
}
header nav { display: flex; gap: 2.5rem; justify-content: center; justify-self: center; }
header nav a {
  color: #ccc;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  transition: color 0.2s;
  position: relative;
}
header nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s;
}
header nav a:hover::after, header nav a.active::after { width: 100%; }
header nav a:hover, header nav a.active { color: var(--gold); }

#header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  justify-self: end;
}

/* 汉堡按钮（桌面隐藏，移动端显示） */
#menu-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  color: #ccc;
  cursor: pointer;
  padding: 0;
}
#menu-toggle:hover { color: var(--gold); }

/* ===========================================================
   语言切换按钮
   =========================================================== */
.lang-switch-group { display: flex; align-items: center; gap: 0.4rem; }
.lang-icon-btn,
.lang-text-btn {
  background: transparent;
  border: 1px solid #3a3a3a;
  color: #bbb;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 18px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.lang-icon-btn .flag { width: 18px; height: 12px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.lang-icon-btn .label { font-size: 0.85rem; }
.lang-text-btn .globe { width: 14px; height: 14px; flex-shrink: 0; }
.lang-icon-btn:hover,
.lang-text-btn:hover { border-color: var(--gold); color: var(--gold-light); }
.lang-icon-btn.active,
.lang-text-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  font-weight: 600;
}

/* ===========================================================
   全球站弹窗
   =========================================================== */
.global-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.global-modal-backdrop.open { display: flex; }
.global-modal {
  position: relative;
  background: var(--ink-light);
  border: 1px solid #3a3a3a;
  border-radius: 18px;
  padding: 2.5rem 2.75rem;
  width: min(640px, 92vw);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(212, 168, 67, 0.08);
  color: #f5f0e8;
  animation: global-modal-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes global-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.global-modal h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #fff;
  letter-spacing: -0.01em;
}
.global-modal p { color: #b0a899; font-size: 1rem; margin-bottom: 1.8rem; line-height: 1.55; }
.global-modal .gm-options { display: flex; flex-direction: column; gap: 1rem; }
.global-modal .gm-option {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.25rem 1.4rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid #3a3a3a;
  color: #f5f0e8;
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  font-family: inherit;
  font-size: 1rem;
}
.global-modal .gm-option:hover { background: var(--ink); border-color: var(--gold); color: var(--gold-light); transform: translateY(-1px); }
.global-modal .gm-option .gm-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f1f1f, #2a2a2a);
  color: var(--gold);
  border: 1px solid rgba(212, 168, 67, 0.25);
}
.global-modal .gm-option .gm-icon svg { width: 24px; height: 24px; }
.global-modal .gm-option .gm-text strong { display: block; font-size: 1.1rem; font-weight: 600; }
.global-modal .gm-option .gm-text span { display: block; color: #999; font-size: 0.88rem; margin-top: 0.25rem; line-height: 1.5; }
.global-modal .gm-option .gm-text .gm-features {
  color: var(--gold);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  margin-top: 0.4rem;
}
.global-modal .gm-option.gm-secondary { border-style: dashed; }
.global-modal .gm-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  color: #888;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.global-modal .gm-close:hover {
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(212, 168, 67, 0.3);
}
.global-modal .gm-close svg { width: 20px; height: 20px; }

/* ===========================================================
   FOOTER
   =========================================================== */
.about-us {
  background: var(--ink);
  color: #fff;
  padding: 5rem 2rem 3rem;
}
.about-us-grid {
  max-width: 80vw;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}
.about-us h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--gold);
}
.contact-item { margin-bottom: 1rem; }
.contact-item .label {
  color: #888;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.contact-item a { color: var(--gold-light); transition: color 0.2s; }
.contact-item a:not(.contact-email):hover { color: #fff; }
.contact-item .contact-email { color: #fff; }
.contact-item .contact-email:hover { color: var(--gold-light); }

/* 联系邮箱行 */
.contact-email-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1rem; }
.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.15rem;
  font-weight: 500;
  color: #fff;
}
.contact-email svg { width: 22px; height: 22px; flex-shrink: 0; }
.contact-email:hover { color: var(--gold-light); }
.contact-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 500;
}
.contact-more::after { content: '›'; font-size: 1.15rem; line-height: 1; }
.contact-more:hover { color: var(--gold-light); }

/* 社交图标 */
.social-row { display: flex; gap: 0.8rem; margin-top: 1rem; flex-wrap: wrap; }
.social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #262626;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}
.social-link img, .social-link svg { width: 18px; height: 18px; }
.social-link:hover { background: #333; transform: translateY(-2px); }

/* 语言网格 */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem 0.8rem;
  margin-top: 0.3rem;
}
.lang-grid span { color: #fff; font-size: 0.95rem; }
.lang-more {
  color: var(--gold-light);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-style: italic;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.lang-more-sep { color: #555; }
.global-site-link { display: inline-flex; align-items: center; color: var(--gold); }
.global-site-link svg { width: 14px; height: 14px; }
.global-site-link:hover { color: var(--gold-light); }

/* 下载 App CTA */
.footer-cta-link { color: var(--gold-light); font-weight: 600; }
.footer-cta-link:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid #222;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.82rem;
  color: #555;
  max-width: 80vw;
  margin: 2rem auto 0;
}
.footer-bottom span { color: inherit; }

/* ===========================================================
   响应式
   =========================================================== */
@media (max-width: 900px) {
  header { padding: 0.8rem 1rem; }
  header nav { gap: 1.2rem; }
  header nav a { font-size: 0.85rem; padding: 0.4rem 0; }
  .about-us-grid { grid-template-columns: 1fr; gap: 2rem; max-width: 100%; }
  .lang-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-bottom { max-width: 100%; }
}

@media (max-width: 600px) {
  header { padding: 0.7rem 0.9rem; }
  header .logo img { height: 26px !important; }
  header nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--ink);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    border-top: 1px solid #333;
    display: none;
    z-index: 99;
  }
  header.nav-open nav { display: flex; }
  header nav a {
    padding: 0.75rem 0.5rem;
    font-size: 0.95rem;
    border-bottom: 1px solid #1f1f1f;
    text-align: center;
  }
  header nav a:last-child { border-bottom: none; }
  #menu-toggle { display: flex; }
  #header-actions { gap: 0.3rem; }
  .lang-switch-group { gap: 0.3rem; }
  .lang-switch-group .lang-icon-btn,
  .lang-switch-group .lang-text-btn { padding: 0.32rem 0.5rem; font-size: 0.7rem; }
  .lang-switch-group .lang-icon-btn .flag { width: 16px; height: 11px; }
  /* 移动端: 两个按钮改为圆形图标按钮, 隐藏文字, 视觉更对称精致 */
  .lang-switch-group .lang-text-btn .label,
  .lang-switch-group .lang-text-btn .globe-label { display: none; }
  .lang-switch-group .lang-icon-btn .label { display: none; }
  .lang-switch-group .lang-text-btn,
  .lang-switch-group .lang-icon-btn {
    width: 34px !important;
    height: 34px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
  }
  .lang-switch-group .lang-text-btn .globe { width: 16px; height: 16px; }
  .lang-switch-group .lang-icon-btn .flag { width: 16px; height: 16px; }

  /* === footer 移动端瘦身 (PC 端不受影响) === */
  .about-us { padding: 2rem 1rem 1.5rem; }
  /* 整块居中:网格改成单列后,所有子元素 text-align center */
  .about-us { text-align: center; }
  .about-us h2,
  .about-us p,
  .about-us .label,
  .about-us .lang-more,
  .about-us .footer-bottom { color: inherit; }
  /* 居中后邮箱行/社交行/语言网格保持子元素居中 */
  .contact-email-row { justify-content: center; }
  .social-row { justify-content: center; }
  .lang-grid { justify-items: center; }
  /* 移动端移除 "Our Reach / 我们的影响" 整块 (第二个直接子 div) */
  .about-us-grid > div:nth-child(2) { display: none; }
  /* 上面这条让第二栏消失,单栏后不再需要两栏之间的分隔线 */
  .about-us-grid > div + div { border-top: none; padding-top: 0; margin-top: 0; }
  .about-us h2 { font-size: 1.3rem; margin-bottom: 0.6rem; }
  .contact-item { margin-bottom: 0.6rem; }
  .about-us .contact-item .label { color: #666 !important; } /* 移动端 label 颜色变浅 (#888 → #666) */
  .lang-grid { grid-template-columns: repeat(3, 1fr); gap: 0.2rem 0.6rem; }
  .lang-grid span { font-size: 0.9rem; }
  .lang-grid span[data-live="false"] { display: none; } /* 未上线的语言 chip 移动端隐藏 */
  .lang-more { font-size: 0.8rem; justify-content: center; }
  .social-row { gap: 0.6rem; margin-top: 0.6rem; }
  .social-link { width: 34px; height: 34px; }
  .social-link svg { width: 17px; height: 17px; }
  .footer-bottom { font-size: 0.75rem; padding-top: 1.2rem; margin-top: 1.5rem; }
}

@media (max-width: 380px) {
  header { padding: 0.6rem 0.7rem; }
  .lang-switch-group .lang-icon-btn .flag { width: 16px; height: 10px; }
  .lang-grid { grid-template-columns: repeat(2, 1fr); }
}
