/**
 * 上海福建人 · 全站三套主题
 * classic 经典闽红 | ocean 海派深蓝 | jade 青绿闽韵
 */
:root,
html[data-theme="ocean"],
body[data-theme="ocean"] {
  --theme-ink: #0f1c2e;
  --theme-sea: #1a4a5c;
  --theme-accent: #d4782f;
  --theme-sand: #f2efe9;
  --theme-muted: #6a7785;
  --theme-card: #ffffff;
  --theme-line: rgba(15, 28, 46, .08);
  --theme-nav: linear-gradient(90deg, #0f1c2e, #1a4a5c);
  --theme-hero-overlay: linear-gradient(120deg, rgba(15,28,46,.72) 8%, rgba(26,74,92,.45) 55%, rgba(15,28,46,.55) 100%);
  --theme-menu-solid: #1a4a5c;
  --theme-link: #1a4a5c;
  --theme-hot: #ad0b08;
}

html[data-theme="classic"],
body[data-theme="classic"] {
  --theme-ink: #2a0a0a;
  --theme-sea: #8b1210;
  --theme-accent: #d4a017;
  --theme-sand: #faf6f2;
  --theme-muted: #7a6666;
  --theme-card: #ffffff;
  --theme-line: rgba(139, 18, 16, .12);
  --theme-nav: linear-gradient(90deg, #6e0c0a, #ad0b08);
  --theme-hero-overlay: linear-gradient(120deg, rgba(80,10,8,.75) 10%, rgba(173,11,8,.42) 55%, rgba(40,8,6,.6) 100%);
  --theme-menu-solid: #ad0b08;
  --theme-link: #ad0b08;
  --theme-hot: #ad0b08;
}

html[data-theme="jade"],
body[data-theme="jade"] {
  --theme-ink: #10241c;
  --theme-sea: #1f6b52;
  --theme-accent: #c49a3c;
  --theme-sand: #f3f6f2;
  --theme-muted: #5f7268;
  --theme-card: #ffffff;
  --theme-line: rgba(16, 36, 28, .1);
  --theme-nav: linear-gradient(90deg, #10241c, #1f6b52);
  --theme-hero-overlay: linear-gradient(120deg, rgba(16,36,28,.75) 8%, rgba(31,107,82,.4) 55%, rgba(16,36,28,.55) 100%);
  --theme-menu-solid: #1f6b52;
  --theme-link: #1f6b52;
  --theme-hot: #1f6b52;
}

/* 兼容会员页旧变量名 */
html[data-theme] {
  --hm-ink: var(--theme-ink);
  --hm-sea: var(--theme-sea);
  --hm-accent: var(--theme-accent);
  --hm-sand: var(--theme-sand);
  --hm-muted: var(--theme-muted);
  --hm-card: var(--theme-card);
  --hm-line: var(--theme-line);
  --lx-ink: var(--theme-ink);
  --lx-sea: var(--theme-sea);
  --lx-accent: var(--theme-accent);
  --lx-sand: var(--theme-sand);
  --lx-muted: var(--theme-muted);
  --lx-card: var(--theme-card);
}

/* 首页原站关键色覆盖 */
.head {
  background: var(--theme-ink) !important;
}
.menu {
  background: var(--theme-nav) !important;
}
.header .search button {
  background: var(--theme-sea) !important;
  color: #fff !important;
}
.contain4 .cont4-one .one1,
.contain4 {
  border-top-color: var(--theme-menu-solid) !important;
}
.contain4 .cont4-one .one1 {
  background-color: var(--theme-menu-solid) !important;
}
.contain5 .hot::after {
  background: var(--theme-accent) !important;
}
.footer {
  background: var(--theme-ink) !important;
}

/* 会员布局 */
.lx-nav {
  background: color-mix(in srgb, var(--theme-ink) 92%, transparent) !important;
}
.lx-hero {
  background:
    radial-gradient(ellipse at 20% 20%, color-mix(in srgb, var(--theme-accent) 22%, transparent), transparent 50%),
    radial-gradient(ellipse at 80% 0%, color-mix(in srgb, var(--theme-sea) 25%, transparent), transparent 45%),
    linear-gradient(120deg, var(--theme-ink) 0%, var(--theme-sea) 100%) !important;
}
.lx-btn {
  background: var(--theme-accent) !important;
}
.lx-btn-outline {
  color: var(--theme-sea) !important;
  border-color: var(--theme-sea) !important;
  background: transparent !important;
}
.lx-tabs a.active {
  background: var(--theme-sea) !important;
  color: #fff !important;
}
.pagination-area .page-item.active .page-link {
  background: var(--theme-sea) !important;
  border-color: var(--theme-sea) !important;
}
.pagination-area .page-link {
  color: var(--theme-sea) !important;
}

/* 主题切换器（官网首页等仍可用底部浮层；会员页用顶部弹窗） */
.theme-switcher {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 9999;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  padding: 10px 12px;
  font-size: 12px;
  color: #333;
  min-width: 132px;
}
body.lx-app-body .theme-switcher { display: none !important; }
.theme-switcher__label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: .04em;
}
.theme-switcher__btns {
  display: flex;
  gap: 6px;
}
.theme-switcher button {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 6px 0;
  cursor: pointer;
  background: #f7f7f7;
  font-size: 12px;
  line-height: 1.2;
}
.theme-switcher button.is-active {
  color: #fff;
  border-color: transparent;
}
.theme-switcher button[data-theme-set="classic"].is-active { background: #ad0b08; }
.theme-switcher button[data-theme-set="ocean"].is-active { background: #1a4a5c; }
.theme-switcher button[data-theme-set="jade"].is-active { background: #1f6b52; }

@media (max-width: 575px) {
  .theme-switcher {
    right: 8px;
    bottom: 10px;
    padding: 8px;
    min-width: 118px;
  }
}

/* 会员顶栏主题弹窗 */
.lx-theme-btn {
  width: 32px !important;
  height: 32px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.16) !important;
  border: 1px solid rgba(255,255,255,.22) !important;
}
.lx-theme-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lx-theme-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(15,28,46,.35);
  opacity: 0;
  transition: opacity .18s ease;
}
.lx-theme-mask.is-open {
  display: block;
  opacity: 1;
}
.lx-theme-panel {
  display: none;
  position: fixed;
  z-index: 1301;
  top: calc(52px + env(safe-area-inset-top, 0px));
  right: 12px;
  width: min(260px, calc(100vw - 24px));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(15,28,46,.18);
  padding: 12px;
  transform: translateY(-6px);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}
.lx-theme-panel.is-open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.lx-theme-panel__title {
  margin: 0 0 10px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--theme-ink, #1a2332);
}
.lx-theme-panel__btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.lx-theme-panel__btns button {
  border: 1px solid #dde3ea;
  border-radius: 10px;
  padding: 10px 4px;
  background: #f6f8fa;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  color: #334;
}
.lx-theme-panel__btns button.is-active {
  color: #fff;
  border-color: transparent;
}
.lx-theme-panel__btns button[data-theme-set="classic"].is-active { background: #ad0b08; }
.lx-theme-panel__btns button[data-theme-set="ocean"].is-active { background: #1a4a5c; }
.lx-theme-panel__btns button[data-theme-set="jade"].is-active { background: #1f6b52; }

@media (min-width: 768px) {
  .lx-theme-btn { display: inline-flex !important; }
  .lx-top-actions {
    display: flex !important;
    align-items: center;
    gap: 8px;
  }
  .lx-top-actions a:not(.lx-theme-btn) {
    color: #fff !important;
    text-decoration: none;
    font-size: .86rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,.1);
  }
}
