/* PurpleWall 全站样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --purple: #7a5fa8;
  --purple-dark: #5d4487;
  --purple-light: #efebf7;
  --text: #333;
  --muted: #888;
  --line: #ddd6ea;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  /* 所有页面都用二外校园照片当背景。
     原图 180KB，已压到 WebP 53KB / JPEG 71KB（图上还盖着 25% 白纱，肉眼几乎无差） */
  background: #f2eff8 url('../assets/campus.jpg') no-repeat center top;
  /* 现代浏览器优先取体积小得多的 WebP，不支持的自动回落到上一行的 JPEG */
  background-image: -webkit-image-set(url('../assets/campus.webp') type('image/webp'),
                                      url('../assets/campus.jpg') type('image/jpeg'));
  background-image: image-set(url('../assets/campus.webp') type('image/webp'),
                              url('../assets/campus.jpg') type('image/jpeg'));
  background-size: cover;
  background-attachment: fixed;
}

/* 校园图上铺一层浅浅的白，让文字看得清，但照片仍然看得见 */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(248, 246, 252, 0.25);
  z-index: -1;
}

.page {
  max-width: 920px;
  margin: 0 auto;
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.68);
  padding: 0 24px 40px;
}

/* ---------- 页头 ---------- */
header.site {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 2px solid var(--purple);
  flex-wrap: wrap;
}
header.site img.logo { width: 56px; height: auto; border-radius: 4px; object-fit: contain; }
header.site .title { font-size: 22px; font-weight: bold; color: var(--purple-dark); }
header.site .sub { font-size: 12px; color: var(--muted); }
header.site nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
header.site nav a {
  position: relative;
  color: var(--text);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 14px;
}
header.site nav a:hover { background: var(--purple-light); color: var(--purple-dark); }
header.site nav a.on { background: var(--purple); color: #fff; }
header.site .who { font-size: 13px; color: var(--muted); }

/* ---------- 内容块 ---------- */
.box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
  margin-top: 18px;
}
.box > h2 {
  font-size: 17px;
  color: var(--purple-dark);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.box .more { float: right; font-size: 13px; color: var(--muted); text-decoration: none; }
.box .more:hover { color: var(--purple); }

.muted { color: var(--muted); font-size: 13px; }
a { color: var(--purple); }

/* 帖子 / 表白列表行 */
.item {
  padding: 10px 2px;
  border-bottom: 1px dashed var(--line);
}
.item:last-child { border-bottom: none; }
.item .t { font-weight: bold; }
.item .t a { color: var(--text); text-decoration: none; }
.item .t a:hover { color: var(--purple); }
.item .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item .excerpt { font-size: 13px; color: #5a5468; margin: 3px 0 2px; line-height: 1.5; }

/* 公告折叠：用浏览器原生 <details>，不依赖 JS，手机/微信内核都能点开 */
.ann { display: block; }
.ann > summary { display: block; list-style: none; cursor: pointer; }
.ann > summary::-webkit-details-marker { display: none; }
.ann .ann-hint {
  float: right;
  font-size: 12px;
  font-weight: 400;
  color: var(--purple);
  white-space: nowrap;
  background: var(--purple-light);
  border: 1px solid #ded3f0;
  border-radius: 11px;
  padding: 1px 9px;
  line-height: 18px;
  margin-top: 2px;
}
.ann .ann-hint::after { content: '展开全文 ▾'; }
.ann[open] .ann-hint::after { content: '收起 ▴'; }
.ann .ann-t { display: block; font-weight: 700; color: var(--text); padding-right: 104px; }
.ann .ann-b { display: block; font-size: 13px; color: #5a5468; margin-top: 3px; line-height: 1.5; }
.ann .ann-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ann .ann-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.75;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

/* 表白卡：一张一张的卡片墙 */
.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.wall-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px 12px;
  box-shadow: 0 1px 3px rgba(122, 95, 168, .08);
  transition: box-shadow .18s ease, transform .18s ease;
  cursor: pointer;
  outline: none;
}
.wall-card:hover {
  box-shadow: 0 5px 16px rgba(122, 95, 168, .18);
  transform: translateY(-2px);
}
.wall-card:focus-visible {
  box-shadow: 0 0 0 2px var(--purple-light), 0 5px 16px rgba(122, 95, 168, .18);
}
/* 卡片顶部的紫色渐变细条，当作「信封口」的装饰 */
.wall-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #cbb9ea, var(--purple), #cbb9ea);
}
/* 卡片标题：XXX的表白卡 */
.wall-card .card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--purple);
  margin-bottom: 9px;
}
.wall-card .card-title .seal {
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #cbb9ea, var(--purple));
}
.wall-card .content {
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14.5px;
  line-height: 1.85;
  color: #3c3648;
  margin-bottom: 10px;
}
/* 「读全文」提示：卡片上只放前 100 字，其余点进去看 */
.wall-card .more {
  font-size: 12.5px;
  color: var(--purple);
  opacity: .82;
  margin: -4px 0 10px;
}
.wall-card img { max-width: 200px; max-height: 200px; margin-top: 8px; border-radius: 4px; display: block; }
.wall-card .ops {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.wall-card .ops a, .wall-card .ops span { color: var(--muted); text-decoration: none; }
.wall-card .ops a { cursor: pointer; }
.wall-card .ops a:hover { color: var(--purple); }
.wall-card .ops .tm { margin-left: auto; font-size: 12px; }

/* 按钮 */
.btn {
  display: inline-block;
  background: var(--purple);
  color: #fff;
  border: 1px solid var(--purple);
  border-radius: 4px;
  padding: 7px 18px;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { background: var(--purple-dark); }
.btn:disabled { background: #b9aed4; border-color: #b9aed4; cursor: not-allowed; }
.btn-line {
  display: inline-block;
  background: #fff;
  color: var(--purple);
  border: 1px solid var(--purple);
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 14px;
  cursor: pointer;
}
.btn-sm { padding: 3px 10px; font-size: 13px; }
.btn-danger { background: #c0564f; border-color: #c0564f; }
/* 线性红按钮：用在「删除自己发的内容」上，白底红字，别太扎眼 */
.btn-line.btn-danger { background: #fff; color: #c0564f; border-color: #c0564f; }
.btn-line.btn-danger:hover { background: #fceeed; }
.btn-line.btn-danger:disabled { background: #fff; color: #d8a8a4; border-color: #e6c9c6; }

/* 列表行里的操作条（我的帖子 / 我的内容） */
.item .ops { margin-top: 6px; }
.wall-card .ops .del-my { color: #c0564f; }

/* 表单 */
label.f { display: block; margin: 12px 0 4px; font-size: 14px; }
input[type=text], input[type=password], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 1px solid var(--purple); }

/* 版块标签 */
.tabs { margin-top: 18px; }
.tabs a {
  display: inline-block;
  padding: 4px 14px;
  margin: 0 6px 6px 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  background: #fff;
}
.tabs a.on { background: var(--purple); border-color: var(--purple); color: #fff; }

/* 候选人卡片 */
.cand {
  display: flex;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  margin-top: 12px;
  background: #fff;
}
.cand.mine { border-color: var(--purple); background: var(--purple-light); }
.cand img { width: 110px; height: 140px; object-fit: cover; border-radius: 4px; }
/* 候选人照片的占位块：本人没传照片时显示姓名首字（照片永久保存，不会过期清空） */
.ph-ph {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--purple-light);
  color: var(--purple);
  font-weight: bold;
  border-radius: 4px;
}
.cand .info { flex: 1; }
.cand .nm { font-weight: bold; font-size: 16px; }
.cand .cls { color: var(--muted); font-size: 13px; margin-left: 8px; }
.cand .bio { font-size: 14px; margin: 6px 0; }
.cand .votes { color: var(--purple-dark); font-weight: bold; }

/* 详情页 */
.post-head { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 12px; }
.post-head h1 { font-size: 20px; color: var(--purple-dark); }
.post-content { white-space: pre-wrap; word-break: break-word; margin-bottom: 14px; }
.post-content img { max-width: 100%; border-radius: 4px; margin-top: 10px; }

.comment {
  padding: 10px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.comment:last-child { border-bottom: none; }
.comment .who { color: var(--purple); font-size: 13px; }
.comment .when { color: var(--muted); font-size: 12px; margin-left: 8px; }

/* 弹层 */
.mask {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 10;
}
.mask .panel {
  background: #fff;
  max-width: 520px;
  margin: 60px auto;
  padding: 20px 22px;
  border-radius: 6px;
  max-height: 80vh;
  overflow: auto;
}
.mask .panel h3 { margin-bottom: 10px; color: var(--purple-dark); }
.mask.show { display: block; }

/* 提示条 */
#toast {
  display: none;
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(60, 45, 90, 0.92);
  color: #fff;
  padding: 10px 22px;
  border-radius: 4px;
  z-index: 99;
  font-size: 14px;
  max-width: 80%;
}

/* 管理后台 tab */
.atabs { margin-top: 18px; border-bottom: 2px solid var(--purple); }
.atabs a {
  position: relative;
  display: inline-block;
  padding: 8px 18px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}
.atabs a.on { background: var(--purple); color: #fff; border-radius: 4px 4px 0 0; }

/* 待办通知红点（仅管理员可见） */
.rdot {
  position: absolute;
  top: -4px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 9px;
  background: #e0483f;
  color: #fff;
  font-size: 11px;
  line-height: 17px;
  font-weight: normal;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
.atabs a .rdot { top: 3px; right: 5px; }
.arow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
  flex-wrap: wrap;
}
.arow:last-child { border-bottom: none; }
.arow .grow { flex: 1; min-width: 200px; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 3px; background: var(--purple-light); color: var(--purple-dark); }
.tag.red { background: #f9e3e1; color: #a33a33; }
.tag.gray { background: #eee; color: #777; }

/* 统计卡片 */
#stat-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.stat-card {
  flex: 1;
  min-width: 130px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--purple-light);
  padding: 18px 12px;
  text-align: center;
}
.stat-card .num { font-size: 30px; font-weight: bold; color: var(--purple-dark); }
.stat-card .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }

footer.site {
  margin-top: 30px;
  padding: 16px 0 6px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 评论：回复 / 删除 ---------- */
.comment .cbody { margin-top: 2px; }
.comment .cops { margin-top: 4px; font-size: 12px; }
.comment .cops a { color: var(--muted); margin-right: 14px; cursor: pointer; }
.comment .cops a:hover { color: var(--purple); }
.comment .cops a.del { color: #c0564f; }
.reply-hint { display: none; align-items: center; gap: 8px; font-size: 13px; color: var(--purple-dark); margin-bottom: 6px; }
.reply-hint.on { display: flex; }
.reply-hint .x { color: var(--muted); cursor: pointer; font-size: 12px; }

/* ---------- 管理后台批量操作条 ---------- */
.bulkbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 6px;
  background: var(--purple-light); border: 1px solid var(--line); border-radius: 4px;
  font-size: 13px;
}
.bulkbar .grow { flex: 1; }
.bulkbar input[type=checkbox] { width: 15px; height: 15px; vertical-align: -2px; }
.arow input[type=checkbox] { width: 16px; height: 16px; flex: 0 0 auto; }

/* ---------- 私聊 ---------- */
.dm-thread {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 8px; border-bottom: 1px dashed var(--line);
  text-decoration: none; color: var(--text);
}
.dm-thread:hover { background: var(--purple-light); }
.dm-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 40px;
  background: var(--purple); color: #fff; text-align: center;
  line-height: 40px; font-size: 16px; font-weight: bold; overflow: hidden;
}
.dm-thread .grow { flex: 1; min-width: 0; }
.dm-thread .nm { font-weight: bold; }
.dm-thread .pv { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-thread .rt { text-align: right; font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.dm-thread .rdot2 {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-top: 4px;
  border-radius: 9px; background: #e0483f; color: #fff; font-size: 11px; text-align: center;
}
.dm-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.dm-body { min-height: 260px; max-height: 56vh; overflow-y: auto; padding: 6px 2px; }
.dm-row { display: flex; margin: 10px 0; }
.dm-row.me { justify-content: flex-end; }
.dm-bubble { max-width: 76%; padding: 8px 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.6; }
.dm-row.me .dm-bubble { background: var(--purple); color: #fff; border-bottom-right-radius: 3px; }
.dm-row.other .dm-bubble { background: #f1eef7; color: var(--text); border-bottom-left-radius: 3px; }
.dm-send { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.dm-send textarea { flex: 1; min-height: 46px; height: 46px; resize: none; }
.dm-empty { text-align: center; color: var(--muted); padding: 46px 0; }

/* ---------- 消息中心（被评论 / 被回复） ---------- */
.nt-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.nt-head h2 { margin: 0; border: 0; padding: 0; }
.nt-head .grow { flex: 1; }
.nt-item {
  display: block; text-decoration: none; color: var(--text);
  padding: 10px 12px; margin-top: 10px;
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 6px; background: #fff;
}
.nt-item:hover { background: var(--purple-light); }
.nt-item.unread { border-left-color: var(--purple); background: #faf8fd; }
.nt-item.dead { opacity: .6; }
.nt-item .nt-line { font-size: 14px; }
.nt-item .nt-line b { color: var(--purple-dark); }
.nt-item .nt-post { margin-top: 2px; font-weight: bold; }
.nt-item .nt-snip { margin-top: 3px; font-size: 13px; color: #666; }
.nt-item .nt-time { margin-top: 5px; font-size: 12px; color: var(--muted); }

/* ---------- 站内搜索 ---------- */
.searchbar { display: flex; gap: 8px; margin-top: 10px; }
.searchbar input {
  flex: 1; min-width: 0;
  padding: 9px 12px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text);
}
.searchbar input:focus { outline: none; border-color: var(--purple); }

/* ---------- 校区 / 学段标签 ---------- */
.camp {
  display: inline-block;
  font-size: 12px;
  line-height: 1.7;
  padding: 0 6px;
  margin-right: 4px;
  border-radius: 3px;
  background: rgba(124, 77, 255, .13);
  color: #6d4bd8;
  vertical-align: 1px;
  white-space: nowrap;
}
/* 发帖框里的「将标为 xx」提示 */
.whereline { font-size: 13px; color: var(--muted); margin-top: 10px; }
.whereline.need { color: #b26a00; background: #fff8e8; border: 1px solid #ffe3ad; border-radius: 4px; padding: 8px 10px; }
.wherepick { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wherepick select { flex: 1 1 120px; min-width: 110px; }

/* ---------- 表白墙字数提示 ---------- */
.cnt { margin-top: 6px; font-size: 12px; color: var(--muted); }
.cnt.ok { color: #2f7d4f; font-weight: bold; }

/* ---------- 评选分类切换（校花 / 校草 / 吉祥物） ---------- */
.vtabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.vtabs a {
  padding: 6px 16px; border: 1px solid var(--line); border-radius: 20px;
  text-decoration: none; color: var(--text); font-size: 14px; background: #fff;
}
.vtabs a:hover { background: var(--purple-light); }
.vtabs a.on { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ---------- 班级群聊 ---------- */
.dm-col { display: flex; flex-direction: column; max-width: 76%; min-width: 0; }
.dm-row.me .dm-col { align-items: flex-end; }
.dm-sender { font-size: 12px; color: var(--muted); margin: 0 0 3px 4px; }
.dm-row.me .dm-sender { margin: 0 4px 3px 0; }
.dm-del {
  align-self: flex-end; margin: 0 0 2px 6px;
  font-size: 12px; color: var(--muted); background: none; border: 0;
  cursor: pointer; padding: 2px 4px;
}
.dm-del:hover { color: #c0392b; text-decoration: underline; }
.grp-card {
  display: block; text-decoration: none; color: var(--text);
  padding: 12px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.grp-card:hover { background: var(--purple-light); }
.grp-card.mine { border-left: 3px solid var(--purple); }
.grp-card .gn { font-weight: bold; font-size: 15px; }
.grp-card .gi { font-size: 13px; color: var(--muted); margin-top: 3px; }
.grp-card .gm { font-size: 12px; color: var(--muted); margin-top: 6px; }
.grp-mine {
  border: 1px solid var(--purple); background: var(--purple-light);
  border-radius: 8px; padding: 12px; margin-top: 10px;
}
.grp-msg { font-size: 14px; line-height: 1.6; }
.grp-msg .del { color: var(--muted); font-style: italic; }

/* ---------- 列表筛选条（表白墙的学段 / 校区 / 日期） ---------- */
.filterbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
  font-size: 13px;
}
.filterbar .sep { margin-left: 10px; }
.filterbar #list-info { margin-left: auto; }
.filterbar input[type=date] {
  width: auto;
  padding: 4px 8px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 4px;
}

/* ---------- 无限滚动的底部提示 ---------- */
.list-foot {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 14px 0 4px;
}
.list-foot.done { color: #b9b3c6; }

/* ---------- 评选：选手下方的留言 ---------- */
.cc-wrap { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.cc-toggle {
  display: inline-block;
  font-size: 13px;
  color: var(--purple);
  cursor: pointer;
  user-select: none;
}
.cc-toggle:hover { text-decoration: underline; }
.cc-toggle.on { font-weight: bold; }
.cc-panel { display: none; margin-top: 8px; }
.cc-panel.on { display: block; }
.cc-form { margin-top: 10px; }
.cc-form textarea { min-height: 60px; }
.cc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 13px;
}
.cc-actions label { color: var(--muted); }

/* 手机上简单适配 */
@media (max-width: 600px) {
  .page { padding: 0 12px 30px; }
  header.site nav { margin-left: 0; width: 100%; }
  .cand { flex-direction: column; }
  .cand img { width: 100%; height: auto; }
  .dm-send textarea { height: 42px; min-height: 42px; }
}
