:root {
  /* 浅色底 + 高对比文字；画面区单独用深色，视频内容不刺眼 */
  --bg: #f5f7fa;
  --bg-soft: #ffffff;
  --bg-raised: #eef1f7;
  --line: #e2e7ef;
  --text: #16202b;
  --text-dim: #64707f;
  --accent: #2f6fed;
  --accent-soft: #e8f0ff;
  --danger: #dc3a30;
  --ok: #17a05a;
  --radius: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(16, 32, 56, 0.05);
  --shadow-md: 0 10px 28px rgba(16, 32, 56, 0.09);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* ------------------------------- 顶栏 ------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.brand span {
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 0;
}

.spacer {
  flex: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  background: var(--bg-raised);
}

.badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa5b2;
}

.badge.live {
  color: #b3261e;
  border-color: #f2c6c1;
  background: #fff1f0;
}

.badge.live::before {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 58, 48, 0.14);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

/* 首页的「服务在线」徽章：绿色，不闪烁 */
.badge.ok {
  color: #157347;
  border-color: #bfe6cd;
  background: #ecf9f1;
}

.badge.ok::before {
  background: var(--ok);
}

/* ------------------------------- 按钮 ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s, background 0.15s, border-color 0.15s;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn.ghost:hover:not(:disabled) {
  background: var(--bg-raised);
}

.btn.danger {
  background: var(--danger);
}

.btn.block {
  width: 100%;
}

/* ------------------------------- 布局 ------------------------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  padding: 16px;
  height: calc(100% - 52px);
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* 画面区：浅色留白，等对方推送画面后由 canvas 铺满 */
.stage-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 120% at 50% 0%, #ffffff, #eaeff6 70%),
    var(--bg-raised);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stage-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.stage-wrap.has-frame canvas {
  display: block;
}

.stage-wrap #annotations {
  z-index: 2;
}

.placeholder {
  position: relative;
  z-index: 3;
  max-width: 420px;
  padding: 24px;
  text-align: center;
  color: #6b7887;
}

/* 已经有画面后再显示提示（对方停止共享、连接断开等）时，要盖住最后一帧 */
.stage-wrap.has-frame .placeholder {
  padding: 18px 22px;
  border: 1px solid #dde4ee;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 20px rgba(16, 32, 56, 0.1);
}

.stage-wrap.has-frame .placeholder h2 {
  font-size: 15px;
}

.placeholder h2 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #2b3644;
}

/* ------------------------------- 侧栏 ------------------------------- */

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
  overflow: auto;
}

.panel h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.code-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-box output {
  flex: 1;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  font: 600 22px/1.2 var(--mono);
  letter-spacing: 4px;
  text-align: center;
  color: var(--text);
  background: #f7f9fc;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  color: var(--text-dim);
}

input[type='text'],
input[type='password'] {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type='text']:hover,
input[type='password']:hover {
  border-color: #ccd6e3;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.14);
}

.hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.stat {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
}

.stat b {
  display: block;
  font: 600 18px/1.3 var(--mono);
}

.stat span {
  font-size: 12px;
  color: var(--text-dim);
}

/* 独占一行的统计块（如分辨率），数字更长 */
.stat.wide {
  grid-column: 1 / -1;
}

.stat.wide b {
  font-size: 15px;
  letter-spacing: 0.5px;
}

/* -------------------------------- 分段选择 -------------------------------- */

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-raised);
}

.segmented button {
  padding: 8px 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button[aria-pressed='true'] {
  background: var(--bg-soft);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(16, 32, 56, 0.08), inset 0 0 0 1px var(--line);
}

/* ------------------------------- 列表页 ------------------------------- */

.session-list {
  display: grid;
  gap: 10px;
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 16px;
}

.session-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.16s, border-color 0.16s;
}

.session-card:hover {
  border-color: #d3dded;
  box-shadow: var(--shadow-md);
}

.session-main {
  flex: 1;
  min-width: 0;
}

.session-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font: 600 15px/1.4 var(--mono);
  letter-spacing: 1px;
}

.session-meta {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

.session-card .btn {
  flex: none;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 58, 48, 0.14);
}

.empty-state {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-dim);
}

.empty-state h2 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--text);
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

