/*
  SWR Glass UI v1
  Layer model:
    - background image (back/1.jpg) on #swr-container::before
    - thin fog glass on #swr-container::after
    - content rendered above
  Notes:
    - Visual-first (no perf constraints)
    - Secondary views must fully hide primary content (JS enforces display:none)
*/

:root{
  --swr-radius: 18px;           /* 适中圆角 */
  --swr-radius-sm: 14px;
  --swr-gap: 18px;              /* 列表间距（更“呼吸”） */
  --swr-card-pad: 18px;
  --swr-blur: 18px;             /* 卡片 blur */
  --swr-fog-blur: 8px;         /* 薄雾 blur */
  --swr-sat: 185%;
  --swr-border: rgba(255,255,255,.22);
  --swr-glass-a1: .18;          /* 卡片不透明度 +10% */
  --swr-glass-a2: .07;
  --swr-glow: rgba(255,255,255,.18);
  --swr-shadow: 0 26px 70px rgba(0,0,0,.18);
  --swr-shadow-soft: 0 14px 40px rgba(0,0,0,.14);
  --swr-text: rgba(40,40,48,.78);
  --swr-subtext: rgba(20,20,25,.62);
  --swr-hairline: rgba(0,0,0,.06);

  /* Motion (visual-first) */
  --swr-ease-out: cubic-bezier(.16, 1, .3, 1);
  --swr-ease-spring: cubic-bezier(.2, .9, .2, 1);
  --swr-dur-view: 520ms;
  --swr-dur-card: 420ms;
}

html, body{
  background: transparent !important;
}

/* Stage */
#swr-container{
  position: fixed !important;
  inset: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: transparent !important;
}

/* Background image */
#swr-container::before{
  content: "";
  position: absolute;
  inset: -40px;
  background-image: var(--swr-bg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(115%) contrast(103%) brightness(102%);
  transform: scale(1.05);
  z-index: 0;
}

/* Thin fog glass */
#swr-container::after{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 800px at 10% 0%, rgba(255,180,220,.22), transparent 60%),
    radial-gradient(900px 700px at 90% 10%, rgba(170,210,255,.18), transparent 55%),
    radial-gradient(900px 700px at 50% 100%, rgba(255,210,160,.14), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  backdrop-filter: blur(var(--swr-fog-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--swr-fog-blur)) saturate(140%);
  z-index: 1;
  pointer-events: none;
}

/* Noise overlay to add premium glass texture */
#swr-main-app,
.swr-swipeable-view,
.swr-right-drawer,
#swr-core-dialog-overlay{
  position: relative;
  z-index: 2;
}

#swr-container .swr-noise{
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image: url('../img/noise.png');
  opacity: .55;
  mix-blend-mode: overlay;
  z-index: 2;
}

/* 3D stage (future-proof): keep a single perspective root */
#swr-main-app{
  transform-style: preserve-3d;
  animation: swr_app_fade 720ms var(--swr-ease-out) both;
}

@keyframes swr_app_fade{
  from{ opacity:0; transform: translateY(10px) scale(.99); }
  to{ opacity:1; transform: translateY(0) scale(1); }
}

/* Generic glass card */
.glass-card,
.swr-panel,
.swr-right-drawer,
.swr-msg-header,
.swr-top-bar,
.swr-header,
.scribe-publish-box,
.scribe-post,
.sf-card,
#swr-core-dialog{
  background: linear-gradient(135deg, rgba(255,255,255,var(--swr-glass-a1)), rgba(255,255,255,var(--swr-glass-a2))) !important;
  backdrop-filter: blur(var(--swr-blur)) saturate(var(--swr-sat));
  -webkit-backdrop-filter: blur(var(--swr-blur)) saturate(var(--swr-sat));
  border: 1px solid var(--swr-border) !important;
  border-radius: var(--swr-radius) !important;
  box-shadow: var(--swr-shadow-soft) !important;
  position: relative;
  overflow: hidden;
  will-change: transform, opacity, filter;
  transform: translateZ(0);
  transition:
    transform var(--swr-dur-card) var(--swr-ease-out),
    box-shadow var(--swr-dur-card) var(--swr-ease-out),
    border-color var(--swr-dur-card) var(--swr-ease-out),
    background var(--swr-dur-card) var(--swr-ease-out),
    filter var(--swr-dur-card) var(--swr-ease-out);
}

