/* ============================================================
   星航 · 多主题风格（完整版）
   后台「站点设置 → 网站风格」选择后，前台 <html> 上加 data-theme
   可选：night(默认深色) / sunset(落日橙) / ocean(海洋蓝) / forest(森林绿) / sakura(樱花粉)
   night 用站点原有深色落日夜景；这里定义其余 4 套浅色主题。
   站点的深色主题用大量 !important 强行设色，本文件统一用 html[data-theme]
   提高具体性来逐项覆盖，保证应用卡片等所有元素在浅色下都清晰可读。
   ============================================================ */

/* 把 4 套主题统一挂到一个标记上，后面用一条规则覆盖全部浅色主题 */
html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]{
  --LH:1; /* light-theme marker */
}

/* ---------- 落日橙 ---------- */
html[data-theme="sunset"]{
  --xh-bg:linear-gradient(170deg,#fff4e6 0%,#ffe2c4 48%,#fff0e0 100%);
  --xh-ink:#4a2a16; --xh-sub:#a3765c;
  --xh-primary:#e8541a; --xh-primary2:#ff9e52;
  --xh-glass:rgba(255,255,255,.9); --xh-glass2:rgba(255,246,236,.82);
  --xh-line:rgba(232,84,26,.22); --xh-nav:rgba(255,250,245,.97);
  --top-line:var(--xh-primary); --top-line-grad:linear-gradient(90deg,var(--xh-primary),var(--xh-primary2));
}
/* ---------- 海洋蓝 ---------- */
html[data-theme="ocean"]{
  --xh-bg:linear-gradient(170deg,#eaf4ff 0%,#d3e8ff 50%,#eaf5ff 100%);
  --xh-ink:#16324f; --xh-sub:#5b7c9c;
  --xh-primary:#1768d6; --xh-primary2:#48a9ff;
  --xh-glass:rgba(255,255,255,.92); --xh-glass2:rgba(234,244,255,.84);
  --xh-line:rgba(23,104,214,.22); --xh-nav:rgba(245,250,255,.98);
  --top-line:var(--xh-primary); --top-line-grad:linear-gradient(90deg,var(--xh-primary),var(--xh-primary2));
}
/* ---------- 森林绿 ---------- */
html[data-theme="forest"]{
  --xh-bg:linear-gradient(170deg,#eafaf0 0%,#cfeedd 50%,#e7f7ee 100%);
  --xh-ink:#163f2b; --xh-sub:#5c8872;
  --xh-primary:#17834a; --xh-primary2:#4fc483;
  --xh-glass:rgba(255,255,255,.91); --xh-glass2:rgba(234,248,240,.84);
  --xh-line:rgba(23,131,74,.22); --xh-nav:rgba(244,252,247,.98);
  --top-line:var(--xh-primary); --top-line-grad:linear-gradient(90deg,var(--xh-primary),var(--xh-primary2));
}
/* ---------- 樱花粉 ---------- */
html[data-theme="sakura"]{
  --xh-bg:linear-gradient(170deg,#fff0f6 0%,#ffd9e8 50%,#fff0f7 100%);
  --xh-ink:#4a2338; --xh-sub:#a46383;
  --xh-primary:#d63d7e; --xh-primary2:#ff86b3;
  --xh-glass:rgba(255,255,255,.92); --xh-glass2:rgba(255,240,247,.84);
  --xh-line:rgba(214,61,126,.22); --xh-nav:rgba(255,248,252,.98);
  --top-line:var(--xh-primary); --top-line-grad:linear-gradient(90deg,var(--xh-primary),var(--xh-primary2));
}

/* ===================================================================
   以下覆盖规则对 4 套浅色主题同时生效：
   用 :is(html[data-theme=...]) 一次性匹配，具体性高于站点的裸类 !important
   =================================================================== */
/* 页面底色与文字 */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]){
  background:var(--xh-bg) !important;
}
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) body{
  background:transparent !important;
  color:var(--xh-ink) !important;
}

/* ---------- 顶部 / 公共容器 ---------- */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) :is(
  header,.premium-header,.fixed-area,.top-bg,.quick-center summary,.quick-item,.quick-panel,
  .nav-main-btn,.carousel-wrap,.icon-ticker,.icon-item,.category-tabs,.tab-btn,
  .card-row,.card,.dialog,.btn.secondary,.shell,.bio,.moment,.tool,.goto-bar,.tool-tab
){
  background:var(--xh-glass) !important;
  color:var(--xh-ink) !important;
  border-color:var(--xh-line) !important;
  box-shadow:none !important;
  text-shadow:none !important;
}
/* 顶部栏底边线：跟随主题主色，避免白色/浅色边线 */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .premium-header{
  border-bottom:1px solid var(--xh-primary) !important;
}
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .premium-header::after{
  background:linear-gradient(90deg,var(--xh-primary),var(--xh-primary2)) !important;
  opacity:1 !important;
}
/* 渐变型容器用半透明玻璃，不要深色实底 */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) :is(
  .fixed-area,.carousel-wrap,.icon-ticker,.card-row
){ background:var(--xh-glass2) !important; }
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) :is(
  .card:hover,.quick-item:hover,.tool:hover
){ background:var(--xh-glass2) !important; border-color:var(--xh-primary) !important; box-shadow:none !important; }

