/* 课间 · 背景皮肤（2026.11.25.506）
   单画布环境光 + 设置页静态色板；普通模式继续用 aurora。 */
#bg-skin{
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  overflow:hidden;
  opacity:1;
  background:#070b12;
  contain:strict;
  transition:opacity .38s ease;
}
html:not([data-view="high"]) #bg-skin{display:none!important}
html[data-view="high"] main{position:relative;z-index:1}
#bg-skin canvas{
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  opacity:.96;
}
#bg-skin[data-bg-mode="css"] canvas{opacity:0}
#bg-skin .bg-skin-veil{
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.055;
  mix-blend-mode:soft-light;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* 高端版不再叠两层背景：aurora 退场，环境光交给皮肤 */
html[data-view="high"] #aurora{
  display:none!important;
  opacity:0!important;
  visibility:hidden!important;
}
html[data-theme="dark"] #aurora,
html[data-high-appearance="dark"] #aurora{
  opacity:0!important;
}

/* 3D 场景与聊天页：不启用皮肤，避免和页面自己的画布抢注意力 */
body[data-page="campus3d"] #bg-skin,
body[data-page="room"] #bg-skin{
  display:none!important;
  opacity:0;
  visibility:hidden;
}

/* ---- 各皮肤 CSS 兜底（WebGL 不可用时也能成立） ---- */
#bg-skin[data-bg-skin="liquid-mesh"]{
  background:
    radial-gradient(62% 78% at 12% 8%,rgba(91,33,182,.92),rgba(91,33,182,0) 68%),
    radial-gradient(54% 66% at 86% 6%,rgba(8,145,178,.74),rgba(8,145,178,0) 66%),
    radial-gradient(64% 76% at 88% 88%,rgba(219,39,119,.62),rgba(219,39,119,0) 68%),
    radial-gradient(52% 62% at 18% 88%,rgba(15,23,42,.9),rgba(15,23,42,0) 70%),
    linear-gradient(135deg,#090312,#04040a 74%);
}
html[data-high-appearance="light"] #bg-skin[data-bg-skin="liquid-mesh"]{
  background:
    radial-gradient(62% 78% at 12% 8%,rgba(199,210,254,.9),rgba(199,210,254,0) 70%),
    radial-gradient(54% 66% at 86% 6%,rgba(165,243,252,.78),rgba(165,243,252,0) 70%),
    radial-gradient(64% 76% at 88% 88%,rgba(245,208,254,.62),rgba(245,208,254,0) 70%),
    linear-gradient(135deg,#ffffff,#f7f8ff 72%);
}
#bg-skin[data-bg-skin="warm-paper"]{
  background:
    radial-gradient(66% 80% at 14% 10%,rgba(92,59,36,.92),rgba(92,59,36,0) 70%),
    radial-gradient(52% 62% at 88% 12%,rgba(161,98,7,.65),rgba(161,98,7,0) 68%),
    radial-gradient(58% 68% at 84% 88%,rgba(47,93,80,.52),rgba(47,93,80,0) 70%),
    linear-gradient(140deg,#120d0a,#0a0807 76%);
}
html[data-high-appearance="light"] #bg-skin[data-bg-skin="warm-paper"]{
  background:
    radial-gradient(66% 80% at 14% 10%,rgba(241,214,179,.95),rgba(241,214,179,0) 68%),
    radial-gradient(52% 62% at 88% 12%,rgba(232,185,143,.8),rgba(232,185,143,0) 68%),
    radial-gradient(58% 68% at 84% 88%,rgba(184,216,196,.7),rgba(184,216,196,0) 70%),
    linear-gradient(140deg,#fbf7ef,#efe4d4 74%);
}
#bg-skin[data-bg-skin="static-glass"]{
  background:
    radial-gradient(52% 62% at 14% 12%,rgba(99,102,241,.78),rgba(99,102,241,0) 68%),
    radial-gradient(46% 58% at 80% 8%,rgba(34,211,238,.52),rgba(34,211,238,0) 68%),
    radial-gradient(58% 64% at 88% 84%,rgba(217,70,239,.38),rgba(217,70,239,0) 70%),
    radial-gradient(42% 48% at 22% 88%,rgba(245,158,11,.26),rgba(245,158,11,0) 68%),
    linear-gradient(118deg,transparent 0 38%,rgba(255,255,255,.14) 47%,transparent 58%),
    linear-gradient(135deg,#101a2f,#070b16 74%);
}
html[data-high-appearance="light"] #bg-skin[data-bg-skin="static-glass"]{
  background:
    radial-gradient(52% 62% at 14% 12%,rgba(199,210,254,.96),rgba(199,210,254,0) 68%),
    radial-gradient(46% 58% at 80% 8%,rgba(165,243,252,.82),rgba(165,243,252,0) 68%),
    radial-gradient(58% 64% at 88% 84%,rgba(245,208,254,.58),rgba(245,208,254,0) 70%),
    radial-gradient(42% 48% at 22% 88%,rgba(254,243,199,.78),rgba(254,243,199,0) 68%),
    linear-gradient(118deg,transparent 0 38%,rgba(255,255,255,.55) 47%,transparent 58%),
    linear-gradient(135deg,#ffffff,#f4f7fb 74%);
}
#bg-skin[data-bg-skin="fluid-glass"]{
  background:
    linear-gradient(118deg,rgba(14,116,144,.9) 0 16%,rgba(103,232,249,.18) 27%,transparent 36% 56%,rgba(196,181,253,.18) 68%,transparent 78%),
    radial-gradient(72% 86% at 76% 12%,rgba(103,232,249,.48),rgba(103,232,249,0) 66%),
    radial-gradient(56% 70% at 18% 88%,rgba(196,181,253,.38),rgba(196,181,253,0) 70%),
    linear-gradient(150deg,#06121c,#020617 76%);
}
html[data-high-appearance="light"] #bg-skin[data-bg-skin="fluid-glass"]{
  background:
    linear-gradient(118deg,rgba(165,243,252,.86) 0 16%,rgba(255,255,255,.42) 27%,transparent 36% 56%,rgba(245,230,207,.46) 68%,transparent 78%),
    radial-gradient(72% 86% at 76% 12%,rgba(186,230,253,.82),rgba(186,230,253,0) 66%),
    radial-gradient(56% 70% at 18% 88%,rgba(245,230,207,.7),rgba(245,230,207,0) 70%),
    linear-gradient(150deg,#f8fbfd,#edf2f5 76%);
}
#bg-skin[data-bg-skin="static-glass"] .bg-skin-veil{opacity:.042}
/* ---- 设置页皮肤卡 ---- */
.bg-skin-panel{
  padding:0!important;
  overflow:hidden;
}
.bg-skin-field{
  display:block;
  margin:0;
  padding:18px;
  border:0;
  min-width:0;
}
.bg-skin-field legend{
  padding:0;
  margin:0;
  font-size:13px;
  font-weight:600;
  letter-spacing:.06em;
  color:var(--muted,#6c6f76);
}
.bg-skin-lead{
  margin:7px 0 14px;
  font-size:12px;
  line-height:1.72;
  color:var(--muted,#6c6f76);
}
.bg-skin-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
}
.bg-skin-card{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  min-width:0;
  min-height:74px;
  margin:0;
  padding:9px;
  border:1px solid rgba(35,31,25,.1);
  border-radius:15px;
  background:rgba(255,252,247,.68);
  color:var(--ink,#1b1b1f);
  text-align:left;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease,background .2s ease;
}
html[data-high-appearance="dark"] .bg-skin-card{
  border-color:rgba(255,255,255,.1);
  background:rgba(23,30,43,.65);
  color:#f1f3f8;
}
.bg-skin-card:hover{
  border-color:rgba(36,92,255,.28);
}
.bg-skin-card:active{transform:scale(.985)}
.bg-skin-card.is-selected{
  border-color:rgba(36,92,255,.62);
  box-shadow:0 0 0 2px rgba(36,92,255,.08),0 8px 22px rgba(36,92,255,.08);
  background:rgba(36,92,255,.06);
}
html[data-high-appearance="dark"] .bg-skin-card.is-selected{
  border-color:rgba(157,188,255,.58);
  box-shadow:0 0 0 2px rgba(157,188,255,.08),0 8px 22px rgba(0,0,0,.18);
  background:rgba(157,188,255,.08);
}
.bg-skin-preview{
  position:relative;
  flex:0 0 54px;
  width:54px;
  height:54px;
  overflow:hidden;
  border-radius:11px;
  border:1px solid rgba(255,255,255,.36);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.35),0 4px 12px rgba(26,31,40,.12);
}
.bg-skin-preview::after{
  content:"";
  position:absolute;
  inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
  opacity:.05;
  mix-blend-mode:soft-light;
  pointer-events:none;
}
.bg-skin-copy{
  min-width:0;
  flex:1;
}
.bg-skin-copy strong{
  display:block;
  font-size:13.5px;
  line-height:1.35;
  font-weight:600;
  color:inherit;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.bg-skin-copy small{
  display:block;
  margin-top:4px;
  font-size:10.5px;
  line-height:1.35;
  color:var(--muted,#6c6f76);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
html[data-high-appearance="dark"] .bg-skin-copy small{color:#a9b2c2}
.bg-skin-check{
  position:absolute;
  right:8px;
  top:8px;
  width:19px;
  height:19px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#245cff;
  color:#fff;
  opacity:0;
  transform:scale(.7);
  transition:opacity .18s ease,transform .18s ease;
}
.bg-skin-check svg{width:12px;height:12px}
.bg-skin-card.is-selected .bg-skin-check{opacity:1;transform:scale(1)}
html[data-high-appearance="dark"] .bg-skin-check{background:#9dbcff;color:#111827}

.bg-skin-toggles{
  margin-top:16px;
  border-top:1px solid rgba(35,31,25,.08);
}
html[data-high-appearance="dark"] .bg-skin-toggles{border-top-color:rgba(255,255,255,.08)}
.bg-skin-toggle{
  display:flex;
  align-items:center;
  gap:14px;
  min-height:58px;
  border-bottom:1px solid rgba(35,31,25,.08);
  cursor:pointer;
}
html[data-high-appearance="dark"] .bg-skin-toggle{border-bottom-color:rgba(255,255,255,.08)}
.bg-skin-toggle span{
  flex:1;
  min-width:0;
}
.bg-skin-toggle strong{
  display:block;
  font-size:13px;
  font-weight:600;
  color:var(--ink,#1b1b1f);
}
html[data-high-appearance="dark"] .bg-skin-toggle strong{color:#f1f3f8}
.bg-skin-toggle small{
  display:block;
  margin-top:4px;
  font-size:11px;
  line-height:1.55;
  color:var(--muted,#6c6f76);
}
html[data-high-appearance="dark"] .bg-skin-toggle small{color:#a9b2c2}
.bg-skin-toggle input{
  position:absolute;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}
.bg-skin-switch{
  position:relative;
  flex:0 0 40px;
  width:40px;
  height:24px;
  border-radius:999px;
  background:rgba(35,31,25,.18);
  transition:background .2s ease;
}
.bg-skin-switch::after{
  content:"";
  position:absolute;
  left:3px;
  top:3px;
  width:18px;
  height:18px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 4px rgba(15,23,42,.16);
  transition:transform .2s ease;
}
.bg-skin-toggle input:checked + .bg-skin-switch{background:#245cff}
html[data-high-appearance="dark"] .bg-skin-toggle input:checked + .bg-skin-switch{background:#9dbcff}
.bg-skin-toggle input:checked + .bg-skin-switch::after{transform:translateX(16px)}
.bg-skin-toggle input:focus-visible + .bg-skin-switch{outline:2px solid rgba(36,92,255,.45);outline-offset:2px}

.bg-skin-status{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  padding:14px 0 10px;
  font-size:11.5px;
  color:var(--muted,#6c6f76);
}
html[data-high-appearance="dark"] .bg-skin-status{color:#a9b2c2}
.bg-skin-status strong{
  font-size:13px;
  font-weight:600;
  color:var(--ink,#1b1b1f);
}
html[data-high-appearance="dark"] .bg-skin-status strong{color:#f1f3f8}
.bg-skin-status span{text-align:right}
.bg-skin-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:2px;
}
.bg-skin-reset{
  min-height:36px;
  padding:0 14px;
  border:1px solid rgba(35,31,25,.12);
  border-radius:999px;
  background:transparent;
  color:var(--ink,#1b1b1f);
  font-size:12px;
  font-weight:600;
}
html[data-high-appearance="dark"] .bg-skin-reset{
  border-color:rgba(255,255,255,.14);
  color:#e7eaf0;
}
.bg-skin-actions span{
  font-size:11px;
  color:var(--muted,#6c6f76);
}
html[data-high-appearance="dark"] .bg-skin-actions span{color:#a9b2c2}

@media (max-width:620px){
  .bg-skin-field{padding:16px}
  .bg-skin-grid{grid-template-columns:1fr}
  .bg-skin-card{min-height:66px}
  .bg-skin-preview{flex-basis:48px;width:48px;height:48px}
}

/* 静态预览色板：与 shader 各自的 dark/light 调色板对齐 */
.bg-skin-preview.p-liquid-mesh{
  background:
    radial-gradient(66% 74% at 18% 18%,#5b21b6,rgba(91,33,182,0) 68%),
    radial-gradient(58% 64% at 84% 12%,#0891b2,rgba(8,145,178,0) 66%),
    radial-gradient(70% 82% at 84% 86%,#db2777,rgba(219,39,119,0) 68%),
    #07030e;
}
.bg-skin-preview.p-warm-paper{
  background:
    radial-gradient(68% 78% at 18% 16%,#f1d6b3,rgba(241,214,179,0) 68%),
    radial-gradient(58% 66% at 84% 14%,#e8b98f,rgba(232,185,143,0) 68%),
    radial-gradient(64% 72% at 82% 86%,#b8d8c4,rgba(184,216,196,0) 70%),
    linear-gradient(145deg,#fbf7ef,#efe4d4);
}
.bg-skin-preview.p-static-glass{
  background:
    radial-gradient(50% 60% at 14% 12%,#6366f1,rgba(99,102,241,0) 68%),
    radial-gradient(46% 58% at 82% 8%,#22d3ee,rgba(34,211,238,0) 68%),
    radial-gradient(58% 64% at 88% 84%,#d946ef,rgba(217,70,239,0) 70%),
    radial-gradient(40% 48% at 20% 88%,#f59e0b,rgba(245,158,11,0) 68%),
    linear-gradient(118deg,transparent 0 38%,rgba(255,255,255,.18) 47%,transparent 58%),
    #0a1220;
}
.bg-skin-preview.p-fluid-glass{
  background:
    linear-gradient(118deg,rgba(14,116,144,.96) 0 16%,rgba(103,232,249,.22) 27%,transparent 36% 56%,rgba(196,181,253,.22) 68%,transparent 78%),
    radial-gradient(74% 88% at 80% 14%,rgba(103,232,249,.52),rgba(103,232,249,0) 66%),
    #04101a;
}
@media (prefers-reduced-motion: reduce){
  .bg-skin-card,.bg-skin-check,.bg-skin-switch,.bg-skin-switch::after{transition:none}
}

/* 高端暗色桌面侧栏：底是深色时，原来的浅玻璃会让白色导航读不出来 */
@media (min-width:651px){
  html[data-theme][data-view="high"][data-scheme="dark"][data-high-appearance="dark"] aside{
    background-color:rgba(16,22,32,.5)!important;
    background-image:linear-gradient(165deg,rgba(255,255,255,.13) 0%,rgba(255,255,255,.035) 52%,rgba(255,255,255,.07) 100%)!important;
    border-right-color:rgba(255,255,255,.14)!important;
    box-shadow:0 24px 60px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.16),inset 0 0 0 1px rgba(255,255,255,.1)!important;
    -webkit-backdrop-filter:blur(26px) saturate(160%)!important;
    backdrop-filter:blur(26px) saturate(160%)!important;
  }
}

/* ---- 高端外观可读性补丁：背景再亮，顶部元信息与设置页卡片也要读得清 ---- */
html[data-view="high"] .td-meta-line span{
  color:rgba(255,255,255,.78)!important;
  text-shadow:0 1px 10px rgba(0,0,0,.42),0 0 2px rgba(0,0,0,.22);
}
html[data-view="high"][data-high-appearance="light"] .td-meta-line span{
  color:rgba(24,32,45,.72)!important;
  text-shadow:0 1px 8px rgba(255,255,255,.72),0 0 2px rgba(255,255,255,.5);
}
html[data-view="high"][data-high-appearance="light"] .bg-skin-card{
  color:#1d2433!important;
  background:rgba(255,255,255,.82)!important;
  border-color:rgba(35,31,25,.10)!important;
}
html[data-view="high"][data-high-appearance="light"] .bg-skin-card.is-selected{
  color:#1d2433!important;
  background:rgba(36,92,255,.10)!important;
  border-color:rgba(36,92,255,.62)!important;
}
html[data-view="high"][data-high-appearance="light"] .bg-skin-card .bg-skin-copy strong{color:#1d2433!important}
html[data-view="high"][data-high-appearance="light"] .bg-skin-card .bg-skin-copy small{color:#5b6675!important}
html[data-view="high"][data-high-appearance="light"] aside nav button[aria-current="page"],
html[data-view="high"][data-high-appearance="light"] aside nav button.active{
  color:#1d2433!important;
}

/* 设置页预览跟随明暗，不再用一套暗色色板代表所有主题 */
html[data-high-appearance="light"] .bg-skin-preview.p-liquid-mesh{
  background:
    radial-gradient(66% 74% at 18% 18%,#c7d2fe,rgba(199,210,254,0) 68%),
    radial-gradient(58% 64% at 84% 12%,#a5f3fc,rgba(165,243,252,0) 66%),
    radial-gradient(70% 82% at 84% 86%,#f5d0fe,rgba(245,208,254,0) 68%),
    #ffffff;
}
html[data-high-appearance="dark"] .bg-skin-preview.p-warm-paper{
  background:
    radial-gradient(68% 78% at 18% 16%,#5c3b24,rgba(92,59,36,0) 68%),
    radial-gradient(58% 66% at 84% 14%,#a16207,rgba(161,98,7,0) 68%),
    radial-gradient(64% 72% at 82% 86%,#2f5d50,rgba(47,93,80,0) 70%),
    linear-gradient(145deg,#120d0a,#0a0807);
}
html[data-high-appearance="light"] .bg-skin-preview.p-static-glass{
  background:
    radial-gradient(50% 60% at 14% 12%,#c7d2fe,rgba(199,210,254,0) 68%),
    radial-gradient(46% 58% at 82% 8%,#a5f3fc,rgba(165,243,252,0) 68%),
    radial-gradient(58% 64% at 88% 84%,#f5d0fe,rgba(245,208,254,0) 70%),
    radial-gradient(40% 48% at 20% 88%,#fef3c7,rgba(254,243,199,0) 68%),
    linear-gradient(118deg,transparent 0 38%,rgba(255,255,255,.55) 47%,transparent 58%),
    #ffffff;
}
html[data-high-appearance="light"] .bg-skin-preview.p-fluid-glass{
  background:
    linear-gradient(118deg,rgba(165,243,252,.86) 0 16%,rgba(255,255,255,.42) 27%,transparent 36% 56%,rgba(245,230,207,.46) 68%,transparent 78%),
    radial-gradient(74% 88% at 80% 14%,rgba(186,230,253,.82),rgba(186,230,253,0) 66%),
    #f8fbfd;
}
html[data-view="high"][data-high-appearance="light"] aside nav button[aria-current="page"] span,
html[data-view="high"][data-high-appearance="light"] aside nav button.active span,
html[data-view="high"][data-high-appearance="light"] aside nav button[aria-current="page"] svg,
html[data-view="high"][data-high-appearance="light"] aside nav button.active svg{
  color:#1d2433!important;
}