/* Premium micro-interactions */
@media (hover:hover){
  .glass-card:hover,
  .swr-chat-entry:hover,
  .swr-contact-entry:hover,
  .scribe-post:hover,
  .sf-post-card:hover,
  .sf-cmt-item:hover{
    transform: translateY(-1px) translateZ(0);
    box-shadow: var(--swr-shadow) !important;
  }
}

.glass-card:active,
.swr-chat-entry:active,
.swr-contact-entry:active,
.scribe-post:active,
.sf-post-card:active,
.sf-cmt-item:active{
  transform: scale(.985) translateY(1px) translateZ(0);
  filter: saturate(110%);
}


/* Cursor highlight follow (desktop) */
.glass-card::after,
.scribe-post::after,
.sf-post-card::after,
.sf-cmt-item::after{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius: inherit;
  pointer-events:none;
  background: radial-gradient(520px 420px at var(--swr-mx,50%) var(--swr-my,20%), rgba(255,255,255,.26), transparent 60%);
  opacity: .0;
  transition: opacity 260ms var(--swr-ease-out);
}
@media (hover:hover){
  .glass-card:hover::after,
  .scribe-post:hover::after,
  .sf-post-card:hover::after,
  .sf-cmt-item:hover::after{ opacity: .9; }
}

/* Stagger entrance for glass cards */
.swr-stagger-in .glass-card,
.swr-stagger-in .swr-chat-entry,
.swr-stagger-in .scribe-post,
.swr-stagger-in .sf-post-card,
.swr-stagger-in .sf-cmt-item{
  opacity: 0;
  transform: translateY(10px) scale(.985);
  animation: swr_stagger_in 680ms var(--swr-ease-out) forwards;
  animation-delay: var(--swr-delay, 0ms);
}
@keyframes swr_stagger_in{
  to{ opacity:1; transform: translateY(0) scale(1); }
}

/* Inner highlight */
.glass-card::before,
.swr-panel::before,
.swr-right-drawer::before,
.scribe-post::before,
.sf-card::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}

/* Remove hard solid backgrounds set inline */
#tab-me [style*="background:#fff"],
#tab-me [style*="background: #fff"],
#tab-feed [style*="background:#fff"],
#tab-feed [style*="background: #fff"],
#tab-msg [style*="background:#fff"],
#tab-msg [style*="background: #fff"],
.swr-swipeable-view[style*="background:#f2f2f2"],
.swr-swipeable-view[style*="background: #f2f2f2"]{
  background: linear-gradient(135deg, rgba(255,255,255,var(--swr-glass-a1)), rgba(255,255,255,var(--swr-glass-a2))) !important;
}

/* App background surfaces should be transparent to show fog + bg */
.swr-tab-content,
.swr-swipeable-view,
#swr-main-app{
  background: transparent !important;
}

/* Top bars */
.swr-msg-header,
.swr-top-bar,
.swr-header{
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  box-shadow: 0 10px 40px rgba(0,0,0,.10) !important;
}

/* Bottom nav as floating glass */
.swr-bottom-nav{
  margin: 0 14px 14px;
  width: calc(100% - 28px);
  border-radius: 22px !important;
  background: linear-gradient(135deg, rgba(255,255,255,var(--swr-glass-a1)), rgba(255,255,255,var(--swr-glass-a2))) !important;
  border: 1px solid rgba(255,255,255,.22) !important;
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  box-shadow: 0 24px 70px rgba(0,0,0,.18);
}

.swr-nav-item{
  transition: transform 380ms var(--swr-ease-out), color 260ms var(--swr-ease-out);
}
.swr-nav-item:active{ transform: translateY(1px) scale(.98); }
.swr-nav-item.active{
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.12));
}

