﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿﻿/* ============================================================
   AI聚合助手 - 全局样式
   设计风格：简洁白色背景 + 蓝色主色 + 卡片式列表
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* iPhone 安全区域适配 */
html {
  height: 100%;
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--bg-page, #F5F7FA);
  overscroll-behavior: none;
}

/* iPhone 底部 Tabbar 安全区适配 */
#tabbar {
  padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
}

/* iPhone 顶部状态栏适配 */
#header {
  padding-top: calc(8px + env(safe-area-inset-top)) !important;
}

:root {
  --primary: #2196F3;
  --primary-light: #E3F2FD;
  --text-main: #333333;
  --text-sub: #999999;
  --text-desc: #B0B0B0;
  --bg-page: #F5F7FA;
  --bg-card: #FFFFFF;
  --divider: #F0F0F0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  --radius: 12px;
}

/* 翎舍/翎册 紫调主题（个人中心 + 成员管理） */
#profileView,
#userMgmtView {
  background: linear-gradient(180deg, #b8a8e8 0%, #c9bcf0 10%, #d4c9f5 20%, #ded4f7 30%, #e6dff9 40%, #ece7fa 50%, #f0ecfb 60%, #f3f0fc 70%, #f6f4fd 80%, #f8f7fe 90%, #faf9ff 100%) !important;
}
#profileView .header,
#userMgmtView .header {
  background: transparent !important;
}
#profileView .header-title,
#userMgmtView .header-title {
  color: #5b4db0 !important;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #E9ECF0;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  max-width: 430px;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  text-align: left;
  background: var(--bg-page);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  position: relative;
}

.hidden { display: none !important; }

/* ============================================================
   顶部品牌标题栏
   ============================================================ */
.top-brand-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px 20px 9px;
  background: var(--bg-card);
}

.top-brand-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 4px;
  padding-left: 4px;
}

/* ============================================================
   密码验证弹窗
   ============================================================ */
.auth-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 28px 16px 22px;
  width: calc(100vw - 32px);
  max-width: 360px;
  box-sizing: border-box;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: authFadeIn 0.35s ease;
  max-height: calc(100vh - 10vh - 20px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.auth-card.wide {
  padding: 28px 16px 24px;
}

@keyframes authFadeIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Toast 提示弹窗 */
.toast-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.toast-modal.hidden { display: none; }
.toast-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 20px;
  width: 280px;
  text-align: center;
  animation: toastPopIn 0.25s ease-out;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}
