/* 全站工具全屏（tool-fullscreen.js 配套） */
.fs-launch {
  position: fixed;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 17px;
  border: 1px solid rgba(23, 107, 91, .2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .97);
  color: var(--primary, #176b5b);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(20, 45, 36, .18), 0 2px 6px rgba(20, 45, 36, .08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.fs-launch:hover {
  transform: translateY(-2px);
  background: var(--primary, #176b5b);
  color: #fff;
  box-shadow: 0 14px 32px rgba(23, 107, 91, .3);
}
.fs-launch:focus-visible { outline: 3px solid rgba(23, 107, 91, .35); outline-offset: 2px; }
.fs-launch svg { width: 16px; height: 16px; flex: none; }
.fs-launch::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 1.5px solid rgba(23, 107, 91, .35);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  animation: fsRing 2.4s ease-out .8s 3;
}
.fs-launch.is-on {
  background: var(--primary, #176b5b);
  border-color: var(--primary, #176b5b);
  color: #fff;
}
.fs-launch.is-on:hover { background: var(--primary-dark, #0e5044); }
.fs-launch.is-on::after { display: none; }
@keyframes fsRing {
  0% { opacity: .65; transform: scale(.94); }
  70% { opacity: 0; transform: scale(1.18); }
  100% { opacity: 0; transform: scale(1.18); }
}

/* 全屏中的工具区域 */
[data-fs-root]:fullscreen,
[data-fs-root]:-webkit-full-screen,
[data-fs-root].fs-fallback {
  box-sizing: border-box;
  overflow: auto;
  background: #fff;
  padding: 22px clamp(16px, 4vw, 56px) 92px;
}
[data-fs-root]:fullscreen,
[data-fs-root]:-webkit-full-screen {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  width: 100%;
  height: 100%;
}
[data-fs-root].fs-fallback {
  position: fixed;
  inset: 0;
  z-index: 3500;
  border: 0;
  border-radius: 0;
}
html.fs-lock,
html.fs-lock body { overflow: hidden; }

/* 全屏询问弹窗 */
.fs-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.fs-modal[hidden] { display: none !important; }
html.fs-modal-open,
html.fs-modal-open body { overflow: hidden; }
.fs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 30, 23, .5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fsFade .2s ease-out;
}
.fs-dialog {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  box-sizing: border-box;
  padding: 30px 28px 22px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 22px;
  background: #fff;
  text-align: center;
  box-shadow: 0 34px 90px rgba(6, 22, 16, .38);
  animation: fsPop .3s cubic-bezier(.2, .9, .3, 1.15);
}
.fs-dialog::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background: linear-gradient(90deg, #176b5b, #2fa88f 55%, #9adcc8);
}
.fs-icon {
  width: 66px;
  height: 66px;
  margin: 2px auto 16px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(140deg, #176b5b, #2fa88f);
  color: #fff;
  box-shadow: 0 14px 30px rgba(23, 107, 91, .34);
}
.fs-icon svg { width: 31px; height: 31px; }
.fs-dialog h3 {
  margin: 0 0 8px;
  color: var(--ink, #17251f);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .2px;
}
.fs-dialog p {
  max-width: 330px;
  margin: 0 auto 16px;
  color: var(--muted, #69776f);
  font-size: 13.5px;
  line-height: 1.75;
}
.fs-file {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin: 0 auto 18px;
  padding: 7px 13px;
  border-radius: 999px;
  background: #f2f7f4;
  color: var(--ink-2, #3d4d46);
  font-size: 12.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-file[hidden] { display: none !important; }
.fs-file i {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: #2fa88f;
}
.fs-actions { display: flex; flex-direction: column; gap: 8px; }
.fs-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 47px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #176b5b, #229078);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(23, 107, 91, .3);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.fs-primary:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 14px 28px rgba(23, 107, 91, .36); }
.fs-primary:active { transform: translateY(0); }
.fs-primary svg { width: 17px; height: 17px; }
.fs-secondary {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted, #69776f);
  font-size: 13.5px;
  cursor: pointer;
}
.fs-secondary:hover { background: #f1f5f3; color: var(--ink-2, #3d4d46); }
.fs-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9aa69f;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.fs-x:hover { background: #f1f4f2; color: var(--ink-2, #3d4d46); }
.fs-dialog button:focus-visible,
.fs-dialog label:focus-visible,
.fs-dialog input:focus-visible {
  outline: 3px solid rgba(23, 107, 91, .35);
  outline-offset: 2px;
}
.fs-remember {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  color: #8a968f;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.fs-remember input { width: 14px; height: 14px; margin: 0; accent-color: var(--primary, #176b5b); }
@keyframes fsFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fsPop {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fsUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .fs-launch {
    right: 14px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    padding: 10px 14px;
    font-size: 13px;
  }
  .fs-modal { align-items: flex-end; padding: 0; }
  .fs-dialog {
    width: 100%;
    max-height: 90vh;
    padding: 26px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    animation-name: fsUp;
  }
  .fs-icon { width: 58px; height: 58px; border-radius: 18px; margin-bottom: 14px; }
  .fs-icon svg { width: 27px; height: 27px; }
  .fs-dialog h3 { font-size: 18.5px; }
  .fs-dialog p { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .fs-launch, .fs-launch::after, .fs-backdrop, .fs-dialog { animation: none !important; transition: none !important; }
}
