/* ============================================
   小韩IM - iOS26液态效果样式
   白底黑字 / FontAwesome 4.7
   ============================================ */

/* ========== 全局变量 ========== */
:root {
    --bg-primary: #f5f5f7;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --bg-glass-dark: rgba(255, 255, 255, 0.55);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #aeaeb2;
    --accent: #007aff;
    --accent-press: #0066d6;
    --green: #34c759;
    --red: #ff3b30;
    --orange: #ff9500;
    --yellow: #ffcc00;
    --purple: #af52de;
    --gray-bg: #f2f2f7;
    --border: rgba(0, 0, 0, 0.06);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --tab-bar-height: 56px;
}

/* ========== Reset ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
}

/* 液态效果 - 毛玻璃 */
.liquid-glass {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* 液态过渡动画 */
.liquid-transition {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 液态弹性 */
.liquid-bounce:active {
    transform: scale(0.96);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 通用 ========== */
#app {
    height: 100%;
    position: relative;
}

.page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: var(--bg-primary);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.page-enter {
    animation: pageEnter 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes pageEnter {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== 导航栏 ========== */
.navbar {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    padding-top: var(--safe-top);
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 0.5px solid var(--border);
}

.navbar-title {
    font-size: 17px;
    font-weight: 600;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.navbar-left, .navbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
}

.navbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--accent);
    transition: all 0.2s;
}

.navbar-btn:active {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(0.92);
}

/* ========== 底部Tab栏 ========== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--tab-bar-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 0.5px solid var(--border);
    display: flex;
    z-index: 100;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tab-item i {
    font-size: 22px;
}

.tab-item.active {
    color: var(--accent);
}

.tab-item .badge {
    position: absolute;
    top: 2px;
    right: 25%;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* ========== 登录/注册页面 ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 50%, #d1d1e0 100%);
}

.auth-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.auth-logo i {
    font-size: 40px;
    color: #fff;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-form {
    width: 100%;
    max-width: 380px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    padding: 28px 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 14px;
    color: var(--text-tertiary);
    font-size: 16px;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 16px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-primary);
    transition: all 0.3s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.input-wrapper .captcha-img {
    position: absolute;
    right: 6px;
    top: 6px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    height: 50px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-primary:active {
    transform: scale(0.97);
    background: var(--accent-press);
}

.btn-primary:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

/* ========== 聊天列表 ========== */
.chat-list {
    background: var(--bg-card);
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:active {
    background: var(--gray-bg);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gray-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.chat-content {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
    overflow: hidden;
}

.chat-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-preview {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.chat-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

.chat-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--red);
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* ========== 聊天窗口 ========== */
.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    -webkit-overflow-scrolling: touch;
}

.msg-row {
    display: flex;
    margin-bottom: 16px;
    animation: msgAppear 0.3s ease;
}

@keyframes msgAppear {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-row.self {
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    overflow: hidden;
}

.msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msg-bubble {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 1.4;
    word-break: break-word;
    position: relative;
}

.msg-row.self .msg-bubble {
    margin-right: 8px;
    background: #95ec69;
    color: var(--text-primary);
    border-radius: 16px 4px 16px 16px;
}

.msg-row.other .msg-bubble {
    margin-left: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 4px 16px 16px 16px;
    box-shadow: var(--shadow-sm);
}

.msg-read-status {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.msg-read-status.read {
    color: var(--accent);
}

.msg-recalled {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
    padding: 4px 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 8px;
    display: inline-block;
    max-width: 100%;
}

/* ========== 聊天输入栏 ========== */
.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 12px;
    padding-bottom: calc(8px + var(--safe-bottom));
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--border);
}

.chat-input-bar i {
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s;
}

.chat-input-bar i:active {
    color: var(--accent);
}

.chat-input {
    flex: 1;
    min-height: 36px;
    max-height: 100px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    resize: none;
    line-height: 1.4;
}

.chat-send-btn {
    height: 36px;
    padding: 0 16px;
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: none;
}

.chat-send-btn.show {
    display: flex;
    align-items: center;
}

/* ========== 通用列表 ========== */
.list-group {
    background: var(--bg-card);
    margin: 8px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:active {
    background: var(--gray-bg);
}

.list-item-icon {
    width: 32px;
    text-align: center;
    color: var(--accent);
    font-size: 20px;
}

.list-item-content {
    flex: 1;
    margin-left: 12px;
    font-size: 16px;
}

.list-item-arrow {
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ========== 通话界面 ========== */
.call-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #1c1c1e;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.call-container.video {
    background: #000;
}

.call-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gray-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #fff;
    overflow: hidden;
    margin-bottom: 20px;
}

.call-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.call-status {
    font-size: 16px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 40px;
}

.call-actions {
    display: flex;
    gap: 40px;
}

.call-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.call-btn.accept {
    background: var(--green);
    color: #fff;
}

.call-btn.reject {
    background: var(--red);
    color: #fff;
}

.call-btn:active {
    transform: scale(0.92);
}

.call-video-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.call-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-local-video {
    position: absolute;
    top: 60px;
    right: 20px;
    width: 100px;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    z-index: 10;
    border: 2px solid rgba(255,255,255,0.3);
}

.call-local-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

/* ========== 弹窗/Modal ========== */
.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    width: 85%;
    max-width: 320px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: modalScale 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes modalScale {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 20px 20px 8px;
    text-align: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 0 20px 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-line;
}

.modal-footer {
    display: flex;
    border-top: 0.5px solid var(--border);
}

.modal-btn {
    flex: 1;
    height: 48px;
    border: none;
    background: transparent;
    font-size: 17px;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn:active {
    background: var(--gray-bg);
}

.modal-btn.primary {
    color: var(--accent);
    font-weight: 600;
}

.modal-btn + .modal-btn {
    border-left: 0.5px solid var(--border);
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 10000;
    max-width: 250px;
    text-align: center;
    animation: toastShow 0.3s ease;
    pointer-events: none;
}

@keyframes toastShow {
    from { opacity: 0; transform: translate(-50%, -40%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ========== 朋友圈 ========== */
.moment-item {
    display: flex;
    padding: 16px;
    background: var(--bg-card);
    border-bottom: 0.5px solid var(--border);
}

.moment-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
    overflow: hidden;
}

.moment-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moment-body {
    flex: 1;
    margin-left: 12px;
    min-width: 0;
}

.moment-username {
    font-size: 15px;
    font-weight: 600;
    color: #576b95;
}

.moment-text {
    font-size: 15px;
    color: var(--text-primary);
    margin-top: 6px;
    line-height: 1.5;
    word-break: break-word;
}

.moment-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 8px;
}

.moment-images img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
}

.moment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.moment-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ========== 加载状态 ========== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-tertiary);
}

.loading i {
    margin-right: 8px;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 空状态 ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}

/* ========== 公告弹窗 ========== */
.announcement-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.announcement-content {
    width: 85%;
    max-width: 340px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: modalScale 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.announcement-header {
    background: linear-gradient(135deg, #007aff, #5856d6);
    padding: 24px;
    text-align: center;
    color: #fff;
}

.announcement-header i {
    font-size: 36px;
    margin-bottom: 8px;
}

.announcement-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.announcement-body {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-line;
}

.announcement-footer {
    padding: 0 20px 20px;
}

.announcement-footer button {
    width: 100%;
    height: 44px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.announcement-footer button:active {
    background: var(--accent-press);
}

/* ============================================
   阶段11: UI优化补充样式
   ============================================ */

/* ========== 通讯录页面 ========== */
.contacts-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.contacts-search-bar {
    padding: 8px 16px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.contacts-search-bar input {
    width: 100%;
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 18px;
    background: rgba(0,0,0,0.04);
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
}

.contacts-section-title {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    font-weight: 500;
}

.contacts-quick-entry {
    display: flex;
    flex-direction: column;
}

.contacts-quick-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 0.5px solid var(--border);
}

.contacts-quick-item:active {
    background: var(--gray-bg);
}

.contacts-quick-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
}

.contacts-quick-icon.friends { background: var(--accent); }
.contacts-quick-icon.tags { background: var(--orange); }
.contacts-quick-icon.teams { background: var(--purple); }
.contacts-quick-icon.groups { background: var(--green); }

.contacts-quick-info {
    flex: 1;
    margin-left: 12px;
}

.contacts-quick-name {
    font-size: 16px;
    font-weight: 500;
}

.contacts-quick-count {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== 个人中心页面 ========== */
.profile-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.profile-header {
    background: var(--bg-card);
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--gray-bg);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-user-info {
    flex: 1;
}

.profile-username {
    font-size: 18px;
    font-weight: 600;
}

.profile-signature {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.profile-id-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.profile-id-row i {
    color: var(--text-tertiary);
}

.profile-section {
    background: var(--bg-card);
    margin-bottom: 8px;
}

.profile-section-title {
    padding: 12px 16px 4px;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.profile-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 0.5px solid var(--border);
}

.profile-item:last-child {
    border-bottom: none;
}

.profile-item:active {
    background: var(--gray-bg);
}

.profile-item-icon {
    width: 32px;
    text-align: center;
    font-size: 20px;
    color: var(--accent);
}

.profile-item-icon.wallet { color: var(--green); }
.profile-item-icon.favorites { color: var(--orange); }
.profile-item-icon.security { color: var(--red); }
.profile-item-icon.privacy { color: var(--purple); }
.profile-item-icon.about { color: var(--text-secondary); }

.profile-item-content {
    flex: 1;
    margin-left: 12px;
    font-size: 16px;
}

.profile-item-value {
    font-size: 14px;
    color: var(--text-secondary);
    margin-right: 8px;
}

.profile-item-arrow {
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ========== 朋友圈详情/发布页 ========== */
.moment-detail-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.moment-publish-page {
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.moment-publish-area {
    flex: 1;
    padding: 16px;
    background: var(--bg-card);
}

.moment-publish-textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: transparent;
    resize: none;
}

.moment-publish-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.moment-publish-img-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
}

.moment-publish-img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moment-publish-img-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}

.moment-publish-add-img {
    aspect-ratio: 1;
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-tertiary);
    cursor: pointer;
}

.moment-comments {
    background: var(--bg-card);
    padding: 12px 16px;
    margin-top: 8px;
}

.moment-comment-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 0.5px solid var(--border);
}

.moment-comment-item:last-child {
    border-bottom: none;
}

.moment-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    flex-shrink: 0;
    overflow: hidden;
}

.moment-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.moment-comment-body {
    flex: 1;
    margin-left: 10px;
}

.moment-comment-name {
    font-size: 14px;
    color: #576b95;
    font-weight: 500;
}

.moment-comment-text {
    font-size: 14px;
    color: var(--text-primary);
    margin-top: 2px;
}

.moment-actions-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px 0;
}

.moment-action {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.moment-action i {
    font-size: 16px;
}

.moment-action.liked {
    color: var(--red);
}

.moment-action:active {
    transform: scale(0.92);
}

/* ========== 群组信息页 ========== */
.group-info-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.group-info-header {
    background: var(--bg-card);
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.group-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--gray-bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    flex-shrink: 0;
}

.group-info-meta {
    flex: 1;
}

.group-name {
    font-size: 18px;
    font-weight: 600;
}

.group-member-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.group-member-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
}

.group-member-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.group-member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gray-bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.group-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-member-name {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.group-add-member {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--text-tertiary);
    cursor: pointer;
}

/* ========== 钱包/安全/隐私/收藏页 ========== */
.wallet-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.wallet-card {
    margin: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #007aff, #5856d6);
    border-radius: var(--radius-lg);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.2);
}