@keyframes toastPopIn {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}
.toast-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-text {
  font-size: 15px;
  color: #333;
  line-height: 1.5;
  margin-bottom: 20px;
  font-weight: 500;
}
.toast-btn {
  width: 100%;
  padding: 11px 0;
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.toast-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

/* 自定义确认弹窗 */
.confirm-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.confirm-card {
  background: white;
  border-radius: 24px;
  padding: 32px 28px 24px;
  width: 80%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: confirmPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes confirmPop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.confirm-icon {
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

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

.confirm-message {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 24px;
}

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

.prompt-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #E8E8E8;
  border-radius: 12px;
  font-size: 15px;
  background: #FAFAFA;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
  box-sizing: border-box;
}
.prompt-input:focus {
  border-color: #2196F3;
  background: #fff;
}

.confirm-btn {
  flex: 1;
  padding: 12px 0;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
}

.confirm-btn:active {
  opacity: 0.85;
}

.confirm-btn.cancel {
  background: #F0F2F5;
  color: #666;
}

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

/* 密码输入弹窗 */
.pwd-card {
  width: 85%;
  max-width: 340px;
}

.pwd-input-wrap {
  position: relative;
  margin-bottom: 12px;
}

.pwd-input {
  width: 100%;
  padding: 14px 44px 14px 16px;
  border: 2px solid #E0E0E0;
  border-radius: 14px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  background: #FAFAFA;
}

.pwd-input:focus {
  border-color: var(--primary);
  background: white;
}

.pwd-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwd-error {
  color: #EF4444;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: left;
}

/* ============================================================
   文档预览弹窗
   ============================================================ */
.doc-preview-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.doc-preview-card {
  background: white;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 430px;
  height: 92vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

.doc-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.doc-preview-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-preview-title-input {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 4px 10px;
  outline: none;
  background: #F0F7FF;
}

.doc-preview-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-preview-meta {
  padding: 10px 20px;
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.doc-preview-meta span {
  background: #F5F5F5;
  padding: 2px 8px;
  border-radius: 4px;
}

.doc-preview-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.doc-preview-edit {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.doc-preview-download {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doc-preview-textarea {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.7;
  font-family: inherit;
  resize: none;
  background: #FAFAFA;
  color: var(--text-main);
  box-sizing: border-box;
}

.doc-preview-footer {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--divider);
  flex-shrink: 0;
}

.doc-btn-cancel,
.doc-btn-save {
  flex: 1;
  padding: 10px 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.doc-btn-cancel {
  background: #F0F0F0;
  color: #666;
}

.doc-btn-save {
  background: #2196F3;
  color: white;
}

.doc-btn-cancel:active,
.doc-btn-save:active {
  opacity: 0.8;
}

.auth-title {
  font-size: 24px;
  font-weight: 600;
  margin: 16px 0 10px;
}

.auth-desc {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 28px;
}

.auth-input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #E0E0E0;
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: var(--primary);
}

.auth-btn {
  width: 100%;
  padding: 13px;
  margin-top: 10px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.auth-btn:active { opacity: 0.85; }

#loginForm {
  gap: 16px;
  padding: 16px 0;
}
#loginForm .auth-input {
  padding: 12px 15px;
  font-size: 15px;
  border-radius: 10px;
}
#loginForm .auth-btn {
  margin-top: 20px;
  padding: 13px;
  font-size: 16px;
  border-radius: 10px;
}
.auth-error {
  color: #f44336;
  font-size: 14px;
  margin-top: 14px;
}

/* ============================================================
   通用视图
   ============================================================ */
.view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ============================================================
   状态栏
   ============================================================ */
.status-bar {
  display: none;
}

/* ============================================================
   顶部标题栏
   ============================================================ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 8px;
  background: var(--bg-card);
  border-bottom: none;
  flex-shrink: 0;
}

.header-title {
  font-size: 17px;
  font-weight: 700;
  color: #0D47A1;
  letter-spacing: 1px;
}

.header-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #BBDEFB;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

/* ============================================================
   首页顶部切换栏（AI助手/同事群/通讯录）
   ============================================================ */
.home-top-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 2px 8px 4px;
  background: var(--bg-card);
  flex-shrink: 0;
}
.home-top-tab {
  position: relative;
  padding: 4px 12px;
  font-size: 14px;
  color: #888;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
}
.home-top-tab.active {
  color: #1565C0;
  background: #E3F2FD;
  font-weight: 600;
}
.im-tab-badge {
  position: absolute;
  top: -2px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #EF4444;
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* 面板容器 */
.im-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

/* 同事群/通讯录 - 顶部标题栏 */
.im-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 14px;
  border-bottom: 1px solid #f0f0f0;
  background: var(--bg-card);
  flex-shrink: 0;
  z-index: 2;
}
.im-panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.im-create-group-btn {
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e3f2fd;
  display: flex;
  align-items: center;
  justify-content: center;
}
.im-create-group-btn::before {
  content: '';
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231976D2' stroke-width='3' stroke-linecap='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'/%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

/* ============================================================
   同事群列表
   ============================================================ */
.im-group-list {
  flex: 1;
  padding: 0 2px 10px 2px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.im-group-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: var(--bg-card);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.im-group-item:active {
  background: var(--bg-hover);
}
.im-group-item.private-highlight {
  background: #5CACEE !important;
  border-left: 5px solid #1565C0;
  padding-left: 9px;
  transform: scale(0.98);
  transition: all 0.15s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#imPrivateList .im-group-item {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.im-group-item.private-highlight .im-group-name span {
  color: #fff !important;
  font-weight: 600;
}
.im-group-item.private-highlight .im-group-last {
  color: rgba(255,255,255,0.8) !important;
}
.im-group-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #4FC3F7, #1976D2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
}
.im-group-avatar.dept-canyin { background: linear-gradient(135deg, #FF9800, #E65100); }
.im-group-avatar.dept-yuanqu { background: linear-gradient(135deg, #4CAF50, #2E7D32); }
.im-group-avatar.dept-kefang { background: linear-gradient(135deg, #2196F3, #0D47A1); }
.im-group-avatar.dept-quanyuan { background: linear-gradient(135deg, #9C27B0, #4A148C); }
.im-group-avatar.dept-yanxue { background: linear-gradient(135deg, #FF5722, #BF360C); }
.im-group-avatar.dept-all { background: linear-gradient(135deg, #607D8B, #37474F); }

/* 私聊头像 - 在线状态 */
.im-group-avatar .online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background: #4CAF50;
  border: 2px solid #fff;
  border-radius: 50%;
  box-sizing: content-box;
}

.im-group-info {
  flex: 1;
  min-width: 0;
}
.im-group-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.im-group-time {
  font-size: 10px;
  color: #999;
  font-weight: 400;
  flex-shrink: 0;
  margin-left: 8px;
}
.im-group-last {
  font-size: 12px;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.im-group-unread {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #EF4444;
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.im-group-unread.mute {
  background: #bbb;
}

/* ============================================================
   通讯录
   ============================================================ */
.im-contact-list {
  flex: 1;
  padding: 4px 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
.im-contact-dept-header {
  padding: 10px 14px 8px;
  font-size: 13px;
  color: #666;
  background: var(--bg-body);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.im-dept-arrow {
  font-size: 10px;
  color: #999;
  width: 12px;
  text-align: center;
  transition: transform 0.2s;
}
.im-dept-name {
  flex: 1;
}
.im-dept-count {
  font-size: 12px;
  color: #999;
  font-weight: 400;
}
/* 在线成员分组特殊样式 */
.im-dept-online {
  color: #2E7D32;
  font-weight: 600;
}
.im-dept-online .im-dept-count {
  color: #66BB6A;
}
.im-contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.im-contact-item:active {
  background: var(--bg-hover);
}
.im-contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}
.im-contact-info {
  flex: 1;
  min-width: 0;
}
.im-contact-name {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
}
.im-contact-role {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}
.im-contact-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4CAF50;
  flex-shrink: 0;
}
.im-contact-online.offline {
  background: #ccc;
}

/* ============================================================
   模型列表
   ============================================================ */
.model-list {
  flex: 1;
  background: #F0F7FF;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
  min-height: 0;
  touch-action: pan-y pan-x;
}

.swipe-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
  will-change: transform;
}

.swipe-page {
  height: 100%;
  overflow: hidden;
  touch-action: none;
  box-sizing: border-box;
}

.swipe-page-inner {
  will-change: transform;
  padding-top: 4px;
}

.loading-hint {
  text-align: center;
  padding: 40px;
  color: var(--text-sub);
  font-size: 14px;
}

.model-item {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  margin: 4px 12px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  background: #fff;
  border: 2px solid #BBDEFB;
  border-radius: 18px;
  -webkit-tap-highlight-color: transparent;
}

.model-item:active {
  background: #F0F7FF;
}

.model-item::after {
  display: none;
}

.model-item:last-child::after { display: none; }

/* 分页指示器 */
.model-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 4px 0 5px;
  background: #F0F7FF;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #BBDEFB;
  cursor: pointer;
  transition: all 0.2s;
}

.page-dot.active {
  width: 20px;
  border-radius: 4px;
  background: #2196F3;
}

.page-btn {
  padding: 4px 14px;
  font-size: 12px;
  border-radius: 999px;
  background: #E3F2FD;
  color: #64B5F6;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
}

.page-btn.disabled {
  background: #f5f5f5;
  color: #CCC;
  cursor: not-allowed;
}

.model-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 14px;
  overflow: hidden;
  border: 2px solid #64B5F6;
  background: #E3F2FD;
}

.model-icon svg, .model-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

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

.model-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.model-name {
  font-size: 15px;
  font-weight: 700;
  color: #0D47A1;
}

.model-badge {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #E3F2FD;
  color: #1976D2;
  font-weight: 600;
  white-space: nowrap;
}

.model-badge.mock {
  background: #FFF3E0;
  color: #FF9800;
}

.model-desc {
  font-size: 12px;
  color: #42A5F5;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.model-chevron {
  flex-shrink: 0;
  margin-left: 8px;
}

/* ============================================================
   底部导航栏
   ============================================================ */
.tabbar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 5px 0 8px;
  background: var(--bg-card);
  border-top: 1px solid var(--divider);
  flex-shrink: 0;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-sub);
  cursor: pointer;
  padding: 2px 14px;
  transition: color 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.tab-item[data-tab="home"] { order: 1; }
.tab-item[data-tab="leaderboard"] { order: 2; }
.tab-item[data-tab="knowledge"] { order: 3; }
.tab-item[data-tab="userMgmt"] { order: 4; }
.tab-item[data-tab="settings"] { order: 5; }

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

.tab-item span { font-size: 11px; }

/* ============================================================
   知识库页面
   ============================================================ */
.knowledge-page {
  flex: 1;
  background: #F0F7FF;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 6px 14px 16px;
}

/* 分类标签栏 */
.kb-category-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 3px;
}

.kb-category-tabs::-webkit-scrollbar {
  height: 2px;
}

/* 翎册管理-部门筛选标签 */
.dept-filter-bar {
  margin-bottom: 8px;
  padding: 0 14px;
}

.dept-filter-scroll {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.dept-filter-scroll::-webkit-scrollbar {
  display: none;
}

.dept-filter-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  border: 1.5px solid #E0E0E0;
  color: #757575;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  transition: all 0.2s;
}

.dept-filter-tab.active {
  background: #2196F3;
  color: #FFF;
  border-color: #2196F3;
}

.dept-filter-tab:active {
  opacity: 0.7;
}

.dept-filter-count {
  font-size: 11px;
  background: rgba(0,0,0,0.08);
  border-radius: 8px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

.dept-filter-tab.active .dept-filter-count {
  background: rgba(255,255,255,0.3);
  color: #FFF;
}

/* 卷宗馆分类标签 */
.kb-main-cats {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.kb-main-cats::-webkit-scrollbar {
  height: 2px;
}

.kb-main-cat-tab {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  border: 1.5px solid var(--cat-color, #BBDEFB);
  color: var(--cat-color, #64B5F6);
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
  transition: all 0.2s;
}

.kb-main-cat-tab.active {
  background: #BBDEFB;
  color: #0D47A1;
  border-color: #64B5F6;
  font-weight: 600;
}

.kb-main-cat-tab:active {
  opacity: 0.7;
}

/* 子类标签 */
.kb-sub-cats {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 3px;
}

.kb-sub-cats::-webkit-scrollbar {
  height: 2px;
}

.kb-sub-cats.hidden {
  display: none;
}

.kb-sub-cat-tab {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  border: 1.5px solid #BBDEFB;
  color: #64B5F6;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  transition: all 0.2s;
}

.kb-sub-cat-tab.active {
  background: #BBDEFB;
  color: #0D47A1;
  border-color: #64B5F6;
  font-weight: 600;
}

.kb-sub-cat-tab:active {
  opacity: 0.7;
}

/* 知识库搜索框 */
.kb-search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  padding: 0 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid #EEE;
}

.kb-search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 0;
  font-size: 12px;
  color: var(--text-main);
  font-family: inherit;
}

.kb-search-box input::placeholder {
  color: #BBB;
}

.kb-search-icon {
  flex-shrink: 0;
  margin-left: 6px;
  width: 14px;
  height: 14px;
}

.kb-cat-tab {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  border: 1.5px solid #BBDEFB;
  color: #64B5F6;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: 600;
}

.kb-cat-tab.active {
  background: #BBDEFB;
  color: #0D47A1;
  border-color: #64B5F6;
  font-weight: 600;
}

.kb-cat-tab:active {
  opacity: 0.7;
}

/* 上传分类选择 */
.kb-upload-category {
  margin-bottom: 10px;
}

.kb-upload-cat-label {
  font-size: 12px;
  color: #666;
  margin-right: 6px;
}

.kb-cat-select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #BBDEFB;
  background: #FFF;
  font-size: 13px;
  color: #333;
  outline: none;
}

/* 自定义分类选择器 */
.kb-cat-picker {
  position: relative;
  display: inline-block;
}

.kb-cat-picker-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid #BBDEFB;
  background: #FFF;
  font-size: 12px;
  color: #333;
  cursor: pointer;
  user-select: none;
}

.kb-cat-picker-dropdown {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 430px;
  background: #FFF;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 200;
  max-height: 70vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
  transition: transform 0.25s ease-out;
}

.kb-cat-picker-dropdown.show {
  transform: translateX(-50%) translateY(0);
}

.cat-picker-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 199;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.kb-cat-picker-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0;
  margin: 0 auto;
  width: 70%;
  padding-left: 60px;
  font-size: 17px;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #F0F0F0;
}

.kb-cat-picker-option:last-child {
  border-bottom: none;
}

.kb-cat-picker-option:hover {
  background: #F5F7FA;
}

.kb-cat-picker-option.selected {
  color: var(--primary);
  font-weight: 500;
}

.kb-cat-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 文档分类徽章 */
.kb-cat-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* 澄清选项按钮 */
.clarify-options {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.clarify-btn {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1.5px solid var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.clarify-btn:active {
  opacity: 0.7;
}

.kb-upload-area {
  background: #F8FAFF;
  border: 2px dashed #BBDEFB;
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 18px;
}

.kb-upload-area:active {
  background: #E3F2FD;
  border-color: var(--primary);
}

.kb-upload-icon {
  margin-bottom: 8px;
  opacity: 0.8;
}

.kb-upload-icon svg {
  width: 34px;
  height: 34px;
}

.kb-upload-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 3px;
}

.kb-upload-hint {
  font-size: 11px;
  color: var(--text-sub);
}

/* 批量上传面板 */
.batch-upload-panel {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.batch-file-list {
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}

.batch-file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: grab;
  transition: background 0.2s;
}

.batch-file-item:last-child {
  border-bottom: none;
}

.batch-file-item:hover {
  background: #f5f5f5;
}

.batch-file-item.dragging {
  opacity: 0.5;
  background: #e3f2fd;
}

.batch-file-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.batch-file-name {
  flex: 1;
  font-size: 13px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-file-size {
  font-size: 11px;
  color: #999;
  flex-shrink: 0;
}

.batch-file-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.batch-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #666;
}

.batch-btn:hover:not(:disabled) {
  background: #f0f0f0;
  border-color: #bbb;
}

.batch-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.batch-up-btn:hover:not(:disabled),
.batch-down-btn:hover:not(:disabled) {
  color: #2196F3;
  border-color: #2196F3;
}

.batch-del-btn:hover:not(:disabled) {
  color: #f44336;
  border-color: #f44336;
}

.batch-confirm-btn,
.batch-cancel-btn {
  flex: 1;
  height: 38px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.batch-confirm-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.batch-confirm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.batch-cancel-btn {
  background: #fff;
  color: #666;
  border: 1px solid #ddd;
}

.batch-cancel-btn:hover {
  background: #f5f5f5;
}

.kb-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.kb-section-title > span:first-child {
  font-size: 14px;
  font-weight: 700;
  color: #0D47A1;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-count {
  font-size: 10px;
  color: var(--text-sub);
  flex-shrink: 0;
}

.kb-title-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 0;
}

/* 确保导出和审批按钮始终可见 */
.kb-title-right button {
  display: inline-block !important;
}

.kb-export-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #2196F3;
  background: #E3F2FD;
  border: 1px solid #BBDEFB;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.kb-export-btn:active {
  opacity: 0.7;
}

.kb-approval-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #F59E0B;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.kb-approval-btn:active {
  opacity: 0.7;
}

/* 下载审批标签页 */
.da-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.da-tab.active {
  color: #2196F3;
  border-bottom-color: #2196F3;
  font-weight: 600;
}

.kb-export-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kb-export-modal-mask {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
}

.kb-export-modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 360px;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kb-export-modal-title {
  padding: 16px;
  font-size: 15px;
  font-weight: 700;
  color: #0D47A1;
  border-bottom: 1px solid #eee;
  text-align: center;
}

.kb-export-cat-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

.kb-export-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
}

.kb-export-cat-item:active {
  background: #f0f7ff;
}

.kb-export-cat-name {
  font-size: 14px;
  color: #333;
}

.kb-export-cat-count {
  font-size: 12px;
  color: #999;
}

.kb-export-back {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  font-size: 13px;
  color: #2196F3;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.kb-export-back:active {
  background: #f0f7ff;
}

.kb-export-domain-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  background: #f0f4f8;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  user-select: none;
}

.kb-export-domain-header:active {
  background: #e8eef5;
}

.kb-export-domain-header.domain-collapsed {
  border-bottom: 1px solid #ddd;
}

.kb-export-domain-toggle {
  font-size: 10px;
  color: #999;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
  transition: transform 0.2s;
}

.kb-export-domain-name {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.kb-export-domain-stat {
  font-size: 11px;
  font-weight: 400;
  color: #999;
  flex-shrink: 0;
}

.kb-export-sub-group {
  display: block;
}

.kb-export-sub-group.collapsed {
  display: none;
}

.kb-export-select-all {
  font-size: 12px;
  color: #2196F3;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  background: #E3F2FD;
  flex-shrink: 0;
}

.kb-export-select-all.active {
  background: #BBDEFB;
  color: #0D47A1;
}

.kb-export-sub-item {
  display: flex;
  align-items: center;
  padding: 9px 14px 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  gap: 8px;
}

.kb-export-sub-item:active {
  background: #f0f7ff;
}

.kb-export-checkbox {
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
}

.kb-export-sub-item.selected .kb-export-checkbox {
  border-color: #2196F3;
  background: #2196F3;
}

.kb-export-sub-item.selected .kb-export-checkbox::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.kb-export-sub-code {
  display: inline-block;
  background: #E3F2FD;
  color: #1565C0;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  min-width: 28px;
  text-align: center;
}

.kb-export-sub-name {
  flex: 1;
  font-size: 13px;
  color: #333;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.kb-export-sub-count {
  font-size: 11px;
  color: #999;
  flex-shrink: 0;
}

.kb-export-sub-item.empty .kb-export-sub-count {
  color: #ccc;
}

.kb-export-sub-item.empty .kb-export-sub-name {
  color: #aaa;
}

.kb-export-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid #eee;
  background: #fff;
  flex-shrink: 0;
}

.kb-export-selected-info {
  font-size: 13px;
  color: #666;
}

.kb-export-selected-info b {
  color: #2196F3;
  font-size: 15px;
}

.kb-export-go-btn {
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #2196F3;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.kb-export-go-btn:active {
  opacity: 0.8;
}

.kb-export-go-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.kb-doc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kb-doc-item {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid #BBDEFB;
  border-radius: 14px;
  padding: 10px 12px;
  position: relative;
}

.kb-doc-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #E3F2FD;
  border: 2px solid #64B5F6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 10px;
}

.kb-doc-icon svg {
  width: 18px;
  height: 18px;
}

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

.kb-doc-name {
  font-size: 13px;
  font-weight: 700;
  color: #0D47A1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
}

.kb-doc-meta {
  font-size: 11px;
  color: var(--text-sub);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
}

.kb-source-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 10px;
  line-height: 1.4;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.kb-doc-delete {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #EF5350;
}

.kb-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-sub);
  font-size: 12px;
}

.kb-empty-icon {
  margin-bottom: 8px;
  opacity: 0.5;
}

.kb-empty-icon svg {
  width: 40px;
  height: 40px;
}

/* ============================================================
   设置页面
   ============================================================ */
.settings-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 10px;
  background: #F0F7FF;
}

.settings-list {
  background: #fff;
  margin: 0 12px;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid #BBDEFB;
}

.settings-section-title {
  font-size: 13px;
  color: var(--text-sub);
  padding: 15px 24px 7px;
  font-weight: 500;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--divider);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-item.clickable {
  cursor: pointer;
  transition: background 0.15s;
}
.setting-item.clickable:active {
  background: #F0F7FF;
}

.setting-arrow {
  flex-shrink: 0;
  margin-left: 8px;
}

.setting-value {
  font-size: 14px;
  color: var(--text-sub);
  max-width: 50%;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 个人信息页 - 可点击项 */
.setting-value-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 55%;
}

.setting-value-wrap .setting-value {
  max-width: none;
}

.setting-arrow-icon {
  flex-shrink: 0;
}

.setting-change-tip {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  padding: 3px 10px;
  background: var(--primary-light);
  border-radius: 20px;
  line-height: 1.4;
}

/* 个人信息编辑弹窗 */
.profile-edit-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-edit-mask {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.profile-edit-panel {
  position: relative;
  background: #fff;
  border-radius: 20px;
  width: 85%;
  max-width: 340px;
  overflow: hidden;
  animation: profileEditPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes profileEditPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.profile-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
}

.profile-edit-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
}

.profile-edit-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.profile-edit-body {
  padding: 8px 20px 20px;
}

.profile-modal-input {
  width: 100%;
  border: 1.5px solid #E3F2FD;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text-main);
  background: #F8FBFF;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}

.profile-modal-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.profile-modal-select-wrap {
  width: 100%;
}

.profile-modal-select {
  width: 100%;
  border: 1.5px solid #E3F2FD;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text-main);
  background: #F8FBFF;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}

.profile-modal-select:focus {
  border-color: var(--primary);
  background: #fff;
}

.profile-edit-footer {
  display: flex;
  border-top: 1px solid #F0F0F0;
}

.profile-edit-btn {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  font-family: inherit;
}

.profile-edit-btn.cancel {
  color: var(--text-sub);
  border-right: 1px solid #F0F0F0;
}

.profile-edit-btn.confirm {
  color: var(--primary);
  font-weight: 600;
}

.profile-edit-btn:active {
  background: #F5F7FA;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
}

.setting-desc {
  font-size: 12px;
  color: var(--text-sub);
}

/* 用户卡片 */
.user-card {
  display: flex;
  align-items: center;
  padding: 20px 18px;
  background: #fff;
  margin: 12px 16px;
  border-radius: 18px;
  border: 2px solid #A3D0F3;
  transition: opacity 0.15s;
}
.user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  flex-shrink: 0;
}
.user-card-info {
  flex: 1;
  margin-left: 14px;
  overflow: hidden;
}
.user-card-name {
  font-size: 17px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}
.user-card-role {
  font-size: 13px;
  color: #888;
}
.user-card-logout {
  flex-shrink: 0;
  padding: 6px 14px;
  background: #f5f5f5;
  border-radius: 20px;
  color: #666;
  font-size: 13px;
  cursor: pointer;
}
.user-card-logout:active { background: #eee; }

/* 统计网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 12px;
}
.stat-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
}
.stat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.stat-label {
  font-size: 11px;
  color: var(--text-sub);
}

/* 个人信息页 */
#profileView .settings-scroll {
  background: linear-gradient(180deg, #e8e4f8 0%, #f0edf7 30%, #f5f3fa 60%, #f8f6fc 100%);
}
.profile-avatar-section {
  text-align: center;
  padding: 28px 0 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin: 12px;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
}
.profile-avatar-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.profile-avatar-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 150px;
  height: 150px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
  border: 2px solid rgba(255,255,255,0.3);
  position: relative;
  z-index: 1;
}
.profile-name {
  font-size: 20px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.profile-role {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.profile-join-days {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.15);
  padding: 5px 12px;
  border-radius: 20px;
  position: relative;
  z-index: 1;
}
.join-days-icon {
  display: inline-flex;
  align-items: center;
}

/* 数据概览卡片 */
.profile-stats-section {
  display: flex;
  gap: 10px;
  padding: 0 12px;
  margin-bottom: 8px;
}
#profileView .profile-stat-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 16px 8px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
#profileView .stat-number {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
#profileView .stat-label {
  font-size: 12px;
  color: #888;
}

/* 个人信息页的设置列表 */
#profileView .settings-list {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.06);
}

/* 快捷功能入口 */
.profile-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 12px;
  margin-bottom: 20px;
}
#profileView .quick-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 14px 4px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  transition: transform 0.15s;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
#profileView .quick-action-item:active {
  transform: scale(0.95);
}
.quick-action-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-action-icon.task-icon {
  background: linear-gradient(135deg, #f093fb, #f5576c);
}
.quick-action-icon.knowledge-icon {
  background: linear-gradient(135deg, #4facfe, #00f2fe);
}
.quick-action-icon.video-icon {
  background: linear-gradient(135deg, #43e97b, #38f9d7);
}
.quick-action-icon.staff-icon {
  background: linear-gradient(135deg, #fa709a, #fee140);
}
.quick-action-text {
  font-size: 12px;
  color: #666;
}

/* 个人信息页的分组标题 */
#profileView .settings-section-title {
  color: #7c6fb8;
  font-weight: 600;
  padding: 16px 20px 8px;
}

.header-back {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 8px;
  cursor: pointer;
}

.settings-version {
  text-align: center;
  color: var(--text-sub);
  font-size: 12px;
  margin-top: 20px;
  padding-bottom: 10px;
}

.admin-switch-btn {
  padding: 6px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.admin-switch-btn:active {
  opacity: 0.8;
}

.setting-item .admin-switch-btn {
  flex-shrink: 0;
}

/* 开关按钮 */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CCC;
  transition: 0.3s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--primary);
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* ============================================================
   聊天页
   ============================================================ */
#chatView {
  background: var(--bg-page);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* AI聊天标题栏紧凑样式 */
#chatView .chat-header {
  padding: 10px 10px 8px;
  min-height: 40px;
}
#chatView .chat-back {
  width: 30px;
  height: 30px;
}
#chatView .chat-header-icon {
  width: 30px;
  height: 30px;
}
#chatView .chat-header-name {
  font-size: 14px;
}
#chatView .chat-header-status {
  font-size: 11px;
}
#chatView .chat-kb-toggle {
  width: 30px;
  height: 30px;
}

