/* 黑白灰玻璃层：学猫导小程序的磨砂玻璃 + 极光底 + 轻微动效。
   只动视觉，不改布局结构；不支持 backdrop-filter 的浏览器会退回半透明底，仍然可读。 */

:root {
  --glass: rgba(255, 255, 255, .62);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-line: rgba(255, 255, 255, .72);
  --glass-ink-line: rgba(20, 20, 18, .08);
  --glass-shadow: 0 18px 46px rgba(20, 20, 18, .07), inset 0 1px 0 rgba(255, 255, 255, .72);
  --glass-shadow-lift: 0 26px 60px rgba(20, 20, 18, .12), inset 0 1px 0 rgba(255, 255, 255, .9);
  --glass-blur: blur(18px) saturate(1.08);
}

/* 底色放在 html 上，body 透明；极光用负 z-index 压到内容后面。
   不要给 .app 加 z-index：那会生成层叠上下文，把会话抽屉(160)/弹层(100)
   全部关在导航(80)下面。 */
html { background: #f4f4f4; }

body {
  position: relative;
  background: transparent;
}

/* 极光底：灰白团块慢慢漂，给玻璃卡提供可被“磨”的底 */
body::before {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(58% 46% at 14% 12%, rgba(255, 255, 255, .96) 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(52% 42% at 88% 18%, rgba(196, 196, 190, .48) 0%, rgba(196, 196, 190, 0) 68%),
    radial-gradient(60% 50% at 52% 104%, rgba(118, 118, 112, .22) 0%, rgba(118, 118, 112, 0) 70%),
    radial-gradient(34% 30% at 76% 74%, rgba(255, 255, 255, .72) 0%, rgba(255, 255, 255, 0) 72%);
  filter: blur(16px);
  animation: aurora-drift 28s ease-in-out infinite alternate;
}

/* 极细网格：让玻璃边缘有东西可折，不靠阴影也不脏 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 20, 18, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 20, 18, .025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 28%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 28%, #000 10%, transparent 78%);
}

/* 只给普通页面容器做定位；.bottom-nav/.modal-back/.cmdk-back 必须保持 fixed，
   写进这里会掉到文档流里（会话抽屉与弹层也就会被底部导航压住）。 */
.app, .auth-shell { position: relative; }

@keyframes aurora-drift {
  0% { transform: translate3d(-1.6%, -1%, 0) scale(1); }
  50% { transform: translate3d(1.4%, 1.2%, 0) scale(1.04); }
  100% { transform: translate3d(-.8%, 1.8%, 0) scale(1.02); }
}

/* ── 玻璃外壳 ───────────────────────────────────────────────────────── */
.rail {
  background: rgba(20, 20, 18, .78) !important;
  backdrop-filter: blur(26px) saturate(1.05);
  -webkit-backdrop-filter: blur(26px) saturate(1.05);
  border-right: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 18px 0 50px rgba(10, 10, 9, .10);
}

.topbar {
  background: rgba(255, 255, 255, .74) !important;
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  border-bottom: 1px solid var(--glass-line);
}

.bottom-nav {
  background: rgba(255, 255, 255, .68) !important;
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  border-top: 1px solid var(--glass-line);
}

.bn-orb {
  box-shadow: 0 10px 26px rgba(10, 10, 9, .22), 0 0 0 6px rgba(255, 255, 255, .18) !important;
}

/* ── 玻璃卡片 ───────────────────────────────────────────────────────── */
.card, .panel, .quick a, .quick button, .kpi, .chart-card, .todo-strip a,
.lp-list, .lp-account, .lp-tool, .mine-card, .bw-card, .wb-card, .chat-card,
.event, .camera, .rect, .composer, .threads, .login-box, .modal, .cmdk,
.auth-card, .lp-filters .lp-search, .seg {
  background: var(--glass) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-line) !important;
  box-shadow: var(--glass-shadow);
}

.card, .panel, .quick a, .quick button, .kpi, .chart-card, .todo-strip a,
.lp-account, .lp-tool, .mine-card, .lp-list {
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease),
    background .18s var(--ease);
}

.kpi:hover, .chart-card:hover, .quick a:hover, .quick button:hover,
.todo-strip a:hover, .lp-account:hover, .lp-tool:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .95) !important;
  box-shadow: var(--glass-shadow-lift);
  background: var(--glass-strong) !important;
}

/* 卡片上的斜向反光：很淡，只让玻璃看起来有厚度 */
.kpi, .chart-card, .lp-account, .lp-tool {
  position: relative;
  overflow: hidden;
}
.kpi::after, .chart-card::after, .lp-account::after, .lp-tool::after {
  content: "";
  position: absolute;
  inset: -40% -60%;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, .55) 50%, transparent 58%);
  opacity: 0;
  transform: translateX(-24%);
  transition: opacity .3s var(--ease), transform .55s var(--ease);
}
.kpi:hover::after, .chart-card:hover::after, .lp-account:hover::after, .lp-tool:hover::after {
  opacity: .38;
  transform: translateX(18%);
}

