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

:root {
  --bg: #f5f6f8;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #f7f8fa;
  --line: #e7e9ef;
  --line-2: #d9dde6;
  --text: #16181d;
  --text-2: #5a6274;
  --text-3: #8b92a1;
  --brand: #6d5cff;
  --brand-2: #0ea5b7;
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #04050a;
  background-image:
    radial-gradient(680px 420px at 18% -12%, rgba(124, 92, 255, 0.26), transparent 62%),
    radial-gradient(560px 380px at 108% 6%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(500px 400px at 50% 112%, rgba(124, 92, 255, 0.10), transparent 65%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  overflow: hidden;
}

.phone {
  position: relative;
  width: 100%;
  /* 顺序不能反：先 100vh 给老浏览器兜底，再用 100dvh 覆盖。
     dvh 会跟随 iOS 地址栏收缩 / 键盘弹出变化，vh 不会（写反了就会高度错位）。 */
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: transparent;
  isolation: isolate;
}

@supports (height: 100dvh) {
  .phone { height: 100dvh; }
}

.phone::before {
  content: none;
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
}

.main-col {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-t) + 18px) 18px 12px;
  background: rgba(7, 8, 12, 0.9);
  position: relative;
  z-index: 5;
}

.brand-wrap { display: flex; align-items: baseline; gap: 8px; }

