/* 共享外壳：左侧悬浮图标条 + 入口页基础样式。
   两个工具的页面各自保留原有内联样式，本文件只负责外壳，不改动它们的任何规则。
   变量统一用 --shell-* 前缀，避免覆盖各工具页面自己的 --bg / --text 等变量。 */

:root {
  color-scheme: dark;
  --shell-bg: #0d0f11;
  --shell-panel: #171a1d;
  --shell-line: #2a2d31;
  --shell-line-soft: #23262a;
  --shell-text: #e7e8e6;
  --shell-muted: #9ca2a7;
  --shell-faint: #6f757b;
  --shell-tone: #e8b386;
  --shell-lut: #b4ed78;
  --shell-rail-w: 78px;
  --shell-scale: 1.25;
  /* 与两个工具页的 --page-gutter 完全一致，保证左右边线对齐 */
  --shell-gutter: clamp(calc(16px * var(--shell-scale)), 4.5vw, calc(78px * var(--shell-scale)));
}

/* 只给读屏用的标题：页面的主标题已在顶栏里视觉呈现，这里补语义 */
.shell-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- 悬浮图标条 ---------- */

.shell-rail {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px;
  background: #14171a;
  background: color-mix(in srgb, #14171a 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid #31353a;
  border-radius: 15px;
  box-shadow: 0 12px 32px #00000073, 0 1px 0 #ffffff0a inset;
  z-index: 60;
}

body {
  padding-left: var(--shell-rail-w);
}

.shell-item {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--shell-muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}

.shell-item svg {
  display: block;
  width: 21px;
  height: 21px;
  overflow: visible;
}

.shell-item:hover {
  background: #24282c;
  color: var(--shell-text);
  text-decoration: none;
}

.shell-item[aria-current="page"] {
  background: #2b2f34;
  color: var(--shell-text);
}

.shell-item[aria-current="page"].tone {
  background: #2f2822;
  color: var(--shell-tone);
}

.shell-item[aria-current="page"].lut {
  background: #262e20;
  color: var(--shell-lut);
}

.shell-sep {
  width: 22px;
  height: 1px;
  background: #34383d;
  margin: 3px 0;
  flex: none;
}

/* 悬停提示：图标条只放图标，名称靠这里补 */

.shell-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 11px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 5px 9px;
  border-radius: 6px;
  background: #22262a;
  border: 1px solid #3a3e43;
  color: var(--shell-text);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s, transform .12s;
}

.shell-item:hover::after,
.shell-item:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.shell-item:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ---------- 窄屏：图标条移到底部居中 ---------- */

@media (max-width: 900px) {
  body {
    padding-left: 0;
    padding-bottom: 74px;
  }

  .shell-rail {
    left: 50%;
    top: auto;
    bottom: 14px;
    transform: translateX(-50%);
    width: auto;
    flex-direction: row;
    padding: 6px;
    gap: 3px;
    border-radius: 14px;
  }

  .shell-item {
    width: 38px;
    height: 38px;
  }

  .shell-item svg {
    width: 20px;
    height: 20px;
  }

  .shell-sep {
    width: 1px;
    height: 20px;
    margin: 0 3px;
  }

  .shell-item::after {
    display: none;
  }
}

/* ---------- 入口页 ---------- */

body.shell-home-page {
  margin: 0;
  background: var(--shell-bg);
  color: var(--shell-text);
  font: 14px -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.shell-home-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: calc(78px * var(--shell-scale));
  padding: 0 var(--shell-gutter);
  border-bottom: 1px solid var(--shell-line);
}

.shell-home-head .shell-brand {
  padding: 0;
  border-bottom: 0;
}

.shell-home-note {
  font-size: 11px;
  letter-spacing: .6px;
  color: var(--shell-faint);
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: calc(11px * var(--shell-scale));
  color: var(--shell-text);
  text-decoration: none;
}

.shell-brand:hover {
  text-decoration: none;
}

.shell-mark {
  width: calc(30px * var(--shell-scale));
  height: calc(30px * var(--shell-scale));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 6px;
  background: #1b1e22;
  border: 1px solid var(--shell-line);
  border-radius: calc(7px * var(--shell-scale));
  flex: none;
}

.shell-mark i {
  display: block;
  border-radius: 1px;
}

.shell-mark i:nth-child(1) {
  background: var(--shell-tone);
}

.shell-mark i:nth-child(2) {
  background: var(--shell-lut);
}

.shell-brand-text strong {
  display: block;
  font-size: calc(15px * var(--shell-scale));
  font-weight: 700;
  letter-spacing: calc(1.6px * var(--shell-scale));
  line-height: 1.2;
}

.shell-brand-text small {
  display: block;
  font-size: calc(9px * var(--shell-scale));
  letter-spacing: calc(1.2px * var(--shell-scale));
  color: var(--shell-faint);
  margin-top: calc(3px * var(--shell-scale));
}

.shell-home-main {
  padding: calc(28px * var(--shell-scale)) var(--shell-gutter) 0;
}

.shell-home-eyebrow {
  font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 2.6px;
  color: var(--shell-faint);
  margin: 0 0 18px;
}

.shell-home-main h1 {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 550;
  letter-spacing: 1px;
  margin: 0 0 14px;
}

.shell-home-lead {
  font-size: 14px;
  line-height: 1.85;
  color: var(--shell-muted);
  margin: 0 0 clamp(30px, 5vw, 52px);
  max-width: 46em;
}

.shell-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 1180px;
}

.shell-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: clamp(22px, 2.4vw, 32px);
  background: #131619;
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  color: var(--shell-text);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: border-color .18s, background .18s, transform .18s;
}

.shell-card::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: currentColor;
  opacity: .55;
}

.shell-card:hover {
  text-decoration: none;
  background: #161a1e;
  transform: translateY(-2px);
}

.shell-card.tone {
  color: var(--shell-tone);
}

.shell-card.tone:hover {
  border-color: #5a4634;
}

.shell-card.lut {
  color: var(--shell-lut);
}

.shell-card.lut:hover {
  border-color: #47562f;
}

.shell-card-no {
  font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 1.4px;
  color: var(--shell-faint);
}

.shell-card-kicker {
  font-size: 9px;
  letter-spacing: 2.2px;
  font-weight: 600;
}

.shell-card strong {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--shell-text);
  margin-top: 2px;
}

.shell-card-slogan {
  font-size: 13.5px;
  line-height: 1.75;
  letter-spacing: .3px;
  color: inherit;
}

.shell-card-desc {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--shell-muted);
}

.shell-card-go {
  margin-top: auto;
  padding-top: 18px;
  font-size: 11px;
  letter-spacing: .5px;
  color: inherit;
}

.shell-card-go i {
  font-style: normal;
  margin-left: 4px;
}

.shell-home-foot {
  display: flex;
  justify-content: center;
  padding: 40px 0 30px;
  font-size: 9px;
  line-height: 1.8;
  color: var(--shell-faint);
}

@media (max-width: 760px) {
  .shell-cards {
    grid-template-columns: 1fr;
  }

  .shell-home-note {
    display: none;
  }

  .shell-home-head {
    height: calc(64px * var(--shell-scale));
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell-card,
  .shell-item {
    transition: none !important;
  }

  .shell-card:hover {
    transform: none;
  }
}
