/* ============================================================
   塔里木高级中学校园墙 · 样式
   色彩与图形语言提取自校徽 塔高.png
   ============================================================ */

:root {
  --blue-900: #0B2559;
  --blue-800: #102E6B;
  --blue-700: #143C8C;
  --blue-600: #1A4FA8;
  --blue-500: #2B63BE;

  --cyan-700: #0A6E8C;
  --cyan-600: #008CB4;
  --cyan-500: #1B8FB5;
  --cyan-400: #46A9C1;
  --cyan-200: #A0C8DC;
  --cyan-100: #D6EAF1;
  --cyan-50: #EDF5F9;

  --gold-700: #A87833;
  --gold-600: #C89545;
  --gold-500: #DCB567;
  --gold-300: #EBD3A3;
  --gold-100: #F9F2E2;

  --ink-900: #141A26;
  --ink-700: #2C3444;
  --ink-500: #4A5568;
  --ink-400: #6B7688;
  --ink-300: #98A2B3;
  --line: #E3E9F2;
  --bg: #F4F7FB;
  --white: #FFFFFF;

  --like: #E4586B;
  --success: #2E9E6B;
  --danger: #D64545;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 3px rgba(16, 46, 107, .07), 0 6px 16px -8px rgba(16, 46, 107, .12);
  --shadow-float: 0 6px 20px rgba(16, 46, 107, .22), 0 2px 6px rgba(16, 46, 107, .14);

  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --topbar-h: 56px;
  --tabbar-h: 60px;
}

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

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-900);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

/* ============================================================
   基础组件
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan-600), var(--blue-700));
  color: #fff;
  box-shadow: 0 4px 14px -3px rgba(20, 60, 140, .45);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 20px -3px rgba(20, 60, 140, .55); }

.btn-ghost {
  background: var(--cyan-50);
  color: var(--cyan-700);
  border: 1px solid var(--cyan-100);
}
.btn-ghost:hover { background: var(--cyan-100); }

.btn-plain { color: var(--ink-500); }
.btn-plain:hover { color: var(--ink-700); }

.btn-danger { background: #FDF0F0; color: var(--danger); border: 1px solid #F7DADA; }

.input {
  width: 100%;
  height: 44px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1.5px solid var(--line);
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.input:focus {
  border-color: var(--cyan-400);
  box-shadow: 0 0 0 3px rgba(70, 169, 193, .16);
}
.input::placeholder { color: var(--ink-300); }

textarea.input {
  height: auto;
  padding: 12px 15px;
  line-height: 1.7;
  resize: vertical;
  min-height: 110px;
}

.field { margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-400);
  margin-bottom: 7px;
  letter-spacing: .3px;
}
.field-hint {
  font-size: 11.5px;
  color: var(--ink-300);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-400), var(--blue-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex: 0 0 auto;
  user-select: none;
}
.avatar-xs { width: 22px; height: 22px; font-size: 10px; }
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-md { width: 38px; height: 38px; font-size: 15px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-dark {
  border-color: var(--line);
  border-top-color: var(--cyan-600);
}
@keyframes spin { to { transform: rotate(360deg); } }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   外壳布局
   ============================================================ */

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300) 18%, var(--cyan-400) 45%, var(--blue-700) 76%, var(--gold-500));
  opacity: .8;
  pointer-events: none;
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 0 1 auto; }
.brand-logo { width: 30px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.brand-text { min-width: 0; overflow: hidden; }
.brand-name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--blue-700);
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 手机屏幕放不下英文全称，先藏起来，平板以上再显示 */
.brand-sub {
  display: none;
  font-size: 10px;
  color: var(--ink-300);
  letter-spacing: .4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-search {
  display: none;
  align-items: center;
  gap: 8px;
  width: 280px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-300);
  font-size: 12.5px;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-400);
  transition: background .16s ease, color .16s ease;
}
.icon-btn:hover { background: var(--cyan-50); color: var(--blue-700); }
.back-btn { margin-left: -8px; margin-right: -2px; }