.brand {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(118deg, #ffffff 5%, #c6b6ff 52%, #7fe7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 3px;
  padding-bottom: 2px;
}

.top-right { display: flex; align-items: center; gap: 10px; }

.online {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
  display: inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.me-btn {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  line-height: 0;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  font-style: normal;
  color: #fff;
  flex: 0 0 auto;
  letter-spacing: 0;
}

.avatar.lg { width: 58px; height: 58px; font-size: 21px; }

.avatar.c0 { background: linear-gradient(135deg, #7c5cff, #5b8cff); }
.avatar.c1 { background: linear-gradient(135deg, #22d3ee, #3b82f6); }
.avatar.c2 { background: linear-gradient(135deg, #f472b6, #a855f7); }
.avatar.c3 { background: linear-gradient(135deg, #34d399, #059669); }
.avatar.c4 { background: linear-gradient(135deg, #fbbf24, #f97316); }
.avatar.c5 { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.avatar.c6 { background: linear-gradient(135deg, #f87171, #dc2626); }
.avatar.c7 { background: linear-gradient(135deg, #a3e635, #65a30d); }

.content {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.page {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
  scrollbar-width: none;
}

.page::-webkit-scrollbar { display: none; }
.page.active { display: block; animation: fadeUp 0.28s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  background: linear-gradient(118deg, rgba(124, 92, 255, 0.18), rgba(34, 211, 238, 0.09));
  border: 1px solid rgba(124, 92, 255, 0.26);
  margin-bottom: 16px;
  overflow: hidden;
}

.notice-icon { color: #b8a8ff; line-height: 0; flex: 0 0 auto; }
.notice-icon svg { width: 17px; height: 17px; }

.notice-view { flex: 1 1 auto; overflow: hidden; }

.notice-track {
  display: inline-block;
  white-space: nowrap;
  font-size: 13px;
  color: #d8d3ff;
  animation: marquee 26s linear infinite;
  will-change: transform;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---- 首页搜索框 ---- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  margin: 0 0 12px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
  box-sizing: border-box;
}
.search-bar .s-ico { width: 16px; height: 16px; flex: 0 0 auto; color: var(--text-3); }
.search-bar input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
}
.search-bar input::placeholder { color: var(--text-3); }
.search-bar .s-clear {
  display: none;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(128, 128, 128, .18);
  color: var(--text-2);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---- 置顶标记 / 浏览数 ---- */
.pin-badge {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ff9a5a, #ff7a45);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .3px;
}
.views { font-size: 12px; color: var(--text-3); }

/* ---- 顶栏通知铃铛 ---- */
.bell-btn {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bell-btn:active { background: rgba(128, 128, 128, .12); }
.bell-btn svg { width: 19px; height: 19px; }
.bell-dot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff4d4f;
  box-shadow: 0 0 0 2px var(--bg-2);
}
.bell-dot.num {
  top: 1px;
  right: 0;
  width: auto;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- 可点击的统计格（收藏）---- */
.stat-click { cursor: pointer; }
.stat-click:active { opacity: .65; }

/* ---- 通用列表弹层（收藏 / 通知 / 某人的帖子）---- */
.sheet-list { max-height: 58vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.list-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.list-row:last-child { border-bottom: none; }
.list-row .lr-main { flex: 1 1 auto; min-width: 0; }
.list-row .lr-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row .lr-sub { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.list-row .lr-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: #ff4d4f;
}
.list-empty { padding: 28px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.author-link { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.author-link:active { opacity: .7; }
.act-fav.on { color: #f5a623; }
.mute-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fff1f0;
  color: #cf1322;
  font-size: 11px;
}
.mute-btn {
  border: 1px solid #ffccc7;
  background: #fff2f0;
  color: #cf1322;
  border-radius: 8px;
  font-size: 12px;
  padding: 4px 9px;
  cursor: pointer;
  font-family: inherit;
}
.mute-btn:active { opacity: .7; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  /* 只过渡颜色，不写 all —— all 会把几何属性一起动画，切分类时整排会抖一下 */
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  font-family: inherit;
}

.chip.active {
  color: #fff;
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.9), rgba(91, 140, 255, 0.85));
  border-color: transparent;
  box-shadow: 0 6px 18px -6px rgba(124, 92, 255, 0.8);
}

.feed { padding-bottom: 8px; }

/* 追加加载时不重播入场动画，避免滚动时整列闪烁 */
.feed.no-anim .post { animation: none !important; }

.post {
  position: relative;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.22s, transform 0.22s, border-color 0.22s;
  animation: fadeUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.post:active { transform: scale(0.988); }

@media (hover: hover) {
  .post:hover { background: var(--card-2); border-color: var(--line-2); }
}

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
}

.tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 7px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.tag-0 { color: #a9c8ff; background: rgba(96, 165, 250, 0.14); }
.tag-1 { color: #c3b4ff; background: rgba(124, 92, 255, 0.16); }
.tag-2 { color: #8ee9f7; background: rgba(34, 211, 238, 0.13); }
.tag-3 { color: #b8b2a6; background: rgba(180, 178, 169, 0.13); }

.time { font-size: 11px; color: var(--text-3); }

.post-title {
  margin: 0 0 7px;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  letter-spacing: -0.1px;
}

.post-body {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.68;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cloud {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 10px 12px;
  border-radius: 13px;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--line-2);
}

.cloud-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  flex: 0 0 auto;
  letter-spacing: -0.3px;
}

.cloud-info { flex: 1 1 auto; min-width: 0; }

.cloud-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cloud-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.cloud-btn {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-family: inherit;
  color: #d5ccff;
  background: rgba(124, 92, 255, 0.18);
  border: 1px solid rgba(124, 92, 255, 0.32);
  cursor: pointer;
  transition: background 0.18s;
}

.cloud-btn:active { background: rgba(124, 92, 255, 0.34); }

.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.author { display: flex; align-items: center; gap: 8px; min-width: 0; }
.author .avatar { width: 26px; height: 26px; font-size: 11px; }
.author span { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.acts { display: flex; gap: 16px; flex: 0 0 auto; }

.act {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-3);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s;
}

.act svg { width: 15px; height: 15px; }
.act.on { color: #ff6b8a; }

.act.on svg { fill: currentColor; animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.feed-end {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  padding: 14px 0 24px;
}

.feed-loading {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  padding: 18px 0;
  letter-spacing: 1px;
  animation: breathe 1.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.page-head { padding: 4px 0 18px; }

.page-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.page-head p { margin: 5px 0 0; font-size: 13px; color: var(--text-3); }
.page-head p b { color: #b8a8ff; font-weight: 600; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 0;
  color: var(--text-3);
}
.empty-mark { color: rgba(255, 255, 255, 0.14); margin-bottom: 12px; }
.empty-mark svg { width: 46px; height: 46px; }
.empty p { margin: 0; font-size: 14px; color: var(--text-2); }
.empty span { font-size: 12px; margin-top: 4px; }

/* ---- 聊天 ---- */
.chat-page.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.chat-head {
  flex: 0 0 auto;
  padding: 4px 16px 12px;
}

.chat-head p { display: flex; align-items: center; gap: 6px; }

.chat-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px 12px;
  scrollbar-width: none;
}

.chat-list::-webkit-scrollbar { display: none; }

.msg {
  display: flex;
  gap: 9px;
  margin-bottom: 16px;
  animation: fadeUp 0.26s ease;
}

.msg.mine { flex-direction: row-reverse; }

.msg-main { max-width: 74%; min-width: 0; }

.msg-name {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 4px;
  padding: 0 4px;
}

.msg.mine .msg-name { text-align: right; }

.bubble {
  padding: 10px 13px;
  border-radius: 16px;
  border-top-left-radius: 5px;
  background: var(--card-2);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}

.msg.mine .bubble {
  background: linear-gradient(128deg, #7c5cff, #5b8cff);
  border-top-left-radius: 16px;
  border-top-right-radius: 5px;
  color: #fff;
}

.chat-input {
  flex: 0 0 auto;
  display: flex;
  gap: 9px;
  padding: 10px 16px calc(10px + var(--safe-b));
  background: rgba(10, 12, 18, 0.7);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.chat-input input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 15px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.chat-input input::placeholder { color: var(--text-3); }
.chat-input input:focus { border-color: rgba(124, 92, 255, 0.5); background: rgba(255, 255, 255, 0.07); }

.send-btn {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(130deg, #7c5cff, #5b8cff);
  cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(124, 92, 255, 0.9);
  transition: transform 0.16s;
}

.send-btn:active { transform: scale(0.92); }
.send-btn svg { width: 18px; height: 18px; }

/* ---- 我的 ---- */
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(118deg, rgba(124, 92, 255, 0.18), rgba(34, 211, 238, 0.07));
  border: 1px solid rgba(124, 92, 255, 0.24);
  margin-bottom: 14px;
}

.profile-name { font-size: 18px; font-weight: 600; }
.profile-id { font-size: 11px; color: var(--text-3); margin-top: 2px; font-family: ui-monospace, monospace; }

.stats {
  display: grid;
  /* 发帖 / 获赞 / 发言 / 收藏 四格 */
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

/* 窄屏四格容易挤，收紧间距 */
@media (max-width: 400px) {
  .stats { gap: 6px; }
  .stats .stat { padding: 12px 4px; }
}

.stat {
  padding: 14px 8px;  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  text-align: center;
}

.stat b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -0.5px; }
.stat span { font-size: 11.5px; color: var(--text-3); }

.panel {
  padding: 16px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.3px;
}

.row { display: flex; gap: 9px; }

.panel input,
.panel textarea,
.field input,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: none;
  transition: border-color 0.2s;
}

.panel input:focus,
.panel textarea:focus,
.field input:focus,
.field textarea:focus {
  border-color: rgba(124, 92, 255, 0.55);
}

.panel input::placeholder,
.panel textarea::placeholder,
.field input::placeholder,
.field textarea::placeholder { color: var(--text-3); }

.panel textarea { margin-bottom: 10px; }

.mini-btn {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.18);
  color: #d5ccff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s;
}

.mini-btn:active { background: rgba(124, 92, 255, 0.32); }
.mini-btn.wide { width: 100%; margin-top: 2px; }

.colors { display: flex; gap: 10px; flex-wrap: wrap; }

.color-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.16s, border-color 0.16s;
}

.color-dot.sel { border-color: #fff; transform: scale(1.06); }
.color-dot:active { transform: scale(0.94); }

.about p { margin: 0 0 8px; font-size: 12.5px; color: var(--text-3); line-height: 1.7; }
.about p:last-child { margin-bottom: 0; }
/* 后台填写的介绍可能有换行，保留它；同时避免长英文/链接撑破容器 */
.about .about-text { white-space: pre-line; word-break: break-word; }
.about code {
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  color: #b8a8ff;
}

.bottom-space { height: 90px; }

/* ---- FAB ---- */
.fab {
  position: absolute;
  right: 18px;
  bottom: calc(76px + var(--safe-b));
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #7c5cff, #5b8cff 60%, #22d3ee);
  box-shadow: 0 10px 26px -8px rgba(124, 92, 255, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  cursor: pointer;
  z-index: 20;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab:active { transform: scale(0.9) rotate(90deg); }
.fab svg { width: 24px; height: 24px; }

/* ---- tabbar ---- */
.tabbar {
  flex: 0 0 auto;
  display: grid;
  /* 5 格：广场 / 资源 / 聊天 / 课表 / 我的（清缓存已移到「我的」页里） */
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 4px calc(8px + var(--safe-b));
  background: rgba(8, 10, 16, 0.82);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  z-index: 15;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--text-3);
  font-size: 10.5px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s;
}

.tab svg { width: 22px; height: 22px; transition: transform 0.2s; }
.tab.active { color: #b8a8ff; }
.tab.active svg { transform: translateY(-1px); }

/* ---- sheet ---- */
.sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
}

.sheet.open { display: block; }

.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade 0.22s ease;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 18px calc(22px + var(--safe-b));
  border-radius: 26px 26px 0 0;
  background: linear-gradient(180deg, #12141d 0%, #0a0c12 40%);
  border-top: 1px solid var(--line-2);
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.9);
  animation: slideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  scrollbar-width: none;
}

.sheet-body::-webkit-scrollbar { display: none; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: none; }
}

.sheet-bar {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  margin: 6px auto 16px;
}

.sheet-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: -0.2px;
}

.field { display: block; margin-bottom: 16px; }

.field > span {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 7px;
  letter-spacing: 0.3px;
}

.cat-row { display: flex; gap: 8px; flex-wrap: wrap; }

.cat {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.cat.sel {
  color: #fff;
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.9), rgba(91, 140, 255, 0.85));
  border-color: transparent;
}

.link-preview { margin-top: 9px; font-size: 12px; line-height: 1.6; color: var(--text-3); }
.link-preview.ok { color: #8ee9f7; }
.link-preview.warn { color: #f0b429; }

/* 正文输入框：发布和编辑共用这一个，默认给足高度，桌面端可再手动拖大 */
.field textarea.body-input {
  min-height: 176px;
  height: 232px;
  max-height: 52vh;
  line-height: 1.75;
  resize: vertical;
}
@media (max-width: 600px) {
  .field textarea.body-input {
    min-height: 150px;
    height: 180px;
    max-height: 40vh;
  }
}

.submit-btn {
  width: 100%;
  padding: 14px;
  border-radius: 15px;
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 1px;
  background: linear-gradient(120deg, #7c5cff, #5b8cff 55%, #22d3ee);
  box-shadow: 0 12px 30px -12px rgba(124, 92, 255, 0.9);
  cursor: pointer;
  transition: transform 0.16s, opacity 0.2s;
  margin-top: 4px;
}

.submit-btn:active { transform: scale(0.985); }
.submit-btn:disabled { opacity: 0.5; }

/* ---- detail ---- */
.detail-body { padding-bottom: calc(84px + var(--safe-b)); }

.detail-title {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 12px;
  letter-spacing: -0.3px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-meta .avatar { width: 30px; height: 30px; font-size: 12px; }
.detail-meta-info { flex: 1 1 auto; }
.detail-meta-name { font-size: 13px; color: var(--text); }
.detail-meta-time { font-size: 11px; color: var(--text-3); }

.detail-text {
  font-size: 14.5px;
  line-height: 1.85;
  color: #d7dbe4;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 18px;
}

.section-label {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.5px;
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.comment {
  display: flex;
  gap: 9px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  animation: fadeUp 0.26s ease;
}

.comment .avatar { width: 28px; height: 28px; font-size: 11px; }
.comment-main { flex: 1 1 auto; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.comment-name { font-size: 12.5px; color: var(--text-2); }
.comment-time { font-size: 10.5px; color: var(--text-3); }
.comment-text { font-size: 13.5px; color: #cdd2dc; line-height: 1.65; word-break: break-word; white-space: pre-wrap; }

.comment-box {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 9px;
  padding: 10px 18px calc(10px + var(--safe-b));
  background: rgba(10, 12, 18, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.comment-box input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.comment-box input:focus { border-color: rgba(124, 92, 255, 0.5); }

/* 进入详情页时隐藏外层导航，让它真正铺满 */
body.detail-open .topbar,
body.detail-open .tabbar,
body.detail-open .fab {
  display: none !important;
}

/* ================= 帖子详情（全屏页） ================= */

.detail-page.active {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  animation: slideInRight 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: none; }
}

.detail-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-t) + 12px) 14px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 16, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.detail-bar .back-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.detail-bar .back-btn:active { background: var(--card-2); color: var(--text); }
.detail-bar .back-btn svg { width: 19px; height: 19px; }

.detail-bar-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px 28px;
  scrollbar-width: none;
}

.detail-scroll::-webkit-scrollbar { display: none; }

.detail-page .comment-box {
  position: static;
  flex: 0 0 auto;
  padding: 10px 16px calc(10px + var(--safe-b));
}

/* ---- toast ---- */
.toast {
  position: absolute;
  left: 50%;
  bottom: 120px;
  transform: translate(-50%, 12px);
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(28, 30, 40, 0.96);
  border: 1px solid var(--line-2);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s;
  z-index: 60;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.9);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

body.no-motion *,
body.no-motion *::before,
body.no-motion *::after {
  animation: none !important;
  transition: none !important;
}

/* 极简模式：去掉所有毛玻璃与动画，给低配显卡 / 排查黑屏用（?lite=1） */
body.lite *,
body.lite *::before,
body.lite *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none !important;
  transition: none !important;
}

/* 浅色主题下 lite 无需额外配色，只保留上面的关动画规则 */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ================= 登录 / 注册 ================= */

.auth {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 22px;
  background:
    radial-gradient(520px 380px at 22% 4%, rgba(124, 92, 255, 0.34), transparent 62%),
    radial-gradient(480px 360px at 92% 92%, rgba(34, 211, 238, 0.18), transparent 62%),
    #06070c;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.auth.hidden {
  display: none;
}

.auth-card {
  width: 100%;
  max-width: 336px;
  padding: 30px 22px 24px;
  border-radius: 26px;
  background: rgba(16, 18, 26, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 36px 90px -34px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.auth-brand {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 5px;
  text-align: center;
  background: linear-gradient(118deg, #ffffff 4%, #c6b6ff 52%, #7fe7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-sub {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 2px;
  margin: 6px 0 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  margin-bottom: 18px;
}

.auth-tab {
  padding: 9px 0;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--text-3);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.auth-tab.active {
  color: #fff;
  background: linear-gradient(120deg, rgba(124, 92, 255, 0.92), rgba(91, 140, 255, 0.86));
  box-shadow: 0 6px 16px -8px rgba(124, 92, 255, 0.95);
}

.auth-form { display: flex; flex-direction: column; gap: 10px; }

.auth-form input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.auth-form input::placeholder { color: var(--text-3); }

.auth-form input:focus {
  border-color: rgba(124, 92, 255, 0.6);
  background: rgba(255, 255, 255, 0.075);
}

.auth-submit {
  margin-top: 6px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  font-family: inherit;
  background: linear-gradient(120deg, #7c5cff, #5b8cff 55%, #22d3ee);
  box-shadow: 0 14px 32px -14px rgba(124, 92, 255, 0.95);
  cursor: pointer;
  transition: transform 0.16s, opacity 0.2s;
}

.auth-submit:active { transform: scale(0.985); }
.auth-submit:disabled { opacity: 0.55; }

.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.link-btn {
  border: none;
  background: none;
  padding: 4px 0;
  color: var(--text-3);
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.18s;
}

.link-btn:active { color: #b8a8ff; }

.auth-tip {
  margin: 12px 0 0;
  min-height: 16px;
  font-size: 12px;
  line-height: 1.5;
  color: #ff8080;
  text-align: center;
}

.auth-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-3);
  text-align: center;
}

.hint {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
  text-align: center;
}

/* ================= 我的页面补充 ================= */

.profile-main { flex: 1 1 auto; min-width: 0; }

.role-badge {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11px;
  color: #ffe6a3;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.role-badge.super {
  color: #ffd76a;
  background: rgba(251, 191, 36, 0.24);
  border-color: rgba(251, 191, 36, 0.5);
}

.panel input + input { margin-top: 9px; }
.panel input + .mini-btn,
.panel textarea + .mini-btn { margin-top: 12px; }
.panel .colors { margin-top: 12px; }

.pass-tip {
  min-height: 15px;
  margin: 7px 0 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-3);
}

.pass-tip.ok { color: #0e9f6e; }
.pass-tip.bad { color: #d92d36; }

.logout-btn {
  width: 100%;
  padding: 13px;
  margin: 4px 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 107, 138, 0.32);
  background: rgba(255, 107, 138, 0.1);
  color: #ff96ab;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s;
}

.logout-btn:active { background: rgba(255, 107, 138, 0.2); }

/* ================= 管理后台 ================= */

.admin-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 18px;
}

.admin-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.back-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.back-btn svg { width: 18px; height: 18px; }

.count-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 11px;
  color: #b8a8ff;
  background: rgba(124, 92, 255, 0.16);
}

.admin-users { display: flex; flex-direction: column; gap: 2px; }

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.user-row:last-child { border-bottom: none; }

.user-row .avatar { width: 32px; height: 32px; font-size: 12px; }

.user-info { flex: 1 1 auto; min-width: 0; }

.user-name {
  font-size: 13.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name em {
  font-style: normal;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 5px;
  color: #ffe6a3;
  background: rgba(251, 191, 36, 0.16);
}

.user-name em.banned {
  color: #ff96ab;
  background: rgba(255, 107, 138, 0.14);
}

.user-name em.self {
  color: #a9c8ff;
  background: rgba(96, 165, 250, 0.16);
}

.user-name em.super {
  color: #ffd76a;
  background: rgba(251, 191, 36, 0.22);
}

.user-none {
  color: var(--text-3);
  font-size: 12px;
  padding: 0 4px;
}

.user-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.user-acts { display: flex; gap: 6px; flex: 0 0 auto; }

.tiny-btn {
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-2);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.tiny-btn.danger {
  color: #ff96ab;
  border-color: rgba(255, 107, 138, 0.3);
  background: rgba(255, 107, 138, 0.1);
}

.notice-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }

.notice-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.5;
}

.notice-row span { flex: 1 1 auto; word-break: break-word; }

.notice-row button {
  flex: 0 0 auto;
  border: none;
  background: none;
  color: #ff96ab;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  padding: 0 2px;
}

/* 管理员专用：帖子详情里的删除条 */

.admin-bar {
  display: flex;
  gap: 8px;
  margin: 18px 0 4px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 107, 138, 0.28);
}

.admin-bar button {
  flex: 1 1 auto;
  padding: 10px;
  border-radius: 11px;
  border: 1px solid rgba(255, 107, 138, 0.32);
  background: rgba(255, 107, 138, 0.1);
  color: #ff96ab;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
}

.comment-del {
  margin-left: auto;
  border: none;
  background: none;
  color: #ff96ab;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
}

.comment-head { display: flex; align-items: baseline; gap: 8px; }

/* ================= 响应式：平板 / 桌面 ================= */

.sidebar { display: none; }
.right-col { display: none; }

@media (min-width: 900px) {
  body { overflow: hidden; }

  .sidebar {
    display: flex;
    flex-direction: column;
    width: 236px;
    flex: 0 0 236px;
    padding: 24px 16px 18px;
    border-right: 1px solid var(--line);
    background: rgba(8, 10, 16, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .side-brand { padding: 0 10px; margin-bottom: 30px; }

  .side-nav { display: flex; flex-direction: column; gap: 3px; }

  .side-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    border: none;
    background: none;
    color: var(--text-2);
    font-size: 14px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
  }

  .side-item svg { width: 20px; height: 20px; flex: 0 0 auto; }
  .side-item:hover { background: var(--card); color: var(--text); }

  .side-item.active {
    color: #fff;
    background: linear-gradient(120deg, rgba(124, 92, 255, 0.22), rgba(34, 211, 238, 0.08));
    box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.22) inset;
  }

  .side-compose {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    padding: 12px;
    border: none;
    border-radius: 13px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    background: linear-gradient(120deg, #7c5cff, #5b8cff 60%, #22d3ee);
    box-shadow: 0 12px 26px -12px rgba(124, 92, 255, 0.95);
    cursor: pointer;
    transition: transform 0.16s;
  }

  .side-compose:active { transform: scale(0.98); }
  .side-compose svg { width: 17px; height: 17px; }

  .side-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 11px 12px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: background 0.18s;
    min-width: 0;
  }

  .side-user:hover { background: var(--card-2); }
  .side-user .avatar { width: 32px; height: 32px; font-size: 12px; }
  .side-user-main { min-width: 0; }
  .side-name { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-sub { font-size: 11px; color: var(--text-3); }

  .topbar { padding: 20px max(32px, calc((100% - 820px) / 2)) 10px; justify-content: flex-end; }
  .topbar .brand-wrap { display: none; }

  .tabbar { display: none; }

  .page { padding: 0 max(32px, calc((100% - 820px) / 2)); }

  .chat-page.active { padding: 0 max(32px, calc((100% - 820px) / 2)); }
  .chat-head, .chat-list { padding-left: 0; padding-right: 0; }
  .chat-input { padding-left: 0; padding-right: 0; }

  .fab { display: none !important; }

  .post-body { -webkit-line-clamp: 3; }

  .sheet-body,
  .comment-box {
    left: 50%;
    right: auto;
    width: 560px;
    margin-left: -280px;
  }

  .detail-bar { padding: 18px max(32px, calc((100% - 820px) / 2)) 14px; }
  .detail-scroll { padding: 22px max(32px, calc((100% - 820px) / 2)) 32px; }

  .detail-page .comment-box {
    position: static;
    left: auto;
    right: auto;
    width: auto;
    margin-left: 0;
    padding: 12px max(32px, calc((100% - 820px) / 2));
  }

  .toast { bottom: 40px; }
}

@media (min-width: 1200px) {
  .right-col {
    display: flex;
    flex-direction: column;
    width: 304px;
    flex: 0 0 304px;
    /* 顶部要和主列的顶栏对齐：顶栏高约 56px，再加原来 20px 间距。
       之前只写 20px，右栏卡片会顶到窗口最上面，和顶栏错位。 */
    padding: 76px 20px 20px;
    gap: 14px;
    border-left: 1px solid var(--line);
    overflow-y: auto;
    scrollbar-width: none;
  }

  .right-col::-webkit-scrollbar { display: none; }

  .right-card {
    padding: 16px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--line);
  }

  .right-card h3 {
    margin: 0 0 12px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-2);
    letter-spacing: 0.4px;
  }

  .r-notice { padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.045); }
  .r-notice:last-child { border-bottom: none; padding-bottom: 0; }
  .r-notice p { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--text-2); word-break: break-word; }
  .r-notice span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--text-3); }

  .right-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .right-stat { padding: 12px 6px; border-radius: 11px; background: rgba(255, 255, 255, 0.035); text-align: center; }
  .right-stat b { display: block; font-size: 19px; font-weight: 600; letter-spacing: -0.4px; }
  .right-stat span { font-size: 11px; color: var(--text-3); }

  .right-about p { margin: 0 0 8px; font-size: 12px; line-height: 1.65; color: var(--text-3); }
  .right-about p:last-child { margin-bottom: 0; }
}

@media (min-width: 641px) and (max-width: 899px) {
  .page { padding: 0 max(16px, calc((100% - 720px) / 2)); }
  .topbar {
    padding-left: max(18px, calc((100% - 720px) / 2));
    padding-right: max(18px, calc((100% - 720px) / 2));
  }
  .tabbar {
    padding-left: max(4px, calc((100% - 720px) / 2));
    padding-right: max(4px, calc((100% - 720px) / 2));
  }
  .fab { right: max(18px, calc((100% - 720px) / 2)); }
  .post-body { -webkit-line-clamp: 3; }
}



/* ============================================================
   浅色主题（白色底）
   毛玻璃 backdrop-filter 已全部移除 —— 集成显卡上是大面积 blur 导致黑屏的根因
   改用：实色底 + 1px 细边框 + 柔和阴影
   ============================================================ */

html, body {
  background-color: var(--bg);
  background-image:
    radial-gradient(720px 420px at 12% -10%, rgba(109, 92, 255, 0.06), transparent 60%),
    radial-gradient(600px 420px at 100% 0%, rgba(14, 165, 183, 0.05), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
}

.phone { background: transparent; }

.topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.brand {
  background: linear-gradient(118deg, #4b3bd6 0%, #6d5cff 55%, #0ea5b7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub { color: var(--text-3); }

.online {
  background: #f2f4f8;
  border: 1px solid var(--line);
  color: var(--text-2);
}

.post {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 18px -10px rgba(16, 24, 40, 0.10);
}

.post-foot { border-top: 1px solid var(--line); }
.time { color: var(--text-3); }
.post-body { color: var(--text-2); }

.tag-0 { color: #1d4ed8; background: #e8f0fe; }
.tag-1 { color: #5b3bd6; background: #efebff; }
.tag-2 { color: #0e7490; background: #e2f6fa; }
.tag-3 { color: #5f5e5a; background: #f1efe8; }

.cloud {
  background: #f8f9fc;
  border: 1px solid var(--line);
}
.cloud-name { color: var(--text); }
.cloud-meta { color: var(--text-3); }
.cloud-btn {
  color: #4b3bd6;
  background: #efebff;
  border: 1px solid #dcd4ff;
}

.notice {
  background: linear-gradient(118deg, #f2eeff, #e9f7f9);
  border: 1px solid #e2dbff;
}
.notice-icon { color: #6d5cff; }
.notice-track { color: #4b3bd6; }

.chip {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text-2);
}
.chip.active {
  color: #fff;
  background: linear-gradient(120deg, #6d5cff, #4f8bff);
  border-color: transparent;
  box-shadow: 0 6px 16px -8px rgba(109, 92, 255, 0.55);
}

.act { color: var(--text-3); }
.act.on { color: #e5484d; }

.panel input,
.panel textarea,
.field input,
.field textarea,
.chat-input input,
.comment-box input,
.auth-form input {
  background: #f5f6f9;
  border: 1px solid var(--line);
  color: var(--text);
}
.panel input:focus,
.panel textarea:focus,
.field input:focus,
.field textarea:focus,
.chat-input input:focus,
.comment-box input:focus,
.auth-form input:focus {
  border-color: #b9aeff;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(109, 92, 255, 0.12);
}

.tabbar {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.tab { color: var(--text-3); }
.tab.active { color: #5b3bd6; }

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.side-item { color: var(--text-2); }
.side-item:hover { background: #f5f6f9; color: var(--text); }
.side-item.active {
  color: #4b3bd6;
  background: #efebff;
  box-shadow: none;
}
.side-user { background: #f7f8fa; border: 1px solid var(--line); }
.side-user:hover { background: #f2f4f8; }
.side-name { color: var(--text); }
.side-sub { color: var(--text-3); }

.right-card {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}
.right-card h3 { color: var(--text-3); }
.r-notice { border-bottom: 1px solid var(--line); }
.r-notice p { color: var(--text-2); }
.r-stat { background: #f7f8fa; }
.right-about p { color: var(--text-3); }

.sheet-body {
  background: #ffffff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 40px -18px rgba(16, 24, 40, 0.18);
}
.sheet-bar { background: #e2e5ec; }
.sheet-title { color: var(--text); }
.sheet-mask {
  background: rgba(16, 24, 40, 0.32);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* 找回密码弹层在未登录时打开，必须盖在登录层(.auth z-index:70)之上，
   否则用户点了「忘记密码」看不到弹层。只提升这一层，不影响其他 sheet 与 toast。 */
#forgotSheet { z-index: 80; }

.detail-bar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.detail-bar-title { color: var(--text); }
.detail-text { color: #2b303a; }
.detail-meta { border-bottom: 1px solid var(--line); }
.detail-meta-name { color: var(--text); }
.comment { border-bottom: 1px solid var(--line); }
.comment-name { color: var(--text-2); }
.comment-text { color: #2b303a; }
.section-label { color: var(--text-3); }
.section-label::after { background: var(--line); }
.comment-box {
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.chat-input {
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.bubble { background: #f2f4f8; color: var(--text); }
.msg.mine .bubble { background: linear-gradient(128deg, #6d5cff, #4f8bff); color: #fff; }

.profile-card {
  background: linear-gradient(118deg, #f2eeff, #e9f7f9);
  border: 1px solid #e2dbff;
}
.stat { background: #ffffff; border: 1px solid var(--line); }
.stat b { color: var(--text); }
.panel { background: #ffffff; border: 1px solid var(--line); }
.mini-btn {
  color: #4b3bd6;
  background: #efebff;
  border: 1px solid #dcd4ff;
}
.logout-btn {
  color: #d92d36;
  background: #fef2f2;
  border: 1px solid #fad4d4;
}

.user-row { border-bottom: 1px solid var(--line); }
.user-name { color: var(--text); }
.user-meta { color: var(--text-3); }
.user-name em { color: #8a6100; background: #fff4d6; }
.user-name em.banned { color: #b42318; background: #fee4e2; }
.user-name em.self { color: #1d4ed8; background: #e8f0fe; }
.user-name em.super { color: #8a6100; background: #fff4d6; }
.tiny-btn { background: #ffffff; border: 1px solid var(--line-2); color: var(--text-2); }
.tiny-btn.danger { color: #b42318; border-color: #fad4d4; background: #fff5f5; }
.notice-row { background: #f8f9fc; border: 1px solid var(--line); color: var(--text-2); }
.count-tag { color: #5b3bd6; background: #efebff; }
.back-btn { background: #ffffff; border: 1px solid var(--line); color: var(--text-2); }

.cat { background: #f5f6f9; border: 1px solid var(--line); color: var(--text-2); }
.cat.sel { color: #fff; background: linear-gradient(120deg, #6d5cff, #4f8bff); border-color: transparent; }
.link-preview { color: var(--text-3); }
.link-preview.ok { color: #0e7490; }
.link-preview.warn { color: #b45309; }

.auth {
  background:
    radial-gradient(560px 400px at 20% 0%, rgba(109, 92, 255, 0.12), transparent 62%),
    radial-gradient(480px 360px at 96% 96%, rgba(14, 165, 183, 0.10), transparent 62%),
    #f5f6f8;
}
.auth-card {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -28px rgba(16, 24, 40, 0.22), 0 2px 8px rgba(16, 24, 40, 0.04);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.auth-brand {
  background: linear-gradient(118deg, #4b3bd6 0%, #6d5cff 55%, #0ea5b7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-sub { color: var(--text-3); }
.auth-tabs { background: #f2f4f8; }
.auth-tab { color: var(--text-3); }
.auth-tab.active { color: #fff; }
.auth-note { color: var(--text-3); }
.auth-tip { color: #d92d36; }
.hint { color: var(--text-3); }

.toast {
  background: #1f2430;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px -12px rgba(16, 24, 40, 0.45);
}

.admin-bar { border-top: 1px dashed #fad4d4; }
.admin-bar button { color: #b42318; border: 1px solid #fad4d4; background: #fff5f5; }
.comment-del { color: #b42318; }

.empty-mark { color: #d5d9e2; }
.about code { background: #f2f4f8; color: #4b3bd6; }
.color-dot.sel { border-color: #16181d; }

.role-badge {
  color: #8a6100;
  background: #fff4d6;
  border: 1px solid #ffe0a3;
}
.role-badge.super {
  color: #7a4d00;
  background: #ffedbf;
  border-color: #f5cf72;
}

.avatar { box-shadow: 0 2px 6px -2px rgba(16, 24, 40, 0.18); }

body.detail-open .topbar,
body.detail-open .tabbar,
body.detail-open .fab { display: none !important; }

/* lite 模式现在只负责关动画，配色随主题走 */
body.lite .sheet-mask { background: rgba(16, 24, 40, 0.32); }
body.lite .auth { background: #f5f6f8; }
body.lite .toast { background: #1f2430; }

/* 密码重置申请（管理后台） */
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-empty { font-size: 12.5px; color: var(--text-3); padding: 8px 0; }
.req-item {
  padding: 12px;
  border-radius: 12px;
  background: #f8f9fc;
  border: 1px solid var(--line);
}
.req-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.req-head b { font-size: 13.5px; color: var(--text); font-weight: 600; }
.req-head span { font-size: 11.5px; color: var(--text-3); }
.req-time { margin-left: auto; }
.req-line { font-size: 12.5px; color: var(--text-2); line-height: 1.65; word-break: break-word; }
.req-acts { display: flex; gap: 8px; margin-top: 10px; }

.pw-result {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #eefaf2;
  border: 1px solid #b7ebc9;
}
.pw-result-title { font-size: 12.5px; color: #0e6b3d; margin-bottom: 8px; }
.pw-result-code { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pw-result-code code {
  flex: 1 1 auto;
  padding: 9px 11px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid #b7ebc9;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  letter-spacing: 1px;
  color: #0b5c33;
  user-select: all;
}
.pw-result-note { font-size: 11.5px; color: #3f7a58; line-height: 1.55; }

/* ================= iOS / 移动端专项 ================= */

/* iOS Safari（含微信内置）对 font-size < 16px 的输入框，聚焦时会自动放大整个页面，
   而且放大后不会缩回去 —— 这是移动端"点了输入框页面就错位"的根因。
   列表页搜索框、聊天输入框都是 14px，这里统一抬到 16px。 */
@media (max-width: 900px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* 长列表在 iOS 上的滚动惯性（不写这一条，滚动会发涩、像卡住） */
.feed,
.chat-list,
.sheet-list,
.req-list,
.admin-users {
  -webkit-overflow-scrolling: touch;
}

/* 阻止 iOS 整页下拉橡皮筋：页面本身是固定高度、内部区域各自滚动 */
html, body {
  overscroll-behavior-y: none;
}

/* 触控目标：可点的图标按钮在手机上至少 40px 高，避免点不中 */
@media (max-width: 900px) {
  .chip,
  .mini-btn,
  .link-btn {
    min-height: 36px;
  }
}

/* ================= 课程表 =================
   列数由 JS 写进 --sch-days（6 或 7），行数是「表头 1 行 + 13 节课」。
   颜色全部走主题变量，深色/浅色两套都不用单独改。 */
#workSchedule { padding-bottom: 96px; }

.sch-head { padding: 14px 16px 4px; }
.sch-title h2 { margin: 0; font-size: 19px; font-weight: 500; color: var(--text); }
.sch-sub { margin: 4px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.6; }

.sch-weeks {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 0 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sch-weeks::-webkit-scrollbar { display: none; }

.sch-chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1;
}
.sch-chip.on {
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
}

.sch-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 10px; }
.sch-btn {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
}
.sch-btn.ghost { color: var(--text-3); }

.sch-imgwrap {
  margin: 0 16px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card-2);
}
.sch-imgwrap img { display: block; width: 100%; }
.sch-imgbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}
.sch-imgbar .sch-btn { padding: 6px 12px; font-size: 12px; }
.sch-imgbar .sch-imgtip { padding: 0; flex: 1 1 160px; }
.sch-imgtip {
  display: block;
  padding: 6px 10px;
  font-size: 11.5px;
  color: var(--text-3);
}

.sch-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 10px;
}
.sch-arrow {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  font-size: 17px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sch-week {
  min-width: 92px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
}
.sch-term {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}
.sch-term input {
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  font-size: 11.5px;
  width: 110px;
}

.sch-scroll { overflow-x: auto; padding: 0 12px; -webkit-overflow-scrolling: touch; }

.sch-grid {
  display: grid;
  grid-template-columns: 34px repeat(7, minmax(84px, 1fr));
  grid-template-rows: 40px repeat(13, 54px);
  gap: 4px;
  min-width: 680px;
}

.sch-corner,
.sch-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 12px;
  color: var(--text-3);
  background: var(--card-2);
  border-radius: 10px;
}
.sch-day b { font-weight: 500; color: var(--text-2); font-size: 12px; }
.sch-day i { font-style: normal; font-size: 10.5px; color: var(--text-3); }
.sch-period {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  color: var(--text-3);
}

.sch-slot { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sch-card {
  flex: 1 1 0;
  min-height: 0;
  padding: 5px 7px;
  border-radius: 8px;
  border: none;
  border-left: 3px solid transparent;
  overflow: hidden;
}
.sch-card b {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.25;
  word-break: break-word;
}
.sch-card span {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  line-height: 1.3;
  opacity: 0.85;
  word-break: break-word;
}

.sch-grid-empty {
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  min-width: 0;
}
.sch-tip { padding: 44px 12px; text-align: center; color: var(--text-3); }
.sch-tip b { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text); }
.sch-tip span { font-size: 12.5px; line-height: 1.7; }

/* 课程表单：节次两个输入框并排 */
.cs-range { display: flex; align-items: center; gap: 8px; }
.field .cs-range input {
  width: 78px;
  text-align: center;
}
.cs-range em { font-style: normal; font-size: 12px; color: var(--text-3); }
.cs-del { width: 100%; margin-top: 10px; }

/* 课表：粘贴导入区 */
.sch-paste { padding: 0 16px 12px; }
.sch-paste textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
  resize: vertical;
}
.sch-pastebar { display: flex; gap: 8px; margin-top: 8px; }

/* 后台设置里的下拉框，跟输入框一个观感 */
.field select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  appearance: none;
  -webkit-appearance: none;
}

/* 「我的 - 关于」最下面的版本号：部署后一眼就能看到自己升上去没有 */
.build-tag {
  margin: 10px 0 0 !important;
  font-size: 11.5px !important;
  color: var(--text-3) !important;
  letter-spacing: 0.3px;
}

/* 微信通知面板 */
.push-hint {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-3);
}

/* ============ 附件（发帖时的图片 / 文件） ============ */
.attach-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.attach-list { display: flex; flex-direction: column; gap: 6px; }
.attach-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
}
.attach-item img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 7px;
  flex: 0 0 auto;
}
.attach-item i { font-style: normal; font-size: 20px; width: 38px; text-align: center; }
.attach-meta { flex: 1 1 auto; min-width: 0; }
.attach-meta b {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-meta em { font-style: normal; font-size: 11px; color: var(--text-3); }
.attach-del {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-3);
  font-size: 15px;
  line-height: 1;
}

/* 帖子里的图片和文件卡片 */
.post-imgwrap { display: block; margin: 8px 0; }
.post-img {
  display: block;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.post-file {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  text-decoration: none;
  color: var(--text);
}
.post-file i { font-style: normal; font-size: 18px; }
.post-file b {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-file em { font-style: normal; font-size: 11.5px; color: var(--text-3); flex: 0 0 auto; }

/* 聊天室的附件按钮 + 气泡里的图片/文件 */
.chat-attach {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  user-select: none;
}
.bubble .post-imgwrap { margin: 4px 0 0; }
.bubble .post-img { max-width: 190px; border-radius: 10px; }
.bubble .post-file { margin: 4px 0 0; padding: 8px 10px; }
.bubble .post-file b { font-size: 12.5px; }


/* ================= 全站界面优化（2026-11-27） ================= */

/* iOS 上输入框字号小于 16px 会自动放大页面，这里统一顶到 16px */
html { -webkit-text-size-adjust: 100%; }
@media (max-width: 900px) {
  .field input,
  .field textarea,
  .field select,
  .panel input,
  .panel textarea,
  .chat-input input,
  .comment-box input,
  .auth-form input,
  .sch-paste textarea,
  .cs-range input,
  .sch-term input {
    font-size: 16px;
  }
}

/* 图片灯箱：帖子/聊天里的图片点开原地放大 */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 10, 16, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.img-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
}
.img-lightbox-close {
  position: absolute;
  top: calc(14px + var(--safe-t));
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* 列表里的帖子：图片当缩略图用，别一张图占满整屏（详情页保持原样） */
.post-body .post-img {
  max-height: 220px;
  object-fit: cover;
}
.post-body { word-break: break-word; }
.detail-text .post-img { max-height: none; }

/* 我的页：清缓存那块的提示文案紧一点 */
#panelCache .mini-btn { margin-top: 2px; }

/* ================= 视觉优化 0.0.0.4（2026-11-27） ================= */

/* 1) 底部导航：从"贴边一条"改成悬浮胶囊 + 毛玻璃 */
.tabbar {
  margin: 0 12px calc(10px + var(--safe-b));
  padding: 6px 4px;
  border-top: none;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow: 0 12px 30px -14px rgba(20, 24, 40, 0.3), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.tab {
  border-radius: 14px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.tab:active { transform: scale(0.94); }
.tab.active { background: rgba(109, 92, 255, 0.1); }

/* 2) 切页轻淡入，别硬生生跳出来 */
/* 页面切换：从右/从左平移进来（跟着标签顺序走），不再用上下淡入 */
@keyframes sgSlideFromRight {
  from { opacity: 0.35; transform: translate3d(16%, 0, 0); }
  to   { opacity: 1;    transform: translate3d(0, 0, 0); }
}
@keyframes sgSlideFromLeft {
  from { opacity: 0.35; transform: translate3d(-16%, 0, 0); }
  to   { opacity: 1;    transform: translate3d(0, 0, 0); }
}
.page.active { animation: sgSlideFromRight 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
.page.active.slide-l { animation-name: sgSlideFromLeft; }
.page.active.slide-r { animation-name: sgSlideFromRight; }
/* 只做「新页滑入」；旧页不留在场上（那套 leaving 动画会导致快速切页出鬼影，已移除） */
.page.active { z-index: 2; }

/* 系统开了「减弱动态效果」就不动 */
@media (prefers-reduced-motion: reduce) {
  .page.active, .page.active.slide-l, .page.active.slide-r { animation: none; }
}

/* 3) 卡片层次：标题更立、阴影分两级、按下有回弹 */
.post {
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}
.post:active { transform: scale(0.994); }
.post-title { letter-spacing: -0.01em; }
.panel {
  transition: box-shadow 0.22s ease;
}

/* 4) 顶部栏：底部一条极淡的分隔光，滚动时不会糊成一片 */
.topbar {
  box-shadow: 0 1px 0 rgba(20, 24, 40, 0.06);
}

/* 5) 按钮统一过渡，点下去有反馈 */
.mini-btn,
.sch-btn,
.send-btn,
.submit-btn,
.act {
  transition: transform 0.16s ease, background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.mini-btn:active,
.sch-btn:active,
.send-btn:active,
.submit-btn:active { transform: scale(0.97); }

/* 6) 尊重"减少动效"系统设置 */
@media (prefers-reduced-motion: reduce) {
  .page.active { animation: none; }
  .tab, .post, .mini-btn, .sch-btn, .send-btn, .submit-btn, .act { transition: none; }
}

/* ================= 我的工作台 ================= */
.work-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 10px;
}
.work-top b { font-size: 15px; }
.work-back {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  border-radius: 10px;
  padding: 5px 10px;
  font-size: 13px;
  font-family: inherit;
}
.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.work-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
}
.work-card span { display: block; font-size: 12px; color: var(--text-3); }
.work-card b { display: block; font-size: 22px; margin-top: 4px; letter-spacing: -0.02em; }
.work-card em { font-style: normal; font-size: 12px; color: var(--text-3); margin-left: 3px; }

.work-done {
  margin: 8px 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  font-size: 13px;
}

/* 打卡热力图：13 列 × 7 行 */
.heat {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 14px);
  grid-auto-columns: 14px;
  gap: 4px;
  padding: 2px 0 6px;
}
.heat i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #eceef3;
}
.heat i.on { background: #2fbf5b; }
.heat i.today { box-shadow: 0 0 0 2px #f59e0b inset; }
.work-legend { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.work-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.work-legend .hl-on { background: #2fbf5b; }
.work-legend .hl-today { background: #eceef3; box-shadow: 0 0 0 2px #f59e0b inset; }

/* 列表项（笔记 / 倒计时） */
.work-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 10px;
}
.work-item h4 { margin: 0 0 4px; font-size: 14px; }
.work-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.work-item .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
}
.work-item .ops button {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text-2);
  border-radius: 8px;
  font-size: 12px;
  padding: 4px 9px;
  margin-left: 6px;
  font-family: inherit;
}
.work-item .big { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.work-item .big small { font-size: 12px; font-weight: 400; color: var(--text-3); margin-left: 4px; }
.work-empty { text-align: center; color: var(--text-3); font-size: 13px; padding: 18px 0; }

/* ================= 头像图片 / 资料弹层 / 功能键 ================= */
.avatar { overflow: hidden; }
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
#topAvatar, #myAvatar, #sideAvatar { cursor: pointer; }

/* 我的页：6 格（4 个数据 + 工作台 + 清缓存） */
.stats-6 { grid-template-columns: repeat(3, 1fr); }
.stats-6 .stat { padding: 12px 6px; }
.stat-act { cursor: pointer; }
.stat-act .act-t { font-size: 15px !important; letter-spacing: 0; }
.stat-act:active { transform: scale(0.97); }

/* 编辑资料弹层 */
.pf-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.pf-ops { display: flex; flex-direction: column; gap: 8px; }
.pf-ops .mini-btn { text-align: center; }

/* ================= 工作台：待办 / 番茄钟 / 片段 ================= */
.todo-group {
  font-size: 12px;
  color: var(--text-3);
  margin: 12px 2px 6px;
}
.todo-progress {
  font-size: 12.5px;
  color: var(--brand);
  background: rgba(109, 92, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 4px;
}
.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.todo-item.done .todo-txt { color: var(--text-3); text-decoration: line-through; }
.todo-box {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.todo-item.done .todo-box { background: #2fbf5b; border-color: #2fbf5b; }
.todo-txt { flex: 1 1 auto; font-size: 13.5px; word-break: break-word; }
.todo-carry {
  font-style: normal;
  font-size: 10.5px;
  color: #d97706;
  background: rgba(217, 119, 6, 0.12);
  border-radius: 6px;
  padding: 1px 5px;
  margin-left: 6px;
}
.todo-del {
  flex: 0 0 auto;
  border: none;
  background: none;
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
}

/* 番茄钟 */
.focus-clock {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 12px;
  color: var(--text);
}
.focus-pick { display: flex; gap: 8px; margin: 10px 0 12px; }
.focus-sum { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); margin-bottom: 10px; }
.focus-num b { font-size: 17px; color: var(--text); }
.focus-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 92px;
  padding: 0 2px;
}
.fbar { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.fbar i { width: 100%; max-width: 22px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #7c5cff, #5b8cff); }
.fbar span { font-size: 10px; color: var(--text-3); margin-top: 2px; min-height: 12px; }
.fbar em { font-style: normal; font-size: 10px; color: var(--text-3); }

/* 代码片段 */
.snip-lang {
  font-size: 11px;
  color: #5b3bd6;
  background: rgba(109, 92, 255, 0.1);
  border-radius: 6px;
  padding: 2px 7px;
}
.snip-code {
  margin: 6px 0 0;
  padding: 10px;
  background: #f6f7fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ================= 举报 ================= */
.warn-badge {
  font-size: 11px;
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
  border-radius: 6px;
  padding: 1px 6px;
}
.detail-report {
  display: flex;
  justify-content: flex-end;
  padding: 10px 0 4px;
}
.report-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-3);
  border-radius: 9px;
  font-size: 12px;
  padding: 5px 12px;
  font-family: inherit;
}
.report-btn:active { transform: scale(0.97); }

/* ================= 个人主页 ================= */
.u-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 15px;
  margin-bottom: 12px;
}
.u-main { flex: 1 1 auto; min-width: 0; }
.u-name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.u-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.u-tag {
  font-size: 11px;
  color: #5b3bd6;
  background: rgba(109, 92, 255, 0.1);
  border-radius: 6px;
  padding: 2px 7px;
}
.u-tag.ghost { color: var(--text-3); background: var(--card-2, #f4f5f9); }
.u-tag.ok { color: #15803d; background: rgba(34, 197, 94, 0.12); }
.u-bio {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
  word-break: break-word;
}

/* ICP 备案号（合规：必须展示并链接工信部） */
.icp { margin-top: 6px; }
.icp a {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: none;
}
.icp a:hover { text-decoration: underline; }

/* ================= 底部导航兜底：永远贴在屏幕最下面 =================
   症状：装成桌面应用后，底栏被内容顶到可视区外（只露出一条边）。
   原因：PWA 独立窗口的可视高度和 100dvh 有偏差，流式布局的底栏会被裁掉。
   处理：窄屏下把底栏改成 fixed，同时给页面补底部留白，内容不会被挡。 */
@media (max-width: 900px) {
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding-bottom: calc(8px + var(--safe-b));
  }
  .page {
    padding-bottom: calc(78px + var(--safe-b));
  }
  /* 底栏大约 62~70px + 安全区，悬浮钮再留出 12px 呼吸，
     之前写 92px 在小屏上会压住「我的」那一格 */
  .fab {
    bottom: calc(122px + var(--safe-b)) !important;
    right: 16px !important;
  }
}

/* ================= 手机/PWA：上下安全区改成浅色 =================
   原来 html/body 是深色底（#04050a），在装机后的独立窗口里，
   顶部状态栏和底部手势条那两条会露出深色，跟浅色页面割裂。
   这里把窄屏下的页面底色改成和内容一致的浅灰。 */
@media (max-width: 900px) {
  html, body {
    background: #f5f6f8 !important;
    background-image: none !important;
  }
}

/* ================= 底栏改成纯白不透明 =================
   之前是 rgba(255,255,255,.96) + 模糊，滚动时下面的卡片会隐隐透出来，
   看着像"糊了一层"。这里改成实心白，并把底部安全区也刷白。 */
@media (max-width: 900px) {
  .tabbar {
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-top: 1px solid #eceef4;
    box-shadow: 0 -6px 18px -14px rgba(20, 24, 40, 0.35);
  }
  html, body {
    background: #ffffff !important;
    background-image: none !important;
  }
}

/* ================= 三端通用硬化 ================= */
/* iOS 上 body 回弹会把固定底栏带歪，锁掉纵向过度滚动 */
html, body { overscroll-behavior-y: contain; }
/* 装成应用后禁用文字选中拖拽（像原生 App），但输入框仍然能选 */
body { -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable], .post-text, .detail-text, .work-item p { -webkit-user-select: text; user-select: text; }

/* ================= 底栏改为通栏贴底，彻底没有缝 =================
   之前底栏是"悬浮胶囊"（margin:0 12px 10px + 圆角），
   那条 10px 外边距会把滚动中的卡片露出来，看着像底栏被切了一刀。
   这里改成通栏贴到底：无外边距、无圆角、实心白，底下的内容一律被盖住。 */
@media (max-width: 900px) {
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    border-top: 1px solid #eceef4 !important;
    background: #ffffff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: 0 -8px 20px -16px rgba(20, 24, 40, 0.4) !important;
    padding: 8px 4px calc(8px + var(--safe-b)) !important;
    z-index: 30;
  }
}

/* ================= 移动端最后一批硬化 ================= */
/* 1) iOS Safari：输入框字号 < 16px 时，聚焦会自动把整页放大 —— 这是最烦人的体验 bug。
      统一提到 16px，页面就不会乱跳。 */
@media (max-width: 900px) {
  input,
  textarea,
  select,
  .panel input,
  .panel textarea,
  .field input,
  .field textarea,
  .row input {
    font-size: 16px !important;
  }
}

/* 2) 横屏/旋转时禁止系统自动放大文字 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* 3) 去掉移动端点击延迟（300ms），按钮跟手一点 */
body {
  touch-action: manipulation;
}

/* 4) 图片/视频不许撑破容器 */
img, video, canvas, svg { max-width: 100%; }

/* ================= 弹层：按钮露不出来 + 滚动不跟手 =================
   两个问题一起治：
   1) .sheet-body 的 max-height 是 92%（按父容器算），装机后窗口高度和可视区不一致，
      底部「发布/保存」就被推到屏幕外 —— 改成按动态视口高度算，并留够底部安全区。
   2) 遮罩上的 backdrop-filter: blur 会盖住整屏，手机 GPU 扛不住，
      滑动时明显掉帧（不跟手）—— 去掉毛玻璃，改成纯半透明。 */
.sheet-body {
  max-height: calc(100dvh - 88px) !important;
  padding-bottom: calc(30px + var(--safe-b)) !important;
  overscroll-behavior: contain;
}

.sheet-mask {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(15, 18, 30, 0.46) !important;
}

/* 提交按钮吸底：滚到哪都能按到 */
#composeSheet .submit-btn,
#authSheet .submit-btn,
#profileSheet .submit-btn {
  position: sticky;
  bottom: 2px;
  z-index: 2;
}

/* ================= 桌面宽屏：工作台数据条改成 4 列 =================
   2 列时每张卡拉到 500px 宽，数字孤零零浮在中间，很空。 */
@media (min-width: 900px) {
  .work-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   第五轮修复（2026-11-30 夜间）—— 来自实际测量的 5 个问题
   ============================================================ */

/* ① 聊天室输入框被底部导航盖住（严重）
   .chat-page.active 把 padding 清成 0，composer 直接贴到视口底部，
   而 tabbar 现在是 position:fixed 盖在上面 → 手机上根本点不到输入框。 */
.chat-page.active {
  padding-bottom: calc(62px + var(--safe-b)) !important;
}

/* ② 悬浮发帖钮压住卡片右侧的「浏览/点赞/评论」
   缩小 + 滚动态半透明，避免挡住操作；列表底部也留出位置。 */
@media (max-width: 900px) {
  .fab {
    width: 50px;
    height: 50px;
    bottom: calc(128px + var(--safe-b)) !important;
    right: 14px !important;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .fab.dim {
    opacity: 0.34;
    transform: scale(0.88);
  }
  .page {
    padding-bottom: calc(132px + var(--safe-b)) !important;
  }
}

/* ③ 320 窄屏品牌区折行：「拾光」竖排、「学习社区」断开
   禁止换行 + 不许被压缩；极窄屏干脆把副标题藏掉。 */
.brand,
.brand-sub {
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 344px) {
  .brand-sub { display: none; }
}

/* ④ 卡片头部：置顶 + 分类挤到左侧一组，时间自己靠右
   原来是 space-between，分类标签被居中悬空，读起来不像一组。 */
.post-head {
  justify-content: flex-start !important;
  gap: 8px !important;
}
.post-head .time {
  margin-left: auto;
}

/* ⑤ 公告跑马灯左右硬切 → 两端加渐隐遮罩 */
.notice-view {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
}

/* ================= 弹层：改成"视口级"定位，彻底解决底部被裁 =================
   症状：发帖/编辑弹层最下面的「保存修改」永远只露一条边，怎么滚都下不去。
   根因：.sheet 是 position:absolute，定位基准是 .phone；
         装机后 .phone 的高度可能比"看得见的区域"更高，于是 bottom:0 落在屏幕外。
   处理：把 .sheet 改成 position:fixed（相对视口），里面的 max-height 也跟着按视口算。 */
.sheet {
  position: fixed !important;
  inset: 0 !important;
}

.sheet-body {
  max-height: calc(100dvh - 88px) !important;
  /* 底部留出安全区 + 一点点余量，按钮不会贴着屏幕边缘 */
  padding-bottom: calc(34px + var(--safe-b)) !important;
  overscroll-behavior: contain;
}

/* 提交按钮吸底并给个实底，滚到哪都能看见、都能点 */
#composeSheet .sheet-body > form > .submit-btn,
#composeSheet .submit-btn {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 3;
}