.chat-header {
  display: flex;
  align-items: center;
  padding: 18px 12px 10px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.chat-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
  flex: 1;
}

.chat-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.chat-header-icon svg, .chat-header-icon img {
  width: 100%;
  height: 100%;
}
.chat-header-icon.im-group-avatar {
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.chat-header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-header-name {
  font-size: 16px;
  font-weight: 600;
}

.chat-header-status {
  font-size: 12px;
  color: #4CAF50;
}

/* IM聊天页 - 标题栏紧凑样式（不影响AI聊天） */
#imChatView .chat-header {
  padding: 10px 12px;
  min-height: 44px;
}

#imChatView .chat-back {
  width: 32px;
  height: 32px;
}

#imChatView .chat-back svg {
  width: 20px;
  height: 20px;
}

#imChatView .chat-header-info {
  gap: 8px;
}

#imChatView .chat-header-icon {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

#imChatView .chat-header-icon.im-group-avatar {
  border-radius: 7px;
  font-size: 13px;
}

#imChatView .chat-header-name {
  font-size: 15px;
}

#imChatView .chat-header-status {
  font-size: 12px;
}

#imChatView .chat-kb-toggle {
  width: 32px;
  height: 32px;
}

#imChatView .chat-kb-toggle svg {
  width: 18px;
  height: 18px;
}

.chat-header-status.typing { color: var(--primary); }

/* 知识库开关（聊天页） */
.chat-kb-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.2s;
}

.chat-kb-toggle:active {
  background: #F0F0F0;
}

.chat-kb-toggle.active svg path:first-child {
  stroke: var(--primary);
}

.chat-kb-toggle.active svg path:last-child {
  stroke: var(--primary);
}

/* 知识库来源提示 */
.kb-sources {
  background: #F0F7FF;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-sub);
}

.kb-sources-title {
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 4px;
}

.kb-source-tag {
  display: inline-block;
  background: white;
  border-radius: 4px;
  padding: 2px 8px;
  margin: 2px 4px 2px 0;
  font-size: 11px;
  color: var(--text-main);
}

/* 消息区域 */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 10px 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 消息气泡 */
.msg-row {
  display: flex;
  gap: 4px;
  max-width: 96%;
  animation: msgIn 0.3s ease;
}

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

.msg-row.user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.msg-avatar svg, .msg-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.msg-bubble {
  padding: 7px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: break-word;
  position: relative;
  max-width: 100%;
  box-sizing: border-box;
}

.msg-content-wrap {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 32px);
  overflow: hidden;
}

.msg-row.ai .msg-bubble {
  background: var(--bg-card);
  color: var(--text-main);
  border-top-left-radius: 16px;
  box-shadow: var(--shadow);
}

.msg-row.user .msg-bubble {
  background: var(--primary);
  color: white;
  border-top-right-radius: 4px;
}

.msg-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: 10px;
  display: block;
  margin-bottom: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  border: none;
  user-select: none;
  -webkit-user-drag: none;
}

.msg-row.user .msg-image {
  margin-left: auto;
}

.msg-bubble .cursor {
  display: inline-block;
  width: 1.5px;
  height: 14px;
  background: var(--primary);
  vertical-align: text-bottom;
  animation: blink 0.8s infinite;
  margin-left: 1px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.msg-bubble.error {
  background: #FFEBEE;
  color: #C62828;
}

/* 消息气泡内 markdown 紧凑样式 */
.msg-bubble p {
  margin: 0 0 4px;
}
.msg-bubble p:last-child {
  margin-bottom: 0;
}
.msg-bubble ul, .msg-bubble ol {
  margin: 4px 0;
  padding-left: 20px;
}
.msg-bubble li {
  margin: 2px 0;
}
.msg-bubble h3, .msg-bubble h4 {
  margin: 6px 0 4px;
  font-size: 14px;
}
.msg-bubble pre {
  margin: 4px 0;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 6px;
  overflow-x: auto;
}
.msg-bubble code {
  font-size: 12px;
  padding: 1px 4px;
  border-radius: 4px;
}

/* ============================================================
   IM 聊天界面样式
   ============================================================ */

/* 消息行布局 */
.msg-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
  padding: 0 14px;
  gap: 10px;
}

.msg-item.msg-right {
  flex-direction: row;
  justify-content: flex-end;
}

.msg-item.msg-right .msg-avatar {
  order: 2;
}

.msg-item.msg-right .msg-content-col {
  align-items: flex-end;
}

.msg-item .msg-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.msg-content-col {
  display: flex;
  flex-direction: column;
  max-width: 72%;
  min-width: 0;
}

.msg-sender-name {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
  padding: 0 4px;
  font-weight: 500;
}

/* 气泡通用 */
.msg-item .msg-bubble {
  max-width: 100%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.55;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  display: inline-block;
}

/* 对方消息 */
.msg-item.msg-left .msg-bubble {
  background: #ffffff;
  color: #333;
  border-top-left-radius: 4px;
  border: 1px solid #eef0f3;
}