.wallet-balance-label {
    font-size: 14px;
    opacity: 0.8;
}

.wallet-balance {
    font-size: 32px;
    font-weight: 700;
    margin-top: 8px;
}

.wallet-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.wallet-action-btn {
    flex: 1;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 18px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.wallet-transaction-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-card);
    border-bottom: 0.5px solid var(--border);
}

.wallet-transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.wallet-transaction-icon.income { background: var(--green); }
.wallet-transaction-icon.expense { background: var(--orange); }

.wallet-transaction-info {
    flex: 1;
    margin-left: 12px;
}

.wallet-transaction-desc {
    font-size: 15px;
    color: var(--text-primary);
}

.wallet-transaction-time {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.wallet-transaction-amount {
    font-size: 16px;
    font-weight: 600;
}

.wallet-transaction-amount.income { color: var(--green); }
.wallet-transaction-amount.expense { color: var(--red); }

/* ========== 收藏页面 ========== */
.favorites-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.favorite-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 0.5px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.favorite-item:active {
    background: var(--gray-bg);
}

.favorite-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gray-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.favorite-content {
    flex: 1;
    margin-left: 12px;
}

.favorite-title {
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.favorite-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ========== 深色模式预留 ========== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1c1c1e;
        --bg-card: #2c2c2e;
        --bg-glass: rgba(30, 30, 30, 0.72);
        --bg-glass-dark: rgba(30, 30, 30, 0.55);
        --text-primary: #f5f5f7;
        --text-secondary: #98989d;
        --text-tertiary: #636366;
        --gray-bg: #3a3a3c;
        --border: rgba(255, 255, 255, 0.08);
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
    }
    
    .msg-row.self .msg-bubble {
        background: #3a5f3a;
        color: #f5f5f7;
    }
    
    .msg-row.other .msg-bubble {
        background: #2c2c2e;
        color: #f5f5f7;
    }
    
    body { background: var(--bg-primary); }
    .chat-input { background: var(--bg-card); color: var(--text-primary); }
    .chat-avatar { background: var(--gray-bg); }
}

