/* ============================================================
   爱莉内容矩阵 · 统一模板样式
   说明：全站共享这一份 CSS。各账号页仅通过 <body class="theme-xxx">
   切换主题色，版式完全一致。修改本文件即修改全站样式。
   ============================================================ */

/* ---------- 1. 设计变量 ---------- */
:root {
  /* 中性色 */
  --bg: #f6f8fa;
  --surface: #ffffff;
  --text: #1f2329;
  --text-2: #4e5969;
  --text-3: #86909c;
  --border: #e8eaf0;

  /* 结构 */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(31, 35, 41, 0.06);
  --shadow-lg: 0 10px 30px rgba(31, 35, 41, 0.10);
  --container: 1120px;

  /* 字体：国内访问优先用系统字体，不加载外部字体，保证秒开 */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* 主题色：各账号仅颜色不同 */
.theme-brand  { --brand:#2f54eb; --brand-dark:#1d39c4; --brand-soft:#eef1fd; } /* 公司·靛蓝 */
.theme-bencao { --brand:#2c7a4b; --brand-dark:#1f5c38; --brand-soft:#ecf5ef; } /* 本草求直·本草绿 */
.theme-qizhi  { --brand:#e07b0a; --brand-dark:#c2640a; --brand-soft:#fdf1e2; } /* 启智教育·活力橙 */
.theme-aili   { --brand:#c94f8a; --brand-dark:#a83a70; --brand-soft:#fbe9f2; } /* 爱莉说·藕粉 */
.theme-gantong{ --brand:#4b5cc4; --brand-dark:#35429c; --brand-soft:#eef0fb; } /* 感通·青蓝 */

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
::selection { background: var(--brand); color: #fff; }

/* ---------- 3. 顶部导航（吸顶 + 毛玻璃） ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.brand-logo .logo-dot {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700;
}
.nav-links { display: flex; align-items: center; gap: 6px; list-style: none; }
.nav-links a { color: var(--text-2); padding: 8px 12px; border-radius: 8px; font-size: 15px; transition: .2s; }
.nav-links a:hover { color: var(--brand); background: var(--brand-soft); }

/* “矩阵”下拉：跳转到其他账号页 */
.has-dropdown { position: relative; }
.dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 6px; display: none; list-style: none;
}
.has-dropdown:hover .dropdown, .has-dropdown:focus-within .dropdown { display: block; }
.dropdown a { display: flex; align-items: center; gap: 8px; padding: 9px 12px; }
.dropdown a .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; }

/* ---------- 4. Hero 首屏 ---------- */
.hero { background: linear-gradient(180deg, var(--brand-soft), var(--bg)); padding: 72px 0 56px; }
.hero-inner { max-width: 820px; }
.hero-badge {
  display: inline-block; background: var(--surface); color: var(--brand);
  border: 1px solid var(--border); padding: 5px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; margin-bottom: 18px;
}
.hero h1 { font-size: 40px; line-height: 1.25; letter-spacing: .5px; margin-bottom: 16px; }
.hero h1 .accent { color: var(--brand); }
.hero p.lead { font-size: 18px; color: var(--text-2); max-width: 640px; margin-bottom: 22px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-tags .tag {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  padding: 6px 14px; border-radius: 999px; font-size: 14px;
}

/* ---------- 5. 通用 Section ---------- */
.section { padding: 56px 0; }
.section:nth-of-type(even) { background: var(--surface); }
.section-head { margin-bottom: 30px; }
.section-head .kicker { color: var(--brand); font-weight: 700; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; }
.section-head h2 { font-size: 28px; margin-top: 6px; }
.section-head p { color: var(--text-2); margin-top: 8px; max-width: 640px; }

/* ---------- 6. 卡片网格（内容方向 / 栏目） ---------- */
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.section:nth-of-type(even) .card { background: var(--bg); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .card-icon {
  width: 44px; height: 44px; border-radius: 11px; background: var(--brand-soft);
  color: var(--brand); font-size: 22px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { color: var(--text-2); font-size: 15px; }

/* ---------- 7. 全网矩阵（平台入口 + 二维码） ---------- */
.matrix-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.matrix-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 18px; text-align: center; box-shadow: var(--shadow); transition: .2s;
}
.section:nth-of-type(even) .matrix-card { background: var(--bg); }
.matrix-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.matrix-card .platform { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.matrix-card .handle { color: var(--text-3); font-size: 13px; margin-bottom: 14px; word-break: break-all; }

/* 二维码占位：上线前替换为真实 <img src="二维码图"> */
.qr-box {
  width: 130px; height: 130px; margin: 0 auto 12px; border-radius: var(--radius-sm);
  border: 2px dashed var(--border); background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px; gap: 6px; padding: 8px; text-align: center;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
.matrix-card .open-link {
  display: inline-block; font-size: 13px; font-weight: 600; color: var(--brand);
  padding: 6px 14px; border: 1px solid var(--brand); border-radius: 999px; transition: .2s;
}
.matrix-card .open-link:hover { background: var(--brand); color: #fff; }

/* ---------- 8. 主理人 ---------- */
.host-card {
  display: flex; gap: 24px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.section:nth-of-type(even) .host-card { background: var(--bg); }
.host-avatar {
  width: 88px; height: 88px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; font-size: 34px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.host-info h3 { font-size: 20px; margin-bottom: 6px; }
.host-info .host-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.host-info .host-tags .tag {
  background: var(--brand-soft); color: var(--brand-dark);
  font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px;
}
.host-info p { color: var(--text-2); font-size: 15px; }

/* ---------- 9. 内容边界 / 免责声明 ---------- */
.notice {
  background: var(--brand-soft); border: 1px solid var(--border);
  border-left: 4px solid var(--brand); border-radius: var(--radius-sm);
  padding: 20px 22px;
}
.notice h4 { font-size: 16px; margin-bottom: 10px; color: var(--brand-dark); }
.notice ul { list-style: none; }
.notice li { color: var(--text-2); font-size: 14px; padding-left: 20px; position: relative; margin-bottom: 8px; }
.notice ul li::before { content: "·"; position: absolute; left: 4px; color: var(--brand); font-weight: 700; }

/* ---------- 10. 页脚 ---------- */
.site-footer { background: #171a21; color: #a9b0bb; padding: 44px 0 28px; margin-top: 10px; }
/* 用 grid 固定列宽：原 flex+wrap 下列宽随文字长短变化，各页换行点不一致导致错位 */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 26px;
  align-items: start;
}
/* 手机：品牌块独占一行，两个导航列并排分列左右（五个页面表现一致） */
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 16px; }
  .footer-brand { grid-column: 1 / -1; }
}
.footer-grid h5 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: 8px; }
.footer-grid a { color: #a9b0bb; font-size: 14px; }
.footer-grid a:hover { color: #fff; }
.footer-brand p { font-size: 14px; max-width: 320px; margin-top: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08); margin-top: 30px; padding-top: 20px;
  font-size: 13px; color: #7c8491; display: flex; flex-wrap: wrap; gap: 8px 20px;
  /* 11-18 19:47 定：页脚只留备案号（链接工信部），不展示版权行 / 不写真名 → 底部居中 */
  justify-content: center; text-align: center;
}
.footer-bottom a { color: #7c8491; }

/* ---------- 11. 返回顶部 ---------- */
.to-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 20px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: .25s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { background: var(--brand-dark); }

/* ---------- 12. 进入动画 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 13. 响应式 ---------- */
@media (max-width: 960px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .matrix-grid { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 30px; }
  .section { padding: 42px 0; }
  .grid.cols-3, .grid.cols-4, .matrix-grid { grid-template-columns: 1fr; }
  .host-card { flex-direction: column; }

  /* 移动端：汉堡菜单 */
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px; display: none; box-shadow: var(--shadow-lg);
  }
  .nav-links.open { display: flex; }
  .dropdown { position: static; box-shadow: none; border: 0; display: block; padding-left: 14px; }
}

/* ---------- 14. 移动端增强 & iOS 安全区（补充） ----------
   需配合各页面 viewport 里的 viewport-fit=cover 才生效。
   集中放在文件末尾，便于统一维护与回滚；桌面端 env() 为 0，视觉不变。 */

:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* 横屏刘海机型：内容不贴屏幕圆角 */
.container {
  padding-left: calc(20px + var(--safe-left));
  padding-right: calc(20px + var(--safe-right));
}

/* 页脚与返回顶部按钮：避开 iPhone 底部横条（Home Indicator） */
.site-footer { padding-bottom: calc(28px + var(--safe-bottom)); }
.to-top { bottom: calc(26px + var(--safe-bottom)); }

@media (max-width: 640px) {
  /* 手机扫不了自己屏幕上的二维码 —— 把「打开主页」提升为首要操作 */
  .matrix-card .open-link {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
  }
  .matrix-card .open-link:hover,
  .matrix-card .open-link:active {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
  }
  /* 二维码在手机上退为辅助信息，降低视觉权重 */
  .qr-box { width: 112px; height: 112px; opacity: .85; }

  /* 页脚现只剩备案号（11-18 19:47 定：不展示版权行 / 不写真名），窄屏保持居中 */
  .footer-bottom { justify-content: center; }
}