/* 自己消息 */
.msg-item.msg-right .msg-bubble {
  background: linear-gradient(135deg, #5B9DEF 0%, #3A7BD5 100%);
  color: white;
  border-top-right-radius: 4px;
  border: none;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}

/* 消息文字 */
.msg-text {
  word-break: break-word;
  white-space: pre-wrap;
}

/* 时间戳 - 在气泡外面 */
.msg-time-row {
  font-size: 11px;
  color: #b0b0b0;
  margin-top: 4px;
  padding: 0 4px;
}

.msg-item.msg-right .msg-time-row {
  text-align: right;
}

/* 图片消息 */
.img-bubble {
  padding: 3px !important;
  overflow: hidden;
}

.img-bubble img {
  max-width: 220px;
  max-height: 280px;
  border-radius: 10px;
  display: block;
  cursor: pointer;
  transition: transform 0.15s;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.img-bubble img:active {
  transform: scale(0.97);
}

/* 文件消息 */
.msg-file {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
}

.msg-file-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.msg-file-name {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

/* 系统消息 */
.msg-system {
  text-align: center;
  margin: 14px 0;
  padding: 0 20px;
}

.msg-system span {
  background: rgba(0, 0, 0, 0.06);
  color: #999;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  display: inline-block;
  line-height: 1.4;
}

/* 聊天头部 */
.im-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: #fff;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 36px;
}

.im-chat-back {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #666;
  transition: background 0.2s;
  font-size: 16px;
}

.im-chat-back:active {
  background: #f0f0f0;
}

.im-chat-title {
  flex: 1;
  text-align: center;
  margin: 0 24px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.im-chat-info-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #666;
  transition: background 0.2s;
  font-size: 14px;
}

.im-chat-info-btn:active {
  background: #f0f0f0;
}

/* 聊天消息区 */
#imChatMessages {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
  background: #f5f7fa;
  -webkit-overflow-scrolling: touch;
}

/* IM聊天页 - 紧凑样式（不影响AI聊天） */
#imChatMessages .msg-item {
  margin-bottom: 2px !important;
  padding: 0 8px;
}

#imChatMessages .msg-item .msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  font-size: 13px;
}

#imChatMessages .msg-sender-name {
  font-size: 11px;
  margin-bottom: 2px;
  padding: 0 2px;
}

#imChatMessages .msg-item .msg-bubble {
  padding: 6px 11px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

#imChatMessages .msg-time-row {
  font-size: 10px;
  margin-top: 2px;
}

#imChatMessages .msg-content-col {
  max-width: 78%;
}

/* 系统消息 */
#imChatMessages .msg-system {
  margin: 6px 0;
}

#imChatMessages .msg-system span {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
}

/* 长按消息操作菜单 */
.im-msg-action-menu {
  position: fixed;
  z-index: 20000;
  background: #ffffff;
  border-radius: 14px;
  min-width: 110px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: opacity 0.15s ease-out;
}

.im-msg-action-inner {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.im-msg-action-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.im-msg-action-item + .im-msg-action-item {
  border-top: 1px solid #f0f0f0;
}

.im-msg-action-item:active {
  background: #f5f5f5;
}

.im-msg-action-icon {
  font-size: 16px;
}

/* 气泡箭头 - 在上（菜单在气泡下方时用） */
.im-msg-action-menu.arrow-top::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #ffffff;
  box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.04);
}

/* 气泡箭头 - 在下（菜单在气泡上方时用） */
.im-msg-action-menu.arrow-bottom::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #ffffff;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.06);
}

/* @提及成员选择面板 */
.mention-panel {
  position: fixed;
  z-index: 20000;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1), 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-height: 200px;
}

.mention-panel.hidden {
  display: none;
}

.mention-list {
  max-height: 200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mention-item:hover,
.mention-item.active {
  background: #f0f7ff;
}

.mention-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.mention-name {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

/* 消息中@提及高亮 */
#imChatMessages .mention-highlight {
  color: #fff;
  background: linear-gradient(135deg, #4a9eff, #667eea);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95em;
  cursor: pointer;
  display: inline-block;
}

/* 消息回复引用 */
#imChatMessages .msg-reply {
  display: flex;
  flex-direction: column;
  padding: 4px 8px;
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.05);
  border-left: 3px solid #4a9eff;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
}

#imChatMessages .msg-right .msg-reply {
  background: rgba(255, 255, 255, 0.3);
  border-left-color: rgba(255, 255, 255, 0.6);
}

#imChatMessages .msg-reply-name {
  color: #4a9eff;
  font-weight: 600;
  margin-bottom: 2px;
}

#imChatMessages .msg-right .msg-reply-name {
  color: rgba(255, 255, 255, 0.9);
}

#imChatMessages .msg-reply-text {
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

#imChatMessages .msg-right .msg-reply-text {
  color: rgba(255, 255, 255, 0.8);
}

/* 回复提示条 */
.reply-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #f5f7fa;
  border-top: 1px solid #e8e8e8;
  font-size: 13px;
}

.reply-bar.show {
  display: flex;
}

.reply-bar-content {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.reply-bar-label {
  color: #4a9eff;
  font-weight: 600;
  margin-right: 6px;
}

.reply-bar-name {
  color: #333;
  font-weight: 500;
  margin-right: 4px;
}

.reply-bar-text {
  color: #999;
}

.reply-bar-close {
  margin-left: 10px;
  color: #999;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

/* 聊天输入栏 */
.im-chat-input-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: #fff;
  border-top: 1px solid #eee;
}

.im-chat-input-wrap {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f5f7fa;
  border-radius: 0;
  padding: 6px 10px;
  border: none;
  border-bottom: 1px solid #eee;
  transition: background 0.2s;
  min-height: 44px;
}

.im-chat-input-wrap:focus-within {
  background: #fff;
}

#imChatInput {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  line-height: 20px;
  resize: none;
  max-height: 72px;
  min-height: 20px;
  height: 20px;
  font-family: inherit;
  color: #333;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  word-wrap: break-word;
  word-break: break-all;
  white-space: pre-wrap;
}

#imChatInput::-webkit-scrollbar {
  width: 0;
  height: 0;
}

#imChatInput::placeholder {
  color: #bbb;
}

.im-chat-add-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #888;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.im-chat-add-btn:active {
  background: #e8e8e8;
  color: #666;
}

/* 表情按钮 */
.im-chat-emoji-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.im-chat-emoji-btn:active {
  background: #e8e8e8;
  transform: scale(0.95);
}

/* 表情面板 */
#imEmojiPanel.im-emoji-panel {
  background: #f5f7fa;
  border-top: 1px solid #eee;
  display: flex;
  flex-direction: column;
  height: 260px;
  width: 100%;
  box-sizing: border-box;
}

#imEmojiPanel.im-emoji-panel.hidden {
  display: none !important;
}

#imEmojiPanel .im-emoji-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 10px 8px;
  align-content: start;
  width: 100%;
  box-sizing: border-box;
}

#imEmojiPanel .im-emoji-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  font-size: 22px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s, transform 0.1s;
}

#imEmojiPanel .im-emoji-item:active {
  background: #e0e0e0;
  transform: scale(1.2);
}

#imEmojiPanel .im-emoji-bottom-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 6px 8px;
  background: #ebecef;
  border-top: 1px solid #ddd;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

#imEmojiPanel .im-emoji-tabs {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#imEmojiPanel .im-emoji-tabs::-webkit-scrollbar {
  display: none;
}

#imEmojiPanel .im-emoji-tab {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

#imEmojiPanel .im-emoji-tab:active,
#imEmojiPanel .im-emoji-tab.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#imEmojiPanel .im-emoji-delete {
  width: 40px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  transition: background 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#imEmojiPanel .im-emoji-delete:active {
  background: #e8e8e8;
}

/* 图片多选预览面板（底部半屏） */
.im-image-preview {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.im-image-preview.hidden {
  display: none;
}

.im-image-preview-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
}

.im-image-preview-sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px 16px 0 0;
  max-height: 70vh;
  padding-bottom: env(safe-area-inset-bottom, 0);
  animation: slideUp 0.25s ease-out;
}

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

.im-image-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.im-image-preview-title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
}

.im-image-preview-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #999;
  cursor: pointer;
  border-radius: 50%;
  background: #f5f5f5;
}

.im-image-preview-close:active {
  background: #e8e8e8;
}

.im-image-preview-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: #f9f9f9;
}

.im-image-preview-list {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease-out;
  will-change: transform;
}

.im-image-preview-item {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  position: relative;
}

.im-image-preview-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.im-image-preview-item .im-image-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}

.im-image-preview-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  flex-shrink: 0;
}

.im-image-preview-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ddd;
  transition: all 0.2s;
}

.im-image-preview-dot.active {
  width: 18px;
  border-radius: 3px;
  background: #07c160;
}

.im-image-preview-input-row {
  padding: 8px 16px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.im-image-preview-input {
  width: 100%;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #e8e8e8;
  border-radius: 18px;
  background: #f7f7f7;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
}

.im-image-preview-input:focus {
  border-color: #07c160;
  background: #fff;
}

.im-image-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
  gap: 12px;
}

.im-image-preview-add {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: #f5f7fa;
  border-radius: 20px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
}

.im-image-preview-add:active {
  background: #e8eaed;
}

.im-image-preview-send {
  min-width: 90px;
  height: 36px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #07c160;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 18px;
  cursor: pointer;
}

.im-image-preview-send:active {
  opacity: 0.8;
}

.im-image-preview-send:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 全屏图片查看器 */
.im-image-viewer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.im-image-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.im-image-viewer-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0) + 12px);
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 1;
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.im-chat-send-btn {
  width: 50px;
  height: 30px;
  border-radius: 15px;
  border: none;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.im-chat-send-btn:active {
  transform: scale(0.96);
  box-shadow: 0 1px 3px rgba(74, 144, 226, 0.25);
}

.im-chat-send-btn:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.6;
}

/* 空状态 */
.im-empty {
  text-align: center;
  color: #aaa;
  padding: 60px 20px;
  font-size: 14px;
}

.im-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* 群信息面板 */
.im-group-info-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 360px;
  height: 100%;
  background: #fff;
  z-index: 1001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
}

.im-group-info-panel.show {
  right: 0;
}

.im-group-info-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  font-size: 16px;
  font-weight: 600;
}

.im-group-info-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #666;
  margin-right: 8px;
  font-size: 18px;
}

.im-group-info-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.im-group-members-title {
  font-size: 14px;
  color: #888;
  margin-bottom: 12px;
  font-weight: 500;
}

.im-group-member-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
}

.im-group-member-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.im-group-member-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
}

.im-group-member-name {
  font-size: 12px;
  color: #666;
  text-align: center;
  max-width: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.im-group-member-remove {
  position: absolute;
  top: -4px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #ff4d4f;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

.im-group-add-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px dashed #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}

.im-group-add-btn:active {
  background: #f0f0f0;
  border-color: #999;
  color: #666;
}

.im-group-owner-badge {
  font-size: 10px;
  background: linear-gradient(135deg, #FFB74D, #FF9800);
  color: white;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}

.im-group-quit-btn {
  margin: 16px;
  padding: 12px;
  background: #fff0f0;
  color: #ff4d4f;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s;
}

.im-group-quit-btn:active {
  background: #ffe0e0;
}

/* 选人弹窗 */
.im-contact-picker-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.im-contact-picker {
  width: 100%;
  max-width: 500px;
  max-height: 75vh;
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

.im-contact-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.im-contact-picker-title {
  font-size: 16px;
  font-weight: 600;
}

.im-contact-picker-cancel {
  color: #888;
  font-size: 14px;
  cursor: pointer;
}

.im-contact-picker-confirm {
  color: #4A90E2;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.im-contact-picker-confirm:disabled {
  color: #ccc;
  cursor: not-allowed;
}

.im-contact-picker-body {
  flex: 1;
  overflow-y: auto;
}

/* 已选成员标签 */
.im-selected-members {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
  min-height: 40px;
}

.im-selected-tag {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #e8f0fe;
  color: #4A90E2;
  padding: 4px 8px 4px 10px;
  border-radius: 14px;
  font-size: 12px;
}

.im-selected-tag-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4A90E2;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  line-height: 1;
}

/* ============================================================
   输入栏
   ============================================================ */
.chat-input-bar {
  padding: 6px 10px 10px;
  background: var(--bg-card);
  border-top: 1px solid var(--divider);
}

/* AI聊天输入栏更紧凑 */
#chatView .chat-input-bar {
  padding: 4px 8px 6px;
  height: 55px;
  min-height: 55px;
  box-sizing: border-box;
}
#chatView .chat-input-wrap {
  padding: 3px 4px 3px 8px;
  border-radius: 16px;
  gap: 4px;
  align-items: center;
}
#chatView .chat-image-btn {
  width: 28px;
  height: 28px;
}