.share-warning {
  padding: 10px 12px;
  border: 1px solid #f3c9c3;
  border-radius: 9px;
  background: #fff4f2;
  color: #a8332b;
  font-size: 12px;
  line-height: 1.7;
}

/* ------------------------------ 站点首页 ------------------------------ */

/* 首页用更冷一点的浅灰 + 蓝绿光晕，工具页保持中性 */
.home-page {
  --bg: #f6f8fb;
  --bg-soft: #ffffff;
  --bg-raised: #eef2f8;
  --line: #e3e9f2;
  --text: #131c26;
  --text-dim: #64707f;

  min-height: 100%;
  /* 装饰层偶尔会探出视口，这里兜住横向滚动 */
  overflow-x: clip;
  background:
    radial-gradient(760px 420px at 50% -200px, rgba(47, 111, 237, 0.14), transparent 70%),
    radial-gradient(520px 320px at 92% 0%, rgba(23, 160, 90, 0.07), transparent 72%),
    var(--bg);
}

/* 科技网格：只在页面上半部可见，极慢地漂移 */
.home-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(19, 28, 38, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(19, 28, 38, 0.055) 1px, transparent 1px);
  background-size: 52px 52px;
  -webkit-mask-image: radial-gradient(110% 72% at 50% 0%, #000 6%, transparent 74%);
  mask-image: radial-gradient(110% 72% at 50% 0%, #000 6%, transparent 74%);
  pointer-events: none;
}

/* 缓慢流动的蓝绿光晕，给浅底一点纵深 */
.home-page::after {
  content: '';
  position: fixed;
  inset: -12% 0 auto 0;
  height: 130vh;
  z-index: 0;
  background:
    radial-gradient(38% 32% at 20% 10%, rgba(47, 111, 237, 0.16), transparent 70%),
    radial-gradient(32% 28% at 82% 4%, rgba(23, 160, 90, 0.13), transparent 70%),
    radial-gradient(28% 26% at 62% 26%, rgba(124, 92, 255, 0.1), transparent 70%);
  animation: aurora 32s var(--ease-in-out) infinite alternate;
  pointer-events: none;
}

@keyframes aurora {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(-2.5%, 2%, 0) scale(1.07);
  }
}

/* 顶栏：玻璃质感，左右边距与内容区对齐 */
.home-page .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 62px;
  padding: 0 max(20px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(19, 28, 38, 0.07);
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}

/* 顶栏下沿的一道静态渐变分隔 */
.home-page .topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(47, 111, 237, 0.35),
    rgba(23, 160, 90, 0.28),
    transparent
  );
  pointer-events: none;
}

.home-page .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
}