.shell {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.page {
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: calc(var(--tabbar-h) + 24px);
}

/* 详情页不显示底部导航，评论栏自己贴着屏幕底边，不需要再留导航高度 */
.page-detail { padding-bottom: 0; }

.sidebar, .rightbar { display: none; }

/* ============================================================
   话题胶囊
   ============================================================ */

.chips {
  display: flex;
  gap: 8px;
  padding: 12px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg);
  position: sticky;
  top: var(--topbar-h);
  z-index: 40;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--white);
  color: var(--ink-500);
  border: 1px solid var(--line);
  transition: all .16s ease;
}
.chip:hover { border-color: var(--cyan-200); color: var(--cyan-700); }
.chip.active {
  background: var(--blue-700);
  color: #fff;
  border-color: var(--blue-700);
  font-weight: 600;
  box-shadow: 0 3px 10px -2px rgba(20, 60, 140, .4);
}

/* ============================================================
   信息流
   ============================================================ */

.feed {
  display: flex;
  gap: 10px;
  padding: 0 12px 12px;
  align-items: flex-start;
}
.feed-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s ease, transform .2s ease;
  cursor: pointer;
}
.card:hover {
  box-shadow: 0 4px 10px rgba(16,46,107,.1), 0 14px 30px -12px rgba(16,46,107,.24);
}

/* 用 aspect-ratio + 绝对定位让图片真正填满容器。
   早先用 padding-bottom 撑高度，img 的 height:100% 并不等于容器内容高度，
   结果图片只占一半、下面露出底色。 */
.card-media {
  position: relative;
  width: 100%;
  background: var(--cyan-100);
  overflow: hidden;
}
.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.card:hover .card-media img { transform: scale(1.03); }

.card-badge {
  position: absolute;
  left: 8px; top: 8px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: rgba(11, 37, 89, .62);
  backdrop-filter: blur(6px);
}
.card-badge.hot {
  background: linear-gradient(135deg, var(--gold-600), var(--gold-500));
  color: #3A2408;
}

.card-text-only {
  padding: 14px 13px 12px;
  background: linear-gradient(150deg, var(--cyan-50), #fff 66%);
  border-left: 3px solid var(--cyan-400);
}
.card-quote {
  font-size: 19px;
  line-height: .7;
  color: var(--cyan-200);
  font-family: Georgia, serif;
  margin-bottom: 3px;
}
.card-text-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink-900);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-text-excerpt {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-500);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body { padding: 9px 11px 10px; }
.card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink-900);
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-400);
}
.card-meta .name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.stat.liked { color: var(--like); font-weight: 600; }

/* 骨架屏 */
.skeleton {
  background: linear-gradient(100deg, #EDF1F7 30%, #F7FAFD 50%, #EDF1F7 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: 6px;
}
@keyframes shimmer {
  from { background-position: 180% 0; }
  to { background-position: -80% 0; }
}
.skeleton-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.skeleton-card .s-img { height: 150px; }
.skeleton-card .s-line { height: 11px; margin: 9px 11px 0; }
.skeleton-card .s-line.short { width: 55%; margin-bottom: 11px; }

/* 空状态 */
.empty {
  text-align: center;
  padding: 56px 24px 60px;
  color: var(--ink-400);
}
.empty-art { width: 128px; margin: 0 auto 18px; opacity: .9; }
.empty h3 { font-size: 15px; font-weight: 700; color: var(--ink-700); margin-bottom: 7px; }
.empty p { font-size: 12.5px; line-height: 1.7; color: var(--ink-300); }

.load-more {
  display: flex;
  justify-content: center;
  padding: 18px 0 10px;
}

/* ============================================================
   悬浮按钮与底部导航（手机）
   ============================================================ */

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--cyan-600), var(--blue-700));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-float);
  z-index: 55;
  transition: transform .16s ease;
}
.fab:active { transform: scale(.93); }
.fab::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-500);
  opacity: .5;
  pointer-events: none;
}

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 58;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  color: var(--ink-300);
  transition: color .16s ease;
  position: relative;
}
.tab.active { color: var(--blue-700); font-weight: 600; }
.tab.active::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 2.5px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--cyan-600), var(--blue-700));
}

/* ============================================================
   详情页
   ============================================================ */