.chat-image-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  transition: background 0.2s;
}

.chat-image-btn:active {
  background: #F0F0F0;
}

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: #F5F5F5;
  border-radius: 20px;
  padding: 5px 5px 5px 10px;
}

.chat-image-preview {
  position: relative;
  margin-top: 8px;
  display: inline-block;
}

.chat-image-preview img {
  max-width: 120px;
  max-height: 120px;
  border-radius: 10px;
  object-fit: cover;
}

.chat-file-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  background: #F0F7FF;
  border-radius: 10px;
  padding: 8px 12px;
  position: relative;
}

.chat-file-preview-icon {
  flex-shrink: 0;
}

.chat-file-preview-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.chat-image-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 底部弹出菜单 */
.add-menu-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 999;
}

.add-menu {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  z-index: 1000;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.add-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  flex: 1;
  max-width: 100px;
}

.add-menu-item:active {
  background: #f5f5f5;
}

.add-menu-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #e8f4fd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-menu-item.cancel .add-menu-icon {
  background: #f5f5f5;
}

.add-menu-item span {
  font-size: 13px;
  color: #333;
}

.chat-input {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  line-height: 1.4;
  resize: none;
  outline: none;
  max-height: 80px;
  padding: 7px 0;
  font-family: inherit;
}

/* AI聊天输入框更紧凑 */
#chatView .chat-input {
  font-size: 13px;
  padding: 0;
  line-height: 28px;
  height: 28px;
  min-height: 28px;
  max-height: 120px;
}

.chat-input::placeholder {
  color: #bbb;
  line-height: inherit;
}

.chat-send {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #D0D0D0;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
}

.chat-send:active {
  opacity: 0.8;
}

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

.chat-send.active:active {
  background: #1976D2;
}

/* ============================================================
   响应式 - 桌面端宽屏适配
   ============================================================ */
/* 桌面布局仅在带鼠标的设备上生效：手机投屏/外接显示器后视口变宽时仍保持手机布局 */
@media (min-width: 768px) and (hover: hover) {
  body {
    background: linear-gradient(135deg, #E3F2FD, #F5F7FA);
  }

  #app {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
  }

  .view { min-height: 100vh; }

  /* === 顶部品牌栏 === */
  .top-brand-bar {
    display: none;
  }

  /* ================================================================
     电脑端翎聊5列布局
     列1: AI模型列表 | 列2: 同事群 | 列3: 私聊 | 列4: 聊天窗口 | 列5: 通讯录
     ================================================================ */
  #homeView.desktop-5col {
    display: flex !important;
    flex-direction: row !important;
    height: 100vh;
    overflow: hidden;
    padding: 0 !important;
  }

  /* 5列通用样式 */
  .desktop-col {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-right: 1px solid #C5D5E8;
    box-sizing: border-box;
  }
  .desktop-col:last-child {
    border-right: none;
  }

  /* 列1：AI模型列表 */
  .desktop-col-1 {
    width: 340px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #E8F4FD 0%, #F7FAFC 100%);
    position: relative;
  }

  .desktop-col-1 #imPanelAi {
    height: 100%;
  }

  /* 列2：同事群 */
  .desktop-col-2 {
    width: 240px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #E8F4FD 0%, #F7FAFC 100%);
  }

  /* 列3：私聊 */
  /* 列3：聊天主窗口 */
  .desktop-col-3 {
    flex: 1;
    background: #fff;
    min-width: 0;
    overflow: hidden; /* 彻底隐藏溢出，防止横向滚动条 */
  }

  /* 列4：私聊列表 */
  .desktop-col-4 {
    width: 240px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #E8F4FD 0%, #F7FAFC 100%);
  }

  /* 列5：通讯录 */
  .desktop-col-5 {
    width: 260px;
    flex-shrink: 0;
    background: #FAFBFC;
  }

  /* 底部TAB栏 - 横跨整个页面底部 */
  .desktop-tabbar-wrap {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #F0F0F0;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .desktop-tabbar-wrap .tabbar {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-bottom: 8px !important;
  }

  /* 5列区域底部留出TAB栏的空间 */
  #homeView.desktop-5col {
    padding-bottom: 60px !important;
    box-sizing: border-box;
  }

  /* 隐藏手机端的header和tab切换栏 */
  #homeView.desktop-5col .header,
  #homeView.desktop-5col .home-top-tabs,
  #homeView.desktop-5col .scroll-banner {
    display: none !important;
  }

  /* ---- 列1：AI模型列表 ---- */
  #imPanelAi {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  #imPanelAi .model-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  #imPanelAi .model-item {
    width: 100%;
    margin: 0;
    padding: 10px 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    border-color: #64B5F6;
    border-width: 1.5px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.08);
  }

  /* 电脑端模型分页 */
  #imPanelAi .model-pagination {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    justify-content: center !important;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    border-top: 1px solid rgba(33, 150, 243, 0.15);
    background: #fff !important;
    height: 55px !important;
    min-height: 55px;
    box-sizing: border-box;
  }

  #imPanelAi .model-pagination .page-btn {
    display: inline-flex !important;
    visibility: visible !important;
    padding: 5px 14px;
    border: 1px solid #2196F3;
    background: #fff;
    border-radius: 6px;
    font-size: 12px;
    color: #1976D2;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    font-weight: 500;
    line-height: 1;
  }

  #imPanelAi .model-pagination .page-btn:hover:not(.disabled) {
    background: #2196F3;
    color: #fff;
  }

  #imPanelAi .model-pagination .page-btn.disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    background: #f5f5f5 !important;
    color: #999 !important;
    border-color: #ddd !important;
  }

  #imPanelAi .model-pagination .page-info-text {
    font-size: 14px;
    color: #333;
    min-width: 60px;
    text-align: center;
    font-weight: 500;
  }

  #imPanelAi .model-pagination .page-dot {
    display: none !important;
  }

  /* 列1顶部标题 */
  #imPanelAi::before {
    content: "谷翎AI助手";
    display: block;
    padding: 16px 14px 12px;
    font-size: 15px;
    font-weight: 700;
    color: #2196F3;
    text-align: center;
    border-bottom: 1px solid rgba(33,150,243,0.15);
    flex-shrink: 0;
  }

  /* ---- 列2/3：群聊/私聊列表 ---- */
  #imPanelGroup,
  #imPanelPrivate {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #imPanelGroup .im-panel-header,
  #imPanelPrivate .im-panel-header {
    flex-shrink: 0;
  }

  #imPanelGroup .im-group-list,
  #imPanelPrivate .im-group-list {
    flex: 1;
    overflow-y: auto;
  }

  /* 群聊/私聊底部白色板块 */
  #imPanelGroup::after,
  #imPanelPrivate::after {
    content: '';
    display: block;
    flex-shrink: 0;
    height: 55px;
    background: #fff;
    border-top: 1px solid #E0E7EE;
    box-sizing: border-box;
  }

  /* ---- 聊天窗口 ---- */
  #chatView,
  #imChatView {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    z-index: 1 !important;
    background: #fff;
    display: flex !important;
    flex-direction: column;
    flex: 1 !important;
  }

  #chatView.hidden,
  #imChatView.hidden {
    display: none !important;
    flex: 0 !important;
  }

  /* 聊天页header */
  #chatView .chat-header,
  #imChatView .chat-header {
    max-width: 100%;
    margin: 0;
    padding: 10px 16px;
    flex-shrink: 0;
  }

  /* 聊天消息区 */
  #chatView .chat-messages,
  #imChatView .chat-messages {
    max-width: 100%;
    margin: 0;
    padding: 12px 20px;
    flex: 1;
    overflow-y: auto;
  }

  /* 聊天输入栏 */
  #chatView .chat-input-bar,
  #imChatView .im-chat-input-bar {
    max-width: 100%;
    margin: 0;
    width: 100%;
    padding: 10px 16px 14px;
    flex-shrink: 0;
    min-height: 55px;
    box-sizing: border-box;
  }

  /* 消息气泡最大宽度 */
  #chatView .msg-row,
  #imChatView .msg-row {
    max-width: 65%;
  }

  /* ---- 列5：通讯录 ---- */
  #imPanelContact {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #imPanelContact .im-contact-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
  }

  /* 通讯录底部白色板块 */
  #imPanelContact::after {
    content: '';
    display: block;
    flex-shrink: 0;
    height: 55px;
    background: #fff;
    border-top: 1px solid #E0E7EE;
    box-sizing: border-box;
  }

  /* 聊天窗口空状态 */
  .desktop-col-3.empty-chat::before {
    content: "选择一个对话开始聊天";
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #B0B0B0;
    font-size: 14px;
    background: #fff;
  }

  /* === 底部TAB栏 - 电脑端移到左侧底部 === */
  .tabbar {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 200px;
    border-top: 1px solid #F0F0F0;
    background: #fff;
    z-index: 50;
    padding-bottom: 8px !important;
  }

  /* === 其他页面：覆盖右侧内容区（除了翎聊其他TAB）=== */
  #profileView, #leaderboardView, #userMgmtView, #settingsView,
  #imageGenView, #copywritingView, #foodView, #tripView, #weatherView, #navView,
  .knowledge-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    z-index: 80;
    overflow-y: auto;
  }

  /* 桌面端卷宗页面：略微收窄，两侧留白防止按钮被裁 */
  .knowledge-page {
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    overflow-x: hidden !important;
    max-width: calc(100% - 20px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  #profileView .tool-content, #leaderboardView .tool-content,
  #userMgmtView .tool-content, #settingsView .tool-content,
  #imageGenView .tool-content, #copywritingView .tool-content,
  #foodView .tool-content, #tripView .tool-content,
  #weatherView .tool-content, #navView .tool-content {
    max-width: 600px;
    margin: 0 auto;
  }

  /* 拖拽提示 */
  .drag-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(33, 150, 243, 0.15);
    border: 3px dashed #2196F3;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #2196F3;
    font-weight: 600;
    pointer-events: none;
  }

  /* 输入框更大 */
  #imChatInput {
    font-size: 15px;
  }

  /* 桌面端：fixed定位的底部按钮改为sticky，跟随列3容器 */
  .create-coupon-footer {
    position: sticky !important;
    bottom: 0;
    left: auto;
    right: auto;
    width: 100%;
  }
}

/* ============================================================
   工具功能页通用样式
   ============================================================ */
.tool-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

.tool-back {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-form { margin-bottom: 16px; }

.tool-form-item { margin-bottom: 18px; }

.tool-form-item label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.tool-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #E8E8E8;
  border-radius: 12px;
  font-size: 15px;
  background: #FAFAFA;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.tool-input:focus { border-color: var(--primary); background: #fff; }

.tool-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #E8E8E8;
  border-radius: 12px;
  font-size: 15px;
  background: #FAFAFA;
  outline: none;
  resize: none;
  min-height: 80px;
  line-height: 1.5;
  transition: border-color 0.2s;
  font-family: inherit;
}

