/* ============================================================
   Firo 公共聊天平台 样式
   主题规则：
   - data-theme="light" : 白天（日出后）蓝白清新风
   - data-theme="dark"  : 夜间（日落后）深色科技风
   ============================================================ */

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

:root {
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  --bg: #eef5fd;
  --bg-grad: linear-gradient(160deg, #e8f2fd 0%, #f7fbff 60%, #eaf4ff 100%);
  --panel: #ffffff;
  --panel-2: #f4f9ff;
  --border: #dceaf7;
  --text: #1c2b3a;
  --text-dim: #6b7f93;
  --primary: #2b7de9;
  --primary-grad: linear-gradient(135deg, #3a8ef6, #2b6fe0);
  --primary-text: #ffffff;
  --bubble-other: #ffffff;
  --bubble-other-text: #1c2b3a;
  --shadow: 0 4px 18px rgba(43, 125, 233, 0.10);
  --accent: #2b7de9;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --bg-grad: linear-gradient(160deg, #0b1220 0%, #0e1626 60%, #101a2e 100%);
  --panel: #131e33;
  --panel-2: #182541;
  --border: #24365a;
  --text: #dce8f7;
  --text-dim: #8ba2c4;
  --primary: #38bdf8;
  /* 渐变蓝端提亮到 #818cf8：保证 --primary-text 暗字在整个渐变上都清晰可读 */
  --primary-grad: linear-gradient(135deg, #38bdf8, #818cf8);
  --primary-text: #06121f;
  --bubble-other: #182541;
  --bubble-other-text: #dce8f7;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  --accent: #38bdf8;
}

body {
  font-family: var(--font);
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* ============ 登录 / 注册页 ============ */
.auth-view {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px;
}

.auth-card {
  width: 380px;
  max-width: 94vw;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 34px 30px 28px;
}

.auth-logo { font-size: 44px; text-align: center; }
.auth-title { text-align: center; font-size: 21px; margin-top: 8px; }
.auth-sub { text-align: center; color: var(--text-dim); font-size: 13px; margin: 6px 0 20px; }

.tab-bar {
  display: flex;
  background: var(--panel-2);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 18px;
}

.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 8px 0;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary-grad);
  color: var(--primary-text);
  font-weight: 600;
}

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }

.field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border 0.2s;
}
.field input:focus { border-color: var(--accent); }
.field input:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-error { color: #e5484d; font-size: 13px; min-height: 18px; margin: 2px 0 8px; }

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px 0;
  background: var(--primary-grad);
  color: var(--primary-text);
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: wait; }

.auth-foot { color: var(--text-dim); font-size: 12px; }

