/* =========================================================
   杰哥云盘 v2.1 样式
   1) 修复「背景照片整页闪烁」：把 background-attachment: fixed
      换成固定定位的伪元素图层（GPU 友好，不重绘）
   2) 登录页亮点 / 公告条 / 聊天与 AI 面板 / 公告管理
   版权归豆包及杰哥(Jie Ge)所有  Copyright (c) 2026 Doubao & Jie Ge
   ========================================================= */

/* ---------- 1. 背景层重构：一次性绘制，滚动不重绘 ---------- */
html { background: #04122b; }

body {
  background: none !important;
  background-attachment: scroll !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 12% -10%, #123f8a 0%, rgba(18, 63, 138, 0) 60%),
    radial-gradient(900px 600px at 100% 0%, #0b3d6e 0%, rgba(11, 61, 110, 0) 55%),
    linear-gradient(160deg, #04122b, #07203f 45%, #031022 100%);
  background-size: cover;
  transform: translateZ(0);
}

body.has-bg::before {
  background-image:
    linear-gradient(180deg, rgba(4, 14, 32, .66) 0%, rgba(4, 14, 32, .80) 55%, rgba(3, 12, 26, .90) 100%),
    var(--brand-bg);
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

/* 登录/主界面自己那层半透明底也去掉 fixed，避免双图层抢绘制 */
.auth-screen.has-bg,
.app-screen.has-bg { background: transparent !important; }

/* ---------- 2. 登录页：左边亮点（v2.1） ---------- */
.auth-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 4px;
  max-width: 430px;
}
.auth-hl {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(8, 28, 58, .55);
  border: 1px solid rgba(120, 175, 240, .22);
  backdrop-filter: blur(6px);
}
.auth-hl i {
  font-style: normal; font-size: 15px; line-height: 1.35;
  filter: drop-shadow(0 2px 6px rgba(53, 194, 255, .45));
}
.auth-hl b { display: block; font-size: 12.5px; color: #e8f3ff; margin-bottom: 2px; }
.auth-hl span { display: block; font-size: 11px; line-height: 1.55; color: var(--ink-3); }

/* ---------- 3. 公告条（登录前 / 登录后通用） ---------- */
.notice-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.notice-stack.in-auth { max-width: 430px; margin: 0 0 16px; }

.notice-item {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid rgba(120, 175, 240, .32);
  border-left-width: 4px;
  background: rgba(9, 30, 62, .78);
  animation: fadeUp .4s var(--ease) both;
}
.notice-item .ni-ico { font-size: 16px; line-height: 1.3; }
.notice-item .ni-txt { flex: 1; min-width: 0; }
.notice-item b { display: block; font-size: 13px; color: #e9f4ff; margin-bottom: 3px; }
.notice-item p { margin: 0; font-size: 11.8px; line-height: 1.72; color: var(--ink-2); white-space: pre-wrap; }
.notice-item .ni-close {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; cursor: pointer;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  color: var(--ink-2); font-size: 11px; line-height: 1;
}
.notice-item .ni-close:hover { background: rgba(255, 255, 255, .16); color: #fff; }

.notice-item.lvl-info { border-left-color: #35c2ff; }
.notice-item.lvl-warn { border-left-color: #ffc14d; background: rgba(58, 42, 12, .72); }
.notice-item.lvl-warn b { color: #ffe3a8; }
.notice-item.lvl-urgent { border-left-color: #ff5d6c; background: rgba(62, 14, 22, .78); }
.notice-item.lvl-urgent b { color: #ffc9cf; }

/* 公告管理列表 */
.notice-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.notice-row.off { opacity: .55; }
.notice-row .nr-main { flex: 1; min-width: 0; }
.notice-row b { font-size: 13px; }
.notice-row p { margin: 4px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.65; }
.notice-row .nr-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

/* ---------- 4. 悬浮聊天 / AI（右下角） ---------- */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(135deg, #1f6feb, #35c2ff);
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: 0 14px 34px rgba(16, 88, 190, .5);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.chat-fab:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 18px 40px rgba(53, 194, 255, .55); }
.chat-fab .fab-dot {
  position: absolute; top: 4px; right: 4px;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: #ff4d5e; color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #06203f;
}

.chat-panel {
  position: fixed; right: 22px; bottom: 88px; z-index: 61;
  width: 372px; max-width: calc(100vw - 32px);
  height: 522px; max-height: calc(100vh - 130px);
  display: flex; flex-direction: column;
  border-radius: 18px; overflow: hidden;
  background: rgba(6, 20, 44, .97);
  border: 1px solid rgba(120, 175, 240, .3);
  box-shadow: 0 26px 60px rgba(0, 0, 0, .55);
  animation: chatIn .26s var(--ease) both;
}
@keyframes chatIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(31, 111, 235, .28), rgba(53, 194, 255, .10));
}
.chat-head b { font-size: 13.5px; }
.chat-head small { display: block; font-size: 10.5px; color: var(--ink-3); }
.chat-head .chat-x {
  margin-left: auto; width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, .08); border: 1px solid var(--line); color: var(--ink-2);
}
.chat-tabs { display: flex; gap: 6px; padding: 9px 12px 0; }
.chat-tab {
  flex: 1; padding: 8px 10px; border-radius: 10px 10px 0 0; cursor: pointer;
  background: rgba(255, 255, 255, .04); border: 1px solid transparent;
  border-bottom: none; color: var(--ink-3); font-size: 12.5px; font-weight: 600;
}
.chat-tab.on { background: rgba(31, 111, 235, .22); color: #eaf4ff; border-color: rgba(120, 175, 240, .32); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 9px;
  background:
    radial-gradient(400px 220px at 100% 0%, rgba(31, 111, 235, .12), transparent 70%),
    rgba(2, 10, 24, .5);
}
.msg { max-width: 82%; padding: 9px 12px; border-radius: 13px; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.msg.me { align-self: flex-end; background: linear-gradient(135deg, #1f6feb, #2f9bff); color: #fff; border-bottom-right-radius: 4px; }
.msg.other { align-self: flex-start; background: rgba(255, 255, 255, .08); color: #e6efff; border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; background: rgba(255, 193, 77, .14); color: #ffe3a8; font-size: 11.5px; border: 1px solid rgba(255, 193, 77, .3); }
.msg .m-meta { display: block; margin-top: 4px; font-size: 10px; opacity: .65; }
.msg.typing { display: inline-flex; gap: 4px; align-items: center; }
.msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: #9fc3ea; animation: blink 1.1s infinite; }
.msg.typing i:nth-child(2) { animation-delay: .18s; }
.msg.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.chat-foot { padding: 10px 12px 12px; border-top: 1px solid var(--line); background: rgba(4, 14, 32, .85); }
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input-row textarea {
  flex: 1; resize: none; min-height: 40px; max-height: 96px;
  padding: 10px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.5;
  background: rgba(4, 16, 38, .8); border: 1px solid var(--line); color: var(--ink); outline: none;
}
.chat-input-row textarea:focus { border-color: var(--blue-400); box-shadow: 0 0 0 3px rgba(53, 194, 255, .12); }
.chat-send {
  flex: 0 0 auto; width: 44px; height: 40px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, #1f6feb, #35c2ff); border: none; color: #fff; font-size: 16px;
}
.chat-send:disabled { opacity: .5; cursor: default; }
.chat-hint { margin: 8px 0 0; font-size: 10.5px; color: var(--ink-3); line-height: 1.6; }

/* 超管会话列表 */
.thread-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; border-bottom: 1px solid var(--line);
}
.thread-item:hover { background: rgba(255, 255, 255, .05); }
.thread-item.on { background: rgba(31, 111, 235, .18); border-color: rgba(120, 175, 240, .35); }
.thread-item .ti-main { flex: 1; min-width: 0; }
.thread-item b { font-size: 12.5px; }
.thread-item span { display: block; font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-item .ti-badge {
  flex: 0 0 auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #ff4d5e; color: #fff; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center;
}

/* ---------- 5. 移动端 ---------- */
@media (max-width: 820px) {
  .auth-highlights { grid-template-columns: 1fr; }
  .chat-panel { right: 8px; left: 8px; width: auto; bottom: 80px; height: 68vh; }
  .chat-fab { right: 14px; bottom: 14px; }
}