/* 深色玻璃（巡店卡 / 登录左栏 / 首页 hero） */
.patrol-card {
  background: linear-gradient(135deg, rgba(22, 22, 20, .94), rgba(38, 38, 34, .82)) !important;
  backdrop-filter: blur(20px) saturate(1.05);
  -webkit-backdrop-filter: blur(20px) saturate(1.05);
  border: 1px solid rgba(255, 255, 255, .13) !important;
  box-shadow: 0 24px 60px rgba(10, 10, 9, .22), inset 0 1px 0 rgba(255, 255, 255, .14);
  position: relative;
  overflow: hidden;
}
.patrol-card::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -120px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .18), transparent 68%);
  pointer-events: none;
}

/* 登录卡：玻璃底需要内边距，否则标题/输入框贴着卡片边缘 */
.auth-card {
  padding: 30px 28px;
  border-radius: 20px;
  box-sizing: border-box;
}
.auth-brand::after { filter: blur(24px); opacity: .7; }

/* ── 对话玻璃 ───────────────────────────────────────────────────────── */
.bubble {
  background: rgba(255, 255, 255, .66) !important;
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  border-color: rgba(255, 255, 255, .76) !important;
  box-shadow: 0 10px 28px rgba(20, 20, 18, .05), inset 0 1px 0 rgba(255, 255, 255, .8);
}

.msg.user .bubble {
  background: linear-gradient(145deg, #1c1c1a, #000) !important;
  border-color: rgba(255, 255, 255, .08) !important;
  box-shadow: 0 12px 30px rgba(10, 10, 9, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.chat-card {
  background: rgba(255, 255, 255, .58) !important;
  border-color: rgba(255, 255, 255, .7) !important;
}

.thread-item.on {
  background: rgba(255, 255, 255, .62) !important;
  border-color: rgba(255, 255, 255, .85) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.threads {
  background: rgba(255, 255, 255, .34) !important;
  backdrop-filter: blur(22px) saturate(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(1.08);
}

/* 手机上会话列表是整面抽屉，玻璃要更实，否则底下的聊天内容会透上来影响读标题 */
@media (max-width: 1100px) {
  .threads { background: rgba(255, 255, 255, .9) !important; }
}

.composer {
  background: rgba(255, 255, 255, .72) !important;
  box-shadow: 0 16px 40px rgba(20, 20, 18, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
}

.send-btn,
.btn-primary,
.auth-submit {
  background: linear-gradient(145deg, #222220, #000) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 8px 20px rgba(10, 10, 9, .16);
}

.btn-ghost,
.auth-send,
.tool-btn,
.pref-chip,
.lp-chip,
.filter {
  background: rgba(255, 255, 255, .60) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, .8) !important;
}

/* 选中态必须压过上面的半透明底，否则白字落在白玻璃上会“消失” */
.lp-chip.on,
.filter.on,
.pref-chip.on,
.seg button.on {
  background: linear-gradient(145deg, #222220, #000) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(10, 10, 9, .16), inset 0 1px 0 rgba(255, 255, 255, .16);
}

/* 首页 hero：深色玻璃带极光，和小程序首屏的磨砂卡同一套语言 */
body[data-page="home"] .page-head {
  position: relative;
  overflow: hidden;
  padding: 30px 32px;
  border-radius: 20px;
  background:
    radial-gradient(46% 70% at 88% 12%, rgba(255, 255, 255, .18), transparent 68%),
    radial-gradient(40% 60% at 8% 108%, rgba(255, 255, 255, .10), transparent 70%),
    linear-gradient(135deg, rgba(20, 20, 18, .96), rgba(42, 42, 37, .86));
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 26px 64px rgba(10, 10, 9, .20), inset 0 1px 0 rgba(255, 255, 255, .14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
body[data-page="home"] .page-head .kicker { color: rgba(255, 255, 255, .55); }
body[data-page="home"] .page-head .page-title {
  color: #fff;
  font-size: 46px;
  line-height: 1.15;
  letter-spacing: -1.5px;
}
body[data-page="home"] .page-head .page-sub { color: rgba(255, 255, 255, .6); }
body[data-page="home"] .page-head .demo-pill {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .82);
}
body[data-page="home"] .page-head::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -70px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .22), transparent 68%);
  pointer-events: none;
}

/* 登录左栏：深色玻璃 + 两团光 */
.auth-brand {
  background:
    radial-gradient(46% 46% at 82% 10%, rgba(255, 255, 255, .14), transparent 70%),
    radial-gradient(40% 44% at 10% 100%, rgba(255, 255, 255, .08), transparent 72%),
    linear-gradient(150deg, #1c1c1a, #0b0b0a) !important;
  position: relative;
  overflow: hidden;
}
.auth-brand::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -120px;
  bottom: -160px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .12), transparent 70%);
  pointer-events: none;
}

/* ── 动效 ───────────────────────────────────────────────────────────── */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

main.content > * {
  animation: rise-in .45s var(--ease) backwards;
}
main.content > *:nth-child(2) { animation-delay: .04s; }
main.content > *:nth-child(3) { animation-delay: .08s; }
main.content > *:nth-child(4) { animation-delay: .12s; }
main.content > *:nth-child(5) { animation-delay: .16s; }

.chat-shell { animation: rise-in .4s var(--ease) backwards; }
.msg { animation: rise-in .26s var(--ease) backwards; }

/* 小屏：hero 内边距与字号收一档 */
@media (max-width: 900px) {
  body[data-page="home"] .page-head { padding: 24px 22px; border-radius: 16px; }
  .auth-card { padding: 22px 18px; border-radius: 16px; }
  body[data-page="home"] .page-head .page-title { font-size: 34px; }
  .rail { backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
}