.detail { background: var(--white); min-height: 100%; }
.detail-hero { position: relative; background: #0B2559; }
.detail-hero img { width: 100%; max-height: 62vh; object-fit: contain; background: #0B2559; }

.gallery { position: relative; }
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  background: #0B2559;
}
.gallery-slide img { width: 100%; max-height: 62vh; object-fit: contain; }
.gallery-dots {
  position: absolute;
  bottom: 10px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
}
.gallery-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  transition: all .2s ease;
}
.gallery-dot.on { background: #fff; width: 16px; border-radius: 3px; }

.detail-body { padding: 16px 16px 0; }
.detail-topic {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--cyan-50);
  color: var(--cyan-700);
  border: 1px solid var(--cyan-100);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.detail-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: .2px;
  color: var(--ink-900);
}
.detail-author {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.detail-author .info { flex: 1 1 auto; min-width: 0; }
.detail-author .n { font-size: 13px; font-weight: 600; color: var(--ink-900); }
.detail-author .m { font-size: 11px; color: var(--ink-300); margin-top: 2px; }

.detail-text {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink-700);
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.action {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-400);
  transition: color .16s ease, transform .16s ease;
}
.action:hover { color: var(--ink-700); }
.action.liked { color: var(--like); }
.action.liked svg { fill: var(--like); }
.action:active { transform: scale(.94); }
.action.push-right { margin-left: auto; }

@keyframes likePop {
  0% { transform: scale(1); }
  38% { transform: scale(1.42); }
  62% { transform: scale(.92); }
  100% { transform: scale(1); }
}
.like-pop { animation: likePop .42s cubic-bezier(.28,.9,.4,1.2); }

/* ============================================================
   评论
   ============================================================ */

.comments { padding: 4px 16px 120px; }
.comments-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 16px 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
}
.comments-head span { font-size: 11.5px; font-weight: 500; color: var(--ink-300); }

.comment {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #F0F4F9;
}
.comment:last-child { border-bottom: 0; }
.comment.reply { padding-left: 38px; }
.comment-main { flex: 1 1 auto; min-width: 0; }
.comment-top {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.comment-name { font-size: 12px; font-weight: 600; color: var(--ink-500); }
.comment-class { font-size: 10.5px; color: var(--ink-300); }
.comment-time { font-size: 10.5px; color: var(--ink-300); margin-left: auto; flex: 0 0 auto; }
.comment-text {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-700);
  margin-top: 4px;
  word-break: break-word;
}
.comment-reply-hi { color: var(--cyan-600); font-weight: 500; }
.comment-ops {
  display: flex;
  gap: 14px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-300);
}
.comment-ops button:hover { color: var(--cyan-700); }

.comment-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 56;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px calc(9px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.comment-bar .input { height: 38px; border-radius: var(--radius-pill); background: var(--bg); }
.comment-bar .send {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 17px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--cyan-600), var(--blue-700));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.comment-bar .send:disabled { opacity: .45; }
.reply-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px;
  font-size: 11.5px;
  color: var(--cyan-700);
}
.reply-hint button { color: var(--ink-300); }

/* ============================================================
   发布页
   ============================================================ */

.publish { padding: 16px 16px 140px; max-width: 640px; margin: 0 auto; }

.grid9 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}
.cell img { width: 100%; height: 100%; object-fit: cover; }
.cell .del {
  position: absolute;
  right: 4px; top: 4px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(11,37,89,.72);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.cell-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1.4px dashed var(--cyan-200);
  background: var(--cyan-50);
  color: var(--cyan-600);
  font-size: 10.5px;
  transition: all .16s ease;
}
.cell-add:hover { border-color: var(--cyan-400); background: var(--cyan-100); }
.cell-add:disabled { opacity: .5; cursor: not-allowed; }

.anon-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.anon-row .t { flex: 1 1 auto; }
.anon-row .t b { display: block; font-size: 13px; font-weight: 600; color: var(--ink-700); }
.anon-row .t span { display: block; font-size: 11px; color: var(--ink-300); margin-top: 2px; }

.tip {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--gold-100);
  border: 1px solid var(--gold-300);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--gold-700);
  margin-bottom: 20px;
}
.tip b { font-weight: 700; }

.publish-actions { display: flex; gap: 10px; }
.publish-actions .btn { flex: 1 1 auto; height: 44px; }

/* ============================================================
   个人中心
   ============================================================ */

.profile { padding: 0 0 100px; }