.home-page .brand span {
  margin-left: 0;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.brand-logo {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.home-wrap {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 内容不足一屏时把页脚压到底部 */
.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* body 变成 flex 容器后，auto margin 会让子项收缩成内容宽度，这里显式撑满 */
.home-page .home-wrap,
.home-page .home-foot {
  width: 100%;
}

.home-page .home-wrap {
  flex: 1;
  padding-bottom: 28px;
}

/* 首页工具栏：搜索 + 计数 + 标签筛选。这是页面第一个元素，直接进入工具列表 */
.home-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 18px 0 14px;
}

/* 计数与搜索框之间加一道竖线，避免它孤零零飘在中间 */
.home-bar .count {
  padding-left: 16px;
  border-left: 1px solid rgba(19, 28, 38, 0.1);
}

.home-bar .search {
  flex: 0 1 340px;
  margin-top: 0;
}

.home-bar .search input {
  height: 40px;
  font-size: 13.5px;
}

.home-bar .filters {
  margin-left: auto;
}

/* 网格已在 .home-wrap 里对齐，取消通用内边距。
   列宽 240px：宽屏 4 列，首屏就能放下全部工具；
   min(100%, 240px) 保证窄屏不会撑出横向滚动 */
.home-wrap .tool-grid {
  padding: 0;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}

@media (max-width: 720px) {
  .home-bar .search {
    flex: 1 1 100%;
  }

  .home-bar .count {
    padding-left: 0;
    border-left: 0;
  }

  .home-bar .filters {
    margin-left: 0;
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  gap: 48px;
  padding: 74px 0 50px;
}

/* 右侧大 logo：光晕 + 轻微浮动，纯装饰 */
.hero-mark {
  position: relative;
  justify-self: center;
  width: 220px;
  height: 220px;
}

.hero-mark::before {
  content: '';
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 111, 237, 0.2), transparent 68%);
  filter: blur(8px);
  animation: breathe 8s var(--ease-in-out) infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

/* 环绕 logo 的轨道：一道虚线 + 一段渐变彗尾 */
.orbit {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.orbit-a {
  inset: -14%;
  border: 1px dashed rgba(47, 111, 237, 0.3);
  animation: spin 28s linear infinite;
}

.orbit-a::after {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #2f6fed;
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.14), 0 0 14px rgba(47, 111, 237, 0.6);
}

.orbit-b {
  inset: -28%;
  background: conic-gradient(
    from 0deg,
    rgba(47, 111, 237, 0) 0 66%,
    rgba(47, 111, 237, 0.5) 84%,
    rgba(23, 160, 90, 0.42) 92%,
    rgba(47, 111, 237, 0) 100%
  );
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
  mask: radial-gradient(closest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hero-mark img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-5deg);
  filter: drop-shadow(0 18px 34px rgba(16, 32, 56, 0.16));
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 5px 12px 5px 10px;
  border: 1px solid #e4ebf5;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: #5b6877;
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 1.8px;
}

.hero-eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(23, 160, 90, 0.14);
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  color: #0f1822;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1.18;
  font-weight: 650;
  letter-spacing: -1.2px;
}

.hero-accent {
  color: var(--accent);
}

.hero-sub {
  max-width: 560px;
  margin: 16px 0 0;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.85;
}

.hero-sub code,
.home-foot code {
  padding: 1px 6px;
  border: 1px solid #e0e7f1;
  border-radius: 5px;
  background: #eef2f8;
  color: #2a3541;
  font: 12px/1.7 var(--mono);
}

/* 搜索框 */
.search {
  position: relative;
  max-width: 540px;
  margin-top: 30px;
}

.search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  color: #93a0b0;
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 50px;
  padding: 0 54px 0 44px;
  border: 1px solid #e0e7f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder {
  color: #98a4b2;
}

.search input:hover {
  border-color: #cfd9e6;
}

.search input:focus {
  border-color: rgba(47, 111, 237, 0.55);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.13);
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 22px;
  padding: 2px 6px;
  border: 1px solid #e2e8f1;
  border-radius: 6px;
  background: #f5f8fc;
  color: #7c8896;
  font: 11px/1.4 var(--mono);
  text-align: center;
}

/* 头图统计 */
.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  color: #6c7a89;
  font-size: 12px;
}

.hero-meta b {
  color: #27333f;
  font: 600 12.5px/1 var(--mono);
}

.meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c3ccd8;
}

/* 清单区 */
.catalog {
  padding-bottom: 8px;
}

.catalog-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 0 16px;
  border-top: 1px solid rgba(19, 28, 38, 0.08);
}

.catalog-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.count {
  color: #7a8794;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.filter-chip {
  padding: 5px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #eef2f8;
  color: #5b6877;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}

.filter-chip:hover {
  background: #e5ebf4;
  color: var(--text);
}

.filter-chip[aria-pressed='true'] {
  border-color: rgba(47, 111, 237, 0.3);
  background: var(--accent-soft);
  color: #1d55c4;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* 首页的网格已经在 .home-wrap 里对齐，不再额外留白 */
.catalog .tool-grid {
  padding: 0;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e5ebf3;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition:
    transform 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out);
}

/* 悬停时从左上角透出的品牌色雾面 */
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(90% 70% at 0% 0%, rgba(47, 111, 237, 0.07), transparent 62%);
  opacity: 0;
  transition: opacity 180ms var(--ease-out);
  pointer-events: none;
}

.tool-card.is-clickable {
  cursor: pointer;
}

/* 颜色/阴影反馈走常规 hover；位移只在真正的指针设备上生效 */
.tool-card:hover {
  border-color: rgba(47, 111, 237, 0.32);
  box-shadow: 0 12px 28px rgba(16, 32, 56, 0.1);
}

@media (hover: hover) and (pointer: fine) {
  .tool-card:hover {
    transform: translateY(-2px);
  }
}

.tool-card:hover::before {
  opacity: 1;
}



.tool-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

