/* 手机端专用样式 —— 小红书式瀑布流 / 沉浸式详情 / 底部 Tab */

body.m-app {
  padding-top: 0;
  padding-bottom: calc(60px + var(--safe-bottom));
  max-width: 100vw;
  background: var(--c-bg);
}

/* 顶部条 */
.m-topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-top) + 10px) 14px 10px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--c-border);
}
.m-topbar .m-back {
  width: 32px; height: 32px; border-radius: 50%; background: var(--c-surface-2);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast);
}
.m-topbar .m-back:active { background: #eaeaea; }
.m-topbar .m-title { flex: 1; font-size: 16px; font-weight: 600; text-align: center; }
.m-topbar .m-search {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: var(--c-surface-2); border-radius: var(--r-full);
  padding: 8px 14px; font-size: 13px; color: var(--c-text-3);
}
.m-topbar .m-search input { flex: 1; border: none; background: transparent; outline: none; font-size: 13px; }

/* 分段 Tab */
.m-tabs { display: flex; gap: 20px; padding: 12px 16px; font-size: 15px; overflow-x: auto; scrollbar-width: none; }
.m-tabs::-webkit-scrollbar { display: none; }
.m-tab { position: relative; padding: 6px 2px; color: var(--c-text-3); white-space: nowrap; font-weight: 500; transition: color var(--dur-fast); }
.m-tab.active { color: var(--c-text); font-weight: 700; font-size: 18px; }
.m-tab.active::after {
  content: ''; position: absolute; left: 50%; bottom: -4px; width: 18px; height: 3px;
  background: var(--brand); border-radius: 2px; transform: translateX(-50%);
}

/* 分类 chip */
.m-chip-row { display: flex; gap: 8px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.m-chip-row::-webkit-scrollbar { display: none; }
.m-chip {
  padding: 6px 14px; border-radius: var(--r-full); background: var(--c-surface-2);
  font-size: 13px; color: var(--c-text-2); white-space: nowrap;
  transition: all var(--dur-fast) var(--ease);
}
.m-chip.active { background: var(--c-text); color: #fff; transform: scale(1.02); }

/* 瀑布流 */
.m-waterfall { padding: 0 8px; column-count: 2; column-gap: 8px; }
.m-waterfall > .m-card { break-inside: avoid; margin-bottom: 8px; display: inline-block; width: 100%; }

.m-card {
  background: #fff; border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--sh-s);
  transition: transform var(--dur) var(--ease);
}
.m-card:active { transform: scale(0.98); }
.m-card .m-cover { width: 100%; display: block; background: var(--c-surface-2); }
.m-card .m-body { padding: 8px 10px 10px; }
.m-card .m-t { font-size: 14px; line-height: 1.35; font-weight: 500; margin-bottom: 6px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.m-card .m-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--c-text-3); }
.m-card .m-foot .m-user { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0; }
.m-card .m-foot .m-user img { width: 20px; height: 20px; border-radius: 50%; }
.m-card .m-foot .m-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-card .m-like { display: flex; align-items: center; gap: 3px; transition: color var(--dur-fast); }
.m-card .m-like.active { color: var(--brand); }
.m-card .m-price { color: var(--brand); font-weight: 700; font-size: 15px; margin-right: 6px; }

/* 底部 Tab */
.m-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; height: calc(56px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--c-border);
}
.m-tabbar-item {
  position: relative; flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  color: var(--c-text-3); font-size: 11px;
  transition: color var(--dur-fast);
}
.m-tabbar-item.active { color: var(--c-text); }
.m-tabbar-item svg { width: 22px; height: 22px; transition: transform var(--dur-fast) var(--ease); }
.m-tabbar-item.active svg { transform: scale(1.1); color: var(--brand); }
.m-tabbar-center {
  position: relative; width: 52px; height: 52px; margin-top: -18px;
  border-radius: 50%; background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-brand);
  transition: transform var(--dur-fast) var(--ease);
}
.m-tabbar-center:active { transform: scale(0.92); }

