/* =========================================================
   DoroForum — 苹果风格 (Apple Design System) 全站样式
   主色 #007AFF · 背景 #F5F5F7 · SF 字体栈 · 毛玻璃 · 分段控件
   ========================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-muted: #86868b;
  --border: rgba(0, 0, 0, .08);
  --primary: #007aff;
  --primary-dark: #0066d6;
  --primary-light: #e8f2ff;
  --danger: #ff3b30;
  --danger-light: #ffeceb;
  --warn: #ff9500;
  --ok: #34c759;
  --ok-light: #e5f8ea;
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px var(--hover-bg);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .07);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .12);
  --bg-elevated: #f5f5f7;
  --bubble-theirs: #e9e9eb;
  --code-bg: #1d1d1f;
  --code-text: #f5f5f7;
  --input-bg: rgba(0, 0, 0, .05);
  --hover-bg: rgba(0, 0, 0, .05);
  --hover-strong: rgba(0, 0, 0, .1);
  --header-bg: rgba(255, 255, 255, .72);
  --card-glass: rgba(255, 255, 255, .9);
  --presence-off: #c7c7cc;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

html { -webkit-font-smoothing: antialiased; text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container { max-width: 100%; margin: 0 auto; padding: 0 20px; width: 100%; }
main.container { flex: 1; padding-top: 28px; padding-bottom: 60px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 顶部导航（毛玻璃） ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--input-bg);
}
.header-inner { display: flex; align-items: center; gap: 18px; padding: 10px 20px; max-width: 100%; margin: 0 auto; }
.logo { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.logo span { color: var(--primary); }
.logo:hover { text-decoration: none; }
.logo-lg { font-size: 28px; font-weight: 800; letter-spacing: -.4px; }

.main-nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s;
}
.nav-link:hover { background: var(--input-bg); text-decoration: none; }

.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
}
/* 导航文字徽章：跟随文字显示 */
.friend-req-badge, .chat-nav-badge { margin-left: 4px; }
/* 铃铛角标：悬浮在图标右上角 */
.notification-nav-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  font-size: 10px;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--header-bg);
}

.header-user { display: flex; align-items: center; gap: 8px; }
.user-name { font-weight: 600; font-size: 14px; }

