/* ============================================================
 * 黄田小学2021级4班 · 六年时光 —— 样式
 * 暖色调、移动端优先、家长手机友好
 * ============================================================ */

:root {
  --bg: #faf6f0;
  --card: #ffffff;
  --ink: #3d3a35;
  --ink-soft: #8a857c;
  --line: #ece5da;
  --accent: #d4526e;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(93, 76, 55, .10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* ---------- 口令门 ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #fdf3e7 0%, #faf6f0 45%, #f6e9e4 100%);
}
.gate-card {
  width: 100%; max-width: 380px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 40px 28px 32px;
  text-align: center;
}
.gate-logo {
  width: 84px; height: 84px;
  object-fit: contain;
  margin-bottom: 8px;
}
.hero-logo {
  width: 76px; height: 76px;
  object-fit: contain;
  margin-bottom: 14px;
  filter: drop-shadow(0 2px 6px rgba(93, 76, 55, .15));
}

/* 班牌 */
.class-badge { margin-top: 22px; }
.class-badge img {
  max-width: 320px; width: 100%;
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: block; margin: 0 auto;
}
.class-badge .badge-caption {
  color: var(--ink-soft); font-size: 13px; margin-top: 8px; letter-spacing: 1px;
}
.gate-title { font-size: 22px; margin-top: 12px; letter-spacing: 1px; }
.gate-sub { color: var(--ink-soft); margin-top: 6px; font-size: 14px; letter-spacing: 2px; }
.gate-hint { color: var(--ink-soft); font-size: 13px; margin: 18px 0 14px; }
.gate-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 16px; text-align: center; letter-spacing: 3px;
  outline: none; background: #fbf8f4;
}
.gate-input:focus { border-color: var(--accent); }
.gate-btn {
  width: 100%; margin-top: 14px; padding: 12px;
  border: none; border-radius: 12px;
  background: var(--accent); color: #fff;
  font-size: 16px; letter-spacing: 2px; cursor: pointer;
  transition: opacity .2s;
}
.gate-btn:active { opacity: .85; }
.gate-error { color: #c0392b; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- 主内容 ---------- */
.app { max-width: 1080px; margin: 0 auto; padding: 0 16px 40px; }

/* 封面 */
.hero {
  text-align: center;
  padding: 56px 16px 36px;
}
.hero-badges { display: flex; align-items: center; justify-content: center; gap: 14px; }
.badge {
  font-size: 14px; letter-spacing: 2px; color: var(--ink-soft);
  border: 1px solid var(--line); background: var(--card);
  padding: 4px 14px; border-radius: 999px;
}
.hero-line { width: 56px; height: 1.5px; background: var(--line); }
.hero-title {
  font-size: clamp(34px, 8vw, 56px);
  margin-top: 18px; letter-spacing: 8px; font-weight: 700;
  background: linear-gradient(120deg, #d4526e, #e8743b, #f2b134);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #d4526e;
}
.hero-sub { margin-top: 12px; color: var(--ink-soft); font-size: 15px; letter-spacing: 1px; }
.hero-tagline {
  margin: 18px auto 0;
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 2;
  letter-spacing: .5px;
}
.hero-stats {
  margin-top: 18px; color: var(--ink-soft); font-size: 13px;
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
}
.hero-stats b { color: var(--ink); }

/* 年级快速导航 */
.grade-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 8px; overflow-x: auto;
  padding: 12px 4px;
  background: linear-gradient(var(--bg) 82%, transparent);
  scrollbar-width: none;
}
.grade-nav::-webkit-scrollbar { display: none; }
.grade-nav a {
  flex: 0 0 auto;
  text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 999px;
  font-size: 14px; white-space: nowrap;
  box-shadow: var(--shadow);
}

/* 时间轴 */
.timeline { position: relative; margin-top: 8px; }
.timeline::before {
  content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.grade-block { position: relative; padding: 26px 0 8px 40px; }
.grade-dot {
  position: absolute; left: 3px; top: 36px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--line);
}
.grade-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.grade-name { font-size: 24px; font-weight: 700; letter-spacing: 2px; }
.grade-period { color: var(--ink-soft); font-size: 13px; }

/* 活动（相册组） */
.event {
  margin: 18px 0 26px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.event-head { margin-bottom: 14px; }
.event-title { font-size: 17px; font-weight: 600; }
.event-date { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.event-note { color: var(--ink-soft); font-size: 14px; margin-top: 8px; line-height: 1.7; }

/* 照片墙：简单网格，自动换行 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.photo-cell { position: relative; }
.photo-cell img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 10px; cursor: pointer; display: block;
  background: #f0ebe2;
  transition: transform .15s;
}
.photo-cell img:hover { transform: scale(1.02); }

/* 点赞按钮 */
.like-btn {
  position: absolute; right: 6px; bottom: 6px;
  border: none; cursor: pointer;
  display: flex; align-items: center; gap: 3px;
  background: rgba(255, 255, 255, .85);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px; color: var(--ink);
  backdrop-filter: blur(4px);
  transition: transform .12s;
}
.like-btn .heart { font-size: 13px; line-height: 1; }
.like-btn.liked .heart { animation: pop .3s ease; }
.like-btn:active { transform: scale(.9); }
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.5); }
  100% { transform: scale(1); }
}