/* 详情页沉浸式 */
.m-detail-hero { width: 100%; display: block; background: var(--c-surface-2); }
.m-detail-body { padding: 16px; }
.m-detail-title { font-size: 20px; font-weight: 700; line-height: 1.3; margin-bottom: 10px; }
.m-detail-author {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--c-divider);
}
.m-detail-author .a-name { flex: 1; font-weight: 600; }
.m-detail-desc { padding: 16px 0; color: var(--c-text-2); font-size: 15px; line-height: 1.8; white-space: pre-wrap; }

.m-detail-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--c-border);
}
.m-detail-bar .m-icon-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: var(--c-text-3); min-width: 40px;
}
.m-detail-bar .m-icon-btn svg { width: 22px; height: 22px; }
.m-detail-bar .m-icon-btn.active { color: var(--brand); }
.m-detail-bar .m-buy-btn { flex: 1; }

/* 表单区 */
.m-form { padding: 16px; }
.m-form .field { margin-bottom: 16px; }
.m-form .field label { display: block; font-size: 13px; color: var(--c-text-2); margin-bottom: 8px; font-weight: 500; }
.m-form .hint { font-size: 12px; color: var(--c-text-3); margin-top: 6px; }

/* 个人中心头图 */
.m-profile-hero {
  position: relative; padding: calc(var(--safe-top) + 20px) 20px 24px;
  background: var(--brand-grad); color: #fff;
}
.m-profile-hero .ph-row { display: flex; align-items: center; gap: 14px; }
.m-profile-hero .avatar { border: 3px solid rgba(255,255,255,0.6); }
.m-profile-hero .nick { font-size: 20px; font-weight: 700; }
.m-profile-hero .stats { display: flex; gap: 22px; margin-top: 16px; }
.m-profile-hero .stat { font-size: 13px; opacity: 0.95; }
.m-profile-hero .stat b { font-size: 18px; display: block; }

/* 列表 */
.m-list { background: #fff; border-radius: var(--r-md); margin: 12px; overflow: hidden; }
.m-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--c-divider);
  transition: background var(--dur-fast);
}
.m-list-item:last-child { border-bottom: none; }
.m-list-item:active { background: var(--c-surface-2); }
.m-list-item .ico {
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.m-list-item .txt { flex: 1; }
.m-list-item .arrow { color: var(--c-text-3); }

/* 聊天 */
.m-chat-body {
  padding: 12px 14px; padding-bottom: 80px;
  min-height: calc(100vh - 50px); background: var(--c-bg);
}
.m-msg { display: flex; margin-bottom: 14px; gap: 8px; animation: fadeInUp .24s var(--ease); }
.m-msg.self { flex-direction: row-reverse; }
.m-msg .bubble {
  max-width: 72%; padding: 10px 14px; border-radius: 16px;
  background: #fff; box-shadow: var(--sh-s); font-size: 15px; line-height: 1.5;
  word-break: break-word;
}
.m-msg.self .bubble { background: var(--brand); color: #fff; }
.m-chat-input {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
  display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-bottom));
  background: rgba(255,255,255,0.96); backdrop-filter: blur(18px);
  border-top: 1px solid var(--c-border);
}
.m-chat-input input {
  flex: 1; padding: 10px 14px; border-radius: var(--r-full);
  background: var(--c-surface-2); border: none; outline: none; font-size: 14px;
}

/* 空状态 */
.m-empty { padding: 60px 20px; text-align: center; color: var(--c-text-3); }
.m-empty .emo { font-size: 48px; margin-bottom: 12px; }

/* 上传图片预览 */
.m-uploader { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-uploader .u-item { position: relative; aspect-ratio: 1/1; border-radius: var(--r-sm); overflow: hidden; background: var(--c-surface-2); }
.m-uploader .u-item img { width: 100%; height: 100%; object-fit: cover; }
.m-uploader .u-item .u-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.m-uploader .u-add {
  aspect-ratio: 1/1; border: 1.5px dashed #ddd; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; color: var(--c-text-3);
  font-size: 28px; background: var(--c-surface-2);
}
