/* ========================================
   IM系统预览 - 用户端（绿色科技风）
   ======================================== */
:root {
  --primary: #00A884;
  --primary-dark: #008F70;
  --primary-light: #E6F7F2;
  --bg: #E8EBED;
  --bg-white: #FFFFFF;
  --bg-bar: #F5F6F7;
  --text: #1A1D21;
  --text-secondary: #868E96;
  --text-muted: #ADB5BD;
  --text-link: #00A884;
  --border: #DEE2E6;
  --border-light: #EDEEF0;
  --danger: #E74C3C;
  --warning: #F0A500;
  --info: #339AF0;
  --radius: 3px;
  --radius-sm: 2px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --nav-h: 46px;
  --tab-h: 52px;
  --bottom-safe: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
  font-family: var(--font); font-size: 14px; color: var(--text); 
  background: #E0E2E5; -webkit-font-smoothing: antialiased; 
  display: flex; justify-content: center; padding: 24px 0;
}

/* ===== 手机模拟器 ===== */
.phone-frame {
  width: 375px; min-height: 750px; background: var(--bg-white);
  overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 24px 64px rgba(0,0,0,0.18);
  display: flex; flex-direction: column;
  border-radius: 10px;
}

/* ===== 导航栏（默认浅色白底） ===== */
.nav-bar {
  height: var(--nav-h); background: var(--bg-white); 
  display: flex; align-items: center; justify-content: center; 
  position: relative; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.nav-bar .back { 
  position: absolute; left: 4px; top: 50%; transform: translateY(-50%); 
  font-size: 16px; color: var(--text); cursor: pointer; 
  border: none; background: none; padding: 6px 12px; font-weight: 400;
}
.nav-bar .title { font-size: 16px; font-weight: 600; color: var(--text); }
.nav-bar .action { 
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); 
  font-size: 14px; color: var(--text-secondary); cursor: pointer; 
  border: none; background: none; 
}

/* 深色导航变体 */
.nav-bar.dark {
  background: #1A1D21; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-bar.dark .back { color: rgba(255,255,255,0.8); }
.nav-bar.dark .title { color: #fff; }
.nav-bar.dark .action { color: rgba(255,255,255,0.7); }

/* ===== 底部Tab（默认浅色白底） ===== */
.tab-bar {
  height: calc(var(--tab-h) + var(--bottom-safe)); background: #F7F8F9; 
  display: flex; border-top: 1px solid var(--border); 
  flex-shrink: 0; padding-bottom: var(--bottom-safe);
}
.tab-item { 
  flex: 1; display: flex; flex-direction: column; align-items: center; 
  justify-content: center; cursor: pointer; color: var(--text-muted); 
  font-size: 10px; text-decoration: none; transition: color 0.15s;
}
.tab-item.active { color: var(--primary); }
.tab-item .t-icon { font-size: 19px; margin-bottom: 2px; line-height: 1; }
.tab-item .badge-wrap { position: relative; }
.tab-item .badge-wrap::after { 
  content: attr(data-badge); position: absolute; top: -4px; right: -14px; 
  background: var(--danger); color: #fff; font-size: 9px; 
  min-width: 16px; height: 16px; line-height: 16px; text-align: center; 
  border-radius: 8px; padding: 0 4px; font-weight: 600;
}

/* ===== 内容区 ===== */
.content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.content::-webkit-scrollbar { display: none; }

/* ===== 搜索栏 ===== */
.search-bar { padding: 8px 12px; background: var(--bg-white); flex-shrink: 0; }
.search-input { 
  width: 100%; height: 34px; border-radius: var(--radius); border: 1px solid var(--border); 
  background: var(--bg-white); padding: 0 12px; font-size: 14px; 
  outline: none; color: var(--text); transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,168,132,0.1); }
.search-input::placeholder { color: var(--text-muted); }

/* ===== 列表项 ===== */
.list-item {
  display: flex; align-items: center; padding: 10px 16px; background: var(--bg-white);
  cursor: pointer; transition: background 0.1s;
  text-decoration: none; color: inherit; border-bottom: 1px solid var(--border-light);
}
.list-item:active { background: #F3F4F5; }
.avatar { 
  width: 44px; height: 44px; border-radius: var(--radius); flex-shrink: 0; 
  object-fit: cover; display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600; color: #fff;
}
.avatar-lg { width: 60px; height: 60px; border-radius: var(--radius); font-size: 22px; }
.avatar-sm { width: 36px; height: 36px; border-radius: var(--radius); font-size: 13px; }
.avatar-round { border-radius: 50%; }
.list-info { flex: 1; margin-left: 12px; overflow: hidden; min-width: 0; }
.list-title { 
  font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 4px; 
}
.list-sub { 
  font-size: 13px; color: var(--text-secondary); margin-top: 2px; 
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.list-extra { text-align: right; flex-shrink: 0; margin-left: 8px; }
.list-time { font-size: 11px; color: var(--text-muted); }
.list-badge { 
  display: inline-block; min-width: 18px; height: 18px; line-height: 18px; 
  text-align: center; background: var(--danger); color: #fff; font-size: 10px; 
  border-radius: 9px; padding: 0 5px; margin-top: 3px; font-weight: 600;
}

/* ===== 按钮 ===== */
.btn { 
  display: inline-block; padding: 9px 22px; border-radius: var(--radius); 
  font-size: 14px; font-weight: 500; cursor: pointer; border: none; text-align: center; 
  transition: all 0.15s; font-family: inherit; text-decoration: none;
  letter-spacing: 0.2px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: rgba(0,168,132,0.04); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; }
.btn-disabled { opacity: 0.35; pointer-events: none; }

/* ===== 表单 ===== */
.form-group { padding: 14px 16px; background: var(--bg-white); border-bottom: 1px solid var(--border-light); }
.form-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-input { 
  width: 100%; height: 42px; border: 1px solid var(--border); 
  border-radius: var(--radius); padding: 0 12px; 
  font-size: 15px; outline: none; font-family: inherit; transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,168,132,0.1); }
.form-textarea { 
  width: 100%; min-height: 80px; border: 1px solid var(--border); 
  border-radius: var(--radius); padding: 10px 12px; 
  font-size: 15px; resize: vertical; outline: none; font-family: inherit;
}
.form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,168,132,0.1); }

