:root {
  --pink: #ff6b9d;
  --pink-light: #ffe4ed;
  --pink-soft: #fff5f8;
  --text: #333;
  --muted: #999;
  --border: #f0e6ea;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--pink-soft); color: var(--text); }
a { color: inherit; text-decoration: none; }

/* 导航 */
.pw-navbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.pw-nav-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; padding: 0 16px; height: 56px; gap: 24px; }
.pw-logo { font-weight: 700; color: var(--pink); font-size: 18px; }
.pw-nav-links { display: flex; gap: 20px; align-items: center; font-size: 14px; margin-left: auto; }
.pw-nav-links a:hover { color: var(--pink); }
.pw-badge { background: var(--pink); color: #fff; border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.pw-dot { display: inline-block; width: 6px; height: 6px; background: var(--pink); border-radius: 50%; margin-left: 4px; vertical-align: middle; }
.pw-hamburger { display: none; background: none; border: none; font-size: 20px; cursor: pointer; margin-left: auto; }

/* 底部 */
.pw-footer { text-align: center; padding: 30px 16px; color: var(--muted); font-size: 13px; }

/* 通用 */
.pw-container { max-width: 1100px; margin: 0 auto; padding: 16px; }

/* ==================== 修复拉伸问题的核心代码 ==================== */
.pw-toolbar { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 12px; 
  justify-content: space-between; 
  align-items: flex-start; /* 顶部对齐，防止右侧撑高左侧 */
  margin-bottom: 16px; 
}
.pw-tabs, .pw-campus { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-tabs a, .pw-campus a { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  height: 32px; /* 固定高度 */
  padding: 0 16px; 
  border-radius: 20px; 
  background: #fff; 
  font-size: 13px; 
  border: 1px solid var(--border); 
  white-space: nowrap;
  transition: all 0.2s;
}
.pw-tabs a:hover, .pw-campus a:hover { border-color: var(--pink); color: var(--pink); }
.pw-tabs a.active, .pw-campus a.active { background: var(--pink); color: #fff; border-color: var(--pink); }
/* ========================================================== */

/* 瀑布流：PC 双列，手机单列 */
.pw-waterfall { column-count: 2; column-gap: 16px; }
.pw-card { break-inside: avoid; background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 16px; box-shadow: 0 2px 10px rgba(255,107,157,.06); }
.pw-card-head { display: flex; align-items: center; gap: 10px; }
.pw-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--pink-light); color: var(--pink); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.pw-avatar.small { width: 28px; height: 28px; font-size: 12px; }
.pw-name { font-weight: 600; font-size: 14px; }
.pw-meta { font-size: 12px; color: var(--muted); }
.pw-campus-tag { padding: 1px 6px; border-radius: 4px; font-size: 11px; color: #fff; }
.pw-campus-tag.south { background: #4a90e2; }
.pw-campus-tag.north { background: #ff8a65; }
.pw-vip-tag { background: linear-gradient(45deg, #ffd700, #ff8c00); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 4px; margin-left: 4px; }
.pw-card-body { display: block; margin-top: 10px; color: inherit; }
.pw-card-body p { line-height: 1.7; white-space: pre-wrap; word-break: break-word; margin: 0; }
.pw-card-foot { display: flex; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.pw-act { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 0; }
.pw-act:hover { color: var(--pink); }

/* 九宫格 */
.pw-grid { display: grid; gap: 4px; margin-top: 8px; }
.pw-grid.grid-1 { grid-template-columns: 1fr; }
.pw-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }
.pw-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.pw-grid-item { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 8px; }
.pw-grid-item img { width: 100%; height: 100%; object-fit: cover; }
.pw-grid.grid-1 .pw-grid-item { aspect-ratio: auto; max-height: 360px; }
.pw-grid.grid-1 .pw-grid-item img { object-fit: contain; }
.pw-remove { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.5); color: #fff; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; cursor: pointer; }

/* 视频卡片 */
.pw-video-card { position: relative; margin-top: 8px; aspect-ratio: 16/9; background-size: cover; background-position: center; border-radius: 10px; display: flex; align-items: center; justify-content: center; background-color: #000; }
.pw-play { font-size: 36px; color: #fff; text-shadow: 0 0 10px #000; }

/* 发布页 */
.pw-form-wrap { background: #fff; border-radius: 14px; padding: 24px; }
.pw-form .pw-row { margin-bottom: 16px; }
.pw-form label { font-size: 14px; margin-right: 10px; }
.pw-form textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; resize: vertical; outline: none; }
.pw-form textarea:focus { border-color: var(--pink); }
.pw-count { text-align: right; font-size: 12px; color: var(--muted); }
.pw-uploader { display: flex; flex-wrap: wrap; gap: 8px; }
.pw-upload-btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border: 1px dashed var(--pink); color: var(--pink); border-radius: 10px; cursor: pointer; font-size: 13px; }
.pw-actions { display: flex; gap: 12px; align-items: center; }
.pw-btn-primary { background: var(--pink); color: #fff; border: none; padding: 10px 22px; border-radius: 22px; cursor: pointer; font-size: 14px; }
.pw-btn-ghost { background: #fff; color: var(--pink); border: 1px solid var(--pink); padding: 10px 22px; border-radius: 22px; cursor: pointer; font-size: 14px; }
.pw-hint { font-size: 12px; color: var(--muted); }

/* 详情 / 评论 */
.pw-detail .pw-card { margin-bottom: 16px; }
.pw-comments { background: #fff; border-radius: 14px; padding: 18px; }
.pw-comments h3 { margin-top: 0; font-size: 16px; }
.pw-comments textarea { width: 100%; min-height: 80px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; resize: vertical; }
.pw-comment { padding: 12px 0; border-bottom: 1px solid var(--border); }
.pw-comment-head { display: flex; align-items: center; gap: 8px; }
.pw-comment-body { margin: 8px 0 4px 36px; line-height: 1.6; }
.pw-comment-foot { margin-left: 36px; display: flex; gap: 14px; font-size: 12px; }
.pw-edited { font-size: 11px; color: #ff9800; background: #fff3e0; padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.pw-empty { text-align: center; padding: 40px; color: var(--muted); }
.pw-toast { position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(0,0,0,.75); color: #fff; padding: 8px 20px; border-radius: 20px; opacity: 0; transition: .3s; pointer-events: none; z-index: 999; }
.pw-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 私聊 */
.pw-chat { display: flex; flex-direction: column; height: calc(100vh - 56px); max-width: 720px; margin: 0 auto; background: #fff; }
.pw-chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.pw-chat-body { flex: 1; overflow-y: auto; padding: 16px; background: #fafafa; }
.pw-msg { display: flex; margin-bottom: 12px; position: relative; }
.pw-msg.mine { justify-content: flex-end; }
.pw-msg-text { max-width: 70%; padding: 8px 12px; border-radius: 12px; background: #fff; line-height: 1.5; word-break: break-word; }
.pw-msg.mine .pw-msg-text { background: var(--pink); color: #fff; }
.pw-msg img, .pw-msg video { max-width: 200px; border-radius: 10px; }
.pw-recall { background: none; border: none; font-size: 11px; color: var(--muted); margin-left: 6px; cursor: pointer; }
.pw-chat-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: #fff; }
.pw-chat-input input[type=text] { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 20px; outline: none; }
.pw-chat-input button { background: var(--pink); color: #fff; border: none; padding: 0 18px; border-radius: 20px; cursor: pointer; }

/* 消息列表 */
.pw-conv { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 12px; padding: 12px 16px; margin-bottom: 8px; }
.pw-conv-main { flex: 1; }
.pw-conv-last { font-size: 13px; color: var(--muted); }

/* 首页大号发布按钮 */
.pw-nav-post-btn {
  background: linear-gradient(135deg, #ff6b9d, #ff477e);
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
  transition: all 0.3s ease;
}
.pw-nav-post-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 157, 0.5);
}

/* 手机适配 */
@media (max-width: 640px) {
  .pw-waterfall { column-count: 1; }
  .pw-nav-links { display: none; position: absolute; top: 56px; right: 0; background: #fff; flex-direction: column; padding: 16px 24px; border-radius: 0 0 0 12px; box-shadow: 0 4px 20px rgba(0,0,0,.1); }
  .pw-nav-links.show { display: flex; }
  .pw-hamburger { display: block; }
  .pw-container { padding: 12px; }
  .pw-form-wrap { padding: 16px; }
  
  /* 手机端隐藏首页右侧的发布按钮，避免撑破排版 */
  .pw-toolbar > div:last-child .pw-nav-post-btn {
    display: none !important;
  }
  
  /* 手机端底部悬浮加号（如果加了的话） */
  .pw-fab-btn {
    display: flex;
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #ff6b9d, #ff477e);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s;
  }
}
/* 手机端底部悬浮发帖按钮 */
.pw-fab-btn {
  display: none; /* 电脑端默认隐藏 */
}

@media (max-width: 640px) {
  .pw-fab-btn {
    display: flex; /* 手机端显示 */
    position: fixed;
    bottom: 30px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #ff6b9d, #ff477e);
    color: #fff;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s;
  }
  .pw-fab-btn:active {
    transform: scale(0.9);
  }
}
img.pw-avatar { object-fit: cover; }
img.pw-avatar { object-fit: cover; }
/* 手机端菜单展示层级修复 */
@media (max-width: 640px) {
  .pw-navbar { z-index: 999; }
  .pw-nav-links { 
    z-index: 1000;
    border: 1px solid var(--border);
    border-top: none;
  }
}