/* ---------- 留言板 ---------- */
.wall { margin-top: 30px; }
.wall-form {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.wall-input, .wall-textarea {
  width: 100%;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: #fbf8f4;
  padding: 10px 14px;
  font-size: 15px; font-family: inherit;
  outline: none; resize: none;
}
.wall-input:focus, .wall-textarea:focus { border-color: var(--accent); }
.wall-textarea { margin-top: 10px; min-height: 84px; line-height: 1.7; }
.wall-form-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px;
}
.wall-count { color: var(--ink-soft); font-size: 12px; }
.wall-submit {
  border: none; cursor: pointer;
  background: var(--accent); color: #fff;
  padding: 9px 22px; border-radius: 999px;
  font-size: 14px; letter-spacing: 1px;
}
.wall-submit:disabled { opacity: .6; cursor: default; }
.wall-tip { color: #c0392b; font-size: 13px; margin-top: 8px; min-height: 16px; }
.wall-tip.ok { color: #4f9d69; }

.wall-list { margin-top: 14px; display: grid; gap: 10px; }
.wall-item {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.wall-item-head {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 6px;
}
.wall-item-name { color: var(--accent); font-weight: 600; }
.wall-item-time { color: var(--ink-soft); }
.wall-item-text { font-size: 15px; line-height: 1.8; word-break: break-word; }
.wall-empty {
  text-align: center; color: var(--ink-soft);
  font-size: 14px; padding: 26px 0;
}


/* 视频卡片 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px; margin-top: 10px;
}
.video-grid video {
  width: 100%; border-radius: 10px; background: #000; display: block;
}

/* 空占位 */
.empty-tip {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 26px 16px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

/* 毕业寄语 */
.messages { margin-top: 30px; }
.section-title { font-size: 20px; letter-spacing: 2px; margin-bottom: 16px; }
.messages-list { display: grid; gap: 12px; }
.message-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.message-from { color: var(--accent); font-size: 13px; margin-top: 10px; }
.message-text { line-height: 1.9; font-size: 15px; }

/* 页脚 */
.footer {
  text-align: center; color: var(--ink-soft);
  font-size: 13px; padding: 40px 0 10px; letter-spacing: 1px;
}
.footer-brand {
  display: inline-block; margin-top: 8px;
  color: var(--accent); text-decoration: none;
  font-size: 13px; letter-spacing: 1px;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.footer-brand:hover { border-bottom-color: var(--accent); }

/* 口令门底部品牌链接 */
.brand-link {
  display: inline-block; margin-top: 26px;
  color: var(--ink-soft); text-decoration: none;
  font-size: 12px; letter-spacing: 1px;
  transition: color .2s;
}
.brand-link:hover { color: var(--accent); }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 16, 12, .92);
  display: flex; align-items: center; justify-content: center;
}
.lb-stage { max-width: 92vw; max-height: 86vh; display: flex; flex-direction: column; align-items: center; }
.lb-stage img, .lb-stage video {
  max-width: 92vw; max-height: 80vh;
  border-radius: 8px; object-fit: contain;
}
.lb-stage figcaption {
  color: #d8d2c8; font-size: 13px; margin-top: 10px; text-align: center;
}
/* 没有描述时，说明文字整行隐藏，不占位 */
.lb-stage figcaption:empty { display: none; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: none; border: none;
  color: #fff; cursor: pointer; user-select: none;
  font-size: 40px; line-height: 1; padding: 12px;
  opacity: .8;
}
.lb-close { top: 10px; right: 14px; font-size: 34px; }
.lb-prev { left: 6px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 6px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; }

/* ---------- 找我家孩子 ---------- */
.face-entry {
  margin-top: 22px;
  border: 1.5px solid var(--accent);
  background: #fff;
  color: var(--accent);
  padding: 10px 26px;
  border-radius: 999px;
  font-size: 15px; letter-spacing: 1px; cursor: pointer;
  transition: background .2s, color .2s;
}
.face-entry:hover { background: var(--accent); color: #fff; }

.face-modal {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(20, 16, 12, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.face-panel {
  position: relative;
  width: 100%; max-width: 560px;
  max-height: 86vh; overflow-y: auto;
  background: var(--card);
  border-radius: 20px;
  padding: 26px 22px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.face-close {
  position: absolute; top: 8px; right: 14px;
  border: none; background: none; font-size: 30px;
  line-height: 1; color: var(--ink-soft); cursor: pointer;
}
.face-title { font-size: 19px; letter-spacing: 1px; }
.face-desc { color: var(--ink-soft); font-size: 14px; line-height: 1.8; margin-top: 10px; }
.face-privacy { color: #4f9d69; font-size: 13px; }
.face-pick {
  display: block; margin-top: 18px;
  text-align: center;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  padding: 22px 12px;
  color: var(--accent); font-size: 15px;
  cursor: pointer;
  background: #fcf9f5;
}
.face-pick:hover { border-color: var(--accent); }
.face-status { color: var(--ink-soft); font-size: 13px; margin-top: 12px; min-height: 18px; }
.face-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 14px;
}
.face-item { position: relative; }
.face-item img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 10px; cursor: pointer; display: block;
}
.face-score {
  position: absolute; right: 5px; bottom: 5px;
  background: rgba(79, 157, 105, .9);
  color: #fff; font-size: 11px;
  padding: 2px 6px; border-radius: 999px;
}


/* 「查看全部」折叠按钮 */
.more-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 12px;
  padding: 12px 16px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.more-btn:hover { background: rgba(0,0,0,.025); color: var(--ink); border-color: #c9c2b4; }
.more-btn:disabled { opacity: .55; cursor: default; }
.more-btn .more-sub { font-size: 12px; font-weight: 400; opacity: .7; }

/* 网格图加载中的底色 */
.photo-cell img[data-full] { background-image: linear-gradient(110deg,#f0ebe2 30%,#f7f3ec 50%,#f0ebe2 70%); }

/* 小屏适配 */
@media (max-width: 480px) {
  .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .event { padding: 14px; }
  .grade-block { padding-left: 34px; }
}