.tool-textarea:focus { border-color: var(--primary); background: #fff; }

.tool-style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.style-option {
  padding: 10px 8px;
  text-align: center;
  border: 1.5px solid #E8E8E8;
  border-radius: 10px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.style-option:active { opacity: 0.7; }

.style-option.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.tool-size-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.size-option {
  padding: 12px 8px;
  text-align: center;
  border: 1.5px solid #E8E8E8;
  border-radius: 10px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  line-height: 1.4;
  transition: all 0.2s;
  background: #fff;
}

.size-option:active { opacity: 0.7; }

.size-option.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.tool-generate-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #2196F3, #1976D2);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.tool-generate-btn:active { opacity: 0.85; }
.tool-generate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============================================================
   第二期：登录/注册弹窗
   ============================================================ */
.auth-tabs {
  display: flex;
  gap: 0;
  margin: 12px 0 18px;
  border-bottom: 2px solid #e0e0e0;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  font-size: 16px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.auth-tab.active {
  color: #2196F3;
  border-bottom-color: #2196F3;
}
.auth-form { display: flex; flex-direction: column; gap: 9px; }
.reg-type-tabs {
  display: flex;
  background: #f5f5f5;
  border-radius: 9px;
  padding: 4px;
  margin-bottom: 4px;
}
.reg-type-tab {
  flex: 1;
  text-align: center;
  padding: 9px;
  font-size: 14px;
  color: #666;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
}
.reg-type-tab.active {
  background: #fff;
  color: #2196F3;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.reg-type-tab.disabled {
  color: #bbb;
  cursor: not-allowed;
  position: relative;
}
.reg-type-tab.disabled::after {
  content: "暂不可用";
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  color: #ff6b6b;
  font-weight: normal;
}
.reg-staff-fields {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
}

/* 新增用户弹窗 */
.add-user-role-tabs {
  display: flex;
  background: #F5F7FA;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 14px;
}

.add-user-role-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  font-size: 13px;
  color: #666;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.add-user-role-tab.active {
  background: #fff;
  color: #2196F3;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.add-user-staff-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  color: #333;
}
.auth-select:invalid,
.auth-select option[value=""] {
  color: #999;
}
.dept-select {
  position: relative;
}
.dept-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #E0E0E0;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
}
.dept-select-trigger.active {
  border-color: #2196F3;
}
.dept-select-placeholder {
  color: #999;
}
.dept-select-placeholder.selected {
  color: #333;
}
.dept-select-arrow {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.dept-select-trigger.active .dept-select-arrow {
  transform: rotate(180deg);
}
.dept-select-trigger.active .dept-select-arrow path {
  stroke: #2196F3;
}
.dept-grid-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  padding: 14px;
  z-index: 100;
  animation: dropUp 0.2s ease;
}
@keyframes dropUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.dept-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.dept-grid-item {
  padding: 12px 6px;
  text-align: center;
  font-size: 14px;
  color: #666;
  background: #f5f7fa;
  border: 2px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}
.dept-grid-item:active {
  transform: scale(0.95);
}
.dept-grid-item.selected {
  background: #e3f2fd;
  border-color: #2196F3;
  color: #2196F3;
  font-weight: 500;
}
.auth-hint {
  font-size: 13px;
  color: #999;
  text-align: center;
  margin: 6px 0 0;
}

/* ============================================================
   滚动字幕（排行榜）
   ============================================================ */
/* 无数据时也保留高度：占位但不可见，防止下方 Tab 区和模型列表上移 */
#scrollBanner.hidden {
  display: flex !important;
  visibility: hidden;
}

.scroll-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
  padding: 4px 12px;
  overflow: hidden;
  border-radius: 0;
}
.scroll-banner-icon { flex-shrink: 0; }
.scroll-banner-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}
.scroll-banner-text {
  display: inline-block;
  color: #FFD700;
  font-size: 13px;
  font-weight: 500;
  animation: scrollText 25s linear infinite;
  white-space: nowrap;
  padding-left: 100%;
}
@keyframes scrollText {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ============================================================
   排行榜
   ============================================================ */
#leaderboardView {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.lb-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  padding: 16px 20px 8px;
}
/* 群英榜页面 - 白色清爽版 */
.lb-hero {
  position: relative;
  padding: 0 0 50px;
  background: #fff;
}
.lb-hero-bg {
  display: none;
}
.lb-hero-content {
  position: relative;
  z-index: 1;
  padding: 20px 20px 16px;
  color: #222;
  border-bottom: 1px solid #f0f0f0;
}
.lb-hero-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.lb-hero-date {
  font-size: 13px;
  color: #999;
}
/* 我的排名（卡片内） */
.lb-my-row {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lb-my-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lb-my-rank-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.lb-my-label {
  font-size: 12px;
  color: #999;
  margin-bottom: 2px;
}
.lb-my-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}
.lb-my-right {
  text-align: center;
}
.lb-my-stat-num {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  line-height: 1;
  margin-bottom: 4px;
}
.lb-my-stat-label {
  font-size: 11px;
  color: #999;
}
.leaderboard-scroll {
  flex: 1;
  overflow: hidden;
  background: #F0F7FF;
  padding: 6px 0 4px;
  display: flex;
  flex-direction: column;
}

/* 日期行 */
.lb-date-row {
  text-align: center;
  padding: 8px 0 2px;
  font-size: 13px;
  color: #999;
}
.lb-main-card {
  background: #fff;
  margin: 2px 10px 0;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid #BBDEFB;
  height: 450px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.lb-main-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../images/lb-bg-dameisha.jpg');
  background-size: cover;
  background-position: center bottom;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}
.lb-fixed-top,
.leaderboard-list {
  position: relative;
  z-index: 1;
}
.lb-fixed-top {
  flex-shrink: 0;
}
/* 前三名 */
.lb-top3 {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 4px 10px 4px;
  gap: 4px;
}
.lb-top3-item {
  flex: 1;
  text-align: center;
  position: relative;
}
.lb-top3-gold {
  transform: scale(1.05);
  z-index: 2;
  margin: 0 2px;
}
.lb-top3-crown {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
}
.lb-top3-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin: 0 auto 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.lb-top3-gold .lb-top3-avatar {
  background: #333;
}
.lb-top3-silver .lb-top3-avatar {
  background: #888;
}
.lb-top3-bronze .lb-top3-avatar {
  background: #bbb;
}
.lb-top3-name {
  font-size: 10px;
  font-weight: 600;
  color: #333;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-top3-count {
  font-size: 9px;
  color: #888;
}
.lb-top3-count span {
  font-weight: 700;
  color: #333;
  font-size: 11px;
}
/* 分割线 */
.lb-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 0 12px;
}
/* 列表标题 */
.lb-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 6px;
}
.lb-list-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
}
.lb-list-total {
  font-size: 12px;
  color: #999;
}
.lb-list-total span {
  color: #333;
  font-weight: 600;
}
.leaderboard-list {
  padding: 0 12px 10px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.leaderboard-empty {
  text-align: center;
  color: #bbb;
  font-size: 13px;
  padding: 60px 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lb-empty-icon {
  font-size: 64px;
  line-height: 1;
}
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 1px;
  transition: background 0.15s;
}
.leaderboard-item:active { background: #f7f7f7; }
.leaderboard-rank {
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  background: #f0f2f5;
  color: #999;
  padding: 0 6px;
}
.leaderboard-rank.rank-gold {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #fff;
}
.leaderboard-rank.rank-silver {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
  color: #fff;
}
.leaderboard-rank.rank-bronze {
  background: linear-gradient(135deg, #CD7F32, #B87333);
  color: #fff;
}
.leaderboard-rank.rank-4th {
  background: linear-gradient(135deg, #42A5F5, #1E88E5);
  color: #fff;
}
.leaderboard-rank.rank-5th {
  background: linear-gradient(135deg, #66BB6A, #43A047);
  color: #fff;
}
.leaderboard-nick {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #333;
}
.leaderboard-count {
  font-size: 12px;
  font-weight: 600;
  color: #333;
}
/* 计分规则卡片 */
.lb-rule-card {
  flex-shrink: 0;
  background: #fff;
  margin: 7px 10px 4px;
  border-radius: 18px;
  padding: 4px 14px;
  border: 2px solid #BBDEFB;
}
.lb-rule-title {
  font-size: 13px;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
}
.lb-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 4px;
}
.lb-rule-item:last-child { margin-bottom: 0; }
.lb-rule-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #999;
  margin-top: 7px;
  flex-shrink: 0;
}

/* ============================================================
   用户管理 - 卡片式布局
   ============================================================ */
.user-mgmt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-mgmt-header .user-mgmt-add-btn {
  padding: 6px 12px;
  font-size: 12px;
}
.user-count-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  margin-left: 6px;
}

/* 翎册管理页 - 与其他页面同色系，稍深一点 */
#userMgmtView {
  background: #EEF3F9 !important;
}
#userMgmtView .admin-panel {
  background: #EEF3F9 !important;
  padding: 0 16px 0;
}
#userMgmtView .header {
  background: #fff !important;
}
#userMgmtView .header-title {
  color: #1a1a1a;
}

/* 翎册管理 - 分段Tab */
#userMgmtView .admin-seg-tabs {
  background: #fff;
  border-bottom: 1px solid #eee;
  margin: 0;
  border-radius: 0;
  margin-top: 0;
  box-shadow: none;
  padding: 0 16px;
}
#userMgmtView .admin-seg-tab {
  color: #999;
}
#userMgmtView .admin-seg-tab.active {
  color: #2196F3;
}
#userMgmtView .admin-seg-tab.active::after {
  background: #2196F3;
}

/* 翎册管理 - 搜索框 */
#userMgmtView .user-mgmt-search {
  background: #fff;
  border: 1px solid #EEE;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

#userMgmtView .user-mgmt-toolbar {
  padding: 12px 0 10px;
}

/* 翎册管理 - 新增用户按钮 */
#userMgmtView .user-mgmt-add-btn {
  background: #2196F3;
  box-shadow: none;
}

.user-mgmt-toolbar {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-mgmt-search {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  padding: 0 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid #EEE;
  flex: 1;
  min-width: 0;
  max-width: 260px;
}

.user-mgmt-search .search-icon {
  flex-shrink: 0;
  margin-left: 8px;
}

.user-mgmt-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 9px 0;
  font-size: 13px;
  color: var(--text-main);
  font-family: inherit;
}

.user-mgmt-search input::placeholder {
  color: #BBB;
}

.user-mgmt-add-btn {
  padding: 7px 14px;
  background: #2196F3;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}
.user-mgmt-add-btn:active { background: #1976D2; }
.user-mgmt-table {
  padding: 6px 14px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 用户卡片 */
/* 翎册管理 - 成员列表 */
#userMgmtView .user-mgmt-table {
  padding: 0 0 0;
}

/* 翎册管理 - 部门筛选 */
#userMgmtView .dept-filter-bar {
  padding: 0 0 4px;
  margin-bottom: 4px;
}
#userMgmtView .dept-filter-scroll {
  margin-bottom: 4px;
}
#userMgmtView .dept-filter-tab {
  background: #fff;
  border-color: #E0E0E0;
  color: #666;
}
#userMgmtView .dept-filter-tab.active {
  background: #2196F3;
  color: #FFF;
  border-color: #2196F3;
  box-shadow: none;
}
#userMgmtView .dept-filter-count {
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
}
#userMgmtView .dept-filter-tab.active .dept-filter-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* 翎册管理 - 用户卡片 */
#userMgmtView .user-card-item {
  background: #fff;
  border: 1px solid #F0F0F0;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.05);
  margin-bottom: 10px;
}
#userMgmtView .admin-panel {
  padding: 0 16px 0;
}

.user-card-item {
  background: #fff;
  border-radius: 11px;
  padding: 9px;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.05);
  margin-bottom: 10px;
}

.user-card-item:last-child {
  margin-bottom: 0;
}

.user-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F0F0F0;
}

.user-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-card-main {
  flex: 1;
  min-width: 0;
}

.user-card-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.user-card-nickname {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card-tags-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.user-card-top-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.user-card-top-btns .btn-sm {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: #F0F7FF;
  color: var(--primary);
  cursor: pointer;
  line-height: 1;
}

.user-card-top-btns .btn-sm.btn-danger {
  border-color: #FFCDD2;
  color: #F44336;
  background: #FFEBEE;
}

.user-card-role-tag {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 999px;
}

.user-card-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}

.user-card-username {
  color: var(--text-sub);
}

.user-card-status {
  flex-shrink: 0;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
}