/* ============ 聊天室布局 ============ */
.chat-view {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.brand-icon { font-size: 20px; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.online-chip {
  font-size: 12px;
  color: var(--accent);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  font-size: 15px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--accent); transform: translateY(-1px); }

.chat-main {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* 侧栏 */
.sidebar {
  width: 190px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-title {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.online-list { list-style: none; overflow-y: auto; flex: 1; padding: 8px; }

.online-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
}
.online-item:hover { background: var(--panel-2); }

.online-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-badge {
  font-size: 10px;
  color: #f59e0b;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  padding: 0 4px;
}

.kick-btn {
  border: none;
  background: transparent;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s;
}
.online-item:hover .kick-btn { opacity: 0.7; }
.kick-btn:hover { opacity: 1 !important; }

/* 头像 */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  user-select: none;
}
.avatar.sm { width: 28px; height: 28px; font-size: 14px; }
.avatar.lg { width: 44px; height: 44px; font-size: 22px; }

/* 消息区 */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.msg-list {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg-row { display: flex; gap: 10px; max-width: 78%; }
.msg-row.mine { align-self: flex-end; flex-direction: row-reverse; }

.msg-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.msg-row.mine .msg-body { align-items: flex-end; }

.msg-meta { font-size: 11px; color: var(--text-dim); display: flex; gap: 6px; align-items: center; }

.msg-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
  background: var(--bubble-other);
  color: var(--bubble-other-text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.msg-row.mine .msg-bubble {
  background: var(--primary-grad);
  color: var(--primary-text);
  border: none;
  border-bottom-right-radius: 4px;
}
.msg-row:not(.mine) .msg-bubble { border-top-left-radius: 4px; }

.msg-del-btn {
  border: none;
  background: transparent;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 2px 4px;
}
.msg-row:hover .msg-del-btn { opacity: 0.6; }
.msg-del-btn:hover { opacity: 1 !important; }

.msg-system {
  align-self: center;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px dashed var(--border);
  padding: 4px 14px;
  border-radius: 999px;
}

.msg-empty {
  align-self: center;
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 30vh;
  text-align: center;
}

/* 表情面板 */
.emoji-panel {
  position: absolute;
  bottom: 74px;
  left: 16px;
  width: 340px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 30;
}

.emoji-sec-title { font-size: 12px; color: var(--text-dim); margin: 4px 0 8px; }

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}

.emoji-item {
  border: none;
  background: transparent;
  font-size: 20px;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.15s;
}
.emoji-item:hover { background: var(--panel-2); }

.kaomoji-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.kaomoji-item {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
}
.kaomoji-item:hover { border-color: var(--accent); }

/* 输入栏 */
.input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 16px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

#msgInput {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  max-height: 120px;
  outline: none;
  transition: border 0.2s;
}
#msgInput:focus { border-color: var(--accent); }

.btn-send {
  border: none;
  border-radius: 12px;
  padding: 10px 22px;
  background: var(--primary-grad);
  color: var(--primary-text);
  font-size: 14px;
  font-weight: 600;
}
.btn-send:hover { opacity: 0.9; }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ 设置弹窗 ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(5, 12, 24, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal {
  width: 400px;
  max-width: 94vw;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.modal-body { padding: 18px; }

.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }

.avatar-option {
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  padding: 2px;
  display: flex;
  justify-content: center;
}
.avatar-option.selected { border-color: var(--accent); }

.settings-msg { font-size: 13px; color: var(--accent); min-height: 18px; margin: 4px 0 10px; }
.settings-msg.err { color: #e5484d; }

.modal textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  resize: vertical;
  font-family: inherit;
}
.modal textarea:focus { border-color: var(--accent); }

.modal-btn-row { display: flex; gap: 10px; }
.modal-btn-row .btn-primary { flex: 1; width: auto; }

.btn-danger {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 12px 0;
  background: linear-gradient(135deg, #e5484d, #c62a2f);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.btn-danger:hover { opacity: 0.9; }
.modal-btn-row .btn-danger { flex: 1; width: auto; }

/* ============ 全站公告横幅 ============ */
.ann-banner {
  width: 380px;
  max-width: 94vw;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 14px;
}

.ann-banner-chat {
  width: auto;
  max-width: none;
  margin: 10px 16px 0;
  flex-shrink: 0;
}

.ann-type {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-text);
  background: var(--primary-grad);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.ann-content { flex: 1; word-break: break-word; white-space: pre-wrap; }
.ann-label { flex-shrink: 0; font-weight: 700; }

/* ============ 管理员工具条 ============ */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 16px 0;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  font-size: 13px;
  flex-shrink: 0;
}

.tool-label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.tool-btn {
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 13px;
}
.tool-btn:hover { border-color: var(--accent); }
.tool-censor { color: #e5484d; border-color: #e5484d55; }
.tool-clear { color: #f59e0b; border-color: #f59e0b55; }
.sel-count { color: var(--text-dim); margin-left: auto; }

/* 消息批量选择框 */
.msg-check { margin-top: 22px; cursor: pointer; width: 16px; height: 16px; flex-shrink: 0; }
.msg-row.selected .msg-bubble { outline: 2px solid #e5484d; outline-offset: 1px; }

/* 被封禁（红字提示）的消息 */
.msg-censored {
  color: #e5484d !important;
  background: transparent !important;
  border: 1px dashed #e5484d !important;
  box-shadow: none !important;
  font-weight: 600;
}
html[data-theme="dark"] .msg-censored { color: #ff6b6f !important; border-color: #ff6b6f66 !important; }
.msg-row.mine .msg-censored {
  background: var(--primary-grad) !important;
  color: #fff !important;
  border: none !important;
}

/* ============ 侧栏封禁条 ============ */
.ban-bar { padding: 10px; border-top: 1px solid var(--border); }
.btn-ban {
  width: 100%;
  border: 1px solid #e5484d;
  background: transparent;
  color: #e5484d;
  border-radius: 8px;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 600;
}
.btn-ban:hover { background: #e5484d; color: #fff; }

.ban-target-list {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 14px;
  background: var(--panel-2);
  font-size: 13px;
}
.ban-target-item { display: flex; align-items: center; gap: 8px; padding: 4px 2px; }

/* 在线用户操作小按钮 */
.grant-btn, .ban-one-btn {
  border: none;
  background: transparent;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s;
}
.online-item:hover .grant-btn, .online-item:hover .ban-one-btn { opacity: 0.7; }
.grant-btn:hover, .ban-one-btn:hover { opacity: 1 !important; }
.ban-one-btn { color: #e5484d; }

/* ============ 封号警告页（红色警告风） ============ */
.ban-view {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #4a0d0d 0%, #7a1216 55%, #3a0808 100%);
  padding: 20px;
}

.ban-card {
  width: 420px;
  max-width: 94vw;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 120, 120, 0.5);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  padding: 40px 34px 30px;
  text-align: center;
  color: #fff;
}

.ban-icon { font-size: 64px; animation: banPulse 1.6s ease-in-out infinite; }

@keyframes banPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.ban-title {
  font-size: 26px;
  letter-spacing: 2px;
  margin: 14px 0 20px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.ban-reason-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(255, 140, 140, 0.6);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  text-align: left;
}

.ban-reason-label { font-size: 12px; color: #ffb3b3; margin-bottom: 6px; }
.ban-reason-text { font-size: 16px; font-weight: 700; line-height: 1.5; word-break: break-word; }

.ban-until { font-size: 13px; color: #ffd9d9; margin-bottom: 20px; }

.ban-countdown { font-size: 14px; color: #ffffffcc; margin-bottom: 18px; }
.ban-countdown span { font-weight: 800; color: #fff; font-size: 18px; }

.btn-ban-back {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  color: #fff;
  border-radius: 10px;
  padding: 10px 28px;
  font-size: 14px;
}
.btn-ban-back:hover { background: rgba(255, 255, 255, 0.15); }

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { color: #e5484d; }

/* ============ 移动端适配 ============ */
@media (max-width: 640px) {
  .sidebar { display: none; }
  .msg-row { max-width: 92%; }
  .brand { font-size: 14px; }
  /* 顶栏允许换行，避免胶囊/按钮过多时横向溢出 */
  .topbar { flex-wrap: wrap; row-gap: 6px; padding: 8px 12px; }
  .topbar-right { flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
  .dy-capsule { padding: 4px 9px; font-size: 11px; }
}

/* ============ 站主抖音号推荐卡片（抖音红青黑白闪亮风） ============ */
.douyin-mask { z-index: 60; background: rgba(10, 10, 14, 0.72); backdrop-filter: blur(6px); }

.dy-card {
  position: relative;
  width: min(360px, 90vw);
  padding: 30px 26px 22px;
  border-radius: 20px;
  background: #111118;
  color: #fff;
  text-align: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    -8px 0 34px rgba(37, 244, 238, 0.28),
    8px 0 34px rgba(254, 44, 85, 0.32),
    0 20px 60px rgba(0, 0, 0, 0.6);
  animation: dyPop 0.35s cubic-bezier(0.18, 1.25, 0.4, 1);
}
.dy-card::before {
  /* 顶部流光条：红→青扫过 */
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 60%; height: 3px;
  background: linear-gradient(90deg, transparent, #25f4ee, #fe2c55, transparent);
  animation: dySweep 2.4s linear infinite;
}
@keyframes dySweep { to { left: 110%; } }
@keyframes dyPop {
  from { transform: scale(0.8) translateY(24px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.dy-close {
  position: absolute; top: 10px; right: 12px;
  width: 30px; height: 30px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff; font-size: 13px; cursor: pointer;
  transition: background 0.2s;
}
.dy-close:hover { background: rgba(255, 255, 255, 0.22); }

.dy-sparkle {
  position: absolute;
  color: #25f4ee;
  font-size: 14px;
  animation: dyTwinkle 1.8s ease-in-out infinite;
  pointer-events: none;
}
.dy-sparkle.s1 { top: 18px; left: 22px; animation-delay: 0s; }
.dy-sparkle.s2 { top: 48px; right: 46px; color: #fe2c55; font-size: 11px; animation-delay: 0.6s; }
.dy-sparkle.s3 { bottom: 66px; left: 34px; font-size: 10px; animation-delay: 1.1s; }
@keyframes dyTwinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.25); }
}

.dy-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(90deg, rgba(254, 44, 85, 0.22), rgba(37, 244, 238, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.dy-note { color: #25f4ee; font-weight: 700; animation: dyBounce 1.2s ease-in-out infinite; }
@keyframes dyBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.dy-title {
  margin: 16px 0 6px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  position: relative;
  /* 抖音经典故障风：青色左偏移 + 红色右偏移 */
  text-shadow:
    -1.5px -1px 0 rgba(37, 244, 238, 0.9),
    1.5px 1px 0 rgba(254, 44, 85, 0.9);
  animation: dyGlitch 3.2s infinite;
}
.dy-title::after {
  content: attr(data-text);
  position: absolute;
  left: 50%; top: 0;
  width: 100%;
  z-index: -1;
  /* 与居中文字完全重合，只做 1.5px 霓虹错位，不产生重影 */
  transform: translate(calc(-50% + 1.5px), 1px);
  background: linear-gradient(90deg, #fe2c55, #ff7a9c, #25f4ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.5;
}
@keyframes dyGlitch {
  0%, 88%, 100% { transform: translateX(0); }
  90% { transform: translateX(2px); }
  92% { transform: translateX(-2px); }
  94% { transform: translateX(1px); }
}

.dy-sub { font-size: 13px; color: rgba(255, 255, 255, 0.68); margin-bottom: 16px; }

.dy-handle-row { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 14px; }
.dy-handle {
  font-size: 17px; font-weight: 700;
  padding: 6px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.dy-verified { font-size: 12px; color: #25f4ee; }

.dy-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.dy-tag {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(254, 44, 85, 0.16);
  border: 1px solid rgba(254, 44, 85, 0.35);
}
.dy-tag:nth-child(2) { background: rgba(37, 244, 238, 0.12); border-color: rgba(37, 244, 238, 0.35); }

.dy-btn {
  display: block;
  width: 100%;
  padding: 13px 0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 4px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(90deg, #fe2c55, #ff5c7a);
  box-shadow: 0 6px 20px rgba(254, 44, 85, 0.45);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.dy-btn::after {
  /* 按钮高光扫过 */
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: dyBtnShine 2.2s ease-in-out infinite;
}
@keyframes dyBtnShine { 0% { left: -80%; } 60%, 100% { left: 130%; } }
.dy-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(254, 44, 85, 0.6); }

.dy-foot { margin-top: 12px; font-size: 11px; color: rgba(255, 255, 255, 0.42); }
.dy-hide-today {
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.dy-hide-today:hover { color: rgba(255, 255, 255, 0.8); }
.dy-hide-today input {
  width: 12px; height: 12px;
  accent-color: #fe2c55;
  cursor: pointer;
}

/* ============ 自定义上传头像 ============ */
.avatar.custom {
  background: var(--panel-2);
  overflow: hidden;
}
.avatar.custom img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-option.upload {
  position: relative;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 2px auto;
  border: 1.5px dashed var(--border);
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--text-dim);
}
.avatar-option.upload.selected { border-style: solid; border-color: var(--accent); }
.avatar-option.upload .up-plus {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.avatar-option.upload:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============ 抖音胶囊按钮（关闭卡片后出现在顶层栏） ============ */
.dy-capsule {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(254, 44, 85, 0.45);
  background: linear-gradient(135deg, rgba(254, 44, 85, 0.1), rgba(37, 244, 238, 0.1));
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  animation: dyPop 0.3s cubic-bezier(0.18, 1.25, 0.4, 1);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.dy-capsule:hover {
  transform: translateY(-1px);
  border-color: rgba(254, 44, 85, 0.8);
  box-shadow: 0 2px 10px rgba(254, 44, 85, 0.25);
}

/* ============================================================
   全局平滑过渡（所有 UI 切换不再生硬）
   ============================================================ */

/* ---- 1. 页面视图切换：淡入 + 轻微上浮（登录页 / 聊天页 / 封号警告页） ---- */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.auth-view, .chat-view, .ban-view { animation: viewIn 0.4s ease both; }

/* ---- 2. 弹窗：遮罩淡入，卡片弹入；关闭时整体淡出下沉 ---- */
@keyframes maskIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes maskOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(22px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes cardOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(14px) scale(0.97); }
}
.modal-mask { animation: maskIn 0.22s ease both; }
.modal-mask > .modal { animation: cardIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.12) both; }
.modal-mask.closing { animation: maskOut 0.18s ease both; pointer-events: none; }
.modal-mask.closing > .modal,
.modal-mask.closing > .dy-card { animation: cardOut 0.18s ease both; }

/* ---- 3. 管理工具栏 / 封禁操作条：下滑淡入 ---- */
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}
.admin-toolbar, .ban-bar { animation: dropIn 0.28s ease both; }

/* ---- 4. 登录/注册切换：昵称字段淡入，卡片轻微呼吸 ---- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#fieldNickname { animation: fadeIn 0.3s ease both; }
.auth-card.swap { animation: cardIn 0.3s ease both; }

/* ---- 5. 主题切换：主要界面颜色平滑渐变 ---- */
body,
.auth-view, .chat-view, .ban-view,
.auth-card, .ban-card,
.topbar, .sidebar, .msg-list, .input-bar,
.modal, .dy-card, .ann-banner,
.admin-toolbar, .ban-bar,
.online-list, .msg-bubble, .msg-empty, .msg-system {
  transition: background-color 0.45s ease, color 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
}