/* Lists: add breathing space to reveal background */
.swr-item-list > li,
.swr-item-list .swr-chat-entry,
#scribe-feed-list .scribe-post,
#myfeed-feed-list .scribe-post,
.sf-topic,
.sf-post,
.sf-post-card,
.sf-cmt-item{
  margin-bottom: var(--swr-gap) !important;
}

/* Forum: make topic/post/comment as standalone glass cards */
.sf-post-card,
.sf-cmt-item,
.sf-dt-content{
  background: linear-gradient(135deg, rgba(255,255,255,var(--swr-glass-a1)), rgba(255,255,255,var(--swr-glass-a2))) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  border-radius: var(--swr-radius) !important;
  box-shadow: 0 18px 55px rgba(0,0,0,.12) !important;
}

.sf-post-card{ padding: 18px 18px !important; border-bottom: none !important; }
.sf-cmt-item{ padding: 18px 18px !important; border-bottom: none !important; }
.sf-cmt-header{ background: transparent !important; border: none !important; padding: 10px 6px 14px 6px !important; }
.sf-quote-block{ background: rgba(255,255,255,.10) !important; border: 1px solid rgba(255,255,255,.16) !important; }

/* Secondary views: cinematic enter */
.swr-swipeable-view{
  opacity: 0;
  transform: translateY(18px) scale(.985) rotateX(6deg) translateZ(-40px);
  transform-origin: 50% 20%;
  transition:
    transform var(--swr-dur-view) var(--swr-ease-out),
    opacity 320ms var(--swr-ease-out);
  will-change: transform, opacity;
}
.swr-swipeable-view.swr-show{
  opacity: 1;
  transform: translateY(0) scale(1) rotateX(0) translateZ(0);
}

/* Drawer open animation becomes more premium */
.swr-right-drawer{
  transition:
    transform 560ms var(--swr-ease-out),
    opacity 220ms var(--swr-ease-out);
}

/* Scroll areas: a bit more padding */
.swr-scroll-area{
  padding-left: 14px !important;
  padding-right: 14px !important;
}

/* Chat bubbles / list items become glass */
.swr-chat-entry,
.swr-contact-entry,
.swr-msg-item{
  border-radius: var(--swr-radius) !important;
  background: linear-gradient(135deg, rgba(255,255,255,var(--swr-glass-a1)), rgba(255,255,255,var(--swr-glass-a2))) !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  backdrop-filter: blur(24px) saturate(175%);
  -webkit-backdrop-filter: blur(24px) saturate(175%);
  box-shadow: 0 18px 50px rgba(0,0,0,.12) !important;
}

/* Typography */
#swr-container,
#swr-container *{
  color: var(--swr-text);
}

#swr-container .muted,
#swr-container .swr-sub,
#swr-container .swr-subtitle{
  color: var(--swr-subtext);
}

/* Buttons: glossy */
.swr-btn-primary,
.swr-circle-arrow-btn{
  border-radius: 999px !important;
  background: linear-gradient(135deg, rgba(10,10,15,.92), rgba(10,10,15,.76)) !important;
  box-shadow: 0 18px 40px rgba(0,0,0,.22) !important;
}

/* Overlay/dialog glass */
#swr-core-dialog-overlay{
  background: rgba(0,0,0,.28) !important;
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
}

/* Forum sidebar overlay should be clickable and above content */
#sf-sidebar-overlay{ z-index: 9998 !important; }
#sf-sidebar{ z-index: 9999 !important; }




/* ===== Glass UI v1.4 polish ===== */

/* 全站文字从纯黑降到深灰 */
#swr-container, #swr-container *{
  color: var(--swr-text);
}
#swr-container b, #swr-container strong{
  color: var(--swr-text-strong, rgba(30,30,36,.86));
}
#swr-container .muted, #swr-container .swr-sub, #swr-container .sub, #swr-container .hint{
  color: rgba(40,40,48,.56) !important;
}

