/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #07c160;
    --primary-dark: #06ad56;
    --primary-light: #e8f8ee;
    --bg: #f5f5f5;
    --bg-white: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-hint: #999999;
    --border: #e5e5e5;
    --danger: #ee0a24;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --header-height: 56px;
    --nav-height: 60px;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    background: var(--bg);
    color: var(--text-primary);
    overflow: hidden;
}

/* ========== 页面切换 ========== */
.page {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* ========== 登录/注册页面 ========== */
.auth-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: linear-gradient(135deg, #07c160 0%, #05a350 100%);
    width: 100%;
}

.auth-logo {
    text-align: center;
    margin-bottom: 48px;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.auth-logo h1 {
    color: white;
    font-size: 28px;
    font-weight: 600;
}

.auth-form {
    width: 100%;
    max-width: 360px;
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    color: white;
    text-align: center;
    margin-bottom: 32px;
    font-size: 24px;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form input {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.95);
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    transition: box-shadow 0.2s;
}

.auth-form input:focus {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}

.auth-form input::placeholder {
    color: #aaa;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    color: rgba(255,255,255,0.85);
    font-size: 14px;
}

.auth-switch a {
    color: white;
    font-weight: 600;
    text-decoration: none;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* ========== 主应用布局 ========== */
.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    z-index: 100;
}

.header-left, .header-right {
    width: 48px;
    display: flex;
    align-items: center;
}

.header-title {
    flex: 1;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin: 0 auto;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    color: var(--text-primary);
}

.icon-btn:active {
    background: var(--bg);
}

/* ========== 搜索栏 ========== */
.search-bar {
    padding: 8px 12px;
    background: var(--bg-white);
    flex-shrink: 0;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: 20px;
    padding: 8px 12px;
    gap: 8px;
}

.search-input-wrap svg {
    color: var(--text-hint);
    flex-shrink: 0;
}

.search-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: var(--text-primary);
}

.search-clear {
    width: 20px;
    height: 20px;
    border: none;
    background: var(--text-hint);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ========== 内容区域 ========== */
.app-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.content-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: none;
    background: var(--bg);
}

.content-page.active {
    display: flex;
    flex-direction: column;
}

/* ========== 消息列表 ========== */
.conversation-list {
    list-style: none;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.conversation-item:active {
    background: var(--bg);
}

.conv-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
}

.conv-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.conv-info {
    flex: 1;
    min-width: 0;
}

.conv-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-last-msg {
    font-size: 13px;
    color: var(--text-hint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conv-meta {
    text-align: right;
    flex-shrink: 0;
    margin-left: 8px;
}

.conv-time {
    font-size: 12px;
    color: var(--text-hint);
    margin-bottom: 4px;
}

.conv-unread {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    background: var(--danger);
    color: white;
    border-radius: 9px;
    font-size: 11px;
    padding: 0 5px;
}

/* ========== 通讯录 ========== */
.contact-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.contact-item:active {
    background: var(--bg);
}

.contact-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-size: 16px;
    font-weight: 500;
}

.contact-status {
    font-size: 12px;
    color: var(--text-hint);
}

.contact-status.online {
    color: var(--primary);
}

.contact-remove {
    padding: 4px 12px;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 4px;
    font-size: 12px;
    background: transparent;
    cursor: pointer;
}

/* ========== 群聊列表 ========== */
.group-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.group-item:active {
    background: var(--bg);
}

.group-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    margin-right: 12px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    overflow: hidden;
}

.group-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.group-info {
    flex: 1;
}

.group-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.group-desc {
    font-size: 13px;
    color: var(--text-hint);
}

.group-members {
    font-size: 12px;
    color: var(--text-hint);
}

/* ========== 聊天窗口 ========== */
#page-chat.content-page.active {
    display: flex;
    flex-direction: column;
}

.chat-header-info {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
}

.chat-header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-header-name {
    font-size: 15px;
    font-weight: 500;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    background: var(--bg);
}

/* 消息气泡 */
.message {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: msgIn 0.2s ease;
    margin-bottom: 12px;
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.self {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message:not(.self) {
    margin-right: auto;
}

.msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--bg-white);
}

.msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msg-avatar.clickable {
    cursor: pointer;
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.message:not(.self) .msg-bubble {
    background: var(--bg-white);
    color: var(--text-primary);
    border-top-left-radius: 4px;
}

.message.self .msg-bubble {
    background: #95ec6a;
    color: var(--text-primary);
    border-top-right-radius: 4px;
}

.msg-name {
    font-size: 12px;
    color: var(--text-hint);
    margin-bottom: 4px;
}

.msg-time {
    font-size: 11px;
    color: rgba(0,0,0,0.3);
    margin-top: 4px;
    text-align: right;
}

.msg-link {
    color: #0645ad;
    text-decoration: underline;
    cursor: pointer;
    word-break: break-all;
}

.msg-link:hover {
    text-decoration: none;
}

/* 媒体消息 */
.msg-image {
    max-width: 200px;
    max-width: 60vw;
    max-height: 240px;
    min-width: 80px;
    min-height: 80px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E") center/32px no-repeat;
    object-fit: scale-down;
}

.msg-image-error {
    opacity: 0.6;
    border: 1px dashed var(--border);
}

.media-loading {
    animation: mediaPulse 1.2s ease infinite;
}

@keyframes mediaPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.media-not-found {
    background: var(--bg) !important;
    cursor: default !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-hint);
    font-size: 13px;
    text-align: center;
    min-height: 80px;
    overflow: hidden;
}

.media-not-found-tip {
    font-size: 12px;
    color: var(--text-hint);
    padding: 4px 0;
}

.msg-video {
    max-width: 240px;
    max-width: 70vw;
    max-height: 240px;
    border-radius: 8px;
    display: block;
    background: #000;
}

.msg-voice {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.msg-voice svg {
    flex-shrink: 0;
}

.msg-voice-duration {
    font-size: 13px;
    color: var(--text-hint);
}

.msg-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 8px;
    cursor: pointer;
}

.msg-file-icon {
    font-size: 28px;
}

.msg-file-info {
    flex: 1;
    min-width: 0;
}

.msg-file-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-file-size {
    font-size: 11px;
    color: var(--text-hint);
}

/* 输入区域 */
.chat-input-area {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 8px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    gap: 6px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.chat-tools {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.chat-tools::-webkit-scrollbar {
    display: none;
}

.chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    width: 100%;
}

.tool-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 50%;
    color: var(--text-secondary);
}

.tool-btn:active {
    background: var(--bg);
}

.chat-input-wrap {
    flex: 1;
    min-width: 0;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    max-height: 100px;
}

.chat-input-wrap textarea {
    width: 100%;
    min-height: 24px;
    max-height: 84px;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
    resize: none;
    line-height: 1.4;
    color: var(--text-primary);
    font-family: inherit;
    overflow-y: auto;
}

.btn-send {
    padding: 8px 16px;
    flex-shrink: 0;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    height: 36px;
}

.btn-send:active {
    background: var(--primary-dark);
}

.btn-send:disabled {
    background: #ccc;
}

/* ========== 底部导航 ========== */
.bottom-nav {
    display: flex;
    height: var(--nav-height);
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    color: var(--text-hint);
    transition: color 0.2s;
    border: none;
    background: transparent;
    font-size: 10px;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item.active {
    color: var(--primary);
}

/* ========== 个人资料 ========== */
.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px 24px;
    background: var(--bg-white);
}

.profile-avatar-wrap {
    position: relative;
    width: 88px;
    height: 88px;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
}

.profile-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-username {
    font-size: 14px;
    color: var(--text-hint);
}

.profile-menu {
    background: var(--bg-white);
    margin-top: 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.menu-item:active {
    background: var(--bg);
}

.menu-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.menu-item span:not(.menu-icon):not(.menu-arrow) {
    flex: 1;
    font-size: 16px;
}

.menu-arrow {
    color: var(--text-hint);
    font-size: 20px;
}

.menu-danger span:not(.menu-icon) {
    color: var(--danger);
}

/* ========== 弹窗 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-large {
    max-width: 500px;
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 18px;
    color: var(--text-hint);
    cursor: pointer;
    border-radius: 50%;
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

/* 链接预览全屏弹窗 */
.link-modal.active {
    align-items: stretch;
    justify-content: flex-start;
}

.link-modal-content {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
}

.link-modal-body {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    position: relative;
}

.link-preview-frame {
    flex: 1;
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-white);
}

