/* ============================================================
   Global Styles — 损者
   ============================================================ */

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

:root {
  --bg-light: #ffffff;
  --bg-gradient-1: #ffffff;
  --bg-gradient-2: #ffffff;
  --bg-gradient-3: #ffffff;
  --deep-blue: #1e3a8a;
  --mid-blue: #0ea5e9;
  --light-blue: #7dd3fc;
  --white: #ffffff;
  --text-primary: #0c4a6e;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: rgba(14, 165, 233, 0.2);
  --sidebar-width: 240px;
  --card-shadow: 0 4px 24px -8px rgba(30, 58, 138, 0.15);
  --radius-md: 12px;
  --radius-lg: 16px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  background: #ffffff;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* 允许输入框和可编辑区域选择文字 */
input, textarea, [contenteditable="true"], .user-selectable {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

/* 聊天消息内容允许选中复制 */
.chat-bubble,
.chat-bubble *,
.msg-content,
.message-text,
.bubble-content {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }
input, textarea { font-family: inherit; outline: none; }

/* ----- App shell ----- */
#app {
  position: fixed;
  inset: 0;
  display: flex;
}

/* ----- Background (shared for all pages) ----- */
.bg-canvas {
  display: none !important;
}

.lens-canvas {
  display: none !important;
}

.vignette {
  display: none !important;
}

/* ----- Sidebar ----- */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(14, 165, 233, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 10;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}

.sidebar-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(30, 58, 138, 0.15));
}

.sidebar-brand-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--deep-blue);
  letter-spacing: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.nav-item:hover {
  background: rgba(14, 165, 233, 0.08);
  color: var(--deep-blue);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(30, 58, 138, 0.1));
  color: var(--deep-blue);
  font-weight: 600;
}

 .nav-item svg {
   width: 18px;
   height: 18px;
   flex-shrink: 0;
 }

 .nav-badge {
   margin-left: auto;
   background: #ef4444;
   color: white;
   font-size: 10px;
   font-weight: 600;
   padding: 2px 6px;
   border-radius: 10px;
   min-width: 16px;
   text-align: center;
   line-height: 1.4;
 }

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  padding: 16px 14px 6px;
  text-transform: uppercase;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(14, 165, 233, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #1e3a8a);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

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

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

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

.sidebar-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

.sidebar-logout-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}

.sidebar-logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ----- Main content ----- */
.main-content {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  position: relative;
  z-index: 5;
  background: #ffffff !important;
}

.page-container {
  padding: 16px 24px;
  max-width: none;
  margin: 0;
}

.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--deep-blue);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

/* ----- Card ----- */
.card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 28px;
}

.card + .card { margin-top: 20px; }

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--deep-blue);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s ease;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #1e3a8a);
  color: white;
  box-shadow: 0 4px 14px -4px rgba(14, 165, 233, 0.5);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -4px rgba(14, 165, 233, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--deep-blue);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(14, 165, 233, 0.08);
  border-color: var(--mid-blue);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

/* ----- Form ----- */
.form-group {
  margin-bottom: 18px;
}

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

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.25s;
}

.form-input:focus {
  border-color: var(--mid-blue);
  background: white;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}

/* ----- Table ----- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(14, 165, 233, 0.04);
  border-bottom: 2px solid var(--border-color);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(14, 165, 233, 0.08);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: rgba(14, 165, 233, 0.03);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.badge-admin { background: rgba(30, 58, 138, 0.15); color: var(--deep-blue); }
.badge-user { background: rgba(14, 165, 233, 0.15); color: var(--mid-blue); }

/* ----- Toggle switch ----- */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider {
  background: var(--mid-blue);
}

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

/* ----- Setting row ----- */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(14, 165, 233, 0.08);
}

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

.setting-info h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.setting-info p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ----- Chat ----- */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  min-height: 500px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-message {
  display: flex;
  gap: 10px;
  max-width: 80%;
}

.chat-message.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #1e3a8a);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.chat-bubble {
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  box-shadow: 0 2px 8px -2px rgba(30, 58, 138, 0.1);
}

