/* =========================================
   1. 以下是你原本的样式 (完全保留，未修改)
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { background-color: #f7f7f7; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #333; line-height: 1.6; padding-bottom: 40px; }
ul, li { list-style: none; }
button { border: none; background: none; cursor: pointer; outline: none; }
img { display: block; max-width: 100%; }

.page { max-width: 600px; margin: 0 auto; min-height: 100vh; background: #fff; display: flex; flex-direction: column; }

.topbar { padding: 40px 20px 20px; background: #fff; border-bottom: 1px solid #eee; }
.topbar__title { font-size: 24px; font-weight: 800; color: #111; margin-bottom: 4px; letter-spacing: 1px; }
.topbar__sub { font-size: 13px; color: #999; }

.card { padding: 20px; border-bottom: 8px solid #f2f2f2; }
.row { display: flex; align-items: flex-start; margin-bottom: 15px; }
.row--nick { align-items: center; }
.avatarPreview { width: 44px; height: 44px; border-radius: 6px; background-color: #eee; background-size: cover; background-position: center; margin-right: 12px; flex-shrink: 0; border: 1px solid #eee; }
.field { flex: 1; }
.label { display: block; font-size: 12px; color: #999; margin-bottom: 6px; }
.selectWrap { position: relative; background: #f7f7f7; border-radius: 6px; }
.select { width: 100%; height: 40px; border: none; background: transparent; padding: 0 12px; font-size: 15px; color: #333; appearance: none; -webkit-appearance: none; border-radius: 6px; }
.selectArrow { position: absolute; right: 12px; top: 16px; width: 0; height: 0; border: 5px solid transparent; border-top-color: #ccc; pointer-events: none; }
.hint { font-size: 11px; color: #aaa; margin-top: 4px; }
.textarea { width: 100%; height: 100px; padding: 12px; background: #f7f7f7; border: none; border-radius: 6px; font-size: 15px; resize: none; color: #333; }
.textarea::placeholder { color: #ccc; }

.row--imgs { display: block; margin-bottom: 20px; }
.labelRow { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.count { font-size: 12px; color: #ccc; }
.grid { display: flex; flex-wrap: wrap; gap: 8px; }
.preview { position: relative; width: 31%; aspect-ratio: 1; border-radius: 4px; overflow: hidden; background: #eee; }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview .del { position: absolute; top: 0; right: 0; width: 20px; height: 20px; background: rgba(0,0,0,0.5); color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center; border-bottom-left-radius: 4px; }
.addBtn { width: 31%; aspect-ratio: 1; border: 1px dashed #ddd; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #ccc; cursor: pointer; background: #fafafa; }
.addBtn .plus { font-size: 24px; line-height: 1; margin-bottom: 4px; }
.addBtn .addText { font-size: 11px; }
#file-input { display: none; }
.miniTip { font-size: 11px; color: #ccc; margin-top: 8px; }

.actions { display: flex; justify-content: flex-end; gap: 12px; }
.btn { padding: 0 20px; height: 36px; border-radius: 18px; font-size: 14px; font-weight: 600; transition: opacity 0.2s; }
.btn:active { opacity: 0.7; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--ghost { background: #f0f0f0; color: #666; }
.btn--primary { background: #07c160; color: #fff; }
.btn--sm { height: 28px; padding: 0 12px; font-size: 12px; }

.feedWrap { padding: 20px; flex: 1; }
.feedHead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.feedTitle { font-size: 18px; font-weight: 700; }
.status { text-align: center; font-size: 13px; color: #999; margin-bottom: 15px; height: 20px; }

.post { display: flex; margin-bottom: 30px; border-bottom: 1px solid #f5f5f5; padding-bottom: 20px; }
.post:last-child { border-bottom: none; }
.post__head { margin-right: 12px; flex-shrink: 0; }
.post .avatar { width: 40px; height: 40px; border-radius: 4px; background-color: #eee; background-size: cover; background-position: center; }
.post__body { flex: 1; overflow: hidden; } /* 稍微改动：增加包裹层以便放评论 */
.post__name { font-size: 15px; font-weight: 600; color: #576b95; margin-bottom: 4px; }
.post__content { font-size: 15px; color: #111; margin-bottom: 10px; white-space: pre-wrap; word-break: break-all; }
.post__imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.post__imgs img { width: 32%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; cursor: zoom-in; background: #f0f0f0; }
.post__imgs.is-single img { width: auto; max-width: 70%; max-height: 200px; aspect-ratio: auto; }
.post__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.post__time { font-size: 12px; color: #bbb; }
.post__del { font-size: 12px; color: #576b95; }

.viewer { position: fixed; z-index: 1000; top: 0; left: 0; width: 100%; height: 100%; display: none; align-items: center; justify-content: center; }
.viewer.is-open { display: flex; }
.viewer__bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); }
.viewer__img { position: relative; max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer__close { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; color: #fff; font-size: 30px; z-index: 1001; }

/* =========================================
   2. 下面是新增的【点赞评论】样式 (附加在最后)
   ========================================= */
.post__actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.actionBtn { display: inline-flex; align-items: center; background: #f7f7f7; padding: 4px 10px; border-radius: 4px; margin-left: 10px; font-size: 12px; color: #576b95; font-weight: 500; }
.actionBtn svg { width: 16px; height: 16px; margin-right: 4px; }
.actionBtn:active { background: #eee; }

.commentsArea { background: #f7f7f7; margin-top: 10px; padding: 8px; border-radius: 4px; font-size: 13px; position: relative; }
.commentsArea::before { content: ""; position: absolute; top: -6px; left: 12px; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #f7f7f7; }
.likeList { padding-bottom: 6px; border-bottom: 1px solid #eee; margin-bottom: 6px; color: #576b95; display: flex; flex-wrap: wrap; align-items: baseline; }
.likeList svg { width: 14px; height: 14px; margin-right: 5px; transform: translateY(2px); }
.likeList:empty { display: none; }
.commentItem { margin-bottom: 4px; line-height: 1.4; }
.commentItem:last-child { margin-bottom: 0; }
.commentName { color: #576b95; font-weight: 500; }
.commentText { color: #333; }
.commentBox { margin-top: 10px; display: flex; gap: 8px; background: #fff; padding: 8px; border: 1px solid #eee; border-radius: 4px; }
.commentBox.hidden { display: none; }
.commentInput { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; }
.commentSend { color: #07c160; font-weight: 600; font-size: 14px; }

/* === 修复：删除图标没尺寸导致被挤掉/裁掉 === */
.actions-right { display:flex; align-items:center; }

.post__del { display:inline-flex; align-items:center; justify-content:center; }
.post__del svg { width:20px; height:20px; display:block; }

.commentItem__del{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  margin-left:6px;
  flex:0 0 auto;
}
.commentItem__del svg{ width:12px; height:12px; display:block; }

/* =========================================
   3. 手机端适配补丁（只做覆盖，不改原样式）
   ========================================= */

/* iPhone 安全区 */
:root{
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 480px){
  body{
    padding-bottom: calc(24px + var(--safe-bottom));
  }

  /* 页面不要强行 600 宽，贴合手机屏幕 */
  .page{
    max-width: 100%;
    min-height: 100dvh;
  }

  /* 顶部留白太大：40px → 16px */
  .topbar{
    padding: calc(16px + var(--safe-top)) 14px 14px;
  }
  .topbar__title{
    font-size: 20px;
    letter-spacing: .5px;
  }

  /* card / feed 外边距更舒服 */
  .card{
    padding: 14px;
    border-bottom-width: 10px;
  }
  .feedWrap{
    padding: 14px;
  }
  .feedHead{
    margin-bottom: 14px;
  }
  .feedTitle{
    font-size: 16px;
  }

  /* 发布区：头像略小、输入框更像手机 */
  .avatarPreview{
    width: 40px;
    height: 40px;
    margin-right: 10px;
  }
  .textarea{
    height: 96px;
    font-size: 16px; /* 防止 iOS 自动放大 */
    line-height: 1.5;
    padding: 10px 12px;
  }

  /* 九宫格：间距稍大一点，圆角更舒服 */
  .grid{
    gap: 10px;
  }
  .preview, .addBtn{
    width: 31.5%;
    border-radius: 10px;
  }
  .preview .del{
    width: 26px;
    height: 26px;
    font-size: 16px;
    border-bottom-left-radius: 10px;
  }

  /* 按钮更好点（触控面积） */
  .btn{
    height: 40px;
    border-radius: 20px;
  }

  /* 动态列表：减少底部空白，贴近手机节奏 */
  .post{
    margin-bottom: 18px;
    padding-bottom: 14px;
  }
  .post__head{
    margin-right: 10px;
  }
  .post .avatar{
    width: 38px;
    height: 38px;
    border-radius: 8px;
  }
  .post__name{
    font-size: 14px;
  }
  .post__content{
    font-size: 15px;
    line-height: 1.55;
    word-break: break-word; /* 手机上别用 break-all，观感更好 */
  }
  .post__imgs{
    gap: 8px;
  }
  .post__imgs img{
    width: 32%;
    border-radius: 8px;
  }

  /* 点赞/评论：增大可点区域 */
  .post__actions{
    justify-content: flex-start;
    gap: 10px;
    margin-top: 10px;
  }
  .actionBtn{
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-left: 0;
    min-height: 36px;
  }
  .actionBtn svg{
    width: 16px;
    height: 16px;
    margin-right: 6px;
  }

  /* 评论输入：更像聊天输入 */
  .commentBox{
    padding: 10px;
    border-radius: 10px;
  }
  .commentInput{
    font-size: 16px; /* iOS 不放大 */
  }
  .commentSend{
    font-size: 15px;
  }

  /* 评论区：圆角更大一点，右侧删除按钮更好点 */
  .commentsArea{
    padding: 10px;
    border-radius: 10px;
  }
  .commentItem{
    display: flex;
    align-items: flex-start;
    gap: 6px;
  }
  .commentText{
    flex: 1;
    word-break: break-word;
  }
  .commentItem__del{
    width: 26px;
    height: 26px;
    margin-left: 0;
  }
  .commentItem__del svg{
    width: 14px;
    height: 14px;
  }

  /* 预览查看器：关闭按钮别顶刘海 */
  .viewer__close{
    top: calc(12px + var(--safe-top));
    right: 12px;
  }
}

/* 更窄屏（SE 等）再收一点 */
@media (max-width: 360px){
  .topbar{ padding-left: 12px; padding-right: 12px; }
  .card, .feedWrap{ padding: 12px; }
  .actionBtn{ padding: 8px 10px; }
}