/* ========== 响应式适配 (APK/WebView) ========== */
@media (max-width: 360px) {
    .navbar-title { font-size: 15px; }
    .msg-bubble { max-width: 70%; font-size: 15px; }
    .chat-avatar { width: 44px; height: 44px; }
    .group-member-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
    /* 平板适配 */
    #app {
        max-width: 430px;
        margin: 0 auto;
        box-shadow: var(--shadow-lg);
    }
    .page { max-width: 430px; margin: 0 auto; }
    .tab-bar { max-width: 430px; margin: 0 auto; }
}

/* ========== 液态动画增强 ========== */
@keyframes liquidRipple {
    0% { transform: scale(0); opacity: 0.4; }
    100% { transform: scale(2); opacity: 0; }
}

.liquid-ripple {
    position: relative;
    overflow: hidden;
}

.liquid-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.liquid-ripple:active::after {
    animation: liquidRipple 0.5s ease-out;
}

/* 液态滑动过渡 */
@keyframes liquidSlideIn {
    from { transform: translate3d(100%, 0, 0); opacity: 0; }
    to { transform: translate3d(0, 0, 0); opacity: 1; }
}

.page.page-enter {
    animation: liquidSlideIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 液态弹跳 */
@keyframes liquidBounce {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-content {
    animation: liquidBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 液态按钮按压 */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.btn-primary:active::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition: transform 0s, opacity 0s;
}

/* 液态下拉刷新 */
.pull-refresh {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 20px;
}

/* 消息发送动画 */
@keyframes msgSlideIn {
    from { transform: translateY(20px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.msg-row {
    animation: msgSlideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 阅后即焚倒计时动画 */
@keyframes burnPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.msg-burn-timer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--red);
    animation: burnPulse 1s ease-in-out infinite;
}

/* ========== 安全设置页 ========== */
.security-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.security-device-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-card);
    border-bottom: 0.5px solid var(--border);
}

.security-device-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gray-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.security-device-info {
    flex: 1;
    margin-left: 12px;
}

.security-device-name {
    font-size: 15px;
    color: var(--text-primary);
}

.security-device-meta {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.security-device-current {
    font-size: 11px;
    color: var(--green);
    border: 1px solid var(--green);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

/* ========== 关于我们页 ========== */
.about-page {
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
}

.about-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #fff;
    margin-bottom: 16px;
}

.about-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.about-version {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.about-desc {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
    max-width: 280px;
}

/* ========== 搜索结果页 ========== */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 0.5px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:active {
    background: var(--gray-bg);
}

.search-result-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--gray-bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.search-result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-info {
    flex: 1;
    margin-left: 12px;
}

.search-result-name {
    font-size: 16px;
    font-weight: 500;
}

.search-result-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ========== 标签管理页 ========== */
.tag-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 0.5px solid var(--border);
}

.tag-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.tag-name {
    flex: 1;
    margin-left: 12px;
    font-size: 16px;
}

.tag-count {
    font-size: 14px;
    color: var(--text-tertiary);
}

/* ========== 好友请求列表 ========== */
.friend-request-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 0.5px solid var(--border);
}

.friend-request-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--gray-bg);
    overflow: hidden;
    flex-shrink: 0;
}