.chat-message.mine .chat-bubble {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
}

.chat-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.chat-message.mine .chat-meta { text-align: right; }

.chat-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 8px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--deep-blue);
}

.chat-input-area {
  border-top: 1px solid var(--border-color);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.5);
}

.chat-textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  resize: none;
  background: rgba(255, 255, 255, 0.8);
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0ea5e9, #1e3a8a);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.chat-send-btn:hover { transform: scale(1.05); }

.chat-upload-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  color: var(--deep-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chat-upload-btn:hover { background: rgba(14, 165, 233, 0.1); }

/* ----- Network login info cards ----- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.info-card {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(30, 58, 138, 0.06));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.info-card-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.info-card-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--deep-blue);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  word-break: break-all;
}

/* ----- Toast ----- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 8px 24px -8px rgba(30, 58, 138, 0.25);
  font-size: 14px;
  color: var(--text-primary);
  border-left: 3px solid var(--mid-blue);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ----- Modal ----- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: white;
  border-radius: 16px;
  padding: 28px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 60px -10px rgba(30, 58, 138, 0.3);
  animation: modalIn 0.3s ease;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--deep-blue);
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

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

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

/* ----- Captcha ----- */
.captcha-container {
  margin-top: 12px;
}

.captcha-slider-wrap {
  position: relative;
  height: 40px;
  background: #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
}

.captcha-slider-track {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: rgba(14, 165, 233, 0.2);
  transition: none;
}

.captcha-slider-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--deep-blue);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: background 0.2s;
}

.captcha-slider-handle:active { cursor: grabbing; }

.captcha-slider-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.captcha-success .captcha-slider-track {
  background: rgba(16, 185, 129, 0.3);
}

.captcha-success .captcha-slider-handle {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.captcha-success .captcha-slider-text {
  color: #059669;
}

/* ----- Empty state ----- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

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

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

/* ----- Vignette overlay ----- */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(56, 139, 253, 0.1) 100%);
}

/* ----- Responsive ----- */