/* “我的”列表条目：与上方卡片同透明度/玻璃质感 */
.swr-me-item{
  background: linear-gradient(135deg, rgba(255,255,255,var(--swr-glass-a1)), rgba(255,255,255,var(--swr-glass-a2))) !important;
  border: 1px solid var(--swr-border) !important;
  border-radius: var(--swr-radius) !important;
  backdrop-filter: blur(var(--swr-blur)) saturate(var(--swr-sat));
  -webkit-backdrop-filter: blur(var(--swr-blur)) saturate(var(--swr-sat));
  box-shadow: var(--swr-shadow-soft) !important;
  margin-bottom: 12px !important;
}
.swr-me-item:active{
  transform: scale(.995);
  box-shadow: 0 12px 30px rgba(0,0,0,.12) !important;
}

/* 聊天气泡：改为朋友圈同款玻璃卡片 */
.swr-msg-bubble{
  background: linear-gradient(135deg, rgba(255,255,255,var(--swr-glass-a1)), rgba(255,255,255,var(--swr-glass-a2))) !important;
  border: 1px solid var(--swr-border) !important;
  border-radius: var(--swr-radius) !important;
  backdrop-filter: blur(calc(var(--swr-blur) - 4px)) saturate(var(--swr-sat));
  -webkit-backdrop-filter: blur(calc(var(--swr-blur) - 4px)) saturate(var(--swr-sat));
  box-shadow: 0 16px 44px rgba(0,0,0,.14) !important;
  color: var(--swr-text) !important;
}
.swr-msg-left .swr-msg-bubble,
.swr-msg-right .swr-msg-bubble{
  border-top-left-radius: var(--swr-radius) !important;
  border-top-right-radius: var(--swr-radius) !important;
}
.swr-msg-right .swr-msg-bubble{
  background: linear-gradient(135deg, rgba(255,255,255,var(--swr-glass-a1)), rgba(255,255,255,var(--swr-glass-a2))) !important;
}

/* 左滑删除：更高级的红色玻璃按钮（不透底） */
.swr-chat-entry{
  overflow: hidden;
  border-radius: var(--swr-radius) !important;
}
.swr-chat-entry-delete{
  background: transparent !important;
}
.swr-chat-entry-delete::before{
  content:'';
  position:absolute;
  inset: 10px 10px 10px 10px;
  border-radius: calc(var(--swr-radius) - 6px);
  background: linear-gradient(135deg, rgba(255,70,90,.72), rgba(255,70,90,.38));
  border: 1px solid rgba(255,255,255,.26);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow:
    0 20px 60px rgba(255,70,90,.25),
    inset 0 1px 0 rgba(255,255,255,.24);
}
.swr-chat-entry-delete span,
.swr-chat-entry-delete{
  color: rgba(255,255,255,.92) !important;
  font-weight: 600;
}

/* 论坛：主题/帖子/跟帖全部独立玻璃卡片 + 更大间距 */
.sf-post-card, .sf-dt-content, .sf-cmt-item, .sf-notif-card{
  background: linear-gradient(135deg, rgba(255,255,255,var(--swr-glass-a1)), rgba(255,255,255,var(--swr-glass-a2))) !important;
  border: 1px solid var(--swr-border) !important;
  border-radius: var(--swr-radius) !important;
  backdrop-filter: blur(var(--swr-blur)) saturate(var(--swr-sat));
  -webkit-backdrop-filter: blur(var(--swr-blur)) saturate(var(--swr-sat));
  box-shadow: var(--swr-shadow-soft) !important;
  overflow: hidden;
}
.sf-post-card{
  margin: 0 0 18px 0 !important;
  border-bottom: none !important;
}
.sf-cmt-item{
  margin-bottom: 16px !important;
}
.sf-post-title, .sf-dt-title, .sf-cmt-name, .sf-dt-name{
  color: var(--swr-text-strong, rgba(30,30,36,.86)) !important;
}
.sf-cmt-text, .sf-dt-text{
  color: var(--swr-text) !important;
}

/* 论坛底部导航/按钮默认不要纯黑 */
.sf-meta-left, .sf-meta-right, .sf-post-meta{
  color: rgba(40,40,48,.62) !important;
}


/* ==============================
   Login background banding fix
   - Reduce fog blur and use lighter fog (less gradient banding).
   ============================== */
#swr-container::after{
  background: rgba(255,255,255,0.08) !important;
  filter: none !important;
}