.friend-request-info {
    flex: 1;
    margin-left: 12px;
}

.friend-request-name {
    font-size: 16px;
    font-weight: 500;
}

.friend-request-msg {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.friend-request-actions {
    display: flex;
    gap: 8px;
}

.friend-request-btn {
    height: 32px;
    padding: 0 16px;
    border: none;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
}

.friend-request-btn.accept {
    background: var(--accent);
    color: #fff;
}

.friend-request-btn.reject {
    background: var(--gray-bg);
    color: var(--text-secondary);
}

/* ========== 好友详情/设置页 ========== */
.friend-detail-page {
    background: var(--bg-primary);
    min-height: 100vh;
}

.friend-detail-header {
    background: var(--bg-card);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.friend-detail-avatar {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 12px;
}

.friend-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.friend-detail-name {
    font-size: 20px;
    font-weight: 600;
}

.friend-detail-actions {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.friend-detail-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
}

.friend-detail-action i {
    font-size: 28px;
}

/* ========== 扫码页 ========== */
.qr-scan-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 9999;
}

.qr-scan-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 16px;
}

.qr-scan-frame::before,
.qr-scan-frame::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--accent);
}

.qr-scan-frame::before {
    top: -3px; left: -3px;
    border-right: none; border-bottom: none;
    border-radius: 16px 0 0 0;
}