/* 每个工具的 logo：工具自带的 48×48 app 图标，居中裁进圆角方块 */
.tool-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(
    155deg,
    hsl(var(--h, 216) 48% 44%),
    hsl(calc(var(--h, 216) + 26) 46% 30%)
  );
  box-shadow: 0 3px 9px rgba(16, 32, 56, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: #fff;
  font: 600 16px/1 var(--mono);
}

.tool-icon img {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .tool-card:hover .tool-icon img {
    transform: scale(1.04);
  }
}

.tool-card-info {
  flex: 1;
  min-width: 0;
}

.tool-card h2,
.tool-card h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.1px;
}

.tool-card h3 a {
  color: var(--text);
  transition: color 0.16s;
}

.tool-card:hover h3 a {
  color: var(--accent);
}

.tool-arrow {
  display: inline-block;
  margin-left: 6px;
  color: #9aa6b4;
  font-size: 12px;
  opacity: 0;
  transform: translate(-2px, 2px);
  transition:
    opacity 150ms var(--ease-out),
    transform 150ms var(--ease-out),
    color 150ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .tool-card:hover .tool-arrow {
    opacity: 1;
    transform: none;
    color: var(--accent);
  }
}

/* 兼容模板页里的普通段落；下面两条更具体的规则会覆盖它 */
.tool-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.75;
}

.tool-meta {
  margin: 2px 0 0;
  color: #7a8794;
  font-size: 11px;
  letter-spacing: 0.2px;
}

.tool-desc {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  color: #5c6876;
  font-size: 12.5px;
  line-height: 1.5;
}

.tool-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
}

.tool-card-actions .btn {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 9px;
}

/* 卡片里的次要按钮在浅底上要更清楚一点 */
.home-page .btn.ghost {
  border-color: #e0e7f1;
  background: #fff;
  color: #38434f;
}

.home-page .btn.ghost:hover {
  border-color: #cfd9e6;
  background: #f5f8fc;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e7ecf3;
  background: #f5f8fc;
  font: inherit;
  font-size: 10.5px;
  color: #63707e;
}

button.tag {
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

button.tag:hover {
  border-color: rgba(47, 111, 237, 0.3);
  background: var(--accent-soft);
  color: #1d55c4;
}

/* 首页骨架屏 */
.skeleton-card {
  position: relative;
  height: 186px;
  border: 1px solid #e7edf5;
  border-radius: 16px;
  background: #eef2f8;
  overflow: hidden;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

/* 首页页脚 */
.home-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 20px 48px;
  border-top: 1px solid rgba(19, 28, 38, 0.08);
  color: #7a8794;
  font-size: 12px;
}

.foot-logo {
  width: 16px;
  height: 16px;
  display: block;
  opacity: 0.7;
}

/* 备案号：工信部要求放在首页底部，链到备案管理系统 */
.foot-icp {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.foot-icp:hover {
  color: var(--accent);
  border-bottom-color: currentColor;
}

.foot-dot {
  color: #c3ccd8;
}

/* ------------------------------- 工具栏 ------------------------------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fc;
}

.swatch {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.swatch[aria-pressed='true'] {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(22, 32, 43, 0.35);
}

/* ------------------------------- Toast ------------------------------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 10px;
  background: #1c2530;
  border: 1px solid #2b3541;
  color: #f3f6fa;
  font-size: 13px;
  box-shadow: 0 12px 28px rgba(16, 32, 56, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 99;
}

#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

#toast[data-variant='error'] {
  border-color: #b3261e;
  background: #b3261e;
  color: #fff;
}

/* 容器贴到视口边缘时，右侧装饰会顶出横向滚动，直接收成单列 */
@media (max-width: 1160px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero-mark {
    display: none;
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 44px 0 30px;
  }

  .hero h1 {
    letter-spacing: -0.6px;
  }

  .catalog-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters {
    margin-left: 0;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }
}

/* 减少动态效果：停掉循环动效和位移，保留颜色/阴影这类帮助理解的反馈 */
@media (prefers-reduced-motion: reduce) {
  .home-page::after,
  .hero-mark::before,
  .orbit-a {
    animation: none;
  }

  .tool-card:hover,
  .tool-card:hover .tool-icon img,
  .tool-card:hover .tool-arrow {
    transform: none;
  }

  .tool-icon img {
    transition: none;
  }
}