﻿/* floating customer service widget */
:root {
  --theme-primary: #2f9cdc;
  --theme-primary-dark: #1d4ed8;
  --theme-soft: #f5f9ff;
}

body.theme-industrial {
  --theme-primary: #2f9cdc;
  --theme-primary-dark: #1d4ed8;
  --theme-soft: #f5f9ff;
}

body.theme-tech {
  --theme-primary: #0f9d7a;
  --theme-primary-dark: #0b7a60;
  --theme-soft: #eefcf7;
}

.service-float {
  position: fixed;
  right: 8px;
  top: 62%;
  transform: translateY(-50%);
  z-index: 9999;
  width: 84px;
  box-shadow: 0 1px 5px #ddd;
  background: #fff;
}

.service-float .svc-btn {
  position: relative;
  display: block;
  width: 84px;
  min-height: 40px;
  color: #1f2937;
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border-bottom: 1px solid #edf2ff;
  background: #fff;
  padding: 8px 4px;
  box-sizing: border-box;
}

.service-float .svc-btn:last-child {
  border-bottom: 0;
}

.service-float .svc-btn::before {
  display: block;
  margin: 0 auto 4px;
  width: 22px;
  height: 22px;
  line-height: 22px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.service-float .svc-online::before { content: "Q"; background: #2b7cff; }
.service-float .svc-phone::before { content: "☎"; background: #14b8a6; }
.service-float .svc-wechat::before { content: "微"; background: #16a34a; }
.service-float .svc-top::before { content: "↑"; background: #64748b; }

.service-float .svc-btn:hover {
  background: var(--theme-soft);
  text-decoration: none;
}

.service-float .svc-phone-panel,
.service-float .svc-wechat-panel {
  display: none;
  position: absolute;
  right: 88px;
  top: 50%;
  transform: translateY(-50%);
  width: 220px;
  padding: 10px 12px;
  border: 1px solid #d9e6ff;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
  color: #111827;
  text-align: left;
  line-height: 1.55;
}

.service-float .svc-wechat-qr {
  margin-top: 8px;
  width: 180px;
  height: 180px;
  border: 1px solid #d1fae5;
  border-radius: 6px;
  background: #fff url("../images/weixin.jpg") center/cover no-repeat;
  text-indent: -9999px;
  overflow: hidden;
}

.service-float .svc-btn:hover .svc-phone-panel,
.service-float .svc-btn:hover .svc-wechat-panel {
  display: block;
}

@media (max-width: 768px) {
  .service-float {
    right: 6px;
    top: auto;
    bottom: 12px;
    transform: none;
    width: 76px;
  }

  .service-float .svc-btn {
    width: 76px;
    font-size: 11px;
    min-height: 36px;
  }

  .service-float .svc-phone-panel,
  .service-float .svc-wechat-panel {
    right: 80px;
    width: 180px;
  }
}

/* reveal animation */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.motion-off [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* quick theme switch button */
.theme-switch-btn {
  position: fixed;
  left: 8px;
  bottom: 12px;
  z-index: 10020;
  border: 1px solid #d9e6ff;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .15);
}

.theme-switch-btn:hover {
  background: var(--theme-soft);
  border-color: var(--theme-primary);
  color: var(--theme-primary-dark);
}

.icon-style-btn {
  position: fixed;
  left: 8px;
  bottom: 48px;
  z-index: 10020;
  border: 1px solid #d9e6ff;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .15);
}

.icon-style-btn:hover {
  background: var(--theme-soft);
  border-color: var(--theme-primary);
  color: var(--theme-primary-dark);
}

/* appearance panel */
.appearance-panel {
  position: fixed;
  right: 10px;
  bottom: 14px;
  z-index: 10030;
}

.appearance-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid #d9e6ff;
  background: #fff;
  color: #334155;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .22);
  font-size: 18px;
  line-height: 38px;
  text-align: center;
  padding: 0;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, color .2s ease, background-color .2s ease;
}

.appearance-toggle:hover {
  border-color: var(--theme-primary);
  color: var(--theme-primary-dark);
  background: var(--theme-soft);
  transform: rotate(16deg);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .26);
}

.appearance-toggle:active {
  transform: scale(.93);
  box-shadow: 0 3px 10px rgba(15, 23, 42, .18);
}

.appearance-body {
  position: absolute;
  right: 0;
  bottom: 50px;
  width: 210px;
  display: block;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--theme-primary) 28%, #cbdcfb 72%);
  border-radius: 10px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .24), 0 0 0 1px rgba(255, 255, 255, .5) inset;
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transform-origin: right bottom;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, box-shadow .22s ease, visibility 0s linear .22s;
}

.appearance-panel.open .appearance-body {
  opacity: 1;
  transform: translateY(0) scale(1);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .26), 0 0 0 1px rgba(255, 255, 255, .58) inset, 0 0 0 3px color-mix(in srgb, var(--theme-primary) 20%, transparent);
  pointer-events: auto;
  visibility: visible;
  transition: opacity .22s ease, transform .22s ease, box-shadow .22s ease;
}

body.motion-off .appearance-body,
body.motion-off .appearance-panel.open .appearance-body {
  transition: none;
}

body.motion-off .appearance-toggle,
body.motion-off .appearance-toggle:hover,
body.motion-off .appearance-toggle:active {
  transition: none;
  transform: none;
}

body.motion-off .appearance-item button,
body.motion-off .appearance-item button:hover,
body.motion-off .appearance-item button:active {
  transition: none;
  transform: none;
}

body.motion-off .appearance-item button[data-role]::before,
body.motion-off .appearance-item button:hover[data-role]::before {
  transition: none;
  filter: none;
  text-shadow: none;
}

.appearance-item {
  margin-bottom: 6px;
}

.appearance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 4px 2px 6px;
}