.profile-head {
  background:
    radial-gradient(700px 300px at 82% -20%, rgba(220,181,103,.28), transparent 62%),
    linear-gradient(150deg, var(--blue-800), var(--blue-700) 58%, var(--blue-600));
  padding: 26px 18px 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.profile-head::after {
  content: "1960";
  position: absolute;
  right: 16px; bottom: -14px;
  font-size: 62px;
  font-weight: 700;
  font-family: Consolas, monospace;
  letter-spacing: 3px;
  color: rgba(255,255,255,.06);
  pointer-events: none;
}
.profile-row { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.profile-avatar {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.42);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex: 0 0 auto;
}
.profile-id { flex: 1 1 auto; min-width: 0; }
.profile-name { font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.profile-meta { font-size: 12px; color: rgba(255,255,255,.72); margin-top: 4px; }

.profile-stats {
  display: flex;
  gap: 26px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}
.profile-stat .n { font-size: 18px; font-weight: 700; }
.profile-stat .l { font-size: 11px; color: rgba(255,255,255,.66); margin-top: 1px; }

.profile-tabs {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: var(--topbar-h);
  z-index: 40;
}
.profile-tab {
  flex: 1 1 0;
  padding: 14px 0 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-400);
  position: relative;
  transition: color .16s ease;
}
.profile-tab.active { color: var(--blue-700); font-weight: 700; }
.profile-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, var(--cyan-600), var(--blue-700));
}

.profile-list { padding: 12px 14px 20px; }
.mine-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
  cursor: pointer;
}
.mine-thumb {
  width: 78px; height: 78px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--cyan-50);
  display: flex; align-items: center; justify-content: center;
  color: var(--cyan-200);
}
.mine-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mine-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.mine-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mine-meta {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-300);
}

.settings-list {
  padding: 14px;
}
.setting-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 14px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--ink-700);
}
.setting-item .si-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--cyan-50);
  color: var(--cyan-700);
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.setting-item .si-text { flex: 1 1 auto; }
.setting-item .si-sub { font-size: 11px; color: var(--ink-300); margin-top: 2px; }

/* ============================================================
   登录页
   ============================================================ */

.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background:
    radial-gradient(900px 460px at 12% -10%, rgba(0, 140, 180, .3), transparent 62%),
    radial-gradient(800px 420px at 92% 8%, rgba(220, 181, 103, .16), transparent 60%),
    linear-gradient(160deg, #0B2559 0%, #102E6B 48%, #143C8C 100%);
}
.login-card {
  width: 100%;
  max-width: 372px;
  background: var(--white);
  border-radius: 22px;
  padding: 34px 26px 30px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .45);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--cyan-400) 46%, var(--blue-700));
}
.login-logo { width: 62px; margin: 0 auto 14px; }
.login-title {
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--blue-700);
  letter-spacing: .4px;
}
.login-sub {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-300);
  margin: 6px 0 24px;
  letter-spacing: .3px;
}
.login-error {
  padding: 9px 13px;
  border-radius: 9px;
  background: #FDF0F0;
  border: 1px solid #F7DADA;
  color: var(--danger);
  font-size: 12.5px;
  margin-bottom: 14px;
}
.login-foot {
  margin-top: 20px;
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-300);
  line-height: 1.7;
}
.login-foot b { color: var(--gold-600); font-family: Consolas, monospace; letter-spacing: .5px; }

/* ============================================================
   Toast
   ============================================================ */

