/* =========================================================
   南山中学双语学校一年级二班 · 成长记录平台
   清新温馨主题样式（PC 版 + 手机版共用）
   ========================================================= */

:root {
  --cream:   #FFFCF7;
  --peach:   #FFD9C9;
  --mint:    #A9DCC8;
  --sky:     #C7E7F5;
  --butter:  #FFE9B0;
  --lilac:   #E4DCF7;
  --ink:     #584C44;
  --ink-2:   #7C6E65;
  --muted:   #A0938A;
  --line:    #F0E6DE;
  --primary: #7FCBB0;
  --primary-d:#63B79B;
  --accent:  #F5A08C;
  --accent-d:#EE8871;
  --radius:  20px;
  --shadow-s:0 4px 16px rgba(150,130,115,.08);
  --shadow-m:0 10px 34px rgba(150,130,115,.13);
  --shadow-l:0 18px 60px rgba(150,130,115,.18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Helvetica Neue", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 8% -8%, #FFF1E6 0%, rgba(255,241,230,0) 60%),
    radial-gradient(900px 480px at 96% 4%, #E6F7F0 0%, rgba(230,247,240,0) 62%),
    radial-gradient(900px 600px at 50% 108%, #EAF4FB 0%, rgba(234,244,251,0) 60%),
    var(--cream);
  background-attachment: fixed;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font-family: inherit; }

.wrap { width: min(1200px, 92vw); margin: 0 auto; }

/* ---------------- 通用组件 ---------------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  border: 1px solid rgba(240,230,222,.9);
  overflow: hidden;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #9BDCC4);
  color: #fff; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(127,203,176,.32);
  transition: transform .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(127,203,176,.4); }
.btn.ghost { background: #fff; color: var(--primary-d); border: 1px solid var(--mint); box-shadow: none; }
.btn.peach { background: linear-gradient(135deg, var(--accent), #FFBCA8); box-shadow: 0 6px 18px rgba(245,160,140,.3); }
.btn.sm { padding: 6px 14px; font-size: 13px; }

.tag {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  font-size: 12px; background: #F2FBF7; color: var(--primary-d); border: 1px solid #DFF3EB;
}
.tag.peach { background: #FFF3EE; color: var(--accent-d); border-color: #FCE3DA; }
.tag.sky { background: #EFF8FD; color: #5E9FBE; border-color: #DCEEF7; }

.section { padding: 54px 0; }
.section-title {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px;
}
.section-title h2 {
  margin: 0; font-size: 26px; letter-spacing: 1px;
  background: linear-gradient(120deg, var(--primary-d), var(--accent-d));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-title span { color: var(--muted); font-size: 13px; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------------- 顶部导航（PC） ---------------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  backdrop-filter: saturate(160%) blur(14px);
  background: rgba(255,252,247,.86);
  border-bottom: 1px solid rgba(240,230,222,.8);
}
.nav-inner { display: flex; align-items: center; gap: 18px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.logo-badge {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mint), var(--sky)); color: #fff; font-size: 18px;
  box-shadow: 0 6px 16px rgba(140,200,190,.35);
}
.logo small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: 2px; }
.nav-menu { display: flex; gap: 4px; margin-left: auto; }
.nav-menu a {
  padding: 8px 16px; border-radius: 999px; font-size: 15px; color: var(--ink-2);
  transition: background .2s, color .2s;
}
.nav-menu a:hover, .nav-menu a.on { background: #F3FBF8; color: var(--primary-d); }

/* ---------------- 头图 Hero ---------------- */
.hero { padding: 46px 0 26px; }
.hero-card {
  position: relative; overflow: hidden;
  border-radius: 28px; padding: 46px 48px;
  background: linear-gradient(120deg, #FFF3E9 0%, #F1FBF6 45%, #EDF6FD 100%);
  box-shadow: var(--shadow-m);
}
.hero-card::after {
  content: ""; position: absolute; right: -80px; top: -110px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,214,190,.85), rgba(255,214,190,0) 70%);
}
.hero-card::before {
  content: ""; position: absolute; right: 150px; bottom: -140px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(169,220,200,.7), rgba(169,220,200,0) 70%);
}
.hero-inner { position: relative; z-index: 2; max-width: 640px; }
.hero h1 { margin: 0 0 10px; font-size: 38px; letter-spacing: 2px; }
.hero h1 em { font-style: normal; color: var(--accent-d); }
.hero p { margin: 0 0 22px; color: var(--ink-2); font-size: 15px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.stat {
  flex: 1; min-width: 118px; background: rgba(255,255,255,.75);
  border: 1px solid rgba(255,255,255,.9); border-radius: 18px; padding: 14px 18px;
}
.stat b { display: block; font-size: 26px; color: var(--primary-d); line-height: 1.3; }
.stat span { font-size: 12px; color: var(--muted); }

/* ---------------- 相册卡片 ---------------- */
.grid-album { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.album-card { cursor: pointer; transition: transform .22s, box-shadow .22s; background: #fff; }
.album-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-m); }
.album-cover { position: relative; height: 172px; background: linear-gradient(135deg, #F6FBF9, #FDF4EF); overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover .ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 42px; opacity: .5; }
.album-body { padding: 14px 18px 18px; }
.album-body h3 { margin: 0 0 6px; font-size: 17px; }
.album-body p { margin: 0 0 10px; font-size: 13px; color: var(--muted); min-height: 22px; }
.album-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---------------- 照片瀑布流 ---------------- */
.masonry { columns: 4; column-gap: 16px; }
.masonry .shot { break-inside: avoid; margin-bottom: 16px; position: relative; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: var(--shadow-s); }
.masonry .shot img { width: 100%; display: block; transition: transform .35s; }
.masonry .shot:hover img { transform: scale(1.04); }
.shot-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px;
  background: linear-gradient(to top, rgba(60,48,42,.72), rgba(60,48,42,0));
  color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.shot-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .2s; }
.shot:hover .shot-actions { opacity: 1; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); color: var(--ink); font-size: 15px;
  display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0,0,0,.15);
}
.icon-btn.on { background: var(--accent); color: #fff; }

/* ---------------- 视频 ---------------- */
.grid-video { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.video-card .cover { position: relative; height: 168px; background: #2f3a38; cursor: pointer; }
.video-card video, .video-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.play {
  position: absolute; inset: 0; margin: auto; width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,.92); display: grid; place-items: center; font-size: 20px; color: var(--primary-d);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

/* ---------------- 同学墙 ---------------- */
.grid-student { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.stu {
  padding: 18px 16px; text-align: center; background: #fff; border-radius: 18px;
  box-shadow: var(--shadow-s); border: 1px solid var(--line);
}
.stu .ava {
  width: 66px; height: 66px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center;
  font-size: 24px; color: #fff; background: linear-gradient(135deg, var(--mint), var(--sky));
  overflow: hidden;
}
.stu .ava img { width: 100%; height: 100%; object-fit: cover; }
.stu b { display: block; font-size: 16px; }
.stu .nick { font-size: 12px; color: var(--muted); }
.stu .hobby { margin-top: 8px; font-size: 12px; color: var(--ink-2); }

/* ---------------- 时光轴 ---------------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: linear-gradient(to bottom, var(--mint), var(--peach)); }
.tl-item { position: relative; margin-bottom: 22px; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 8px; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary); box-shadow: 0 0 0 4px rgba(127,203,176,.16);
}
.tl-item h4 { margin: 0 0 4px; font-size: 16px; }
.tl-item .date { font-size: 12px; color: var(--accent-d); margin-bottom: 4px; }
.tl-item p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* ---------------- 留言 ---------------- */
.grid-msg { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.msg { padding: 18px 20px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-s); border: 1px solid var(--line); }
.msg .who { font-weight: 700; font-size: 15px; }
.msg .rel { font-size: 12px; color: var(--muted); margin-left: 8px; }
.msg p { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.msg-form { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-bottom: 22px; }
.msg-form input, .msg-form textarea {
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #FFFCF9; font-size: 14px; color: var(--ink);
}
.msg-form textarea { grid-column: span 2; min-height: 92px; resize: vertical; }
.msg-form input:focus, .msg-form textarea:focus { outline: none; border-color: var(--mint); }

/* ---------------- 我的相册抽屉 ---------------- */
.drawer-mask { position: fixed; inset: 0; background: rgba(60,48,42,.42); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 90; }
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 400px; max-width: 92vw; background: var(--cream);
  box-shadow: var(--shadow-l); transform: translateX(105%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  z-index: 100; display: flex; flex-direction: column;
}
.drawer.on { transform: none; }
.drawer-head { padding: 18px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 18px; }
.drawer-body { flex: 1; overflow: auto; padding: 16px 20px; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: #fff; }
.mini img, .mini video { width: 100%; height: 100%; object-fit: cover; }
.mini .del { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; }

/* ---------------- 灯箱 ---------------- */
.lightbox { position: fixed; inset: 0; background: rgba(48,38,34,.92); display: none; z-index: 200; }
.lightbox.on { display: flex; align-items: center; justify-content: center; }
.lightbox img, .lightbox video { max-width: 92vw; max-height: 84vh; border-radius: 12px; }
.lb-close { position: absolute; top: 18px; right: 22px; font-size: 30px; color: #fff; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 40px; color: #fff; cursor: pointer; padding: 0 18px; user-select: none; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
.lb-bar { position: absolute; bottom: 20px; left: 0; right: 0; display: flex; justify-content: center; gap: 12px; }

/* ---------------- 页脚 ---------------- */
.footer {
  margin-top: 30px; padding: 34px 0 28px;
  background: linear-gradient(120deg, #FFF7F1, #F3FBF7);
  border-top: 1px solid var(--line);
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.footer .cp { font-size: 13px; color: var(--ink-2); }
.footer .cp b { color: var(--primary-d); }
.footer-links { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; left: 50%; top: 24px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  padding: 10px 20px; border-radius: 999px; background: rgba(72,60,54,.92); color: #fff; font-size: 14px;
  box-shadow: var(--shadow-m); animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------------- 加载骨架 ---------------- */
.skeleton { border-radius: 16px; background: linear-gradient(90deg, #F5EFE9 25%, #FFF9F5 37%, #F5EFE9 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* =========================================================
   手机版（mobile first 覆盖）
   ========================================================= */
body.mobile { padding-bottom: 76px; }

.m-appbar {
  position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: rgba(255,252,247,.94); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(240,230,222,.9);
}
.m-appbar .t { font-size: 17px; font-weight: 700; }
.m-appbar .s { font-size: 11px; color: var(--muted); }
.m-appbar .fav-entry { margin-left: auto; }

.m-hero { margin: 14px; padding: 22px 20px; border-radius: 24px; background: linear-gradient(135deg, #FFF2E8, #EEFAF4 60%, #ECF5FD); box-shadow: var(--shadow-s); }
.m-hero h1 { margin: 0 0 6px; font-size: 25px; line-height: 1.35; }
.m-hero p { margin: 0 0 14px; font-size: 13px; color: var(--ink-2); }
.m-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px; }
.m-stat { background: #fff; border-radius: 16px; padding: 12px 6px; text-align: center; box-shadow: var(--shadow-s); }
.m-stat b { display: block; font-size: 19px; color: var(--primary-d); }
.m-stat span { font-size: 11px; color: var(--muted); }

.m-section { margin: 22px 14px; }
.m-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.m-sec-head h2 { margin: 0; font-size: 18px; }
.m-sec-head a { font-size: 12px; color: var(--primary-d); }

.m-albums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-album { border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--shadow-s); }
.m-album .c { height: 108px; background: linear-gradient(135deg, #F6FBF9, #FDF3EE); }
.m-album .c img { width: 100%; height: 100%; object-fit: cover; }
.m-album .b { padding: 10px 12px 12px; }
.m-album .b h3 { margin: 0; font-size: 14px; }
.m-album .b p { margin: 4px 0 0; font-size: 11px; color: var(--muted); }

.m-waterfall { columns: 2; column-gap: 10px; }
.m-waterfall .shot { break-inside: avoid; margin-bottom: 10px; border-radius: 14px; overflow: hidden; position: relative; background: #fff; box-shadow: var(--shadow-s); }
.m-waterfall .shot img { width: 100%; }
.m-shot-bar { display: flex; gap: 8px; padding: 8px 10px; align-items: center; }
.m-shot-bar span { font-size: 12px; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.m-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: flex;
  background: rgba(255,255,255,.96); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.m-tabbar a { flex: 1; text-align: center; color: var(--muted); font-size: 11px; padding: 4px 0; }
.m-tabbar a .ic { display: block; font-size: 20px; line-height: 1.4; }
.m-tabbar a.on { color: var(--primary-d); font-weight: 700; }

.m-favbar {
  position: fixed; left: 14px; right: 14px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 78;
  display: none; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px;
  background: rgba(255,255,255,.97); box-shadow: var(--shadow-m); font-size: 13px;
}
.m-favbar.on { display: flex; }
.m-favbar .btn { margin-left: auto; }

/* ---------------- 后台管理 ---------------- */
.admin-body { background: #F7F5F2; }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-side { width: 208px; background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; flex-shrink: 0; }
.admin-side .brand { padding: 6px 10px 18px; font-weight: 700; font-size: 15px; }
.admin-side a { display: block; padding: 10px 14px; border-radius: 12px; color: var(--ink-2); font-size: 14px; margin-bottom: 4px; }
.admin-side a:hover, .admin-side a.on { background: #F1FAF6; color: var(--primary-d); }
.admin-main { flex: 1; padding: 22px 26px; overflow: auto; }
.admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.admin-head h2 { margin: 0; font-size: 20px; }
.panel { background: #fff; border-radius: 18px; padding: 20px; box-shadow: var(--shadow-s); margin-bottom: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 16px; }
table.tb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tb th, table.tb td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
table.tb th { color: var(--muted); font-weight: 500; font-size: 13px; }
table.tb img.thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.form-row input, .form-row select, .form-row textarea {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #FFFCF9; font-size: 14px;
}
.drop {
  border: 2px dashed #DCEDE6; border-radius: 18px; padding: 34px; text-align: center; color: var(--muted);
  background: #FBFFFD; cursor: pointer;
}
.drop.over { border-color: var(--primary); background: #F2FBF8; }
.progress { height: 8px; border-radius: 8px; background: #EFE9E3; overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--mint)); transition: width .2s; }
.login-box { max-width: 380px; margin: 12vh auto; background: #fff; border-radius: 22px; padding: 32px; box-shadow: var(--shadow-m); }
.login-box h2 { margin: 0 0 4px; font-size: 21px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-box input { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; background: #FFFCF9; font-size: 15px; }
.login-box button { width: 100%; padding: 13px; border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--primary), #9BDCC4); color: #fff; font-size: 16px; cursor: pointer; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .masonry { columns: 3; }
}
@media (max-width: 768px) {
  .masonry { columns: 2; }
  .hero-card { padding: 30px 22px; }
  .hero h1 { font-size: 27px; }
  .nav-menu { display: none; }
  .section { padding: 34px 0; }
  .admin-wrap { flex-direction: column; }
  .admin-side { width: 100%; display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-side .brand { display: none; }
  .admin-side a { white-space: nowrap; margin: 0; }
  .admin-main { padding: 16px; }
  .msg-form { grid-template-columns: 1fr; }
  .msg-form textarea { grid-column: span 1; }
  .drawer { width: 100%; }
}