/* ===== 聊天 ===== */
.chat-content { flex: 1; overflow-y: auto; background: var(--bg); padding: 10px 0; }
.chat-content::-webkit-scrollbar { display: none; }
.chat-msg { padding: 5px 14px; display: flex; align-items: flex-start; }
.chat-msg.self { flex-direction: row-reverse; }
.msg-avatar { 
  width: 34px; height: 34px; border-radius: var(--radius); flex-shrink: 0; 
  display: flex; align-items: center; justify-content: center; 
  font-size: 13px; font-weight: 600; color: #fff;
}
.msg-bubble { 
  max-width: 245px; padding: 10px 13px; border-radius: var(--radius); 
  font-size: 15px; line-height: 1.5; word-break: break-all; position: relative; 
}
.chat-msg:not(.self) .msg-bubble { background: #fff; margin-left: 8px; }
.chat-msg.self .msg-bubble { background: #D4F5E9; margin-right: 8px; }
.chat-input-bar { 
  display: flex; align-items: center; padding: 8px 12px; 
  background: var(--bg-white); border-top: 1px solid var(--border); 
  gap: 8px; flex-shrink: 0; 
}
.chat-input-bar .input { 
  flex: 1; height: 36px; border-radius: var(--radius); border: 1px solid var(--border); 
  padding: 0 12px; font-size: 14px; outline: none; background: var(--bg); 
  font-family: inherit; transition: border-color 0.15s;
}
.chat-input-bar .input:focus { border-color: var(--primary); }
.chat-input-bar .send-btn { 
  padding: 7px 16px; background: var(--primary); color: #fff; 
  border: none; border-radius: var(--radius); font-size: 14px; cursor: pointer; 
  font-weight: 500;
}
.chat-time { text-align: center; font-size: 11px; color: var(--text-muted); padding: 10px 0; }

/* ===== 朋友圈 ===== */
.feed-item { padding: 16px 16px; background: #fff; border-bottom: 1px solid var(--border-light); }
.feed-header { display: flex; align-items: flex-start; margin-bottom: 8px; }
.feed-avatar { 
  width: 40px; height: 40px; border-radius: var(--radius); margin-right: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; 
  font-size: 15px; font-weight: 600; color: #fff;
}
.feed-name { font-size: 14px; font-weight: 600; color: var(--primary); }
.feed-time-wrap { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 8px; }
.feed-body { font-size: 15px; line-height: 1.65; margin-bottom: 8px; }
.feed-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-bottom: 8px; }
.feed-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2px; background: #DDE1E6; }
.feed-actions { 
  display: flex; align-items: center; gap: 8px; margin-top: 8px; 
  padding-top: 8px; border-top: 1px solid var(--border-light); 
}
.feed-action { 
  font-size: 13px; color: var(--text-secondary); cursor: pointer; 
  display: flex; align-items: center; gap: 3px; background: none; border: none; padding: 2px 6px;
}

/* ===== Tab导航 ===== */
.tab-nav { display: flex; background: var(--bg-white); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.tab-nav-item {
  flex: 1; text-align: center; padding: 13px 0; font-size: 14px; font-weight: 500;
  cursor: pointer; color: var(--text-secondary); background: none; border: none;
  position: relative; font-family: inherit; transition: color 0.15s;
}
.tab-nav-item.active { color: var(--primary); }
.tab-nav-item.active::after {
  content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 2px; background: var(--primary); border-radius: 1px;
}

/* ===== 分区间隔 ===== */
.section-gap { height: 8px; background: var(--bg); border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }

/* ===== 功能入口行 ===== */
.func-row {
  display: flex; align-items: center; padding: 13px 16px; 
  background: var(--bg-white); border-bottom: 1px solid var(--border-light);
  cursor: pointer; text-decoration: none; color: var(--text); font-size: 15px;
  transition: background 0.1s;
}
.func-row:active { background: #F3F4F5; }
.func-row .arrow { margin-left: auto; color: var(--text-muted); font-size: 13px; font-weight: 300; }

/* ===== 模态框 ===== */
.modal-mask { 
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); 
  display: flex; align-items: center; justify-content: center; z-index: 1000; 
}
.modal-box { 
  background: #fff; border-radius: 8px; padding: 24px; 
  min-width: 280px; max-width: 340px; text-align: center;
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary); }
.text-link { color: var(--text-link); }
.font-bold { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.hidden { display: none; }
.w-full { width: 100%; }
.relative { position: relative; }
