/* theme.css —— 视觉精修覆盖层（必须最后加载）：v1.9 精修、骨架屏、表情面板、v1.9.1 聊天输入栏、交互反馈、他人主页 */

/* ====================== [UI 优化 v1.9] 视觉精修（放在最后，统一覆盖） ====================== */
:root {
  --shadow: 0 2px 12px rgba(26,58,110,0.07);
  --shadow-up: 0 -2px 14px rgba(26,58,110,0.06);
  --grad-primary: linear-gradient(135deg, #6fd0fa 0%, #3fb6f3 100%);
  --radius: 16px;
}
/* 页面切换淡入 */
.page.active { animation: pageIn .22s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* 顶栏：渐变 + 更轻的阴影 */
.topbar { background: var(--grad-primary); box-shadow: 0 2px 10px rgba(63,182,243,0.28); }
.topbar-center { letter-spacing: 1.5px; }
/* 底栏：毛玻璃 + 选中态小圆点 */
.tabbar {
  background: rgba(255,255,255,0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: none; box-shadow: var(--shadow-up);
}
.tab-item { position: relative; }
.tab-item .tab-icon { transition: transform .18s; }
.tab-item.active .tab-icon { transform: translateY(-1px) scale(1.12); }
.tab-item.active:not(.tab-item-post)::after {
  content: ''; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.tab-post-btn { background: var(--grad-primary); box-shadow: 0 6px 16px rgba(63,182,243,0.45); border: 3px solid #fff; }
/* 帖子卡片：更大圆角、更松的排版 */
.post-card { border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 16px 12px 20px; margin-bottom: 14px; }
.post-card:active { transform: scale(0.992); }
.post-avatar { width: 38px; height: 38px; box-shadow: 0 0 0 2px #fff, 0 1px 5px rgba(0,0,0,0.12); }
.post-action { border-radius: 14px; }
/* 按钮 */
.btn-primary { background: var(--grad-primary); border-radius: 12px; box-shadow: 0 4px 14px rgba(63,182,243,0.35); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { border-radius: 12px; }
/* 输入框 / 聊天 */
.chat-input-bar { background: rgba(255,255,255,0.95); border-top: none; box-shadow: var(--shadow-up); }
.chat-input { background: #f1f4f8; transition: box-shadow .15s, background .15s; }
.chat-input:focus { background: #fff; box-shadow: 0 0 0 2px rgba(79,195,247,0.55); }
.chat-send-btn { background: var(--grad-primary); color: #fff; box-shadow: 0 3px 10px rgba(63,182,243,0.4); }
.chat-send-btn:active { transform: scale(0.92); }
.post-textarea { border-radius: 12px; transition: box-shadow .15s, background .15s; }
.post-textarea:focus { background: #fff; box-shadow: 0 0 0 2px rgba(79,195,247,0.55); }
.chat-bubble { border-radius: 4px 14px 14px 14px; box-shadow: 0 1px 4px rgba(20,40,70,0.07); }
.chat-bubble.mine { background: var(--grad-primary); border-radius: 14px 4px 14px 14px; box-shadow: 0 2px 8px rgba(63,182,243,0.3); }
/* 通知 / 私信列表 */
.notify-item { border-radius: 14px; box-shadow: var(--shadow); }
.notify-cat { box-shadow: 0 1px 6px rgba(26,58,110,0.07); }
.notify-cat.active { background: var(--grad-primary); box-shadow: 0 3px 10px rgba(63,182,243,0.4); }
/* 空状态 */
.empty-box { padding: 56px 0; }
.empty-icon { font-size: 44px; width: 84px; height: 84px; border-radius: 50%; background: #eaf6fd; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty-label { font-size: 14px; color: var(--text-body); }
.empty-tip { text-align: center; padding: 56px 0; color: var(--text-tip); font-size: 13px; }
.empty-tip::before { content: '📭'; display: block; font-size: 40px; margin-bottom: 10px; opacity: .85; }
/* 骨架屏 */
.sk-card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.sk-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sk-circle, .sk-line {
  background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 40%, #eef1f5 60%); background-size: 200% 100%;
  animation: skShine 1.3s linear infinite;
}
.sk-circle { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.sk-line { height: 11px; border-radius: 6px; margin-bottom: 9px; }
@keyframes skShine { from { background-position: 100% 0; } to { background-position: -100% 0; } }
/* 表情面板 */
.chat-bubble.lp-target { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.emoji-btn { font-size: 20px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.emoji-btn.on { background: #e8f6fe; }
.emoji-btn-inline {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 5px 12px;
  border-radius: 14px; background: #f1f4f8; color: var(--text-body); font-size: 13px; cursor: pointer; user-select: none;
}
.emoji-panel {
  position: absolute; left: 0; right: 0; height: 232px; z-index: 250; display: none; flex-direction: column;
  background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(20,40,70,0.14);
  animation: emojiUp .18s ease both;
}
.emoji-panel.show { display: flex; }
@keyframes emojiUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.emoji-tabs { display: flex; padding: 6px 8px 0; border-bottom: 1px solid var(--border-light); }
.emoji-tab { flex: 1; text-align: center; font-size: 19px; padding: 5px 0 7px; cursor: pointer; border-bottom: 2px solid transparent; opacity: .6; }
.emoji-tab.active { opacity: 1; border-bottom-color: var(--accent); }
.emoji-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(8, 1fr); padding: 6px 8px 10px; align-content: start; -webkit-overflow-scrolling: touch; }
.emoji-item { text-align: center; font-size: 24px; line-height: 38px; height: 38px; cursor: pointer; border-radius: 8px; user-select: none; -webkit-user-select: none; }
.emoji-item:active { background: #eaf6fd; transform: scale(1.2); }
.emoji-empty { grid-column: 1 / -1; text-align: center; color: var(--text-tip); font-size: 13px; padding: 40px 0; }

/* ====================== [UI v1.9.1] 聊天输入栏：QQ / 微信式两行布局 ====================== */
.chat-send-btn { width: auto; min-width: 58px; height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; font-weight: 700; letter-spacing: 1px; }
.chat-input-bar2 {
  height: auto; flex-direction: column; align-items: stretch; gap: 0;
  padding: 0 0 env(safe-area-inset-bottom, 0px);
}
.chat-row-main { display: flex; align-items: center; gap: 10px; padding: 9px 12px 4px; }
.chat-row-main .chat-input, .chat-row-main .chat-hold-btn { flex: 1; min-width: 0; height: 40px; border-radius: 12px; }
.chat-row-main .chat-send-btn { height: 40px; flex-shrink: 0; }
.chat-row-tools { display: flex; align-items: center; justify-content: space-around; height: 42px; padding: 0 12px 2px; }
.chat-row-tools .chat-tool-btn, .chat-row-tools .emoji-btn {
  width: 56px; height: 38px; border-radius: 10px; background: none; color: #5f6b76;
}
.chat-row-tools .chat-tool-btn:active { background: #eef2f6; opacity: 1; }
.chat-row-tools .emoji-btn.on { background: #e8f6fe; color: var(--accent); }
.chat-row-tools svg, .emoji-btn svg { width: 26px; height: 26px; display: block; }
#page-chat .page-content { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
#page-chat .mention-panel { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }

html, body { touch-action: manipulation; }
.tab-item, .msg-tab, .chat-item, .topbar-left, .search-submit-btn, .profile-tab, .user-row, .post-card { -webkit-tap-highlight-color: transparent; }
.tab-item, .msg-tab, .chat-item, .topbar-left, .search-submit-btn, .profile-tab { -webkit-user-select: none; user-select: none; }
.post-card, .chat-item, .user-row, .tab-item, .msg-tab, .topbar-left, .search-submit-btn, .profile-tab, .tab-post-btn, .ubtn { transition: transform .12s ease, background-color .12s ease, opacity .12s ease; }
.post-card:active, .chat-item:active, .user-row:active { background: #f1f4f7; transform: scale(.985); }
.tab-item:active, .msg-tab:active, .topbar-left:active, .search-submit-btn:active, .profile-tab:active, .tab-post-btn:active, .ubtn:active { opacity: .55; transform: scale(.94); }
.page.active { animation: pageFade .16s ease-out; }
@keyframes pageFade { from { opacity: .35; } to { opacity: 1; } }
.page-content { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.post-time { font-size: 12px; color: var(--text-tip); margin: -2px 0 6px; }
.post-credit { font-size: 11px; color: var(--text-tip); margin: 4px 0 2px; }
.post-credit a { color: inherit; text-decoration: underline; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid #f0f2f4; cursor: pointer; }
.user-row-avatar { width: 42px !important; height: 42px !important; margin: 0 !important; flex: none; }
.user-row-info { flex: 1; min-width: 0; }
.user-row-name { font-size: 15px; font-weight: 600; color: var(--text-title); }
.user-row-sub { font-size: 12px; color: var(--text-tip); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ubtn { flex: none; font-size: 12px; padding: 5px 10px; border-radius: 14px; border: 1px solid var(--primary); color: var(--primary); background: #fff; cursor: pointer; }
.ubtn.on { background: var(--primary); color: #fff; }
.search-group-btn { font-size: 12px; color: #fff; background: var(--primary); padding: 3px 10px; border-radius: 12px; cursor: pointer; }

/* 和 #page-profile 完全一致的容器规则：内容从屏幕最上沿开始，封面顶满，返回键悬浮（用同一组选择器，避免两页渲染环境出现差异） */
#page-profile .page-content, #page-user .page-content { top: 0; padding-top: 0; padding-bottom: 24px; }
#page-user .page-content { overflow-y: auto; -webkit-overflow-scrolling: touch; }
#page-user .profile-back-btn-float { top: calc(14px + env(safe-area-inset-top, 0px)); }
#page-user .profile-banner { cursor: default; flex-shrink: 0; }
#page-user .profile-avatar { cursor: default; }
#page-user .profile-avatar::after { display: none; } /* 别人的头像不显示“可更换”相机角标 */
.user-post { background: #fff; padding: 12px 16px; margin-bottom: 8px; }
.user-post-time { font-size: 12px; color: var(--text-tip); margin-bottom: 6px; }
.user-post-text { font-size: 14px; color: var(--text-title); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.user-empty { text-align: center; color: var(--text-tip); font-size: 13px; padding: 30px 0; }
