/* ============================================================
   青柚校园墙 · 样式表
   清新校园风 / 浅蓝浅青 / 响应式
   ============================================================ */

:root {
  --bg: #eef7f9;
  --card: #ffffff;
  --line: #e3eef2;
  --primary: #16b3c5;
  --primary-2: #2fbfa8;
  --primary-deep: #0c93a5;
  --primary-soft: #e2f6f8;
  --text: #22424c;
  --text-2: #5d7d87;
  --text-3: #93aeb7;
  --danger: #ff5a76;
  --danger-soft: #ffeef1;
  --warn: #f5a623;
  --warn-soft: #fff4e0;
  --ok: #2fbf8f;
  --ok-soft: #e6f8f0;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(22, 140, 160, .07);
  --shadow-lg: 0 12px 32px rgba(22, 140, 160, .14);
  --grad: linear-gradient(135deg, #23c3c9, #2fbfa8);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* 背景装饰光斑 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(560px 380px at 12% -4%, rgba(64, 205, 214, .18), transparent 70%),
    radial-gradient(620px 420px at 96% 4%, rgba(94, 222, 178, .16), transparent 70%),
    radial-gradient(700px 500px at 50% 110%, rgba(120, 200, 235, .12), transparent 70%);
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
img { display: block; max-width: 100%; }
::selection { background: rgba(22, 179, 195, .2); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c9e2e8; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #aed4dc; }

.hide { display: none !important; }

/* ------------------------------ 顶栏 ------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(24, 180, 180, .35);
  transition: transform .25s;
}
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: .5px; }

.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
  transition: all .2s;
}
.topnav a:hover { color: var(--primary); background: var(--primary-soft); }
.topnav a.active { color: var(--primary-deep); background: var(--primary-soft); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: all .2s;
}
.user-chip:hover { background: #f2fafb; border-color: var(--line); }
.user-chip .avatar { width: 30px; height: 30px; font-size: 13px; }
.user-chip span.name { font-size: 14px; font-weight: 600; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown {
  position: fixed; top: 56px; right: 16px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; min-width: 168px;
  animation: popIn .18s ease;
  z-index: 120;
}
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  border: none; background: none; border-radius: 9px;
  font-size: 14px; color: var(--text); text-align: left;
  transition: background .15s;
}
.dropdown a:hover, .dropdown button:hover { background: #f2fafb; }
.dropdown .danger { color: var(--danger); }
.dropdown .danger:hover { background: var(--danger-soft); }
.dropdown hr { border: none; border-top: 1px solid var(--line); margin: 5px 8px; }

/* ------------------------------ 头像 ------------------------------ */
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 16px;
  flex-shrink: 0;
  user-select: none;
}
.avatar.anon { background: #b7ccd4 !important; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; box-shadow: 0 6px 18px rgba(22,140,160,.25); }

/* ------------------------------ 布局 ------------------------------ */
.main { max-width: 1140px; margin: 0 auto; padding: 22px 20px 90px; min-height: calc(100vh - 190px); }
.view { animation: viewIn .38s cubic-bezier(.22, .9, .35, 1); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }

/* ------------------------------ 通用按钮 ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: 12px;
  padding: 10px 20px;
  font-size: 14px; font-weight: 600;
  transition: all .2s;
  white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(24, 180, 180, .3); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(24, 180, 180, .4); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: #fff; color: var(--primary-deep); border: 1.5px solid #cfe9ee; }
.btn-ghost:hover { border-color: var(--primary); background: var(--primary-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #ffdee5; }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ------------------------------ 输入 ------------------------------ */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.input {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  background: #f7fbfd;
  border: 1.5px solid #e0edf1;
  border-radius: 12px;
  outline: none;
  transition: all .2s;
}
.input::placeholder { color: var(--text-3); }
.input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3.5px rgba(22, 179, 195, .13); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.7; }

.hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.form-error { font-size: 13px; color: var(--danger); background: var(--danger-soft); padding: 9px 13px; border-radius: 10px; margin-bottom: 14px; }

/* 开关 */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .track {
  position: absolute; inset: 0;
  background: #d3e5ea; border-radius: 999px;
  transition: background .25s;
}
.toggle .track::after {
  content: ""; position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.toggle input:checked + .track { background: var(--primary); }
.toggle input:checked + .track::after { transform: translateX(18px); }

/* ------------------------------ Hero ------------------------------ */
.hero {
  position: relative;
  border-radius: 20px;
  padding: 26px 30px;
  color: #fff;
  background: linear-gradient(115deg, #38c4cf 0%, #3fcdb6 55%, #7ee3c0 100%);
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(35, 180, 180, .28);
  margin-bottom: 18px;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
}
.hero::before { width: 210px; height: 210px; right: -60px; top: -110px; }
.hero::after { width: 120px; height: 120px; right: 130px; bottom: -70px; background: rgba(255,255,255,.12); }
.hero h1 { font-size: 24px; font-weight: 800; letter-spacing: 1px; position: relative; }
.hero p { margin-top: 7px; font-size: 14px; color: rgba(255, 255, 255, .92); position: relative; }
.hero-stats { display: flex; gap: 10px; margin-top: 16px; position: relative; flex-wrap: wrap; }
.hero-stat {
  background: rgba(255, 255, 255, .2);
  backdrop-filter: blur(4px);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12.5px;
  font-weight: 600;
}
.hero-stat b { font-weight: 800; margin-right: 4px; }

/* ------------------------------ 分类 & 排序 ------------------------------ */
.feed-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  background: #fff;
  color: var(--text-2);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: all .2s;
  cursor: pointer;
}
.chip:hover { transform: translateY(-1.5px); border-color: #bfe0e7; color: var(--primary-deep); box-shadow: var(--shadow); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 5px 14px rgba(24,180,180,.3); }

.feed-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feed-count { font-size: 13px; color: var(--text-3); }
.seg { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; }
.seg-btn {
  border: none; background: none;
  padding: 7px 18px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-3);
  border-radius: 9px;
  transition: all .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg-btn:hover { color: var(--primary-deep); }
.seg-btn.active { background: var(--primary-soft); color: var(--primary-deep); }

/* ------------------------------ 帖子卡片 ------------------------------ */
.feed { display: flex; flex-direction: column; gap: 14px; }

.post-card {
  background: var(--card);
  border: 1px solid #e9f3f6;
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s;
  animation: cardIn .4s ease both;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #d4edf1; }

.post-head { display: flex; align-items: center; gap: 11px; }
.post-head .meta { flex: 1; min-width: 0; }
.p-name { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.p-time { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.tag {
  font-size: 11px; font-weight: 600;
  padding: 2.5px 8px; border-radius: 6px;
  line-height: 1.4;
  flex-shrink: 0;
}
.tag-anon { background: #eef3f6; color: #8aa3b0; }
.tag-me { background: var(--primary-soft); color: var(--primary-deep); }
.tag-pin { background: var(--warn-soft); color: #c07b00; display: inline-flex; align-items: center; gap: 4px; }

.cat-chip {
  font-size: 12px; font-weight: 700;
  padding: 3.5px 11px;
  border-radius: 999px;
  flex-shrink: 0;
}
.badge-status { font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; flex-shrink: 0; }
.badge-pending { background: var(--warn-soft); color: #c07b00; }
.badge-approved { background: var(--ok-soft); color: #1d9a68; }
.badge-rejected { background: var(--danger-soft); color: var(--danger); }

.p-content {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.75;
  color: #2c454e;
  word-break: break-word;
  white-space: pre-wrap;
}
.p-content.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.expand-btn { background: none; border: none; color: var(--primary); font-size: 13.5px; font-weight: 600; padding: 6px 0 0; }
.expand-btn:hover { color: var(--primary-deep); }

.p-imgs { display: grid; gap: 7px; margin-top: 12px; border-radius: 12px; overflow: hidden; }
.p-imgs.count-1 { grid-template-columns: 1fr; }
.p-imgs.count-1 .p-img { max-height: 380px; }
.p-imgs.count-2, .p-imgs.count-4 { grid-template-columns: 1fr 1fr; }
.p-imgs.count-3 { grid-template-columns: 1fr 1fr 1fr; }
.p-img {
  width: 100%; height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  cursor: zoom-in;
  transition: transform .3s;
  background: #eef4f6;
}
.p-img:hover { transform: scale(1.025); }

.p-actions { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed #ecf4f6; }
.act-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: none;
  color: var(--text-3);
  font-size: 13px; font-weight: 500;
  padding: 6px 12px;
  border-radius: 9px;
  transition: all .18s;
}
.act-btn:hover { background: var(--primary-soft); color: var(--primary-deep); }
.act-btn.liked { color: var(--danger); font-weight: 700; }
.act-btn.liked svg { animation: heartPop .35s ease; }
.act-btn.liked svg path { fill: var(--danger); stroke: var(--danger); }
.act-del { margin-left: auto; }
.act-del:hover { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------ 骨架屏 ------------------------------ */
.skeleton-card {
  background: #fff; border-radius: var(--radius);
  padding: 18px 20px; border: 1px solid #e9f3f6;
}
.sk { border-radius: 8px; background: linear-gradient(90deg, #edf4f6 25%, #f6fafb 37%, #edf4f6 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; }
.sk-row { display: flex; gap: 11px; align-items: center; }
.sk-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.sk-line { height: 13px; }
.sk-w30 { width: 30%; } .sk-w50 { width: 50%; } .sk-w80 { width: 80%; } .sk-w100 { width: 100%; }
.sk-mt { margin-top: 14px; }

/* ------------------------------ 空状态 ------------------------------ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  background: #fff;
  border: 1.5px dashed #d5e9ee;
  border-radius: var(--radius);
}
.empty .empty-ic {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 20px;
  background: var(--primary-soft);
  display: grid; place-items: center;
  color: var(--primary);
}
.empty h3 { font-size: 16px; color: var(--text-2); margin-bottom: 6px; }
.empty p { font-size: 13.5px; }

/* 加载更多 */
.load-more { text-align: center; padding: 18px 0 6px; color: var(--text-3); font-size: 13px; }

/* ------------------------------ 侧栏 ------------------------------ */
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 82px; }
.side-card {
  background: #fff;
  border: 1px solid #e9f3f6;
  border-radius: var(--radius);
  padding: 18px;
}
.side-card.me-card {
  background: linear-gradient(135deg, #ffffff, #f2fbfc);
}
.side-title { font-size: 14px; font-weight: 700; margin-bottom: 13px; display: flex; align-items: center; gap: 7px; color: var(--text); }
.side-title::before { content: ""; width: 4px; height: 15px; border-radius: 2px; background: var(--grad); }

.side-user { display: flex; align-items: center; gap: 12px; }
.side-user .info { flex: 1; min-width: 0; }
.side-user .info b { display: block; font-size: 15px; }
.side-user .info span { font-size: 12.5px; color: var(--text-3); }
.side-guest p { font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 13px; }

.hot-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .18s;
}
.hot-item:hover { background: #f2fafb; }
.hot-idx {
  width: 20px; height: 20px; flex-shrink: 0;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 800;
  background: #eef4f6; color: var(--text-3);
  margin-top: 1px;
}
.hot-item:nth-child(1) .hot-idx { background: #ffe9e0; color: #f2662d; }
.hot-item:nth-child(2) .hot-idx { background: #fff2d9; color: #dd9a0b; }
.hot-item:nth-child(3) .hot-idx { background: #fdf3e3; color: #c8a23c; }
.hot-item .t {
  font-size: 13px; line-height: 1.5; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hot-item .n { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.notice-card { font-size: 13px; color: var(--text-2); line-height: 1.8; }
.notice-card li { margin: 4px 0 4px 18px; }

/* ------------------------------ 详情页 ------------------------------ */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: 14px; font-weight: 500;
  margin-bottom: 14px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  transition: all .2s;
  background: #fff; border: 1px solid var(--line);
}
.back-link:hover { color: var(--primary-deep); border-color: #bfe0e7; transform: translateX(-2px); }

.detail-card { background: #fff; border-radius: var(--radius); border: 1px solid #e9f3f6; padding: 24px; }
.detail-card .p-content { font-size: 16px; margin-top: 16px; }
.detail-stats { display: flex; gap: 18px; margin-top: 18px; color: var(--text-3); font-size: 13px; align-items: center; }
.detail-stats span { display: inline-flex; align-items: center; gap: 6px; }

.reject-tip {
  margin-top: 14px;
  background: var(--danger-soft); color: #d94b64;
  font-size: 13px; padding: 10px 14px; border-radius: 10px;
}

.comments-wrap { background: #fff; border-radius: var(--radius); border: 1px solid #e9f3f6; padding: 20px 24px; margin-top: 14px; }
.comments-wrap h3 { font-size: 15px; margin-bottom: 14px; }
.comment-item { display: flex; gap: 11px; padding: 13px 0; border-bottom: 1px dashed #eef4f6; }
.comment-item:last-child { border-bottom: none; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment-head b { font-size: 13.5px; }
.comment-head .tag { transform: scale(.92); }
.comment-head time { color: var(--text-3); font-size: 12px; }
.comment-content { margin-top: 5px; font-size: 14px; line-height: 1.7; color: #2c454e; word-break: break-word; white-space: pre-wrap; }
.comment-del { background: none; border: none; color: var(--text-3); font-size: 12px; padding: 2px 8px; border-radius: 7px; transition: all .15s; }
.comment-del:hover { color: var(--danger); background: var(--danger-soft); }

.comment-form { display: flex; gap: 10px; margin-top: 16px; align-items: flex-start; }
.comment-form textarea { flex: 1; min-height: 44px; max-height: 130px; }
.comment-form-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.anon-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); cursor: pointer; user-select: none; }

.login-tip { text-align: center; padding: 18px; background: var(--primary-soft); border-radius: 12px; margin-top: 16px; font-size: 14px; color: var(--primary-deep); }
.login-tip a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------ 发帖页 ------------------------------ */
.compose-card { background: #fff; border-radius: var(--radius); border: 1px solid #e9f3f6; padding: 26px; max-width: 720px; margin: 0 auto; }
.compose-head { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.compose-head h2 { font-size: 19px; }
.compose-head .sub { font-size: 12.5px; color: var(--text-3); }

.cat-select { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 18px; }
.cat-opt {
  padding: 7.5px 17px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--text-2);
  cursor: pointer;
  transition: all .2s;
}
.cat-opt:hover { transform: translateY(-1.5px); border-color: #bfe0e7; }
.cat-opt.active { color: #fff !important; border-color: transparent !important; box-shadow: 0 5px 14px rgba(24,180,180,.28); transform: translateY(-1.5px); }

#compose-text { min-height: 170px; font-size: 15px; }
.char-count { text-align: right; font-size: 12px; color: var(--text-3); margin-top: 6px; }
.char-count.over { color: var(--danger); }

.compose-anon {
  display: flex; align-items: center; justify-content: space-between;
  background: #f7fbfd;
  border: 1px solid #e4eff3;
  border-radius: 13px;
  padding: 13px 16px;
  margin: 16px 0;
  cursor: pointer;
}
.compose-anon .txt b { font-size: 14px; display: flex; align-items: center; gap: 7px; }
.compose-anon .txt span { font-size: 12.5px; color: var(--text-3); margin-top: 2px; display: block; }

.img-upload-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.img-item { position: relative; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; animation: popIn .25s ease; }
.img-item img { width: 100%; height: 100%; object-fit: cover; }
.img-remove {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: grid; place-items: center;
  transition: all .15s;
}
.img-remove:hover { background: var(--danger); transform: scale(1.1); }
.img-add {
  width: 92px; height: 92px;
  border-radius: 12px;
  border: 1.5px dashed #c4dfe6;
  background: #f7fbfd;
  color: var(--text-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11.5px;
  transition: all .2s;
}
.img-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.img-add.uploading { animation: pulse 1s infinite; }

.compose-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }
.compose-tip { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }

/* ------------------------------ 登录注册 ------------------------------ */
.auth-wrap {
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 30px;
  max-width: 960px;
  margin: 30px auto 0;
  align-items: stretch;
}
.auth-brand {
  border-radius: 22px;
  background: linear-gradient(150deg, #38c4cf 0%, #3fcdb6 60%, #7ee3c0 100%);
  color: #fff;
  padding: 44px 40px;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  box-shadow: 0 18px 44px rgba(35, 180, 180, .3);
}
.auth-brand::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.14); top: -100px; right: -80px; }
.auth-brand::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; background: rgba(255,255,255,.1); bottom: -60px; left: -40px; }
.auth-brand h2 { font-size: 28px; font-weight: 800; letter-spacing: 1px; position: relative; }
.auth-brand .slogan { margin-top: 14px; font-size: 15px; line-height: 1.9; color: rgba(255,255,255,.94); position: relative; }
.auth-brand .bubbles { display: flex; gap: 8px; margin-top: 26px; position: relative; }
.auth-brand .bubbles span {
  background: rgba(255,255,255,.2);
  padding: 6px 14px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  backdrop-filter: blur(4px);
}

.auth-card { background: #fff; border-radius: 22px; border: 1px solid #e9f3f6; box-shadow: var(--shadow-lg); padding: 34px 32px; }
.auth-tabs { display: flex; background: #f1f8fa; border-radius: 13px; padding: 5px; margin-bottom: 24px; }
.auth-tab {
  flex: 1;
  border: none; background: none;
  padding: 10px;
  font-size: 14.5px; font-weight: 700;
  color: var(--text-3);
  border-radius: 10px;
  transition: all .25s;
}
.auth-tab.active { background: #fff; color: var(--primary-deep); box-shadow: 0 2px 8px rgba(22,140,160,.12); }
.auth-sub { text-align: center; font-size: 13px; color: var(--text-3); margin-top: 18px; line-height: 1.7; }
.auth-sub a { color: var(--primary); font-weight: 600; }

/* ------------------------------ 个人中心 ------------------------------ */
.me-head {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid #e9f3f6;
  padding: 26px;
  display: flex; align-items: center; gap: 18px;
  flex-wrap: wrap;
}
.me-head .info { flex: 1; min-width: 180px; }
.me-head .info b { font-size: 19px; display: block; }
.me-head .info .uname { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.me-head .info .bio { font-size: 13.5px; color: var(--text-2); margin-top: 7px; }
.me-stats { display: flex; gap: 10px; }
.me-stat {
  background: #f7fbfd; border: 1px solid #e9f3f6;
  border-radius: 13px;
  padding: 10px 18px;
  text-align: center;
  min-width: 76px;
  transition: all .2s;
}
.me-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.me-stat b { font-size: 18px; display: block; color: var(--primary-deep); }
.me-stat span { font-size: 11.5px; color: var(--text-3); }

.me-tabs { display: flex; gap: 8px; margin: 18px 0 14px; }
.me-tab {
  border: 1px solid var(--line); background: #fff;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-2);
  transition: all .2s;
}
.me-tab:hover { border-color: #bfe0e7; color: var(--primary-deep); }
.me-tab.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 5px 14px rgba(24,180,180,.3); }

/* 我的评论列表 */
.myc-item {
  background: #fff; border: 1px solid #e9f3f6;
  border-radius: 13px; padding: 15px 18px;
  cursor: pointer;
  transition: all .2s;
  animation: cardIn .35s ease both;
}
.myc-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d4edf1; }
.myc-item .post-ref { font-size: 12px; color: var(--text-3); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.myc-item .post-ref b { color: var(--primary-deep); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------ 管理后台 ------------------------------ */
.admin-gate {
  max-width: 420px; margin: 50px auto 0;
  background: #fff; border-radius: 22px;
  border: 1px solid #e9f3f6;
  box-shadow: var(--shadow-lg);
  padding: 38px 34px;
  text-align: center;
}
.admin-gate .gate-ic {
  width: 68px; height: 68px;
  margin: 0 auto 18px;
  border-radius: 22px;
  background: var(--grad);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 24px rgba(24,180,180,.35);
}
.admin-gate h2 { font-size: 20px; margin-bottom: 8px; }
.admin-gate .sub { font-size: 13px; color: var(--text-3); margin-bottom: 24px; line-height: 1.7; }
.admin-gate .demo { margin-top: 16px; font-size: 12px; color: var(--text-3); background: #f7fbfd; border-radius: 10px; padding: 9px 12px; }
.admin-gate .demo code { color: var(--primary-deep); font-weight: 600; }

.admin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.admin-head h2 { font-size: 20px; display: flex; align-items: center; gap: 9px; }
.admin-head h2 .shield { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 5px 14px rgba(24,180,180,.3); }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: #fff; border: 1px solid #e9f3f6;
  border-radius: 15px; padding: 17px 18px;
  display: flex; align-items: center; gap: 13px;
  transition: all .22s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card .ic-box { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.stat-card b { font-size: 21px; display: block; line-height: 1.2; }
.stat-card span { font-size: 12px; color: var(--text-3); }

.admin-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-side { background: #fff; border: 1px solid #e9f3f6; border-radius: var(--radius); padding: 10px; position: sticky; top: 82px; }
.admin-nav {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: none; background: none;
  border-radius: 11px;
  font-size: 14px; font-weight: 600;
  color: var(--text-2);
  transition: all .18s;
  text-align: left;
}
.admin-nav:hover { background: #f2fafb; color: var(--primary-deep); }
.admin-nav.active { background: var(--primary-soft); color: var(--primary-deep); }
.admin-nav .cnt { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 700; }

.admin-panel { background: #fff; border: 1px solid #e9f3f6; border-radius: var(--radius); padding: 18px; }
.admin-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.admin-toolbar .input { flex: 1; }

.admin-row {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 15px 6px;
  border-bottom: 1px dashed #eef4f6;
  animation: cardIn .3s ease both;
}
.admin-row:last-child { border-bottom: none; }
.admin-row .body { flex: 1; min-width: 0; }
.admin-row .content { font-size: 14px; line-height: 1.65; margin-top: 5px; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.admin-row .content.show-all { -webkit-line-clamp: unset; }
.admin-row .meta-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.admin-row .acts { display: flex; gap: 7px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; max-width: 240px; }
.admin-thumbs { display: flex; gap: 6px; margin-top: 8px; }
.admin-thumbs img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }

/* ------------------------------ 弹窗 ------------------------------ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 48, 58, .4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 430px;
  padding: 26px;
  animation: modalIn .28s cubic-bezier(.34, 1.4, .64, 1);
  max-height: 86vh;
  overflow-y: auto;
}
.modal h3 { font-size: 17px; margin-bottom: 8px; }
.modal .modal-text { font-size: 14px; color: var(--text-2); line-height: 1.7; }
.modal .modal-acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.modal .input { margin-top: 14px; }

.color-swatches { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 4px; }
.swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: all .18s;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: var(--text); transform: scale(1.12); box-shadow: 0 0 0 3px #fff inset; }

/* ------------------------------ 轻框图 ------------------------------ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(10, 30, 38, .82);
  z-index: 300;
  display: grid; place-items: center;
  padding: 30px;
  cursor: zoom-out;
  animation: fadeIn .2s ease;
}
.lightbox img { max-width: 92vw; max-height: 90vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }

/* ------------------------------ Toast ------------------------------ */
#toast-wrap {
  position: fixed;
  top: 72px; left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
  width: max-content; max-width: 88vw;
}
.toast {
  background: rgba(28, 52, 61, .92);
  color: #fff;
  font-size: 13.5px; font-weight: 500;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(10, 40, 50, .3);
  animation: toastIn .3s cubic-bezier(.34, 1.4, .64, 1);
  display: flex; align-items: center; gap: 8px;
  max-width: 100%;
}
.toast.ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4be0a8; flex-shrink: 0; }
.toast.err::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff8296; flex-shrink: 0; }
.toast.out { animation: toastOut .25s ease forwards; }

/* ------------------------------ 页脚 ------------------------------ */
.footer { border-top: 1px solid var(--line); padding: 22px 20px 30px; }
.footer-inner {
  max-width: 1140px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 12.5px; color: var(--text-3);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-3); transition: color .2s; }
.footer-links a:hover { color: var(--primary); }

/* --------------------------- 移动端底部导航 --------------------------- */
.tabbar { display: none; }

/* ------------------------------ 动画 ------------------------------ */
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(.9) translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes heartPop { 0% { transform: scale(1); } 45% { transform: scale(1.4); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px) scale(.94); } }
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ------------------------------ 响应式 ------------------------------ */
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .auth-wrap { grid-template-columns: 1fr; max-width: 460px; }
  .auth-brand { display: none; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-side { position: static; display: flex; overflow-x: auto; padding: 8px; gap: 4px; }
  .admin-nav { white-space: nowrap; width: auto; }
  .admin-nav .cnt { margin-left: 4px; }
}

@media (max-width: 640px) {
  .topnav { display: none; }
  .main { padding: 14px 13px 110px; }
  .hero { padding: 20px; border-radius: 16px; }
  .hero h1 { font-size: 20px; }
  .post-card { padding: 15px 16px; }
  .detail-card, .comments-wrap { padding: 18px 16px; }
  .compose-card, .auth-card { padding: 24px 20px; border-radius: 18px; }
  .me-head { padding: 20px; }
  .admin-row { flex-direction: column; }
  .admin-row .acts { justify-content: flex-start; max-width: none; }
  .topbar-inner { padding: 0 14px; gap: 12px; }
  .user-chip span.name { display: none; }

  .tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 110;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-top: 1px solid var(--line);
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: flex-end;
  }
  .tab-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 22px;
    font-size: 10.5px;
    color: var(--text-3);
    border-radius: 12px;
    transition: color .2s;
  }
  .tab-item.active { color: var(--primary); }
  .tab-item:hover { color: var(--primary); }
  .tab-fab {
    width: 54px; height: 54px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    display: grid; place-items: center;
    margin-top: -26px;
    box-shadow: 0 8px 20px rgba(24, 180, 180, .45), 0 0 0 5px var(--bg);
    transition: transform .2s;
  }
  .tab-fab:hover { transform: translateY(-3px) scale(1.05); }
  .footer { padding-bottom: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ================= 协议勾选 / 图片头像 / 私信 ================= */
.agree-row { margin: 4px 0 14px; font-size: 13px; color: var(--text-2); display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.agree-line { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.agree-line input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.agree-link { color: var(--primary-deep); font-weight: 600; text-decoration: none; }
.agree-link:hover { text-decoration: underline; }
#auth-submit:disabled { opacity: .55; cursor: not-allowed; }

.avatar.has-img { overflow: hidden; }
.avatar.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-edit { display: flex; align-items: center; gap: 14px; }
.avatar-edit .avatar { flex-shrink: 0; font-size: 22px; font-weight: 700; color: #fff; }
.avatar-edit-acts { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.avatar-tip { font-size: 12px; color: var(--text-3); line-height: 1.6; }

.dm-badge { display: inline-block; margin-left: auto; background: var(--danger, #e5588a); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 999px; padding: 0 5px; }
.dm-badge.hide { display: none; }
.dm-badge.zero { background: #c3d6dc; }
.dm-thread { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #e9f3f6; border-radius: var(--radius); padding: 13px 16px; margin-bottom: 10px; cursor: pointer; transition: box-shadow .15s; }
.dm-thread:hover { box-shadow: 0 4px 14px rgba(24,180,180,.12); }
.dm-thread-main { flex: 1; min-width: 0; }
.dm-thread-top { display: flex; align-items: baseline; gap: 8px; }
.dm-thread-top b { font-size: 14.5px; color: var(--text); }
.dm-time { font-size: 12px; color: var(--text-3); margin-left: auto; flex-shrink: 0; }
.dm-last { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.dm-chat { background: #fff; border: 1px solid #e9f3f6; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 220px); min-height: 420px; }
.dm-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #eef5f7; background: #fbfeff; }
.dm-uname { font-size: 12px; color: var(--text-3); }
.dm-msgs { flex: 1; overflow-y: auto; padding: 18px 16px; background: #f7fbfc; }
.dm-msg { display: flex; gap: 9px; margin-bottom: 14px; align-items: flex-start; }
.dm-msg.mine { flex-direction: row-reverse; }
.dm-bubble { max-width: 72%; background: #fff; border: 1px solid #e5f0f3; border-radius: 4px 14px 14px 14px; padding: 9px 13px; font-size: 14px; line-height: 1.65; word-break: break-word; white-space: pre-wrap; }
.dm-msg.mine .dm-bubble { background: var(--primary-soft, #e0f5f7); border-color: #c9ecf0; border-radius: 14px 4px 14px 14px; }
.dm-msg-time { font-size: 11px; color: var(--text-3); margin-top: 4px; text-align: right; }
.dm-empty { text-align: center; color: var(--text-3); font-size: 13.5px; padding: 30px 0; }
.dm-input-wrap { border-top: 1px solid #eef5f7; padding: 12px 14px; background: #fff; }
.dm-input-row { display: flex; gap: 10px; align-items: flex-end; }
.dm-input-row textarea.input { flex: 1; resize: none; min-height: 44px; max-height: 110px; }
.dm-limit { font-size: 12px; color: #d98a00; margin-top: 6px; min-height: 16px; }
.dm-muted { background: #fff5f7; color: #c2456e; border: 1px solid #f6d3de; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }

.dm-admin-row { cursor: default; }
.dm-admin-title { font-weight: 700; font-size: 14.5px; color: var(--text); margin-bottom: 10px; }
.dm-admin-msgs { max-height: 480px; overflow-y: auto; border: 1px solid #e9f3f6; border-radius: 10px; padding: 6px 14px; background: #fbfeff; }
.dm-admin-msg { padding: 10px 0; border-bottom: 1px dashed #e8f1f4; font-size: 13.5px; line-height: 1.7; }
.dm-admin-msg:last-child { border-bottom: none; }
.dm-admin-msg b { color: var(--primary-deep); }
.dm-admin-time { float: right; font-size: 11.5px; color: var(--text-3); }
@media (max-width: 640px) { .dm-chat { height: calc(100vh - 200px); } }

/* ================= 消息中心 / 角色徽章 ================= */
.icon-btn { position: relative; background: none; border: none; cursor: pointer; padding: 7px; border-radius: 10px; color: var(--text-2); display: inline-flex; align-items: center; transition: background .15s; }
.icon-btn:hover { background: var(--primary-soft, #e6f6f8); color: var(--primary-deep); }
.tag-owner { background: linear-gradient(135deg, #ff9f43, #ff7a9e); color: #fff; }
.tag-pin { background: var(--primary-soft, #e0f5f7); color: var(--primary-deep); }

.notif-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #e9f3f6; border-radius: var(--radius); padding: 13px 16px; margin-bottom: 10px; cursor: pointer; transition: box-shadow .15s, background .15s; }
.notif-row:hover { box-shadow: 0 4px 14px rgba(24,180,180,.12); }
.notif-row.unread { background: #f2fbfd; border-color: #d3eef3; }
.notif-ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-like { background: #ffedf2; color: #e5588a; }
.notif-comment { background: #e8f3ff; color: #4a90e2; }
.notif-dm { background: #e6f9f5; color: #12b886; }
.notif-review { background: #f3f0ff; color: #7a6ff0; }
.notif-system { background: #fff4e6; color: #ff9f43; }
.notif-main { flex: 1; min-width: 0; }
.notif-text { font-size: 13.5px; line-height: 1.6; color: var(--text); word-break: break-word; }
.notif-row.unread .notif-text { font-weight: 600; }
.notif-time { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: #e5588a; flex-shrink: 0; }

.ann-row { display: flex; align-items: flex-start; gap: 12px; background: #fff; border: 1px solid #e9f3f6; border-radius: var(--radius); padding: 15px 16px; margin-bottom: 12px; }
.ann-row.unread { background: #fffaf2; border-color: #f6e3c8; }
.ann-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.ann-content { font-size: 13.5px; line-height: 1.7; color: var(--text-2); margin-top: 5px; white-space: pre-wrap; word-break: break-word; }

.ann-form { background: #fff; border: 1px solid #e9f3f6; border-radius: var(--radius); padding: 16px; }
.ann-form .field { margin-bottom: 12px; }
.ann-form textarea.input { resize: vertical; min-height: 90px; }

#auth-tab-notif-wrap .auth-tab { position: relative; }
