/* ===== 山野伴行·支教随笔站点 全局样式 ===== */

/* ---------- 变量与基础重置 ---------- */
:root {
  --bg: #faf7f2;            /* 暖白底 */
  --bg-soft: #f3ede3;       /* 柔和米色 */
  --card: #ffffff;
  --primary: #7ca982;       /* 柔和青草绿 */
  --primary-soft: #a8c5a8;
  --accent: #e0a899;        /* 柔和珊瑚 */
  --accent-soft: #f0cfc4;
  --text: #4a4640;          /* 柔和深灰棕 */
  --text-soft: #8a8478;     /* 次要文字 */
  --line: #e8e0d3;          /* 浅线条 */
  --shadow: 0 4px 18px rgba(122, 110, 90, 0.08);
  --shadow-hover: 0 8px 28px rgba(122, 110, 90, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --max-w: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  padding-top: 68px; /* 留给固定导航 */
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- 顶部固定导航 ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
  display: flex;
  align-items: center;
}
.nav-inner {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  margin-right: auto;
  letter-spacing: 1px;
  white-space: nowrap;
}
.nav-brand small {
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 400;
  margin-left: 6px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--text);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--primary); }
.nav-links a.active { background: var(--primary); color: #fff; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
}

/* ---------- 通用容器 ---------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.page-title {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.page-sub {
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 32px;
}
.section { margin-bottom: 48px; }

/* ---------- 首页 ---------- */
.hero {
  text-align: center;
  padding: 30px 0 20px;
}
.hero h1 {
  font-size: 30px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: 2px;
}
.hero .lead {
  font-size: 16px;
  color: var(--text-soft);
  max-width: 620px;
  margin: 0 auto;
  line-height: 2;
}
.hero .lead p + p { margin-top: 10px; }
.hero .deco {
  display: inline-block;
  color: var(--primary);
  margin: 18px 0 6px;
  font-size: 14px;
  letter-spacing: 6px;
}

/* 团队标签 */
.team-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}
.team-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  width: 220px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.team-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.team-card .avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600;
  margin-bottom: 12px;
}
.team-card .name { font-weight: 600; margin-bottom: 8px; }
.team-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.team-card .tag {
  font-size: 12px;
  background: var(--bg-soft);
  color: var(--text-soft);
  padding: 3px 10px;
  border-radius: 12px;
}

/* 站点说明 */
.notice {
  background: var(--bg-soft);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 2;
}
.notice strong { color: var(--primary); }

/* 快捷入口卡片 */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.quick-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--primary-soft); }
.quick-card .ico { font-size: 26px; }
.quick-card .t { font-weight: 600; font-size: 16px; }
.quick-card .d { font-size: 13px; color: var(--text-soft); }
.quick-card .go { color: var(--primary); font-size: 13px; margin-top: 4px; }

/* ---------- 相册手账风格包装 ---------- */
.gallery-wrap {
  background: #fbf6ec;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  position: relative;
}
.gallery-wrap::before {
  content: "";
  position: absolute;
  top: 14px; left: 14px; right: 14px; bottom: 14px;
  border: 1px dashed #d8cdb8;
  border-radius: 12px;
  pointer-events: none;
}
.gallery-header {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}
.gallery-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.gallery-header p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.8;
}
.gallery-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed #d8cdb8;
  position: relative;
  z-index: 1;
}
.gallery-footer p {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.8;
}

/* ---------- 相册瀑布流（手账贴画风） ---------- */
.masonry {
  column-count: 3;
  column-gap: 22px;
  position: relative;
  z-index: 1;
}
.masonry .photo {
  break-inside: avoid;
  margin-bottom: 22px;
  background: #fffdf8;
  border: 1px solid #e8dfce;
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    0 1px 3px rgba(122, 110, 90, 0.12),
    0 4px 12px rgba(122, 110, 90, 0.08);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}
/* 随机倾斜，模拟手账贴画效果 */
.masonry .photo:nth-child(3n+1) { transform: rotate(-0.6deg); }
.masonry .photo:nth-child(3n+2) { transform: rotate(0.5deg); }
.masonry .photo:nth-child(3n+3) { transform: rotate(-0.3deg); }
.masonry .photo:hover {
  transform: rotate(0deg) translateY(-4px) scale(1.02);
  box-shadow:
    0 4px 8px rgba(122, 110, 90, 0.15),
    0 10px 24px rgba(122, 110, 90, 0.12);
  z-index: 5;
}
/* 胶带装饰 */
.masonry .photo::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 14px;
  background: rgba(224, 168, 153, 0.55);
  border-left: 1px dashed rgba(255,255,255,0.4);
  border-right: 1px dashed rgba(255,255,255,0.4);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  z-index: 2;
}
.masonry .photo:nth-child(even)::after { background: rgba(168, 197, 168, 0.5); }
.masonry .photo:nth-child(3n)::after { background: rgba(210, 190, 160, 0.55); }