.user-card-status.status-active {
  background: #E8F5E9;
  color: #4CAF50;
}

.user-card-status.status-disabled {
  background: #FFEBEE;
  color: #F44336;
}

/* 信息网格 */
.user-card-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 9px;
  padding: 8px 0;
  border-bottom: 1px solid #F0F0F0;
}

.user-card-info-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.user-card-info-label {
  font-size: 9px;
  color: var(--text-sub);
}

.user-card-info-value {
  font-size: 11px;
  color: var(--text-main);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 操作区 */
.user-card-actions {
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-card-action-row-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-card-action-row-row .user-card-action-row {
  flex: 1;
}

.user-card-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.user-card-action-label {
  font-size: 11px;
  color: var(--text-sub);
  flex-shrink: 0;
}

.user-card-select-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex: 1;
  max-width: 125px;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-main);
  background: #FAFAFA;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  user-select: none;
  -webkit-user-select: none;
}

.user-card-select-display:active {
  border-color: #2196F3;
  background: #fff;
}

/* 核销员开关 */
.user-card-switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #E0E0E0;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.user-card-switch.on {
  background: #8B5CF6;
}
.user-card-switch .switch-dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: left 0.2s;
}
.user-card-switch.on .switch-dot {
  left: 20px;
}

/* ========== 新建优惠券页面 ========== */
.form-card {
  background: #fff;
  border-radius: 12px;
  margin: 12px 16px;
  padding: 4px 16px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.form-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  padding: 14px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-item {
  padding: 10px 0;
}
.form-item label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}
.form-item label .required {
  color: #EF4444;
  margin-left: 2px;
}
.form-item input,
.form-item select,
.form-item textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: #F9FAFB;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.form-item input:focus,
.form-item select:focus,
.form-item textarea:focus {
  border-color: #8B5CF6;
  background: #fff;
}
.form-item textarea {
  resize: none;
  line-height: 1.5;
}

/* 类型选择器 */
.type-selector {
  display: flex;
  gap: 10px;
}
.type-option {
  flex: 1;
  padding: 14px 8px;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #F9FAFB;
}
.type-option.active {
  border-color: #8B5CF6;
  background: linear-gradient(135deg, #F3E8FF, #EDE9FE);
}
.type-icon {
  font-size: 24px;
  margin-bottom: 4px;
}
.type-name {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}
.type-option.active .type-name {
  color: #7C3AED;
}

/* 等级范围 */
.level-range {
  display: flex;
  align-items: center;
  gap: 10px;
}
.level-range select {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 14px;
  background: #F9FAFB;
}
.level-divider {
  color: #9CA3AF;
  font-size: 13px;
  flex-shrink: 0;
}

/* 日期范围 */
.date-range {
  display: flex;
  align-items: center;
  gap: 10px;
}
.date-range input {
  flex: 1;
}
.date-divider {
  color: #9CA3AF;
  font-size: 13px;
  flex-shrink: 0;
}
.form-tip {
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 6px;
}

/* 底部创建按钮 */
.create-coupon-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #F3F4F6;
  z-index: 100;
}
.btn-create {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6D28D9, #A855F7);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-create:active {
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

/* 优惠券管理 - 新建按钮卡片 */
.create-coupon-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #6D28D9, #A855F7);
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
  transition: transform 0.15s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.create-coupon-card::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}
.create-coupon-card::after {
  content: '';
  position: absolute;
  bottom: -30px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.create-coupon-card:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}
.create-coupon-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 300;
  color: #fff;
  flex-shrink: 0;
  z-index: 1;
}
.create-coupon-text {
  flex: 1;
  z-index: 1;
}
.create-coupon-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}
.create-coupon-sub {
  font-size: 12px;
  opacity: 0.8;
}

.select-option-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.select-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  -webkit-user-select: none;
}

.select-option-item:active {
  background: #F0F7FF;
}

.select-option-item.selected {
  background: #F0F7FF;
}

.select-option-label {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
}

.select-option-item.selected .select-option-label {
  color: #2196F3;
  font-weight: 600;
}

.select-option-check {
  flex-shrink: 0;
}

.user-card-action-btns {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.user-card-action-btns button {
  padding: 4px 9px;
  border: 1.5px solid #BBDEFB;
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
  color: #0D47A1;
  cursor: pointer;
  font-weight: 600;
}

.user-card-action-btns .btn-danger {
  color: #f44336;
  border-color: #ffcdd2;
}

.user-card-action-btns .btn-danger:active { background: #ffebee; }

/* 管理员专属标签隐藏控制 */
.admin-only-tab { display: none; }
.admin-only-tab.visible { display: flex; }

.tool-result { margin-top: 20px; }

.tool-result-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.image-gen-img-wrap {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #F5F5F5;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.image-gen-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-gen-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.tool-action-btn {
  flex: 1;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tool-action-btn.secondary {
  background: #F0F0F0;
  color: #666;
}

.tool-action-btn:active { opacity: 0.7; }

.copy-result-content {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.7;
  color: #333;
  white-space: pre-wrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tool-loading {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #E0E0E0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 14px;
  color: #666;
}

/* 天气页 */
.weather-card {
  background: linear-gradient(135deg, #4FACFE, #00F2FE);
  border-radius: 20px;
  padding: 28px 24px;
  color: white;
  text-align: center;
  margin-bottom: 18px;
  box-shadow: 0 4px 20px rgba(79, 172, 254, 0.3);
}

.weather-city {
  font-size: 16px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.weather-temp {
  font-size: 56px;
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 4px;
}

.weather-desc {
  font-size: 18px;
  margin-bottom: 18px;
}

.weather-detail {
  display: flex;
  justify-content: space-around;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.2);
}

.weather-detail-item { text-align: center; }

.weather-detail-label {
  display: block;
  font-size: 12px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.weather-detail-value {
  font-size: 16px;
  font-weight: 600;
}

.weather-forecast {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.weather-forecast-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
}

.weather-forecast-list {
  display: flex;
  justify-content: space-between;
}

.forecast-item {
  text-align: center;
  flex: 1;
}

.forecast-day {
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
}

.forecast-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.forecast-temp {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}

.weather-tip {
  text-align: center;
  font-size: 12px;
  color: #999;
  padding: 8px;
}

/* 导航页 */
.nav-card {
  background: #fff;
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.nav-icon { margin-bottom: 16px; }

.nav-title {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin-bottom: 6px;
}

.nav-address {
  font-size: 14px;
  color: #999;
}

.nav-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  color: white;
  text-decoration: none;
  transition: all 0.15s;
}

.nav-btn:active { opacity: 0.85; }

.nav-btn.gaode { background: linear-gradient(135deg, #00B2FF, #007AFF); }
.nav-btn.baidu { background: linear-gradient(135deg, #2932E1, #1A237E); }
.nav-btn.tencent { background: linear-gradient(135deg, #FF7A45, #FA5151); }

.nav-tip {
  text-align: center;
  font-size: 12px;
  color: #999;
  padding: 8px;
}

/* ============================================================
   PWA 全屏模式专属样式（添加到桌面时生效）
   ============================================================ */
@media (display-mode: standalone) {
  /* 顶部标题栏适配状态栏 */
  .chat-header,
  .top-brand-bar,
  .im-chat-header {
    padding-top: calc(env(safe-area-inset-top) + 8px) !important;
  }

  /* 主页顶部标签栏额外间距 */
  .home-top-tabs {
    padding-top: calc(env(safe-area-inset-top) + 4px) !important;
  }

  /* 底部 tabbar 适配底部横条 */
  #tabbar {
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }

  /* IM 聊天输入栏适配底部横条 */
  .im-chat-input-bar {
    padding-bottom: env(safe-area-inset-bottom) !important;
  }

  /* 图片预览底部面板适配 */
  .im-image-preview-sheet {
    padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
  }

  /* 全屏图片查看器关闭按钮位置调整 */
  .im-image-viewer-close {
    top: calc(env(safe-area-inset-top) + 16px) !important;
  }

  /* 群信息面板顶部适配 */
  #groupInfoPanel {
    padding-top: env(safe-area-inset-top) !important;
  }
}

/* ============================================================
   群英页面 - 分段 Tab 切换
   ============================================================ */
.lb-segment-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  padding: 0 20px;
  flex-shrink: 0;
}
.lb-seg-tab {
  flex: 1;
  text-align: center;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 600;
  color: #999;
  position: relative;
  cursor: pointer;
  transition: color 0.2s;
}
.lb-seg-tab.active {
  color: #2196F3;
}
.lb-seg-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: #2196F3;
  border-radius: 2px;
}

/* 内容容器 */
.lb-content-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.lb-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   山海剧场
   ============================================================ */
.theater-scroll {
  min-height: 100%;
  background: #F5F7FA;
  padding-bottom: 20px;
}
.theater-section {
  padding: 16px 16px 0;
}
.theater-sec-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 2px;
}
.theater-sec-title > span:first-child {
  font-size: 17px;
  font-weight: 700;
  color: #222;
}
.theater-sec-more {
  font-size: 13px;
  color: #2196F3;
  cursor: pointer;
}

/* 热门推荐 - 横向滚动卡片 */
.theater-promo-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.theater-promo-row::-webkit-scrollbar {
  display: none;
}
.theater-card-h {
  flex-shrink: 0;
  width: 200px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s;
}
.theater-card-h:active {
  transform: scale(0.97);
}
.theater-card-cover {
  width: 100%;
  height: 112px;
  background: #e0e0e0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
}
.theater-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.theater-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}
.theater-card-body {
  padding: 10px 12px 12px;
}
.theater-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
.theater-card-meta {
  margin-top: 6px;
  font-size: 12px;
  color: #999;
}

/* 短剧网格 */
.theater-series-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.theater-card-v {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.15s;
}
.theater-card-v:active {
  transform: scale(0.97);
}
.theater-card-v .theater-card-cover {
  height: 140px;
}
.theater-card-v .theater-card-body {
  padding: 8px 10px 10px;
}
.theater-card-v .theater-card-title {
  font-size: 13px;
  min-height: 34px;
}
.series-badge {
  display: inline-block;
  padding: 2px 6px;
  background: #FF6B35;
  color: #fff;
  font-size: 10px;
  border-radius: 4px;
  margin-bottom: 4px;
}

/* 宣传视频列表 */
.theater-promo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.theater-list-item {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.15s;
}
.theater-list-item:active {
  transform: scale(0.98);
}
.theater-list-cover {
  width: 120px;
  height: 68px;
  border-radius: 8px;
  background: #e0e0e0;
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
}
.theater-list-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.theater-list-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.theater-list-title {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.theater-list-meta {
  font-size: 12px;
  color: #999;
}

/* 空状态 */
.theater-empty {
  text-align: center;
  padding: 30px 0;
  color: #999;
  font-size: 14px;
  grid-column: 1 / -1;
}

/* ============================================================
   视频播放页
   ============================================================ */
#videoPlayerView {
  background: #000;
  display: flex;
  flex-direction: column;
}
#videoPlayerView .chat-header {
  background: #111;
  color: #fff;
  border-radius: 12px 12px 0 0;
  margin-top: 4px;
}
#videoPlayerView .chat-header-title {
  color: #fff;
}
#videoPlayerView .chat-back svg path {
  stroke: #fff;
}
.video-player-wrap {
  flex: 1;
  overflow-y: auto;
  background: #000;
  -webkit-overflow-scrolling: touch;
}
.video-player-box {
  width: 100%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.video-player-box video {
  width: 100%;
  display: block;
  max-height: 56vh;
}
.video-info-card {
  background: #fff;
  margin: 0;
  border-radius: 12px;
  padding: 16px;
}
.video-info-title {
  font-size: 17px;
  font-weight: 700;
  color: #222;
  line-height: 1.4;
  margin-bottom: 6px;
}
.video-info-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #999;
  margin-bottom: 12px;
}
.video-info-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.video-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  border-radius: 20px;
  background: #f5f5f5;
  color: #555;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.video-action-btn:active {
  transform: scale(0.95);
}
.video-action-btn.liked {
  background: #ffe0e0;
  color: #e5342b;
}
.video-action-btn.liked svg path {
  fill: #e5342b;
}
.video-info-desc {
  font-size: 14px;
  color: #555;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ============================================================
   短剧详情页
   ============================================================ */
#seriesDetailView {
  background: #F5F7FA;
  display: flex;
  flex-direction: column;
}
.series-detail-wrap {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.series-header-card {
  display: flex;
  gap: 14px;
  background: #fff;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
}
.series-cover {
  width: 100px;
  height: 140px;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  overflow: hidden;
}
.series-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.series-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.series-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
}
.series-count {
  font-size: 13px;
  color: #2196F3;
  margin-bottom: 8px;
  font-weight: 600;
}
.series-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.series-episodes {
  padding: 16px;
}
.series-ep-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.series-ep-item {
  background: #fff;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.series-ep-item:active {
  transform: scale(0.95);
  background: #2196F3;
  color: #fff;
}
.series-ep-item.playing {
  background: #2196F3;
  color: #fff;
}

/* ============================================================
   管理后台 - 分段 Tab
   ============================================================ */
.admin-seg-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.admin-seg-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #999;
  position: relative;
  cursor: pointer;
  transition: color 0.2s;
}
.admin-seg-tab.active {
  color: #2196F3;
}
.admin-seg-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: #2196F3;
  border-radius: 2px;
}
.admin-panel {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.admin-panel.hidden {
  display: none;
}

/* 视频管理 */
.video-mgmt-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 12px 16px 8px;
  background: #fff;
  flex-shrink: 0;
}

