/* Admin 后台样式 - 深绿侧栏 + 浅灰主区 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; color: #2c3e50; background: #f0f2f5; }
a { color: #2d5a3d; text-decoration: none; }
a:hover { color: #1f3f2a; }
.admin-body { overflow-x: hidden; }

.admin-layout { display: flex; min-height: 100vh; }

/* === 侧栏 === */
.admin-sidebar {
  width: 220px;
  background: linear-gradient(180deg, #2d5a3d 0%, #1f3f2a 100%);
  color: #e8f5ed;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.brand-logo {
  width: 40px; height: 40px;
  background: #4caf50;
  color: #fff;
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.brand-text { flex: 1; }
.brand-title { font-size: 15px; font-weight: 600; color: #fff; line-height: 1.2; }
.brand-sub { font-size: 11px; color: rgba(255,255,255,0.6); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  position: relative;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  text-decoration: none;
}
.sidebar-item.active {
  background: rgba(76, 175, 80, 0.18);
  color: #fff;
  border-left-color: #4caf50;
  font-weight: 600;
}
.sidebar-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-badge {
  position: absolute; right: 12px;
  background: #f56c6c; color: #fff;
  font-size: 11px; padding: 1px 7px; border-radius: 9px;
  font-weight: 600;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.1);
}
.user-avatar {
  width: 36px; height: 36px;
  background: #4caf50; color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; color: #fff; font-weight: 500; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.6); }
.user-logout {
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
}
.user-logout:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* === 主内容 === */
.admin-main {
  flex: 1;
  margin-left: 220px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  background: #fff;
  padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #e8e8e8;
  position: sticky; top: 0; z-index: 50;
}
.page-title { font-size: 20px; color: #2c3e50; font-weight: 600; }
.topbar-time { color: #909399; font-size: 13px; font-family: monospace; }

.admin-notice {
  background: #fff8e1;
  color: #996300;
  padding: 10px 24px;
  font-size: 13px;
  border-bottom: 1px solid #f0e0a0;
}

.admin-content {
  flex: 1;
  padding: 24px;
}

/* === 卡片 === */
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card .stat-icon {
  width: 48px; height: 48px;
  background: #e8f5ed;
  color: #2d5a3d;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}
.stat-card .stat-label { font-size: 13px; color: #909399; }
.stat-card .stat-value { font-size: 26px; color: #2c3e50; font-weight: 700; margin-top: 4px; }

.card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 16px;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 600; color: #2c3e50; }
.card-actions { display: flex; gap: 8px; }

/* === 表格 === */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th, .admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}
.admin-table th {
  background: #fafbfc;
  color: #606266;
  font-weight: 600;
  white-space: nowrap;
}
.admin-table tbody tr:hover { background: #f8fdf9; }
.admin-table .id-col { color: #909399; font-family: monospace; }
.admin-table .actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* === 按钮 === */
.btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: #4caf50; color: #fff; }
.btn-primary:hover { background: #43a047; color: #fff; }
.btn-default { background: #fff; color: #606266; border: 1px solid #dcdfe6; }
.btn-default:hover { background: #f5f7fa; }
.btn-warning { background: #e6a23c; color: #fff; }
.btn-warning:hover { background: #cf9236; color: #fff; }
.btn-danger { background: #f56c6c; color: #fff; }
.btn-danger:hover { background: #dd6161; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* === 状态 === */
.status {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 10px;
  font-weight: 500;
}
.status-pending { background: #fef0e6; color: #e6a23c; }
.status-approved, .status-active, .status-on { background: #e8f5ed; color: #2d5a3d; }
.status-rejected, .status-off { background: #fef0f0; color: #f56c6c; }
.status-done { background: #e6f7ff; color: #1890ff; }
.status-matching { background: #fff7e6; color: #fa8c16; font-weight: bold; }

/* === 表单 === */
.form-row {
  display: flex; gap: 16px; align-items: center; margin-bottom: 16px; flex-wrap: wrap;
}
.form-row label { width: 120px; color: #606266; font-size: 13px; }
.form-row input, .form-row select, .form-row textarea {
  flex: 1; min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 0; border-color: #4caf50;
}
.form-row textarea { min-height: 80px; }

/* === 聊天详情 === */
.chat-view {
  display: flex; flex-direction: column;
  height: calc(100vh - 220px);
  min-height: 500px;
}
.chat-view-meta {
  background: #fff8e1;
  color: #996300;
  padding: 10px 16px;
  font-size: 12px;
  display: flex; gap: 16px; flex-wrap: wrap;
  border-radius: 6px 6px 0 0;
}
.chat-view-meta b { color: #664400; }
.chat-view-meta .danger { color: #f56c6c; }

.chat-view-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #f5f7fa;
  display: flex; flex-direction: column; gap: 12px;
}
.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  position: relative;
}
.chat-bubble.guest {
  background: #fff;
  border: 1px solid #e8e8e8;
  color: #2c3e50;
  align-self: flex-start;
}
.chat-bubble.staff {
  background: #d4f4dd;
  color: #1f3f2a;
  align-self: flex-end;
  border: 1px solid #b8e6c5;
}
.chat-bubble .bubble-name { font-size: 11px; color: #909399; margin-bottom: 2px; font-weight: 600; }
.chat-bubble.staff .bubble-name { color: #2d5a3d; }
.chat-bubble .bubble-time { font-size: 11px; color: #c0c4cc; margin-top: 4px; }

.chat-view-form {
  display: flex; gap: 0;
  border-top: 1px solid #e8e8e8;
  background: #fff;
}
.chat-view-form input {
  flex: 1; border: 0; padding: 14px 16px; font-size: 14px; outline: 0;
  font-family: inherit;
}
.chat-view-form button {
  background: #4caf50; color: #fff; border: 0; padding: 0 28px; cursor: pointer; font-size: 14px;
}
.chat-view-form button:hover { background: #43a047; }

.empty-tip {
  text-align: center; color: #c0c4cc; padding: 40px; font-size: 14px;
}

/* === 响应式 === */
@media (max-width: 768px) {
  .admin-sidebar { width: 60px; }
  .admin-sidebar .brand-text, .admin-sidebar .sidebar-item span:not(.sidebar-icon),
  .admin-sidebar .user-info, .admin-sidebar .user-logout { display: none; }
  .admin-sidebar .sidebar-item { justify-content: center; padding: 14px 0; }
  .admin-sidebar .sidebar-badge { right: 4px; }
  .admin-main { margin-left: 60px; }
  .admin-sidebar .brand-logo { margin: 0 auto; }
  .admin-sidebar .sidebar-brand { justify-content: center; padding: 16px 8px; }
}

/* === admin topbar 切换链接 (访问前台 / 用户中心) === */
.topbar-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; margin-right: 16px; }
.topbar-link { color: #606266; font-size: 13px; padding: 6px 12px; border-radius: 4px; text-decoration: none; transition: all .2s; background: #f5f7fa; border: 1px solid #ebeef5; display: inline-flex; align-items: center; gap: 4px; }
.topbar-link:hover { color: #4a8b3a; background: #f0f7eb; border-color: #c2e0b8; }
.topbar-link[target="_blank"]::after { content: ' ↗'; font-size: 11px; opacity: 0.6; }

/* === admin chats.php (聊天管理) === */
.chat-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid #ebeef5; }
.chat-tab { padding: 10px 20px; cursor: pointer; text-decoration: none; color: #606266; border-bottom: 3px solid transparent; margin-bottom: -2px; font-weight: 500; }
.chat-tab.active { color: #2d5a3d; border-bottom-color: #2d5a3d; background: #f0f9f4; }
.chat-tab .badge { background: #f56c6c; color: #fff; border-radius: 10px; padding: 2px 8px; font-size: 11px; margin-left: 6px; }
.chat-toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.chat-toolbar .chat-search { flex: 1; padding: 7px 12px; border: 1px solid #dcdfe6; border-radius: 4px; font-size: 13px; }
.chat-toolbar .chat-search:focus { outline: 0; border-color: #2d5a3d; }
.chat-toolbar .chat-stat { color: #909399; font-size: 12px; }
.chat-layout { display: grid; grid-template-columns: 320px 1fr; gap: 0; background: #fff; border: 1px solid #ebeef5; border-radius: 4px; overflow: hidden; height: calc(100vh - 280px); min-height: 500px; }
.chat-list { overflow-y: auto; min-height: 0; max-height: 100%; border-right: 1px solid #ebeef5; background: #fafbfc; }
.chat-list-empty { padding: 24px; text-align: center; color: #c0c4cc; font-size: 13px; }
.chat-list-item {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #303133;
    transition: all .2s;
    position: relative;
}
.chat-list-item:hover {
    background: linear-gradient(90deg, #f0f9f4 0%, #f5fbf6 100%);
    transform: translateX(2px);
}
.chat-list-item.active {
    background: linear-gradient(90deg, #e1f3d8 0%, #f0f9f4 100%);
    border-left: 4px solid #2d5a3d;
    padding-left: 12px;
}
.chat-list-item .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d5a3d 0%, #4a7a5d 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(45,90,61,0.15);
}
.chat-list-item.unread::after {
    content: "";
    position: absolute;
    top: 14px;
    right: 14px;
    width: 8px;
    height: 8px;
    background: #f56c6c;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(245,108,108,0.2);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}
.chat-list-content { flex: 1; min-width: 0; }
.chat-list-name {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}
.chat-list-msg {
    color: #606266;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}
.chat-list-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #909399;
    margin-top: 6px;
    gap: 6px;
}
.chat-window { display: flex; flex-direction: column; min-height: 0; max-height: 100%; overflow: hidden; }
.chat-header { padding: 12px 16px; background: #f5f7fa; border-bottom: 1px solid #ebeef5; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.chat-header .chat-close { color: #909399; text-decoration: none; padding: 4px 10px; border: 1px solid #dcdfe6; border-radius: 3px; font-size: 12px; font-weight: 400; }
.chat-header .chat-close:hover { color: #f56c6c; border-color: #f56c6c; background: #fef0f0; }
.chat-header .chat-meta { color: #909399; font-weight: 400; font-size: 12px; margin-left: 8px; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; background: #fafbfc; }
.chat-form { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid #ebeef5; background: #fff; align-items: center; }
.chat-form .chat-tool-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.chat-form .chat-tool-btn:hover { background: #f0f9eb; }
.chat-form input { flex: 1; padding: 8px 12px; border: 1px solid #dcdfe6; border-radius: 4px; }
.chat-form input:focus { outline: 0; border-color: #2d5a3d; }
.chat-form button { padding: 8px 20px; background: #2d5a3d; color: #fff; border: 0; border-radius: 4px; cursor: pointer; }
.chat-form button:hover { background: #3d7a30; }
.chat-form button:disabled { background: #c0c4cc; cursor: not-allowed; }
.chat-msg { margin-bottom: 12px; max-width: 70%; }
.chat-msg .bubble { padding: 8px 12px; border-radius: 8px; background: #fff; border: 1px solid #ebeef5; word-break: break-word; }
.chat-msg.staff { margin-left: auto; }
.chat-msg.staff .bubble { background: #2d5a3d; color: #fff; border-color: #2d5a3d; }
.chat-msg .name { font-size: 11px; color: #909399; margin-bottom: 4px; }
.chat-msg.staff .name { text-align: right; }
.chat-msg .time { font-size: 10px; color: #c0c4cc; margin-top: 4px; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: #c0c4cc; font-size: 14px; }
.chat-flash { animation: chatFlash 1.2s ease-out; }
@keyframes chatFlash { 0% { background: #fffbe6; } 100% { background: transparent; } }
.role-badge { display: inline-block; padding: 2px 6px; border-radius: 3px; font-size: 10px; margin-left: 4px; }
.role-lessor { background: #e1f3d8; color: #67c23a; }
.role-lessee { background: #fdf6ec; color: #e6a23c; }
.role-admin { background: #ecf5ff; color: #409eff; }

/* ============================================
   admin/chats.php 视觉升级 v2
   - tab 选中态加背景色块
   - 消息气泡渐变 + 头像
   - 输入框圆角
   ============================================ */
.chat-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid #ebeef5;
    background: #fafbfc;
    padding: 4px;
    border-radius: 8px;
}
.chat-tab {
    padding: 10px 20px;
    cursor: pointer;
    text-decoration: none;
    color: #606266;
    border-radius: 6px;
    margin-bottom: -2px;
    font-weight: 500;
    transition: all .2s;
    flex: 1;
    text-align: center;
}
.chat-tab:hover {
    background: #f0f9f4;
    color: #2d5a3d;
}
.chat-tab.active {
    color: #fff !important;
    background: linear-gradient(135deg, #2d5a3d 0%, #1a3a24 100%) !important;
    box-shadow: 0 2px 8px rgba(45,90,61,0.25);
}
.chat-tab.active .badge { background: #fff !important; color: #2d5a3d !important; }
.chat-tab .badge {
    background: #f56c6c;
    color: #fff;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    margin-left: 6px;
    display: inline-block;
    min-width: 20px;
    text-align: center;
}
.chat-toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.chat-toolbar input[type=text] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 22px;
    font-size: 14px;
    outline: none;
    transition: all .2s;
}
.chat-toolbar input[type=text]:focus {
    border-color: #2d5a3d;
    box-shadow: 0 0 0 3px rgba(45,90,61,0.08);
}

.chat-msg {
    display: flex;
    align-items: flex-start;
    margin-bottom: 14px;
    gap: 10px;
    animation: m-fade-in .3s;
}
@keyframes m-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg.staff { flex-direction: row-reverse; }
.chat-msg .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.chat-msg.guest .avatar { background: linear-gradient(135deg, #5a7a9c 0%, #3a5a7c 100%); }
.chat-msg.staff .avatar { background: linear-gradient(135deg, #2d5a3d 0%, #1a3a24 100%); }
.chat-msg .name { font-size: 12px; color: #909399; margin-bottom: 4px; font-weight: 500; }
.chat-msg .bubble {
    background: #f5f7fa;
    padding: 10px 14px;
    border-radius: 4px 14px 14px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #303133;
    max-width: 70%;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.chat-msg.staff .bubble {
    background: linear-gradient(135deg, #2d5a3d 0%, #1a3a24 100%);
    color: #fff;
    border-radius: 14px 4px 14px 14px;
}
.chat-msg .time {
    font-size: 11px;
    color: #c0c4cc;
    margin-top: 4px;
    text-align: right;
}
.chat-msg.staff .time { text-align: left; }

/* ★ 统一微信风格式 (3 tab 同步) - 新类名别名 */
.chat-msg-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e4e7ed;
    object-fit: cover;
    flex-shrink: 0;
}
.chat-msg.staff .chat-msg-avatar,
.chat-msg.self .chat-msg-avatar { background: linear-gradient(135deg, #2d5a3d 0%, #1a3a24 100%); }
.chat-msg-body {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    min-width: 60px;
}
.chat-msg.staff .chat-msg-body,
.chat-msg.self .chat-msg-body { align-items: flex-end; }
.chat-msg-name {
    font-size: 11px;
    color: #909399;
    margin-bottom: 4px;
    font-weight: 500;
    padding: 0 4px;
}
.chat-msg-bubble {
    background: #f5f7fa;
    padding: 10px 14px;
    border-radius: 4px 14px 14px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #303133;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    display: inline-block;
}
.chat-msg.staff .chat-msg-bubble,
.chat-msg.self .chat-msg-bubble {
    background: linear-gradient(135deg, #2d5a3d 0%, #1a3a24 100%);
    color: #fff;
    border-radius: 14px 4px 14px 14px;
}
.chat-msg-meta {
    font-size: 11px;
    color: #c0c4cc;
    margin-top: 4px;
    padding: 0 4px;
}
.chat-msg.staff .chat-msg-meta,
.chat-msg.self .chat-msg-meta { text-align: right; }
/* 收到新消息闪烁动画 */
.chat-msg.chat-flash { animation: m-flash 1.2s ease-out 1; }
@keyframes m-flash {
    0% { background: rgba(45,90,61,0.18); }
    100% { background: transparent; }
}

.chat-window form {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: #fafbfc;
    border-top: 1px solid #ebeef5;
}
.chat-window form input[type=text] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 22px;
    font-size: 14px;
    outline: none;
    background: #fff;
}
.chat-window form input[type=text]:focus {
    border-color: #2d5a3d;
    box-shadow: 0 0 0 3px rgba(45,90,61,0.08);
}
.chat-window form button {
    background: linear-gradient(135deg, #2d5a3d 0%, #1a3a24 100%);
    color: #fff;
    border: 0;
    border-radius: 22px;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(45,90,61,0.2);
    transition: all .15s;
}
.chat-window form button:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(45,90,61,0.3); }
.chat-window form button:active { transform: scale(0.97); }

/* === chat-tab 未读数 badge === */
.chat-tab-unread {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    background: #f56c6c;
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    vertical-align: top;
    box-shadow: 0 1px 3px rgba(245,108,108,0.4);
    animation: pulse-unread 1.5s ease-in-out infinite;
}

@keyframes pulse-unread {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 后台 ws 推送 toast 通知 */
.admin-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 280px;
    max-width: 360px;
    background: #fff;
    border-left: 4px solid #4a8b3a;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    padding: 14px 18px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(120%);
    transition: all 0.3s ease;
    cursor: default;
}
.admin-toast.show { opacity: 1; transform: translateX(0); }
.admin-toast-title { font-weight: 600; color: #2d5a3d; font-size: 14px; margin-bottom: 4px; }
.admin-toast-body { color: #666; font-size: 13px; line-height: 1.5; }

/* 声音开关提示 */
.sound-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 6px;
    background: #f0f9eb; color: #4a8b3a;
    font-size: 12px; cursor: pointer; border: 1px solid #d4ecc1;
}
.sound-toggle.off { background: #f5f5f5; color: #999; border-color: #e0e0e0; }
