/* ============================================
   NekoChat · 全站天空风主题
   在 style.css 之后加载，覆盖深色默认值
   ============================================ */

:root {
  --bg: #eef6ff;
  --bg-soft: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #e8f3ff;
  --border: #d8e9fb;

  --text: #123a63;
  --text-dim: #5b7fa3;
  --text-faint: #9fb4c9;

  --accent: #4aa3ff;
  --accent-hover: #2b7fe0;
  --gold: #f5a623;
  --red: #ef4444;
  --green: #22c55e;

  --radius: 16px;
  --radius-sm: 10px;

  --shadow-sm: 0 2px 8px rgba(74, 163, 255, .08);
  --shadow-md: 0 6px 20px rgba(74, 163, 255, .12);
  --shadow-lg: 0 12px 32px rgba(74, 163, 255, .16);
}

body {
  background: var(--bg);
  color: var(--text);
}

/* ============ 应用主容器 ============ */
.app-view {
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
}

/* ============ 侧边栏（桌面） ============ */
.sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 16px rgba(74, 163, 255, .06);
}

.brand {
  background: linear-gradient(92deg, #4aa3ff, #2b7fe0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}

/* 头像 */
.avatar,
.avatar-fallback {
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(74, 163, 255, .2);
}

.avatar-fallback {
  background: linear-gradient(135deg, #7fc4ff, #4aa3ff);
  color: #fff;
  font-weight: 700;
}

.avatar-edit {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.profile-name {
  color: var(--text);
  font-weight: 700;
}

.profile-level {
  color: var(--text-dim);
}

/* 钱包卡片 */
.wallet-card {
  background: linear-gradient(135deg, #4aa3ff 0%, #2b7fe0 100%);
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(43, 127, 224, .28);
}

.wallet-label {
  color: rgba(255, 255, 255, .82);
  font-size: 11.5px;
  letter-spacing: .5px;
}

.wallet-amount {
  color: #fff;
  font-weight: 800;
}

.wallet-amount small {
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
  font-weight: 500;
}

.wallet-card .btn-ghost {
  background: rgba(255, 255, 255, .22);
  border: 1px solid rgba(255, 255, 255, .45);
  color: #fff;
}

.wallet-card .btn-ghost:active {
  background: rgba(255, 255, 255, .32);
}

/* 侧边导航 */
.nav-item {
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  transition: background .18s ease, color .18s ease;
}

.nav-item:active {
  background: var(--bg-hover);
}

.nav-item.active {
  background: linear-gradient(135deg, #e8f3ff, #d6eaff);
  color: var(--accent-hover);
  font-weight: 700;
}

/* 退出登录按钮 */
.btn-logout {
  background: #fff;
  border: 1.5px solid #ffd4d4;
  color: #e5484d;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background .18s ease, transform .12s ease;
}

.btn-logout:active {
  background: #fff5f5;
  transform: scale(.98);
}

/* ============ 主内容区 ============ */
.main {
  background: var(--bg);
}

.page-head {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.page-head h2 {
  color: var(--text);
  font-weight: 800;
}

.online-count {
  color: var(--text-dim);
}

.online-count .dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
}

/* ============ 消息区 ============ */
.messages {
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
}

.msg-content {
  display: block;
  min-width: 0;
}

.msg-content,
.bubble {
  background: transparent;
  border: none;
  box-shadow: none;
  color: var(--text);
}

.bubble {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 9px 13px;
  border-radius: 14px;
  color: var(--text);
}

/* 自己的消息 */
.msg.self .bubble {
  background: linear-gradient(135deg, #4aa3ff, #2b7fe0);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(43, 127, 224, .24);
}

.msg-content .msg-meta {
  display: flex;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.msg.self .msg-meta {
  justify-content: flex-end;
}

.msg-nick,
.msg-name {
  color: var(--text-dim);
  font-weight: 500;
}

.msg-system {
  color: var(--text-faint);
}

.msg-avatar {
  background: linear-gradient(135deg, #7fc4ff, #4aa3ff);
}

/* 输入区：输入框与按钮对齐 */
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.composer textarea {
  flex: 1;
  line-height: 1.45;
  padding: 10px 14px;
  min-height: 42px;
  height: 42px;
  max-height: 110px;
  resize: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.composer textarea::placeholder {
  color: var(--text-faint) !important;
  font-size: 13.5px !important;
  line-height: 1.45 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer .composer-tools {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.composer .btn-send {
  flex-shrink: 0;
  height: 42px;
  padding: 0 20px;
}

/* 桌面端输入框更高 */
@media (min-width: 1024px) {
  .composer textarea {
    min-height: 46px;
    height: 46px;
  }

  .composer .btn-send {
    height: 46px;
  }
}

/* ============ 输入区 ============ */
.composer {
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
}

.composer textarea {
  background: #f5f9ff;
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}

.composer textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74, 163, 255, .14);
}

.composer textarea::placeholder {
  color: var(--text-faint);
}

.tool-btn {
  background: #f0f7ff;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  transition: background .18s ease, transform .12s ease;
}

.tool-btn:active {
  background: var(--bg-hover);
  transform: scale(.94);
}

.btn-send {
  background: linear-gradient(135deg, #4aa3ff, #2b7fe0);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(43, 127, 224, .26);
  transition: transform .12s ease, box-shadow .18s ease;
}

.btn-send:active {
  transform: scale(.96);
}

.btn-send:disabled {
  opacity: .55;
  box-shadow: none;
}

/* ============ 按钮通用 ============ */
.btn-primary {
  background: linear-gradient(135deg, #4aa3ff, #2b7fe0);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(43, 127, 224, .26);
}

.btn-primary:active {
  transform: scale(.98);
}

.btn-ghost {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
}

.btn-ghost:active {
  background: var(--bg-hover);
}

.btn-icon {
  background: #f0f7ff;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 50%;
}

.btn-icon:active {
  background: var(--bg-hover);
}

/* ============ 卡片 / 列表 ============ */
.card,
.video-card,
.level-card,
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.video-title {
  color: var(--text);
  font-weight: 700;
}

.video-desc {
  color: var(--text-dim);
}

/* ============ 表单 ============ */
.field input,
.field textarea,
.field select,
input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  background: #f5f9ff;
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}

.field input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74, 163, 255, .14);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-faint);
}

select option {
  background: #fff;
  color: var(--text);
}

/* ============ 表格 ============ */
.table {
  background: #fff;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.table th {
  background: #f0f7ff;
  color: var(--text-dim);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.table td {
  color: var(--text);
  border-bottom: 1px solid #eef6ff;
}

.table tr:last-child td {
  border-bottom: none;
}

/* ============ 弹窗 ============ */
.modal-mask {
  background: rgba(18, 58, 99, .38);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 60, 120, .24);
}

/* ============ Toast ============ */
.toast {
  background: #123a63;
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(15, 60, 120, .3);
}

/* ============ 管理后台 tabs ============ */
.admin-tabs {
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.admin-tab {
  color: var(--text-dim);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.admin-tab.active {
  background: linear-gradient(135deg, #e8f3ff, #d6eaff);
  color: var(--accent-hover);
  font-weight: 700;
}

.admin-panel {
  background: var(--bg);
}

/* ============ 红包 ============ */
.rp {
  background: linear-gradient(160deg, #ff6b6b, #e63946);
  box-shadow: 0 8px 24px rgba(230, 57, 70, .3);
}

/* ============ 会员等级卡片 ============ */
.level-card {
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .18s ease;
}

.level-card:active {
  transform: scale(.99);
}

/* ============ 滚动条（桌面） ============ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c9dff5;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8caee;
}