/* ---------- 文字：标题用主文字色，副文字用次要色 ---------- */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) :is(
  header .brand .title,.card .title,.card-meta strong,
  #cardsScroll .section h2,.group-title,.tool-name,.foot,.moment-name,.moment-text,
  .signature,.meta,.content-state,.dialog label,.foot
){ color:var(--xh-ink) !important; text-shadow:none !important; }
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) :is(
  .card-desc,.site-footer,.brand-footer,
  .brand-footer .copy,.description,.location
){ color:var(--xh-sub) !important; }

/* ---------- 强调色 / 按钮 / 角标：统一主题渐变 + 白字 ---------- */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) :is(
  .btn.primary,.card-cta,.card .go,.tab-btn.active,.dot.active,.pin,
  .tool-tab.active,.goto-btn,.marquee-wrap
){
  background:linear-gradient(120deg,var(--xh-primary),var(--xh-primary2)) !important;
  color:#fff !important;
  border-color:transparent !important;
  box-shadow:none !important;
}
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) :is(
  .rating,.stars,.location,.card .title strong,
  .bottom-nav a.active
){ color:var(--xh-primary) !important; }
/* 推荐角标：主题色，白字 */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .rec-badge{
  background:linear-gradient(120deg,var(--xh-primary),var(--xh-primary2)) !important;
  color:#fff !important;
}
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .rec-badge-text{ color:#fff !important; }

/* ---------- 轮播 / 光点 ---------- */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .dot{
  background:var(--xh-glass2) !important; border-color:var(--xh-line) !important;
}
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .car-btn{
  background:var(--xh-glass) !important; color:var(--xh-ink) !important; border-color:var(--xh-line) !important;
}
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .marquee-text{ color:#fff !important; }

/* ---------- 底部导航 ---------- */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .bottom-nav{
  background:var(--xh-nav) !important; border-color:var(--xh-line) !important; box-shadow:none !important;
}
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .bottom-nav a{ color:var(--xh-sub) !important; }

/* ---------- 动态页顶部封面 / 工具箱头部 ---------- */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) :is(.hero:not(.has-hero-img),.head){
  background-image:linear-gradient(135deg,var(--xh-primary),var(--xh-primary2)) !important;
}

/* ---------- 页面光晕 ---------- */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) body::before{
  background:radial-gradient(circle,var(--xh-glass2) 0%,transparent 70%) !important;
  opacity:.6 !important;
}

/* ===================================================================
   补齐：内联样式里写死的深色元素（浅色主题下统一走主题色）
   =================================================================== */
/* 中性玻璃容器：返回按钮、统计卡、标签栏、输入框、图标底、对话框表单按钮 */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) :is(
  .back,.topbar .back,.admin-only,.summary-card,.tool-tabs,.goto-input,.feed,
  .tool-icon,.field input,.field select,.dialog-actions button
){
  background:var(--xh-glass2) !important;
  color:var(--xh-ink) !important;
  border-color:var(--xh-line) !important;
  box-shadow:none !important;
  text-shadow:none !important;
}
/* 添加工具按钮 */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .add-btn{
  background:var(--xh-glass) !important;
  color:var(--xh-primary) !important;
  border-color:var(--xh-line) !important;
}
/* 对话框主要操作按钮 + 轮播字幕：主题渐变 + 白字 */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) :is(
  .dialog-actions .primary,.slide-caption
){
  background:linear-gradient(120deg,var(--xh-primary),var(--xh-primary2)) !important;
  color:#fff !important;
  border-color:transparent !important;
}
/* 弹窗遮罩 */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) :is(.dialog-backdrop,.ann-mask){
  background:rgba(20,10,5,.45) !important;
}
/* 卡片光晕 */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .card::after{
  background:radial-gradient(circle at center,var(--xh-glass2) 0%,transparent 60%) !important;
}
/* 粒子层 */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) #bg-particles{
  opacity:.35 !important;
}
/* ---------- 公告弹窗整套 ---------- */
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .ann-dialog{
  background:var(--xh-glass) !important;
  color:var(--xh-ink) !important;
  border-color:var(--xh-line) !important;
  box-shadow:0 20px 50px rgba(0,0,0,.16) !important;
}
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .ann-head{
  background:linear-gradient(90deg,var(--xh-primary),var(--xh-primary2)) !important;
}
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .ann-title{ color:var(--xh-ink) !important; }
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .ann-text{ color:var(--xh-sub) !important; }
:is(html[data-theme="sunset"],html[data-theme="ocean"],html[data-theme="forest"],html[data-theme="sakura"]) .ann-btn{
  background:linear-gradient(90deg,var(--xh-primary),var(--xh-primary2)) !important;
  color:#fff !important;
}