.qr-scan-frame::after {
    bottom: -3px; right: -3px;
    border-left: none; border-top: none;
    border-radius: 0 0 16px 0;
}

/* ========== 音视频消息 ========== */
.msg-voice {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.msg-voice i {
    font-size: 20px;
}

.msg-voice-duration {
    font-size: 13px;
}

.msg-file {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.msg-file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.msg-file-info {
    flex: 1;
}

.msg-file-name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.msg-file-size {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ========== 表情面板 ========== */
.emoji-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 250px;
    background: var(--bg-card);
    border-top: 0.5px solid var(--border);
    z-index: 50;
    display: none;
    flex-direction: column;
}

.emoji-panel.show {
    display: flex;
}

.emoji-panel-tabs {
    display: flex;
    border-bottom: 0.5px solid var(--border);
    overflow-x: auto;
}

.emoji-tab {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.emoji-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.emoji-grid {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 8px;
}

.emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.emoji-item:active {
    background: var(--gray-bg);
}

/* ========== 更多面板(聊天+面板) ========== */
.chat-plus-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: var(--bg-card);
    border-top: 0.5px solid var(--border);
    z-index: 50;
    display: none;
    padding: 16px;
}

.chat-plus-panel.show {
    display: block;
}

.chat-plus-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.chat-plus-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.chat-plus-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gray-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent);
}

.chat-plus-label {
    font-size: 12px;
    color: var(--text-secondary);
}