.appearance-head strong {
  font-size: 12px;
  color: #334155;
}

.appearance-state {
  font-size: 11px;
  color: var(--theme-primary-dark);
  background: color-mix(in srgb, var(--theme-soft) 86%, #fff 14%);
  border: 1px solid color-mix(in srgb, var(--theme-primary) 22%, #d9e6ff 78%);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.appearance-item:last-child {
  margin-bottom: 0;
}

.appearance-item button {
  position: relative;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--theme-primary) 24%, #d9e6ff 76%);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,251,255,.9));
  font-size: 12px;
  color: #1e293b;
  padding: 9px 10px 9px 30px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
  transition: border-color .2s ease, background-color .2s ease, transform .18s ease, box-shadow .2s ease, color .2s ease;
}

.appearance-item button:hover {
  border-color: var(--theme-primary);
  background: linear-gradient(180deg, color-mix(in srgb, var(--theme-soft) 78%, #fff 22%), color-mix(in srgb, var(--theme-soft) 56%, #fff 44%));
  color: var(--theme-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, .12);
}

.appearance-item button:active {
  transform: translateY(0) scale(.985);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .09);
}

.appearance-item button[data-role]::before {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  text-align: center;
  color: var(--theme-primary-dark);
  background: linear-gradient(180deg, var(--theme-primary-dark), var(--theme-primary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 8px color-mix(in srgb, var(--theme-primary) 35%, transparent);
  opacity: .96;
  font-size: 12px;
  line-height: 1;
  transition: text-shadow .2s ease, filter .2s ease, opacity .2s ease;
}

.appearance-item button[data-role="theme"]::before {
  content: "◉";
}

.appearance-item button[data-role="icon"]::before {
  content: "✦";
}

.appearance-item button[data-role="motion"]::before {
  content: "↻";
}

.appearance-item button:hover[data-role]::before {
  text-shadow: 0 0 10px color-mix(in srgb, var(--theme-primary) 52%, transparent);
  filter: saturate(1.08);
}

@media (max-width: 768px) {
  .appearance-panel {
    right: 8px;
    bottom: 10px;
  }
  .appearance-body { width: 184px; }
}

/* title/back-link theme icons for list/detail pages */
.title-theme-icon {
  display: inline-block;
  width: 1.2em;
  margin-right: 4px;
  text-align: center;
  color: var(--theme-primary, #2f9cdc);
}

.back-link-icon {
  margin-right: 4px;
  color: var(--theme-primary, #2f9cdc);
}

/* simple image lightbox */
.img-lightbox-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10050;
  padding: 20px;
  box-sizing: border-box;
}

.img-lightbox-mask.show {
  display: flex;
}

.img-lightbox-img {
  max-width: min(1100px, 94vw);
  max-height: 88vh;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  background: #fff;
}

.img-lightbox-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: 0;
  background: rgba(255,255,255,.16);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  cursor: pointer;
  font-size: 18px;
  line-height: 34px;
}