/* 视频分类筛选 */
.video-cat-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.video-cat-tabs {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.video-cat-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  border-radius: 8px;
  font-size: 12.5px;
  border: 1.5px solid #E8E8E8;
  color: #666;
  background: #FAFAFA;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  transition: all 0.2s;
}

.video-cat-tab.active {
  background: #2196F3;
  color: #FFF;
  border-color: #2196F3;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.25);
}

.video-cat-tab:active {
  opacity: 0.7;
}

.video-cat-count {
  font-size: 10.5px;
  background: rgba(0,0,0,0.08);
  border-radius: 7px;
  padding: 0 5px;
  min-width: 16px;
  text-align: center;
  line-height: 15px;
}

.video-cat-tab.active .video-cat-count {
  background: rgba(255,255,255,0.3);
  color: #FFF;
}

.video-mgmt-upload-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  background: #2196F3;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

.video-mgmt-upload-btn:active {
  background: #1976D2;
}

.video-mgmt-list {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
}
.video-mgmt-item {
  display: flex;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.video-mgmt-cover {
  width: 100px;
  height: 56px;
  border-radius: 8px;
  background: #e0e0e0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
}
.video-mgmt-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-mgmt-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.video-mgmt-title {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-mgmt-meta {
  font-size: 12px;
  color: #999;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.video-mgmt-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.video-mgmt-btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #f0f0f0;
  color: #666;
}
.video-mgmt-btn.danger {
  background: #fee;
  color: #e53935;
}
.video-mgmt-btn.primary {
  background: #2196F3;
  color: #fff;
}
.video-cat-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  background: #E3F2FD;
  color: #1976D2;
}
.video-cat-tag.drama {
  background: #FFF3E0;
  color: #F57C00;
}

/* 上传弹窗 */
.video-upload-modal {
  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;
  padding: 20px;
}
.video-upload-modal.hidden {
  display: none;
}
.video-upload-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
}
.video-upload-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}
.video-upload-form .form-row {
  margin-bottom: 14px;
}
.video-upload-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}
.video-upload-form input,
.video-upload-form select,
.video-upload-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  box-sizing: border-box;
  outline: none;
}
.video-upload-form input:focus,
.video-upload-form select:focus,
.video-upload-form textarea:focus {
  border-color: #2196F3;
}
.video-upload-form textarea {
  resize: vertical;
  min-height: 60px;
}
.video-upload-form .form-row-inline {
  display: flex;
  gap: 10px;
}
.video-upload-form .form-row-inline > div {
  flex: 1;
}
.video-upload-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.video-upload-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.video-upload-actions .btn-cancel {
  background: #f0f0f0;
  color: #666;
}
.video-upload-actions .btn-submit {
  background: #2196F3;
  color: #fff;
}



/* ============================================================
   优惠券系统
   ============================================================ */

/* 卡券 Tab */
.coupon-tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.coupon-tab {
  flex: 1;
  text-align: center;
  padding: 14px 0;
  font-size: 15px;
  color: #666;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}
.coupon-tab.active {
  color: #6D28D9;
  font-weight: 600;
}
.coupon-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: linear-gradient(90deg, #6D28D9, #A855F7);
  border-radius: 2px;
}

/* 卡券列表 */
.coupon-list {
  padding: 16px;
  padding-bottom: 100px;
}
.coupon-item {
  background: #fff;
  border-radius: 14px;
  margin-bottom: 14px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: relative;
  cursor: pointer;
  transition: transform 0.15s;
}
.coupon-item:active {
  transform: scale(0.98);
}
.coupon-item.used, .coupon-item.expired {
  opacity: 0.55;
  filter: grayscale(0.5);
}
.coupon-left {
  width: 100px;
  background: linear-gradient(135deg, #6D28D9, #A855F7);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 8px;
  position: relative;
}
.coupon-left::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #f5f5f5;
  border-radius: 50%;
}
.coupon-value {
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
}
.coupon-unit {
  font-size: 13px;
  margin-top: 4px;
  opacity: 0.9;
}
.coupon-right {
  flex: 1;
  padding: 14px 16px 14px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.coupon-name {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
}
.coupon-desc {
  font-size: 12px;
  color: #999;
  line-height: 1.5;
}
.coupon-expire {
  font-size: 12px;
  color: #F59E0B;
  margin-top: 8px;
}
.coupon-status-tag {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  background: #f0f0f0;
  color: #999;
}
.coupon-status-tag.unused {
  background: #ECFDF5;
  color: #10B981;
}

/* 券详情页 */
.coupon-detail-wrap {
  padding: 20px 16px 100px;
}
.coupon-detail-card {
  background: linear-gradient(135deg, #6D28D9, #A855F7);
  border-radius: 18px;
  color: #fff;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}
.coupon-detail-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}
.coupon-detail-name {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 8px;
  position: relative;
}
.coupon-detail-value {
  font-size: 48px;
  font-weight: bold;
  line-height: 1;
  margin: 16px 0 6px;
  position: relative;
}
.coupon-detail-desc {
  font-size: 13px;
  opacity: 0.85;
  position: relative;
}
.coupon-detail-expire {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 16px;
  position: relative;
}

/* 核销码大展示 */
.redeem-code-section {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.redeem-code-label {
  font-size: 13px;
  color: #999;
  margin-bottom: 10px;
}
.redeem-code-big {
  font-size: 42px;
  font-weight: bold;
  letter-spacing: 12px;
  color: #6D28D9;
  font-family: 'Courier New', monospace;
  margin-bottom: 10px;
}
.redeem-code-tip {
  font-size: 12px;
  color: #F59E0B;
  background: #FFFBEB;
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-block;
}

/* 使用说明 */
.coupon-info-section {
  background: #fff;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.coupon-info-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  margin-bottom: 12px;
}
.coupon-info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
}
.coupon-info-row:last-child {
  border-bottom: none;
}
.coupon-info-label {
  color: #999;
}
.coupon-info-val {
  color: #333;
}
.coupon-desc-text {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
}

/* 核销页面 */
.redeem-wrap {
  padding: 24px 16px;
}
.redeem-coupon-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 16px;
}
.redeem-coupon-name {
  font-size: 18px;
  font-weight: 600;
  color: #222;
  margin-bottom: 8px;
}
.redeem-coupon-value {
  font-size: 32px;
  font-weight: bold;
  color: #6D28D9;
  margin: 12px 0;
}
.redeem-user-info {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #f0f0f0;
  margin-top: 12px;
}
.redeem-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6D28D9, #A855F7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-right: 10px;
}
.redeem-user-name {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}
.redeem-user-level {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}
.redeem-success-box {
  background: #ECFDF5;
  border: 1px solid #10B981;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-top: 16px;
}
.redeem-success-icon {
  font-size: 48px;
  margin-bottom: 8px;
}
.redeem-success-text {
  font-size: 16px;
  font-weight: 600;
  color: #10B981;
}



/* 表单样式 */
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #6D28D9;
}
.form-group textarea {
  resize: vertical;
  min-height: 60px;
}
.form-row {
  display: flex;
}
.form-radio-group {
  display: flex;
  gap: 16px;
}
.form-radio {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #333;
  cursor: pointer;
}
.form-radio input {
  margin-right: 5px;
  width: auto;
}

/* 管理员优惠券列表 */
.admin-coupon-list {
  padding: 0 16px 100px;
}
.admin-coupon-item {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.admin-coupon-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.admin-coupon-name {
  font-size: 15px;
  font-weight: 600;
  color: #222;
}
.admin-coupon-value {
  font-size: 18px;
  font-weight: bold;
  color: #6D28D9;
}
.admin-coupon-meta {
  font-size: 12px;
  color: #999;
  line-height: 1.8;
}
.admin-coupon-stats {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}
.admin-coupon-stat {
  flex: 1;
  text-align: center;
}
.admin-coupon-stat-num {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}
.admin-coupon-stat-label {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}
.admin-coupon-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.admin-coupon-btn {
  flex: 1;
  padding: 7px 0;
  font-size: 13px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.admin-coupon-btn.primary {
  background: #EEF2FF;
  color: #4F46E5;
}
.admin-coupon-btn.danger {
  background: #FEF2F2;
  color: #EF4444;
}
.admin-coupon-btn.warn {
  background: #FFFBEB;
  color: #D97706;
}
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.status-badge.active {
  background: #ECFDF5;
  color: #10B981;
}
.status-badge.inactive {
  background: #F3F4F6;
  color: #6B7280;
}

/* 桌面端：文档预览弹窗放大 */
.doc-preview-modal {
  align-items: center;
}
.doc-preview-card {
  max-width: 1000px;
  width: 90vw;
  height: 88vh;
  max-height: 88vh;
  border-radius: 16px;
  animation: modalFadeIn 0.25s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================
   添加到桌面（独立运行）模式
   独立运行时视口高度和浏览器里不一致，把 #app 锁定到真实可视区域，
   避免底部TAB被挤出屏幕
   ============================================================ */
@media (display-mode: standalone) {
  #app {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: auto;
    min-height: 0;
  }
}

/* 苹果独立运行模式（由JS标记，兼容媒体查询不生效的版本） */
html.ios-standalone #app {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  min-height: 0;
}

/* ============================================================
   投屏 / 外接屏幕适配
   手机（触屏设备）投屏后视口被放大到 ≥768px 时：
   保持手机布局（底部TAB仍在），同时让界面铺满整个屏幕
   ============================================================ */
@media (hover: none) and (pointer: coarse) and (min-width: 768px) {
  #app {
    max-width: none;
    width: 100%;
    margin: 0;
    box-shadow: none;
  }

  /* 宽屏下给内容留出适度边距，避免文字贴到屏幕边缘 */
  .model-item {
    margin: 6px 3vw;
  }

  #chatView .chat-messages,
  #imChatView .chat-messages,
  .knowledge-page,
  #tabbar {
    padding-left: 2vw;
    padding-right: 2vw;
  }
}

/* ===== ICP备案信息（首页底部）===== */
.icp-footer {
  flex-shrink: 0;
  text-align: center;
  padding: 6px 0 4px;
  background: #FFFFFF;
  border-top: 1px solid #F0F2F5;
}

.icp-footer a {
  font-size: 11px;
  color: #9AA0A6;
  text-decoration: none;
  letter-spacing: 0.2px;
}