.toast-layer {
  position: fixed;
  left: 0; right: 0;
  top: 68px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 16px;
}
.toast {
  max-width: 340px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(20, 26, 38, .92);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
  backdrop-filter: blur(8px);
  animation: toastIn .22s ease;
}
.toast.err { background: rgba(168, 40, 40, .95); }
.toast.ok { background: rgba(24, 110, 76, .95); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   平板
   ============================================================ */

@media (min-width: 768px) {
  :root { --topbar-h: 62px; }
  .topbar { padding: 0 20px; gap: 14px; }
  .brand-logo { width: 34px; height: 38px; }
  .brand-name { font-size: 16.5px; }
  .brand-sub { display: block; font-size: 10.5px; }
  .topbar-search { display: flex; }
  .chips { padding: 14px 20px 12px; }
  .feed { padding: 0 18px 18px; gap: 14px; }
  .feed-col { gap: 14px; }
  .card-title { font-size: 13.5px; }
  .detail-body { padding: 20px 24px 0; }
  .comments { padding: 4px 24px 130px; }
  .publish { padding: 20px 24px 130px; }
  .profile-list { padding: 16px 18px 24px; }
  .login-card { padding: 38px 32px 32px; }
}

/* ============================================================
   桌面
   ============================================================ */

@media (min-width: 1180px) {
  .shell { padding: 0 20px; gap: 22px; }

  .sidebar {
    display: flex;
    flex-direction: column;
    flex: 0 0 196px;
    padding: 20px 0;
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    align-self: flex-start;
  }
  .side-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10.5px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink-500);
    margin-bottom: 3px;
    cursor: pointer;
    transition: all .16s ease;
  }
  .side-item:hover { background: var(--cyan-50); color: var(--blue-700); }
  .side-item.active {
    background: linear-gradient(100deg, var(--blue-700), var(--blue-600));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 5px 14px -4px rgba(20, 60, 140, .45);
  }
  .side-sep { height: 1px; background: var(--line); margin: 13px 10px; }
  .side-foot {
    margin-top: auto;
    padding: 14px;
    border-top: 1px solid var(--line);
  }
  .side-foot .y {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-600);
    font-family: Consolas, monospace;
    letter-spacing: 1.5px;
  }
  .side-foot .t { font-size: 10.5px; color: var(--ink-300); margin-top: 3px; line-height: 1.5; }

  .rightbar {
    display: flex;
    flex-direction: column;
    flex: 0 0 272px;
    gap: 14px;
    padding: 20px 0;
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    align-self: flex-start;
    overflow-y: auto;
  }
  .panel {
    background: var(--white);
    border-radius: var(--radius);
    padding: 15px 16px;
    box-shadow: var(--shadow-card);
  }
  .panel h3 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink-900);
    margin-bottom: 11px;
    display: flex;
    align-items: center;
    gap: 7px;
  }
  .panel h3::before {
    content: "";
    width: 3px; height: 13px;
    border-radius: 2px;
    background: linear-gradient(var(--cyan-600), var(--blue-700));
  }
  .topic-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 12.5px;
    cursor: pointer;
  }
  .topic-row:last-child { border-bottom: 0; padding-bottom: 0; }
  .topic-row:hover .tn { color: var(--blue-700); }
  .topic-rank {
    width: 17px; height: 17px;
    border-radius: 5px;
    background: var(--cyan-50);
    color: var(--cyan-700);
    font-size: 10px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 auto;
  }
  .topic-row:nth-child(2) .topic-rank,
  .topic-row:nth-child(3) .topic-rank { background: var(--gold-100); color: var(--gold-700); }
  .topic-row .tn { flex: 1 1 auto; color: var(--ink-700); font-weight: 500; transition: color .16s ease; }
  .topic-row .tc { font-size: 10.5px; color: var(--ink-300); }

  .notice-row {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    font-size: 11.5px;
    line-height: 1.65;
    color: var(--ink-500);
  }
  .notice-dot {
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--cyan-400);
    margin-top: 7px;
    flex: 0 0 auto;
  }
  .panel-about {
    background: linear-gradient(150deg, var(--blue-800), var(--blue-700) 62%, var(--blue-600));
    color: #fff;
    position: relative;
    overflow: hidden;
  }
  .panel-about::after {
    content: "1960";
    position: absolute;
    right: 10px; bottom: -10px;
    font-size: 42px;
    font-weight: 700;
    font-family: Consolas, monospace;
    letter-spacing: 2px;
    color: rgba(255,255,255,.07);
  }
  .panel-about img { width: 30px; margin-bottom: 9px; }
  .panel-about h4 { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
  .panel-about p {
    font-size: 11px;
    line-height: 1.7;
    color: rgba(255,255,255,.74);
    position: relative;
    z-index: 1;
  }

  .feed { padding: 0 0 24px; gap: 14px; }
  .page { padding-bottom: 24px; }
  .fab, .tabbar { display: none; }

  .grid9 { grid-template-columns: repeat(4, 1fr); }
  .comment-bar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    max-width: 760px;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-radius: 14px 14px 0 0;
  }
  .toast-layer { top: 76px; }
}

/* ------------------------------------------------------------
   瀑布流列数：手机两条，平板及以上三条。
   多算了一列放在 DOM 里，靠这里控制是否显示，避免切换设备时重新组织数据。
   ------------------------------------------------------------ */
.feed-col-2 { display: none; }

@media (min-width: 768px) {
  .feed-col-2 { display: flex; }
}