.masonry .photo img {
  width: 100%;
  height: auto;
  display: block;
  background: var(--bg-soft);
}
.masonry .photo .cap {
  padding: 12px 16px 14px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.8;
  font-family: "KaiTi", "STKaiti", "楷体", "PingFang SC", serif;
  border-top: 1px dashed #e8dfce;
  background: #fffdf8;
}
.masonry .photo .cap .date {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
}

/* ---------- 图片放大预览弹层 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(40, 35, 28, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 30px;
  cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 92%;
  max-height: 86%;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.lightbox .lb-cap {
  position: absolute;
  bottom: 24px;
  left: 0; right: 0;
  text-align: center;
  color: #f3ede3;
  font-size: 14px;
}

/* ---------- 看原图 弹窗 ---------- */
.original-modal {
  position: fixed;
  inset: 0;
  background: rgba(40, 35, 28, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 30px;
  cursor: pointer;
}
.original-modal.show { display: flex; }
.original-modal .om-box {
  background: #fffdf8;
  border-radius: 12px;
  padding: 36px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  cursor: default;
}
.original-modal .om-text {
  font-size: 16px;
  line-height: 2;
  color: var(--text);
  margin-bottom: 20px;
}
.original-modal .om-qr {
  display: block;
  margin: 0 auto;
  max-width: 220px;
  width: 70%;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.original-modal .om-tip {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 14px;
}

/* ---------- 我的手账 Alice 风格 ---------- */
.journal-wrap {
  background: #fbf6ec;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  position: relative;
}
.journal-wrap::before {
  content: "";
  position: absolute;
  top: 14px; left: 14px; right: 14px; bottom: 14px;
  border: 1px dashed #d8cdb8;
  border-radius: 12px;
  pointer-events: none;
}
.journal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.j-tab {
  padding: 7px 18px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}
.j-tab:hover { color: var(--primary); }
.j-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.j-mode-switch {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--text-soft);
}
.j-mode-switch .m-btn {
  padding: 5px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 12px;
}
.j-mode-switch .m-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }

/* 日期时间轴 */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--primary-soft);
}
.tl-item { position: relative; margin-bottom: 34px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -26px; top: 8px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #fbf6ec;
}
.tl-date {
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.tl-title { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.tl-mood {
  display: inline-block;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 400;
}
.tl-body { color: var(--text); line-height: 2.1; margin-bottom: 12px; }
.tl-imgs { display: flex; gap: 10px; flex-wrap: wrap; }
.tl-imgs img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 10px;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
}

/* 事件分类 */
.event-block {
  margin-bottom: 32px;
  padding: 22px 24px;
  background: #fffdf8;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.event-block h3 {
  font-size: 17px;
  color: var(--primary);
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.event-block .ev-meta { font-size: 12px; color: var(--text-soft); margin-bottom: 10px; }
.event-block p { line-height: 2.1; margin-bottom: 10px; }

/* 碎片随笔 */
.fragments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.fragment {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.fragment::before {
  content: "❀";
  position: absolute;
  top: -8px; left: 16px;
  background: #fbf6ec;
  color: var(--accent);
  padding: 0 6px;
  font-size: 14px;
}
.fragment .f-text { font-size: 14px; line-height: 2; color: var(--text); }
.fragment .f-date { font-size: 11px; color: var(--text-soft); margin-top: 10px; text-align: right; }

/* ---------- 登录页 ---------- */
.auth-box {
  max-width: 380px;
  margin: 40px auto 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.auth-box h2 { font-size: 22px; margin-bottom: 6px; }
.auth-box .sub { color: var(--text-soft); font-size: 13px; margin-bottom: 26px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; color: var(--text-soft); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.2s ease;
}
.field input:focus { outline: none; border-color: var(--primary); }
.btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease;
}
.btn:hover { background: #6a9170; }
.btn:disabled { background: var(--text-soft); cursor: not-allowed; }
.auth-tip {
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.8;
}
.auth-msg {
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}
.auth-msg.err { color: var(--accent); }
.auth-msg.ok { color: var(--primary); }

/* 个人中心小卡片 */
.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.user-card .ava {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary-soft); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.user-card .info .n { font-weight: 600; }
.user-card .info .s { font-size: 12px; color: var(--text-soft); }

/* 登录态提示条 */
.login-banner {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
}
.login-banner.guest { background: var(--bg-soft); color: var(--text-soft); }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center;
  padding: 30px 24px 40px;
  color: var(--text-soft);
  font-size: 12px;
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .masonry { column-count: 2; }
}
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 60px; right: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    width: 180px;
    border: 1px solid var(--line);
    border-radius: 0 0 0 var(--radius-sm);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 14px; }
  .hero h1 { font-size: 24px; }
  .masonry { column-count: 1; }
  .container { padding: 28px 18px 60px; }
  .journal-wrap { padding: 24px 18px; }
  .tl-imgs img { width: 100px; height: 100px; }
}