/* 手机端 */
@media (max-width: 767px) {
  .sidebar {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .page-container {
    padding: 16px 14px;
    padding-bottom: 20px;
  }
  /* 只有显示底部导航栏的页面才需要底部padding */
  body.has-bottom-nav .page-container {
    padding-bottom: 100px !important;
  }
  .page-header {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .page-title {
    font-size: 20px;
  }
  .page-subtitle {
    font-size: 12px;
  }
  .card {
    padding: 16px;
    border-radius: 12px;
  }
  .card-title {
    font-size: 15px;
    margin-bottom: 12px;
  }

  /* 表格横向滚动 */
  .card:has(.data-table),
  .card[style*="padding:0"]:has(table) {
    overflow-x: auto;
  }
  .data-table {
    font-size: 12px;
    min-width: 600px;
  }
  .data-table th, .data-table td {
    padding: 8px 10px;
    white-space: nowrap;
  }

  /* 网格变单列 */
  .info-grid,
  .quick-entry-wrap {
    grid-template-columns: 1fr !important;
  }

  /* 弹窗适配 */
  .modal {
    width: calc(100vw - 32px) !important;
    max-width: 420px !important;
    margin: 16px;
    max-height: calc(100vh - 32px) !important;
  }
  .modal-title {
    font-size: 16px;
  }

  /* 按钮缩小 */
  .btn {
    padding: 8px 14px;
    font-size: 13px;
  }
  .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
  }
  .btn-xs {
    padding: 3px 8px;
    font-size: 11px;
  }

  /* 表单 */
  .form-input,
  .form-select {
    font-size: 14px;
  }
  .form-label {
    font-size: 13px;
  }

  /* 聊天消息 */
  .chat-message {
    max-width: 85%;
  }

  /* 个人资料页 */
  .profile-cover-banner {
    height: 140px !important;
  }

  /* 底部导航栏 */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    border-top: 1px solid var(--border-color);
    z-index: 900;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 10px;
    transition: color 0.2s;
    position: relative;
    text-decoration: none;
  }
  .bottom-nav-item.active {
    color: var(--mid-blue);
  }
  .bottom-nav-plus {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
  }
  .bottom-nav-plus .plus-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(14,165,233,0.4);
    transition: transform 0.15s;
  }
  .bottom-nav-plus:active .plus-btn {
    transform: scale(0.9);
  }
  .bottom-nav-item svg {
    width: 22px;
    height: 22px;
  }
  .bottom-nav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    background: #ef4444;
    color: white;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 600;
  }

   /* 公告卡片 */
   .announcement-list {
     grid-template-columns: 1fr !important;
   }

   /* 聊天页手机端适配 */
   .chat-container {
     height: calc(100vh - 120px) !important;
     min-height: 0 !important;
   }
   .chat-messages {
     padding: 12px !important;
     gap: 10px !important;
   }
   .chat-message {
     max-width: 85% !important;
     gap: 8px !important;
   }
   .chat-avatar {
     width: 32px !important;
     height: 32px !important;
     flex-shrink: 0;
   }
   .chat-bubble {
     padding: 8px 12px !important;
     font-size: 14px !important;
     border-radius: 12px !important;
   }
   .chat-input-area {
     padding: 10px 12px !important;
     gap: 8px !important;
   }
   .chat-textarea {
     min-height: 40px !important;
     max-height: 100px !important;
     padding: 8px 12px !important;
     font-size: 14px !important;
     border-radius: 8px !important;
   }
   .chat-send-btn,
   .chat-upload-btn {
     width: 40px !important;
     height: 40px !important;
     border-radius: 8px !important;
   }

   /* 频道页头部手机端 */
   .channel-header {
     padding: 10px 12px !important;
   }
   .channel-header h2 {
     font-size: 16px !important;
   }
   .channel-member-count {
     font-size: 12px !important;
   }

   /* 手机端底部安全区（适配iPhone等有Home Indicator的设备） */
   .bottom-nav {
     padding-bottom: env(safe-area-inset-bottom);
     height: calc(60px + env(safe-area-inset-bottom));
   }

   /* 登录页适配在login.css里处理 */

  /* 有弹幕时整体下移 */
  body.bulletin-active .bottom-nav {
    bottom: 0 !important;
  }
}

@media (max-width: 480px) {
  .info-grid { grid-template-columns: 1fr; }
  .chat-message { max-width: 90%; }
  .page-title { font-size: 18px; }
  .card { padding: 14px; }
  .bottom-nav-item { font-size: 10px; }
  .bottom-nav-item svg { width: 20px; height: 20px; }
}

/* ----- 新增：更多 badge 变体 ---- */
.badge-primary { background: rgba(30, 58, 138, 0.12); color: var(--deep-blue); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #d97706; }

.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 6px; }

.table-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #1e3a8a);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(14, 165, 233, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(14, 165, 233, 0.4); }

/* modal 关闭按钮 */
.modal-close-btn:hover { color: var(--deep-blue); }

/* 响应式显示控制 */
.desktop-only { display: block; }
.mobile-only { display: none; }
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
}

/* ===== 全局弹幕公告 ===== */
.bulletin-bar {
  position: relative;
  width: 100%;
  height: 36px;
  background: #0ea5e9;
  color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  transition: opacity 0.3s;
}
.bulletin-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
.bulletin-text {
  font-size: 13px;
  white-space: nowrap;
  position: absolute;
  left: 100%;
  will-change: left;
  animation: bulletinMarquee 15s linear 1 forwards;
}
@keyframes bulletinMarquee {
  0%   { left: 100%; }
  100% { left: calc(0px - var(--bulletin-text-width, 300px)); }
}
.bulletin-close {
  flex-shrink: 0;
  width: 32px;
  height: 36px;
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.bulletin-close:hover { opacity: 1; }

/* 有弹幕时（弹幕在内容区内部，不需要全局下移） */
body.bulletin-active .main-content {
  /* 弹幕用sticky定位，会自动占据空间，不需要额外设置 */
}

/* ===== 手机端主内容区：无padding、全屏聊天 ===== */
@media (max-width: 767px) {
  .bulletin-text {
    animation: bulletinMarquee 10s linear 1 forwards;
  }
  .main-content {
    padding: 0 !important;
  }
  .page-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 0 100px 0 !important;
  }
  /* 非聊天页面的内容区留一点padding，由各页面自己控制 */
  .page-header {
    padding: 16px 16px 0 16px;
  }
}