.role-tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
}
.role-tag-super { background: #fff3e0; color: #b26a00; }
.role-tag-plain { background: var(--input-bg); color: var(--text-muted); }
.role-tag-danger { background: var(--danger-light); color: var(--danger); }
.role-tag-ok { background: var(--ok-light); color: var(--ok); }

.inline-form { display: inline; }

/* ============ 按钮（胶囊） ============ */
.btn {
  display: inline-block;
  padding: 8px 18px;
  border: none;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  background: var(--input-bg);
  color: var(--text);
  transition: all .18s ease;
}
.btn:hover { text-decoration: none; background: var(--hover-strong); }
.btn:active { transform: scale(.97); }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #0071e8; }
.btn-ghost { background: var(--input-bg); color: var(--primary); }
.btn-ghost:hover { background: rgba(0, 0, 0, .09); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e6352b; }
.btn-danger-link { background: transparent; color: var(--danger); }
.btn-danger-link:hover { background: var(--danger-light); }
.btn-warn { background: var(--warn); color: #fff; }
.btn-warn:hover { background: #e08700; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #2dab4e; }

/* ============ 登录注册 ============ */
.auth-page {
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, #f5f5f7 0%, #eef1f6 100%);
}
.auth-card {
  background: var(--card-glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--input-bg);
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -.3px; margin: 20px 0 18px; text-align: center; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { font-size: 13px; color: var(--text-muted); display: flex; flex-direction: column; gap: 6px; }
.auth-form input {
  padding: 12px 14px;
  background: var(--input-bg);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  transition: all .2s;
}
.auth-form input:focus { outline: none; background: var(--field-focus-bg); box-shadow: 0 0 0 4px rgba(0, 122, 255, .18); }
.auth-switch { text-align: center; font-size: 13px; margin-top: 18px; color: var(--text-muted); }

.alert { padding: 11px 16px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; }
.alert-error { background: var(--danger-light); color: var(--danger); }
.alert-ok { background: var(--ok-light); color: var(--ok); }

/* ============ 页面头 / 分段控件 Tab ============ */
.page-head { margin-bottom: 18px; }
.page-head h2 { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.subtitle { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.board-tabs, .admin-tabs, .ticket-tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  padding: 3px;
  margin: 12px 0 14px;
  background: var(--input-bg);
  border-radius: 10px;
  width: fit-content;
  max-width: 100%;
}
.tab {
  padding: 6px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all .18s ease;
}
.tab:hover { background: var(--hover-bg); color: var(--text); transform: none; box-shadow: none; text-decoration: none; }
.tab-active { background: var(--card); color: var(--primary); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); font-weight: 600; }
.tab-active:hover { background: var(--card); color: var(--primary); }
.tab .badge { margin-left: 2px; background: var(--danger); color: #fff; }

.toolbar { margin-bottom: 14px; display: flex; justify-content: flex-end; }

/* ============ 卡片 / 表单 ============ */
.card {
  background: var(--card);
  border: 1px solid var(--input-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
}
.form-stack { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.form-stack label { font-size: 14px; font-weight: 600; display: flex; flex-direction: column; gap: 6px; }
.form-stack input, .form-stack select, .form-stack textarea {
  padding: 11px 14px;
  background-color: var(--input-bg);
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  color: var(--text);
  transition: all .2s;
}
.form-stack input:focus, .form-stack textarea:focus, .form-stack select:focus {
  outline: none; background: var(--field-focus-bg); box-shadow: 0 0 0 4px rgba(0, 122, 255, .18);
}

/* ============ 帖子列表 ============ */
.post-list { display: flex; flex-direction: column; gap: 12px; }
.post-item {
  background: var(--card);
  border: 1px solid var(--input-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  transition: box-shadow .2s, transform .2s;
}
.post-item:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.post-title { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--primary); text-decoration: none; }
.post-meta { font-size: 13px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.post-excerpt { font-size: 14px; color: var(--text-muted); margin-top: 8px; }
.post-side { display: flex; align-items: flex-start; }
.comment-count { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.board-chip {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
}
.empty { text-align: center; color: var(--text-muted); padding: 28px 0; }

/* ============ 帖子详情 ============ */
.post-detail { margin-bottom: 16px; }
.post-detail-head { border-bottom: 1px solid var(--border); padding-bottom: 14px; margin-bottom: 14px; }
.post-detail-head h2 { font-size: 24px; font-weight: 700; letter-spacing: -.3px; margin-top: 8px; }
.post-content { font-size: 15px; white-space: pre-wrap; }
.comment-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.comment-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.comment-form textarea {
  padding: 11px 14px;
  background: var(--input-bg);
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  transition: all .2s;
}
.comment-form textarea:focus { outline: none; background: var(--field-focus-bg); box-shadow: 0 0 0 4px rgba(0, 122, 255, .18); }
.comment-form .btn { align-self: flex-end; }
.comment-form input[type="file"] { font-size: 13px; color: var(--text-muted); }
.comment-list { display: flex; flex-direction: column; }
.comment-item { padding: 14px 0; border-top: 1px solid var(--border); }
.comment-head { display: flex; align-items: center; gap: 10px; }
.comment-head strong { font-size: 14px; }
.comment-time { font-size: 12px; color: var(--text-muted); flex: 1; }
.comment-body { margin-top: 6px; font-size: 14px; white-space: pre-wrap; }

/* ============ Markdown 渲染 ============ */
.md-body { font-size: 15px; line-height: 1.8; }
.md-body pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 14px 16px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13px;
  margin: 10px 0;
}
.md-body code { background: var(--input-bg); padding: 2px 6px; border-radius: 5px; font-size: 13px; }
.md-body pre code { background: transparent; padding: 0; }
.md-body blockquote { border-left: 3px solid var(--primary); padding-left: 14px; color: var(--text-muted); margin: 8px 0; }
.md-body img { max-width: 100%; border-radius: 12px; }
.md-body table { border-collapse: collapse; margin: 10px 0; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 6px 10px; }

/* ============ 徽章 / 标签 / 图片画廊 ============ */
.post-badges { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.badge-chip { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.badge-pinned { background: #fff3e0; color: #b26a00; }
.badge-featured { background: #fde8f3; color: #c21e68; }

.tag-row { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag-chip {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--input-bg);
  color: var(--primary);
}

.post-actions { display: flex; gap: 8px; margin-top: 10px; }

.gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.gallery img {
  width: 180px; height: 180px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform .15s;
}
.gallery img:hover { transform: scale(1.03); }
.gallery-sm img { width: 120px; height: 120px; }

/* ============ 功能占位区 ============ */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.feature-card h4 { margin-bottom: 8px; }
.feature-card-placeholder { border-style: dashed; border-color: var(--border); text-align: center; color: var(--text-muted); }

/* ============ 后台 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-top: 16px; }
.stat-card { text-align: center; }
.stat-card h3 { font-size: 30px; font-weight: 700; color: var(--primary); letter-spacing: -.5px; }
.stat-card p { color: var(--text-muted); font-size: 13px; }

.search-bar { display: flex; gap: 8px; margin-bottom: 14px; max-width: 420px; }
.search-bar input {
  flex: 1; padding: 9px 14px;
  background: var(--input-bg);
  border: none; border-radius: 12px;
  font-size: 14px; font-family: inherit;
  transition: all .2s;
}
.search-bar input:focus { outline: none; background: var(--field-focus-bg); box-shadow: 0 0 0 4px rgba(0, 122, 255, .18); }

.create-admin-card { margin-bottom: 16px; max-width: 640px; }
.create-admin-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.create-admin-form { display: flex; gap: 8px; flex-wrap: wrap; }
.create-admin-form input {
  flex: 1; min-width: 140px; padding: 9px 14px;
  background: var(--input-bg);
  border: none; border-radius: 12px;
  font-size: 14px; font-family: inherit;
  transition: all .2s;
}
.create-admin-form input:focus { outline: none; background: var(--field-focus-bg); box-shadow: 0 0 0 4px rgba(0, 122, 255, .18); }

.table-wrap { padding: 6px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
td { vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.th-actions { text-align: right; }
.td-actions { text-align: right; white-space: nowrap; }
.td-time { white-space: nowrap; font-size: 13px; color: var(--text-muted); }
.td-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-actions .inline-form { margin-left: 4px; }

/* ============ 聊天（通用） ============ */
.admin-chat-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }

.conv-list { padding: 12px; }
.conv-list-title { font-size: 13px; font-weight: 600; color: var(--text-muted); padding: 4px 8px 10px; }
.conv-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 4px;
  color: var(--text);
  transition: background .15s;
}
.conv-item:hover { background: var(--input-bg); text-decoration: none; }
.conv-item-active { background: var(--primary-light); }
.conv-item-head { display: flex; align-items: center; gap: 8px; }
.conv-item-head strong { font-size: 14px; flex: 1; }
.conv-last {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-unread { flex: 0 0 auto; }

.chat-window { display: flex; flex-direction: column; height: 560px; padding: 0; overflow: hidden; background: var(--card); }
.chat-window-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-elevated);
}
.chat-empty { text-align: center; color: var(--text-muted); padding: 40px 0; }
.chat-msg { display: flex; }
.chat-msg-mine { justify-content: flex-end; }
.chat-msg-theirs { justify-content: flex-start; }
.chat-bubble {
  max-width: 72%;
  padding: 9px 14px;
  border-radius: 16px;
  font-size: 14px;
}
.chat-msg-mine .chat-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg-theirs .chat-bubble { background: var(--bubble-theirs); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble p { white-space: pre-wrap; word-break: break-word; }
.chat-time { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }
.chat-input { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--card); }
.chat-input input {
  flex: 1; padding: 8px 14px;
  background: var(--input-bg);
  border: none; border-radius: 12px;
  font-size: 14px; font-family: inherit;
  line-height: 1.4;
  transition: all .2s;
}
.chat-input input:focus { outline: none; background: var(--field-focus-bg); box-shadow: 0 0 0 4px rgba(0, 122, 255, .18); }
.chat-input-disabled { color: var(--text-muted); font-size: 13px; text-align: center; }

/* 语音消息 */
.voice-btn { flex-shrink: 0; font-size: 15px; padding: 8px 12px; }
.voice-recording { background: var(--danger) !important; color: #fff !important; }
.voice-player { height: 32px; max-width: 220px; border-radius: 8px; }
.chat-bubble .voice-player { display: block; }

/* ============ 聊天室板块 ============ */
.create-room-bar { display: flex; gap: 8px; margin-bottom: 16px; max-width: 480px; }
.create-room-bar input {
  flex: 1; padding: 11px 14px;
  background: var(--input-bg);
  border: none; border-radius: 12px;
  font-size: 14px; font-family: inherit;
  transition: all .2s;
}
.create-room-bar input:focus { outline: none; background: var(--field-focus-bg); box-shadow: 0 0 0 4px rgba(0, 122, 255, .18); }

.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.room-card { display: flex; flex-direction: column; gap: 8px; }
.room-name { font-size: 16px; font-weight: 600; }
.room-name a { color: var(--text); }
.room-name a:hover { color: var(--primary); text-decoration: none; }
.room-meta { font-size: 13px; color: var(--text-muted); }
.room-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; }

.online-count { color: var(--ok); font-weight: 700; }

.room-chat { display: flex; flex-direction: column; height: 560px; padding: 0; overflow: hidden; }
.room-chat .chat-messages { flex: 1; }
.wg-chat { height: 420px; }
.wg-chat .chat-messages { border-radius: 0; }

/* ============ 钉钉式群聊界面 ============ */
/* 工作组列表页 */
.dg-list-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .dg-list-wrap { grid-template-columns: 1fr; } }
.dg-list { display: flex; flex-direction: column; gap: 8px; }
.dg-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--input-bg);
  transition: background .15s;
}
a.dg-list-item:hover { background: var(--hover-bg); text-decoration: none; }
.dg-list-avatar { flex-shrink: 0; }
.dg-list-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dg-list-name { font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-list-meta { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-list-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* 群信息栏 */
.dg-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary-light), transparent);
}
.dg-group-name { font-size: 20px; font-weight: 700; margin: 0; color: var(--text); }
.dg-group-meta { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }
.dg-group-avatar { flex-shrink: 0; display: flex; }
.dg-group-avatar .avatar { border-radius: 18px; }
.dg-avatar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dg-avatar-form { display: flex; flex-direction: column; gap: 6px; }
.dg-avatar-form input[type="file"] { font-size: 12px; color: var(--text-muted); }
.dg-group-actions { flex-shrink: 0; }

/* 群公告横幅 */
.dg-notice {
  display: flex; align-items: center; gap: 10px;
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.dg-notice-tag {
  flex-shrink: 0;
  font-size: 12px; font-weight: 600;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  padding: 2px 10px;
}
.dg-notice-text { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 群设置抽屉 */
.dg-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, .35);
}
.dg-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 91;
  width: 340px; max-width: 92vw;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.dg-drawer-open { transform: translateX(0); }
.dg-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.dg-drawer-head h3 { margin: 0; font-size: 16px; }
.dg-drawer-body { flex: 1; overflow-y: auto; padding: 4px 16px 20px; }
.dg-sec { padding: 14px 0; border-bottom: 1px solid var(--border); }
.dg-sec:last-child { border-bottom: none; }
.dg-sec h4 { font-size: 13px; font-weight: 600; color: var(--text-muted); margin: 0 0 10px; }
.dg-info-row { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; }
.dg-info-row > span { color: var(--text-muted); min-width: 64px; }
.dg-info-row > strong { flex: 1; }
.dg-name-input { flex: 1; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--input-bg); font-size: 14px; color: var(--text); }
.dg-notice-input {
  width: 100%; min-height: 72px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  font-size: 13px; font-family: inherit;
  color: var(--text);
  resize: vertical;
}
.dg-notice-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(0, 122, 255, .15); }
.dg-notice-read { font-size: 13px; color: var(--text); margin: 0; }
.dg-add-member { margin-bottom: 10px; }
.dg-add-member select { flex: 1; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--input-bg); font-size: 13px; color: var(--text); }
.dg-member-list { display: flex; flex-direction: column; gap: 6px; }
.dg-member {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 10px;
  background: var(--input-bg);
}
.dg-member-info { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.dg-member-info .user-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-member-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.dg-member-ops .btn { padding: 2px 8px; font-size: 12px; }

/* ============ 工作组会议（钉钉式多人语音/屏幕分享） ============ */
.wg-meet-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.wg-meet-status { font-size: 12px; color: var(--ok); margin-left: auto; }
.wg-meeting {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  background: var(--bg-elevated);
}
.wg-chat { position: relative; }
.wg-meeting-stage { flex: 1; overflow-y: auto; padding: 14px; position: relative; }
.wg-meeting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.wg-meet-tile {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #1c1c1e;
  border-radius: 12px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 13px;
}
.wg-meet-tile video { width: 100%; height: 100%; object-fit: contain; }
.wg-meet-tile .avatar { width: 56px; height: 56px; font-size: 24px; }
.wg-meet-mic {
  position: absolute; top: 8px; right: 8px;
  color: #fff;
  opacity: .65;
  line-height: 1;
  display: flex;
  transition: all .15s;
}
.wg-meet-mic .icon { width: 18px; height: 18px; }
.wg-meet-mic-speaking { opacity: 1; color: #30d158; }
.wg-meet-mic-muted { opacity: .4; }
.wg-meet-ban {
  position: absolute; left: 8px; top: 8px;
  background: rgba(255, 59, 48, .85);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}

/* ============ QQ 语音风格 ============ */
.wg-voice-mode { background: linear-gradient(160deg, #1f2a3d, #141b26 60%, #0f1520); }
.wg-meet-voice-head {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 10px 0 6px;
  color: #fff;
  font-size: 14px;
}
.wg-meet-timer {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: 2px 12px;
}
.wg-voice-grid {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 28px;
  min-height: 300px;
  padding-top: 6px;
}
.wg-voice-tile {
  aspect-ratio: auto;
  background: transparent;
  width: 120px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 6px;
}
.wg-voice-avatar .avatar {
  width: 96px; height: 96px;
  font-size: 40px;
  border-radius: 50%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
  transition: box-shadow .2s;
}
.wg-voice-avatar img.avatar-img { object-fit: cover; }
.wg-voice-speaking .wg-voice-avatar .avatar {
  box-shadow: 0 0 0 3px #30d158, 0 8px 30px rgba(0, 0, 0, .45);
}
.wg-voice-name {
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
  max-width: 120px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wg-voice-self {
  position: absolute; right: 18px; bottom: 14px;
  display: flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .14);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  color: #fff;
}
.wg-voice-self-avatar .avatar { width: 36px; height: 36px; border-radius: 50%; }
.wg-voice-self-label { font-size: 12px; opacity: .85; }

/* 圆形控制按钮 */
.wg-meeting-controls {
  display: flex; justify-content: center; align-items: center; gap: 22px;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.wg-meet-ctl {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  transition: all .18s ease;
}
.wg-meet-ctl .icon { width: 20px; height: 20px; }
.wg-meet-ctl:hover { background: var(--hover-strong); transform: scale(1.06); }
.wg-meet-ctl:active { transform: scale(.94); }
.wg-meet-ctl-active { background: var(--primary) !important; color: #fff !important; }
.wg-meet-ctl-end { background: var(--danger) !important; color: #fff !important; }
.wg-meet-ctl-end:hover { background: #e0312b !important; }
/* 麦克风发送音量 */
.wg-meet-micgain {
  display: none;
  align-items: center; gap: 6px;
  background: var(--input-bg);
  border-radius: 999px;
  padding: 8px 14px;
  margin-right: 8px;
}
.wg-meet-micgain-icon { display: flex; color: var(--text-muted); }
.wg-meet-micgain-icon .icon { width: 16px; height: 16px; }
.wg-meet-micgain .wg-meet-vol-range { width: 90px; background: var(--border); }
.wg-meet-micgain .wg-meet-vol-range::-webkit-slider-thumb { background: var(--primary); }
.wg-meet-micgain .wg-meet-vol-range::-moz-range-thumb { background: var(--primary); }
/* 音量滑条 */
.wg-meet-vol {
  position: absolute; right: 8px; bottom: 30px;
  display: flex; align-items: center; gap: 4px;
  background: rgba(0, 0, 0, .55);
  border-radius: 999px;
  padding: 2px 8px;
  opacity: 0;
  transition: opacity .15s;
}
.wg-meet-tile:hover .wg-meet-vol { opacity: 1; }
.wg-meet-vol-icon { display: flex; color: #fff; }
.wg-meet-vol-icon .icon { width: 14px; height: 14px; }
.wg-meet-vol-range {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, .35);
  border-radius: 999px;
  outline: none;
  cursor: pointer;
}
.wg-meet-vol-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
}
.wg-meet-vol-range::-moz-range-thumb {
  width: 12px; height: 12px;
  border: none;
  border-radius: 50%;
  background: #fff;
}
/* 双击放大视频格子 */
.wg-meet-tile { cursor: default; }
.wg-meet-tile-zoom {
  position: fixed; inset: 0; z-index: 300;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000;
}
.wg-meet-tile-zoom video { object-fit: contain; }
.wg-meet-tile-zoom .wg-meet-mic { top: 16px; right: 16px; }
.wg-meet-tile-zoom .wg-meet-mic .icon { width: 26px; height: 26px; }
.wg-meet-tile-label {
  position: absolute; left: 8px; bottom: 8px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  max-width: 80%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wg-meeting-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 20px 0; }
.room-sender {
  font-size: 12px; font-weight: 700;
  margin-bottom: 2px;
  color: var(--primary);
  display: flex; align-items: center; gap: 6px;
}
.chat-msg-mine .room-sender { color: var(--card-glass); }
.room-sender .role-tag { font-size: 11px; padding: 0 6px; }

/* ============ 头像（圆角方形） ============ */
.avatar {
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  user-select: none;
}
.avatar-img { background: var(--bg); }
.avatar-xs { width: 22px; height: 22px; font-size: 11px; }
.avatar-sm { width: 32px; height: 32px; font-size: 14px; }
.avatar-md { width: 44px; height: 44px; font-size: 18px; }
.avatar-xl { width: 96px; height: 96px; font-size: 36px; }

/* ============ 个人中心 ============ */
.profile-layout { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.profile-card { width: 280px; text-align: center; }
.profile-avatar { display: flex; justify-content: center; margin-bottom: 14px; }
.profile-upload { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.profile-upload input[type="file"] { font-size: 12px; color: var(--text-muted); }
.profile-info { flex: 1; min-width: 260px; }
.profile-info p { margin-bottom: 8px; }

/* ============ 微信风格私信（QQ 化） ============ */
.wechat-layout { display: grid; grid-template-columns: 300px 6px 1fr; gap: 0 8px; align-items: stretch; height: 600px; }
.wechat-sidebar { padding: 12px; display: flex; flex-direction: column; overflow: hidden; min-width: 180px; max-width: 480px; }
.sidebar-resizer {
  width: 6px;
  cursor: col-resize;
  border-radius: 3px;
  transition: background .15s;
  align-self: stretch;
  align-self: stretch;
}
.sidebar-resizer:hover { background: rgba(0, 122, 255, .25); }
.wechat-toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.wechat-search {
  flex: 1; padding: 8px 14px;
  background: var(--input-bg);
  border: none; border-radius: 10px;
  font-size: 13px; font-family: inherit;
  transition: all .2s;
}
.wechat-search:focus { outline: none; background: var(--field-focus-bg); box-shadow: 0 0 0 4px rgba(0, 122, 255, .18); }
.wechat-toolbar { position: relative; }
/* 搜索用户面板 */
.search-panel {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  z-index: 30;
  max-height: 320px; overflow-y: auto;
  padding: 8px;
}
.search-panel-title { font-size: 12px; color: var(--text-muted); padding: 2px 6px 6px; }
.search-panel-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 10px; }
.search-user {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 6px; border-radius: 10px;
}
.search-user:hover { background: var(--input-bg); }
.search-user .user-name { flex: 1; font-size: 14px; }
/* 好友请求条 */
.friend-req-bar {
  display: flex; align-items: center; gap: 6px;
  background: var(--primary-light);
  border-radius: 10px;
  padding: 8px 10px; margin-bottom: 8px;
}
.friend-req-bar-text { flex: 1; font-size: 13px; color: var(--text); }
.friend-req-toggle { flex: 0 0 auto; }
.friend-req-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.friend-req-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 6px; border-radius: 10px;
  background: var(--input-bg);
}
.friend-req-item .user-name { flex: 1; font-size: 13px; }
.friend-req-actions { display: flex; gap: 6px; }
.wechat-conv-list { flex: 1; overflow-y: auto; }
.wechat-conv {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px;
  border-radius: 10px;
  color: var(--text);
  transition: background .15s;
}
.wechat-conv:hover { background: var(--input-bg); text-decoration: none; }
.wechat-conv-active { background: var(--primary-light); }
.wechat-conv-active:hover { background: var(--primary-light); }
.wechat-conv-avatar { position: relative; }
.presence-dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--presence-off);
  border: 2px solid #fff;
}
.presence-online { background: #30d158; }
[data-theme="dark"] .presence-dot { border-color: var(--card); }
.wechat-conv-info { flex: 1; min-width: 0; }
.wechat-conv-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wechat-conv-top strong { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.wechat-conv-bottom { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.wechat-conv-bottom .conv-last { font-size: 12px; color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wechat-chat { display: flex; flex-direction: column; height: 600px; padding: 0; overflow: hidden; background: var(--card); }
#dm-chat-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.wechat-chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.wechat-chat-user { display: flex; flex-direction: column; }
.wechat-chat-user strong { font-size: 15px; font-weight: 600; }
.presence-text { font-size: 12px; color: var(--text-muted); }
.wechat-chat .chat-messages { background: var(--bg-elevated); }
.wechat-msg { display: flex; align-items: flex-start; gap: 8px; }
.wechat-msg-mine { justify-content: flex-end; }
.wechat-msg .chat-bubble {
  max-width: 60%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 1px 2px var(--input-bg);
}
.wechat-msg-mine .chat-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.wechat-msg-theirs .chat-bubble { background: var(--bubble-theirs); color: var(--text); border-bottom-left-radius: 4px; }
.date-divider { text-align: center; font-size: 11px; color: var(--text-muted); margin: 12px 0 4px; }
.typing-bar {
  display: none;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  animation: typingPulse 1.2s ease-in-out infinite;
}
@keyframes typingPulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ============ 好友与群聊 ============ */
.friend-add { margin-bottom: 16px; }
.friend-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.friend-cards { display: flex; flex-direction: column; gap: 6px; }
.friend-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: box-shadow .15s;
}
.friend-card:hover { box-shadow: var(--shadow-sm); }
.friend-card .user-name { font-size: 14px; }

/* ============ 客服工单 ============ */
.ticket-body { margin-bottom: 16px; }
.ticket-replies h3 { margin-bottom: 12px; }
.ticket-close-form { display: block; margin: 6px 0 0 auto; width: fit-content; }
.admin-ticket-layout { display: flex; gap: 16px; align-items: flex-start; }
.ticket-ops { padding: 14px; }
.ticket-op-form { margin-bottom: 10px; }
.ticket-ops select { padding: 7px 12px; border: none; border-radius: 10px; font-size: 13px; font-family: inherit; }

/* ============ 打卡 ============ */
.checkin-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.checkin-main { text-align: center; padding: 36px 24px; }
.checkin-clock .checkin-time { font-size: 44px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.checkin-clock { margin-bottom: 24px; }
.checkin-done-icon { font-size: 52px; margin-bottom: 8px; }
.checkin-done p { font-size: 16px; font-weight: 600; }
.checkin-btn { font-size: 16px; padding: 12px 20px; }
.checkin-stats { display: flex; flex-direction: column; gap: 14px; }
.checkin-history { display: flex; flex-direction: column; }
.checkin-history-item { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 14px; }
.checkin-history-item:last-child { border-bottom: none; }
@media (max-width: 720px) { .checkin-layout { grid-template-columns: 1fr; } }

/* ============ 通知中心 ============ */
.notice-item {
  display: block;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background .15s;
}
.notice-item:last-child { border-bottom: none; }
.notice-item:hover { background: rgba(0, 0, 0, .03); text-decoration: none; }
.notice-item-unread { background: var(--primary-light); }
.notice-item-unread:hover { background: #dcecff; }
.notice-head { display: flex; align-items: center; gap: 10px; }
.notice-head strong { font-size: 14px; flex: 1; }
.notice-body { font-size: 13px; color: var(--text-muted); margin: 4px 0; }
.notice-type { float: right; }

/* ============ 验证码 ============ */
.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-img {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: var(--field-focus-bg);
}

/* ============ 页脚 / 错误页 ============ */
.site-footer {
  background: var(--header-bg);
  border-top: 1px solid var(--border);
  padding: 18px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.error-page { text-align: center; padding: 60px 24px; }
.error-page h2 { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.error-page p { margin-bottom: 24px; color: var(--text-muted); }

/* ============ 苹果风格细节增强 ============ */

/* 下拉选择器（苹果风：浅灰底 + 自定义箭头 + 聚焦光环） */
select {
  background-color: var(--input-bg);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="6" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="%2386868b" stroke-width="1.6" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  border: none;
  border-radius: 10px;
  padding: 8px 32px 8px 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  transition: all .2s;
  cursor: pointer;
}
select:focus { outline: none; background-color: var(--field-focus-bg); box-shadow: 0 0 0 4px rgba(0, 122, 255, .18); }

/* 细滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, .3); }
::-webkit-scrollbar-track { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .2) transparent; }

/* 占位符颜色 */
::placeholder { color: #aeaeb2; opacity: 1; }

/* 页面进入淡入动效 */
main.container { animation: pageFade .28s ease; }
@keyframes pageFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* 表格行悬停 */
tbody tr:hover { background: rgba(0, 0, 0, .02); }

/* 链接过渡 */
a { transition: color .15s; }

/* 卡片悬停微提升 */
.room-card, .post-item { transition: box-shadow .2s, transform .2s; }

/* 选中文本 */
::selection { background: rgba(0, 122, 255, .25); }

/* ============ 响应式 ============ */
/* 大屏（≥1200px）：充分利用全屏宽度 */
@media (min-width: 1200px) {
  /* 帖子列表按宽度自适应列数（超宽屏自动更多列） */
  .post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 14px; }
  .post-item { margin: 0; }
  /* 聊天室/房间卡片自适应列数 */
  .room-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  /* 好友分区固定三列 */
  .friend-columns { grid-template-columns: repeat(3, 1fr); }
  /* 后台统计卡片加大 */
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: 6px; }
  .main-nav { order: 3; width: 100%; }
  .admin-chat-layout, .admin-ticket-layout { grid-template-columns: 1fr; }
  .conv-list { max-height: 200px; overflow-y: auto; }
  .chat-window, .room-chat { height: 480px; }
  .wechat-layout { grid-template-columns: 1fr; height: auto; }
  .sidebar-resizer { display: none; }
  .wechat-sidebar { max-height: 220px; }
  .wechat-chat { height: 460px; }
  .friend-columns { grid-template-columns: 1fr; }
  .admin-ticket-layout { flex-direction: column; }
  .ticket-ops { width: 100% !important; }
}

/* ============ 暗色模式 ============ */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1c1e;
  --card: #2c2c2e;
  --text: #f5f5f7;
  --text-muted: #98989d;
  --border: rgba(255, 255, 255, .12);
  --primary: #0a84ff;
  --primary-dark: #0a84ff;
  --primary-light: rgba(10, 132, 255, .16);
  --danger: #ff453a;
  --danger-light: rgba(255, 69, 58, .16);
  --ok: #30d158;
  --ok-light: rgba(48, 209, 88, .16);
  --warn: #ff9f0a;
  --bg-elevated: #232326;
  --bubble-theirs: #3a3a3c;
  --code-bg: #111113;
  --code-text: #e5e5ea;
  --input-bg: rgba(255, 255, 255, .08);
  --hover-bg: rgba(255, 255, 255, .08);
  --hover-strong: rgba(255, 255, 255, .16);
  --header-bg: rgba(44, 44, 46, .8);
  --card-glass: rgba(44, 44, 46, .85);
  --presence-off: #5a5a5e;
  --field-focus-bg: #3a3a3c;
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .5);
}
[data-theme="dark"] .auth-page { background: linear-gradient(180deg, #1c1c1e 0%, #232326 100%); }
[data-theme="dark"] .role-tag-super { background: rgba(255, 159, 10, .2); color: #ffb340; }
[data-theme="dark"] .badge-pinned { background: rgba(255, 159, 10, .2); color: #ffb340; }
[data-theme="dark"] .badge-featured { background: rgba(255, 45, 85, .2); color: #ff8fa3; }
[data-theme="dark"] .site-footer { background: var(--header-bg); }
[data-theme="dark"] .wechat-chat .chat-messages, [data-theme="dark"] .typing-bar { background: var(--bg-elevated); }

/* ============ 打卡弹窗 ============ */
.checkin-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.checkin-modal.show { display: flex; animation: modalIn .25s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.checkin-modal-card {
  width: 320px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  text-align: center;
}
.checkin-modal-head { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.checkin-modal-body { min-height: 48px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; color: var(--text-muted); font-size: 14px; }
.checkin-popup-done { color: var(--ok); font-weight: 600; font-size: 15px; }
.checkin-modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ============ 扁平图标 ============ */
.icon {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  flex-shrink: 0;
}
.icon-xs { width: 14px; height: 14px; vertical-align: -2px; }
.icon-lg { width: 26px; height: 26px; vertical-align: -5px; }
.icon-spin { animation: iconSpin 1s linear infinite; }
@keyframes iconSpin { to { transform: rotate(360deg); } }
.badge-chip .icon, .badge-pinned .icon, .badge-featured .icon { vertical-align: -2px; }
.checkin-done-icon .icon { color: var(--ok); }
.error-page .icon { color: var(--warn); }

/* ============ 顶部导航 / 底部页脚 显式暗色规则 ============ */
[data-theme="dark"] .site-header {
  background: rgba(28, 28, 30, .85);
  border-bottom-color: rgba(255, 255, 255, .1);
}
[data-theme="dark"] .site-footer {
  background: rgba(28, 28, 30, .92);
  border-top-color: rgba(255, 255, 255, .1);
}
[data-theme="dark"] .header-inner,
[data-theme="dark"] .header-user,
[data-theme="dark"] .main-nav { color: var(--text); }

/* ============ 钉钉风格任务卡片 ============ */
.task-list { display: flex; flex-direction: column; gap: 12px; }
.task-card {
  display: block;
  padding: 16px 20px;
  transition: box-shadow .2s, transform .2s;
}
.task-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.task-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.task-card-title { font-size: 16px; font-weight: 600; color: var(--text); }
.task-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-card-foot {
  display: flex; justify-content: space-between;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}

.task-info-card {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  padding: 14px 20px;
  margin-bottom: 16px;
}
.task-info-item { display: flex; align-items: center; gap: 8px; }
.task-info-label { font-size: 12px; color: var(--text-muted); }

/* ============ 钉钉风格任务操作条 ============ */
.task-ops-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 20px;
  margin-bottom: 16px;
}
.task-ops-assignee { font-size: 13px; color: var(--text-muted); }
.task-ops-bar .btn { padding: 8px 22px; font-size: 14px; }

/* ============ 管理端客服：会话搜索 + 快捷回复 ============ */
.admin-conv-search {
  width: 100%;
  padding: 7px 12px;
  margin-bottom: 8px;
  background: var(--input-bg);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  transition: all .2s;
}
.admin-conv-search:focus { outline: none; background: var(--field-focus-bg); box-shadow: 0 0 0 4px rgba(0, 122, 255, .18); }
.quick-replies {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.quick-chip {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.quick-chip:hover { background: var(--primary-light); border-color: transparent; }
.quick-manage { color: var(--text-muted); border-style: dashed; }
.quick-manage:hover { background: var(--hover-bg); }

/* ============ 头像裁剪与检视 ============ */
.crop-modal, .avatar-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.crop-modal.show, .avatar-viewer.show { display: flex; }
.crop-modal-card {
  width: 360px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 18px;
}
.crop-modal-head { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.crop-modal-body { margin-bottom: 14px; }
.crop-modal-body img { max-width: 100%; max-height: 320px; display: block; margin: 0 auto; }
.crop-modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.avatar-viewer-card { text-align: center; }
.avatar-viewer-card img {
  max-width: 320px;
  max-height: 320px;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 14px;
  background: #fff;
}

/* ============ 首页 ============ */
.home-hero { text-align: center; padding: 60px 20px; }
.home-hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 10px; }
.home-hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.home-card { display: block; text-align: center; padding: 24px 16px; transition: box-shadow .2s, transform .2s; }
.home-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.home-card-icon { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 14px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.home-card h4 { font-size: 15px; font-weight: 600; color: var(--text); }
.home-card .subtitle { font-size: 12px; }

/* ============ 聊天室 TG 风格 ============ */
.tg-msg { display: flex; align-items: flex-end; gap: 8px; }
.tg-msg-mine { justify-content: flex-end; }
.tg-bubbles { display: flex; flex-direction: column; max-width: 72%; }
.tg-sender { font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 0 0 2px 4px; display: flex; align-items: center; gap: 4px; }
.tg-bubble {
  position: relative;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .06);
  animation: tgIn .18s ease;
}
.tg-msg-mine .tg-bubble {
  background: #3390ec;
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  margin-left: auto;
}
.tg-msg-theirs .tg-bubble {
  background: #e3e3e5;
  color: var(--text);
  border-radius: 14px 14px 14px 4px;
}
[data-theme="dark"] .tg-msg-mine .tg-bubble { background: #8774e1; }
[data-theme="dark"] .tg-msg-theirs .tg-bubble { background: #2b2b30; }
.tg-msg-mine .tg-bubble + .tg-bubble { border-top-right-radius: 14px; margin-top: 2px; }
.tg-msg-theirs .tg-bubble + .tg-bubble { border-top-left-radius: 14px; margin-top: 2px; }
.tg-bubble p { white-space: pre-wrap; word-break: break-word; }
.tg-time { display: block; font-size: 10px; opacity: .65; margin-top: 2px; text-align: right; }
.tg-msg-theirs .tg-time { text-align: left; }
.tg-msg .voice-player { display: block; }
@keyframes tgIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============ 右键菜单 ============ */
.context-menu {
  position: fixed; z-index: 9999;
  min-width: 150px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 4px;
}
.context-menu-item {
  padding: 8px 12px; font-size: 13px; border-radius: 8px;
  cursor: pointer; color: var(--text);
}
.context-menu-item:hover { background: var(--hover-bg); }
.context-menu-danger { color: var(--danger); }
.context-menu-danger:hover { background: var(--danger-light); color: var(--danger); }
.context-menu-disabled { color: var(--text-muted); cursor: default; }
.context-menu-disabled:hover { background: transparent; }

/* ============ 全局公告横幅 ============ */
.global-announce {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(90deg, rgba(0, 122, 255, .12), rgba(0, 122, 255, .05));
  border: 1px solid rgba(0, 122, 255, .25);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.global-announce-tag {
  flex-shrink: 0;
  font-size: 12px; font-weight: 600;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  padding: 2px 10px;
}
.global-announce-text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  word-break: break-word;
}
.global-announce-close {
  flex-shrink: 0;
  border: none; background: transparent;
  font-size: 18px; line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}
.global-announce-close:hover { color: var(--text); }

/* 后台公告表单 */
.ann-form { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.ann-form input, .ann-form textarea {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  font-size: 14px; font-family: inherit;
  color: var(--text);
}
.ann-form textarea { min-height: 80px; resize: vertical; }
.ann-form input:focus, .ann-form textarea:focus { outline: none; box-shadow: 0 0 0 3px rgba(0, 122, 255, .15); }
.ann-form.inline { display: inline; }
.ann-content { max-width: 320px; color: var(--text-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-current-body {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--primary-light);
  border: 1px solid rgba(0, 122, 255, .25);
}
.ann-current-text { flex: 1; min-width: 0; }
.ann-current-text strong { font-size: 15px; color: var(--text); }
.ann-current-text p { margin: 4px 0; font-size: 13px; color: var(--text); word-break: break-word; }
.ann-current-meta { font-size: 12px; color: var(--text-muted); }

/* ============ 客服系统（管理端） ============ */
.ext-status {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: var(--input-bg);
  font-size: 13px;
  color: var(--text-muted);
}
.ext-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}
.ext-status-on { background: #30d158; }
.ext-conv-list { flex: 1; overflow-y: auto; }
.support-layout { display: grid; grid-template-columns: 260px 1fr 240px; gap: 12px; align-items: stretch; height: 640px; }
@media (max-width: 1100px) { .support-layout { grid-template-columns: 240px 1fr; } .inspector { display: none; } }
@media (max-width: 760px) { .support-layout { grid-template-columns: 1fr; height: auto; } .conv-list { max-height: 260px; } }
.support-layout .conv-list { padding: 10px; display: flex; flex-direction: column; overflow: hidden; }
.conv-toolbar { margin-bottom: 8px; }
.admin-conv-search { width: 100%; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--input-bg); font-size: 13px; color: var(--text); }
.conv-filters { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.conv-filter {
  flex: 1; padding: 5px 0; font-size: 12px; text-align: center;
  border: 1px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text-muted); cursor: pointer;
}
.conv-filter-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.conv-pin-mark { font-size: 11px; margin-left: auto; }
.conv-group-tag { font-size: 10px; padding: 1px 6px; border-radius: 999px; margin-left: 4px; }
.conv-group-important { background: #fff3e0; color: #b26a00; }
.conv-group-completed { background: #e8f5e9; color: #2e7d32; }
[data-theme="dark"] .conv-group-important { background: rgba(255,159,10,.2); color: #ffb340; }
[data-theme="dark"] .conv-group-completed { background: rgba(48,209,88,.15); color: #6fdc8c; }

/* 聊天窗口 */
.support-layout .chat-window { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: auto; }
.chat-window-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-window-head .avatar { flex-shrink: 0; }
.reply-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  background: var(--primary-light);
  font-size: 12px;
}
.reply-bar-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.reply-quote {
  font-size: 12px; color: var(--text-muted);
  background: var(--input-bg);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  padding: 4px 8px;
  margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.reply-quote-resolved { cursor: default; }
.chat-revoked { color: var(--text-muted); font-style: italic; }
.chat-img { max-width: 240px; max-height: 240px; border-radius: 10px; display: block; }
.chat-img-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, .8);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.chat-img-overlay img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }
.chat-revoke {
  align-self: flex-end;
  border: none; background: transparent;
  color: var(--text-muted); font-size: 11px;
  cursor: pointer; padding: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.chat-reply {
  align-self: flex-start;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-muted); font-size: 12px;
  border-radius: 50%; width: 22px; height: 22px;
  cursor: pointer; padding: 0;
  opacity: 0;
  transition: opacity .15s;
}
.chat-msg:hover .chat-revoke, .chat-msg:hover .chat-reply { opacity: 1; }

/* 客户资料侧栏 */
.inspector { padding: 12px; overflow-y: auto; }
.inspector-body { display: flex; flex-direction: column; gap: 10px; }
.inspector-avatar { display: flex; justify-content: center; padding: 6px 0; }
.inspector-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; background: var(--input-bg); border-radius: 10px; }
.inspector-row span { font-size: 11px; color: var(--text-muted); }
.inspector-row strong { font-size: 13px; word-break: break-all; }
.inspector-actions { display: flex; gap: 8px; margin-top: 6px; }

.rtc-bar { display: flex; gap: 6px; align-items: center; }
.rtc-status { font-size: 12px; color: var(--ok); margin-left: 6px; }
.rtc-panel {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.rtc-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rtc-panel-head strong { font-size: 14px; }
.rtc-panel video { width: 100%; max-height: 220px; border-radius: 10px; background: #000; }
.rtc-panel audio { width: 100%; }

/* ============ 聊天/语音子界面 ============ */
.view-switch { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.voice-view { display: flex; flex-direction: column; height: 600px; padding: 0; overflow: hidden; background: linear-gradient(160deg, #1f2a3d, #141b26 60%, #0f1520); }
.voice-head {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px;
  color: #fff;
  font-size: 14px;
}
.voice-timer {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: 2px 12px;
}
.voice-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .25);
  overflow: hidden;
  position: relative;
}
.voice-stage video { width: 100%; height: 100%; object-fit: contain; }
.voice-stage audio { width: 80%; }
.voice-placeholder { color: rgba(255,255,255,.6); font-size: 15px; }
.voice-controls {
  display: flex;
  gap: 22px;
  justify-content: center;
  align-items: center;
  padding: 14px;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.voice-ctl {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  transition: all .18s ease;
}
.voice-ctl .icon { width: 20px; height: 20px; }
.voice-ctl:hover { background: var(--hover-strong); transform: scale(1.06); }
.voice-ctl:active { transform: scale(.94); }
.voice-ctl-active { background: var(--primary) !important; color: #fff !important; }
.voice-ctl-end { background: var(--danger) !important; color: #fff !important; }
.voice-ctl-end:hover { background: #e0312b !important; }

/* 名字行内头像 */
.tg-sender { display: flex; align-items: center; gap: 4px; }
.btn-recording { background: var(--danger) !important; color: #fff !important; }
.voice-user {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,.55);
  border-radius: 12px;
  padding: 8px 14px;
  color: #fff;
  z-index: 2;
}
.voice-user-info { display: flex; flex-direction: column; }
.voice-user-info strong { font-size: 14px; }
.voice-user-info span { font-size: 11px; opacity: .75; }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; }
.room-layout { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.room-members-panel { padding: 12px; }
.room-members { display: flex; flex-direction: column; gap: 2px; max-height: 520px; overflow-y: auto; }
.room-member { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; }
.room-member:hover { background: var(--hover-bg); }
.room-member-avatar { display: flex; position: relative; }
.room-member-name { font-size: 13px; display: flex; align-items: center; gap: 4px; }
@media (max-width: 720px) { .room-layout { grid-template-columns: 1fr; } .room-members-panel { max-height: 180px; } }