.link-preview-fallback {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.link-preview-url {
    word-break: break-all;
    text-align: center;
    color: var(--text-primary);
    font-size: 16px;
    max-width: 100%;
    line-height: 1.6;
}

/* ========== 确认弹窗 ========== */
.confirm-modal-content {
    padding: 28px 24px;
    text-align: center;
    max-width: 320px;
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
}

.confirm-buttons .btn {
    flex: 1;
    padding: 10px 0;
    font-size: 15px;
    border-radius: var(--radius-sm);
}

.confirm-buttons .btn-outline {
    background: var(--bg);
    color: var(--text-primary);
    border: none;
}

.confirm-buttons .btn-outline:active {
    background: var(--border);
}

.confirm-buttons .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    color: var(--text-primary);
    background: var(--bg-white);
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary);
}

/* ========== 用户资料弹窗 ========== */
.user-profile-modal-content {
    position: relative;
    padding: 32px 24px 24px;
    text-align: center;
    max-width: 320px;
}

.user-profile-modal-content .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.user-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.user-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile-nickname {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-profile-username {
    font-size: 14px;
    color: var(--text-hint);
    margin-bottom: 16px;
}

.user-profile-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.user-profile-actions .btn {
    padding: 12px 0;
    font-size: 15px;
}

/* ========== 搜索结果显示 ========== */
.search-results {
    margin-top: 12px;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.search-result-item:active {
    opacity: 0.7;
}

.search-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    overflow: hidden;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.search-result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-name {
    flex: 1;
    font-size: 15px;
}

.search-result-btn {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

/* ========== 成员列表 ========== */
.member-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.member-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 64px;
    cursor: pointer;
}

.member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 4px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-name {
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

.member-role {
    font-size: 10px;
    color: var(--primary);
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    text-align: center;
    max-width: 80%;
}

.toast.show {
    opacity: 1;
}

/* ========== 加载遮罩 ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.7);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    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-hint);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 14px;
}

/* ========== 日期分隔 ========== */
.date-divider {
    text-align: center;
    font-size: 12px;
    color: var(--text-hint);
    padding: 8px 0;
}

/* ========== 响应式：平板/桌面 ========== */
@media (min-width: 768px) {
    .app-content {
        max-width: 480px;
        margin: 0 auto;
    }
    
    .bottom-nav {
        max-width: 480px;
        margin: 0 auto;
    }
    
    .auth-container {
        max-width: 400px;
        margin: 0 auto;
    }
}

/* ========== 滚动条美化 ========== */
.content-page::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.content-page::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
}

/* ========== 语音录制动画 ========== */
.voice-recording {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
}

.voice-recording .rec-dot {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ========== Action Sheet ========== */
.action-sheet {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1500;
    flex-direction: column;
    justify-content: flex-end;
}

.action-sheet.active {
    display: flex;
}

.action-sheet-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
}

.action-sheet-content {
    position: relative;
    background: var(--bg);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
    animation: actionSheetIn 0.25s ease;
}

@keyframes actionSheetIn {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.action-sheet-title {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: var(--text-hint);
}

.action-sheet-item {
    padding: 16px;
    text-align: center;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--text-primary);
    cursor: pointer;
}

.action-sheet-item:active {
    opacity: 0.7;
}

.action-sheet-cancel {
    padding: 16px;
    text-align: center;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
}

.action-sheet-cancel:active {
    opacity: 0.7;
}

/* ========== 录音弹窗 ========== */
.voice-record-modal-content {
    position: relative;
    padding: 32px 24px 24px;
    text-align: center;
    max-width: 320px;
    border-radius: var(--radius);
}

.voice-record-modal-content .modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
}

.voice-record-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.voice-record-icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: recordingPulse 1.5s ease infinite;
}

@keyframes recordingPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.85; }
}

.voice-record-time {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.voice-record-tip {
    font-size: 13px;
    color: var(--text-hint);
    margin-bottom: 24px;
}

.voice-record-stop {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--danger);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(238, 10, 36, 0.3);
}

.voice-record-stop:active {
    transform: scale(0.95);
}