/* ===== 移动端首页双板块布局 ===== */
@media (max-width: 767px) {
  .home-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
  }
  .home-section-card {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.5);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  }
  .home-section-card.full {
    grid-column: span 2;
  }
  .home-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .home-section-title .dot {
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: linear-gradient(180deg, #0ea5e9, #6366f1);
  }
  /* 快捷入口2列grid */
  .quick-entry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .quick-entry-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: rgba(14, 165, 233, 0.06);
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
    gap: 6px;
  }
  .quick-entry-item:active {
    background: rgba(14, 165, 233, 0.12);
  }
  .quick-entry-item svg {
    width: 22px;
    height: 22px;
    color: #0ea5e9;
  }
  /* 公告列表简化 */
  .announce-mini-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .announce-mini-item:last-child { border-bottom: none; }
  .announce-mini-item.pinned {
    color: var(--deep-blue);
    font-weight: 500;
  }
}

/* ===== 移动端聊天：全屏无框 ===== */
@media (max-width: 767px) {
  .chat-page .card {
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
  }
  .chat-page .chat-container {
    height: calc(100vh - 60px) !important;
    border-radius: 0 !important;
  }
  .chat-page .chat-input-area {
    border-radius: 0 !important;
  }
}

/* ===== 移动端频道列表：一行3个 ===== */
@media (max-width: 767px) {
  .channels-grid-mobile {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px 12px 12px 12px;
  }
  .channel-card-mobile {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.5);
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: transform 0.15s;
  }
  .channel-card-mobile:active {
    transform: scale(0.96);
  }
  .channel-card-mobile .cover {
    flex: 1;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: rgba(255,255,255,0.8);
    background-size: cover;
    background-position: center;
  }
  .channel-card-mobile .info {
    padding: 6px 8px;
    font-size: 11px;
    color: var(--text-primary);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
  }
  .channel-card-mobile .count {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
  }
}

/* ===== 移动端个人主页：抖音风格 ===== */
@media (max-width: 767px) {
  .profile-page .page-header { display: none; }
  .profile-page .profile-cover-banner {
    border-radius: 0 !important;
    margin: 0 !important;
    height: 220px !important;
  }
  .profile-page .profile-info-card {
    margin-top: -50px !important;
    border-radius: 20px 20px 0 0 !important;
    padding-top: 60px !important;
  }
  .profile-page .card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85) !important;
    border-radius: 16px;
    margin: 12px;
  }
  .profile-page .profile-avatar {
    width: 80px !important;
    height: 80px !important;
    position: absolute !important;
    top: -40px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border: 4px solid #fff !important;
  }
  .profile-name-mobile {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
  }
  .profile-bio-mobile {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding: 0 16px;
  }
  .profile-actions-mobile {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
  }
  .profile-settings-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
  }
  .profile-tabs-mobile {
    display: flex;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 12px;
  }
  .profile-tab-item {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
  }
  .profile-tab-item.active {
    color: var(--deep-blue);
    font-weight: 600;
  }
  .profile-tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
  }
}


/* 统一返回箭头按钮 */
.back-arrow-v2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 24px;
  font-weight: 300;
  color: var(--text-primary, #1e293b);
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
  line-height: 1;
  user-select: none;
}
.back-arrow-v2:hover {
  background: rgba(0,0,0,0.06);
}
.back-arrow-v2:active {
  background: rgba(0,0,0,0.1);
}
