/* ========== 基础与主题（Pure Black + Tech Controls 2px） ========== */
:root {
  --primary: #38bdf8;
  --primary-dark: #0ea5e9;
  --primary-light: rgba(56, 189, 248, 0.08);
  --bg: #000000;
  --card-bg: #111318;
  --editor-bg: #0b0d10;
  --text: #f0f4f8;
  --text-sub: #7a8da8;

  /* 三级描边（2px）：常态 / hover / focus */
  --stroke-n: rgba(56, 189, 248, 0.28);
  --stroke-h: rgba(56, 189, 248, 0.55);
  --stroke-f: rgba(56, 189, 248, 0.90);
  --glow-f: inset 0 0 6px rgba(56, 189, 248, 0.22);

  /* 切角 */
  --cut: 4px;
  --cut-lg: 6px;
  --cutpath: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  --cutpath-lg: polygon(var(--cut-lg) 0, 100% 0, 100% calc(100% - var(--cut-lg)), calc(100% - var(--cut-lg)) 100%, 0 100%, 0 var(--cut-lg));

  /* 扫光亮带（白青渐变窄带，峰值 ≤0.35） */
  --sweep: linear-gradient(115deg, transparent 46%, rgba(150, 220, 255, 0.25) 50%, transparent 54%);
  --sweep-light: linear-gradient(115deg, transparent 46%, rgba(255, 255, 255, 0.30) 50%, transparent 54%);
}

/* 扫光关键帧：hover 扫一次 / 焦点元素缓慢循环 */
@keyframes tf-sweep {
  from { background-position: 140% 140%; }
  to   { background-position: -40% -40%; }
}
@keyframes tf-sweep-loop {
  0%   { background-position: 140% 140%; }
  20%  { background-position: -40% -40%; }
  100% { background-position: -40% -40%; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  /* 先给字面量再覆盖变量：老内核不支持 CSS 变量时仍是纯黑底 + 近白字 */
  background: #000000;
  background: var(--bg);
  color: #f0f4f8;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* =========================================================
 * 公共切角描边体系（.tf 模式，纯 CSS 选择器分组实现）
 * ::before = 2px 描边层（切角处连续）
 * ::after  = 填充层（inset 2px，承载扫光亮带，随父级 clip-path 裁剪）
 * ========================================================= */
.hero-tag, .hero-search, .tool-card, .local-tip, .now-item,
.btn, .btn-back, .back-top, .toast, .auth-card, .auth-submit,
.btn-auth.primary, .btn-auth.ghost, .category-list li, .recent-item {
  position: relative;
  z-index: 0;
  border: none;
  background: none;
  clip-path: var(--tf-clip, var(--cutpath));
}
.hero-tag::before, .hero-search::before, .tool-card::before,
.local-tip::before, .now-item::before, .btn::before, .btn-back::before,
.back-top::before, .toast::before, .auth-card::before, .auth-submit::before,
.btn-auth.primary::before, .btn-auth.ghost::before,
.category-list li::before, .recent-item::before {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background: var(--tf-stroke, var(--stroke-n));
  transition: background 0.15s;
}
.hero-tag::after, .hero-search::after, .tool-card::after,
.local-tip::after, .now-item::after, .btn::after, .btn-back::after,
.back-top::after, .toast::after, .auth-card::after, .auth-submit::after,
.btn-auth.primary::after, .btn-auth.ghost::after,
.category-list li::after, .recent-item::after {
  content: "";
  position: absolute; inset: 2px; z-index: -1;
  background-color: var(--tf-fill, var(--card-bg));
  background-image: var(--tf-sweep-img, var(--sweep));
  background-repeat: no-repeat;
  background-size: 300% 300%;
  background-position: 140% 140%; /* 扫光带停靠在控件外 */
}

/* hover 扫一次：工具卡片（仅 online 的 a 卡）、分类条目、按钮 */
a.tool-card:hover::after,
.category-list li:hover::after,
.btn:hover::after, .btn-back:hover::after,
.btn-auth.ghost:hover::after, .auth-submit:hover::after,
.back-top:hover::after {
  animation: tf-sweep 1.1s ease-out both;
}

/* ========== 顶部导航 ========== */
.topbar {
  background: #000000;
  color: #eaf2ff;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--stroke-n);
}
.topbar-inner { display: flex; align-items: center; height: 56px; gap: 28px; }

.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: 1px; }

.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a {
  padding: 6px 14px; font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.15s, color 0.15s;
}
.topnav a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.topnav a.active { background: rgba(255, 255, 255, 0.18); color: #fff; font-weight: 600; }

.top-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* 顶栏按钮 */
.btn-auth {
  padding: 7px 20px;
  font-size: 13px; cursor: pointer; font-weight: 600;
  font-family: inherit;
  transition: color 0.15s;
}
.btn-auth.primary { --tf-fill: var(--primary); color: #000; }
.btn-auth.primary:hover::after { background-color: var(--primary-dark); }
/* 主按钮：极缓慢循环扫光（焦点元素 1/2） */
.btn-auth.primary::after {
  --tf-sweep-img: var(--sweep-light);
  animation: tf-sweep-loop 9s ease-in-out infinite;
}
.btn-auth.ghost { --tf-fill: transparent; --tf-stroke: rgba(200, 220, 255, 0.55); color: #fff; }
.btn-auth.ghost:hover::before { background: rgba(230, 242, 255, 0.85); }

/* ========== Hero 主视觉（背景视频 + 遮罩 + 纯黑降级） ========== */
.hero {
  position: relative;
  padding: 28px 0 32px;
  background: #000000;
  text-align: center;
  overflow: hidden;
}
/* 背景视频层：默认可见（opacity:1），不依赖 JS 才显示；
   未出首帧时由自身黑底兜底，任何内核都不会出现白块/透明块。
   素材缺失或解码失败时由 JS 加 .is-failed 隐藏整个层，Hero 回到纯黑。 */
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  background: #000;
  opacity: 1;
  /* 提亮视频并稍增对比，保守值避免过曝/死黑 */
  filter: brightness(1.2) contrast(1.1) saturate(1.02);
}
.hero-video.is-failed { display: none; }
/* 压暗遮罩整体减淡，让画面真正透出来 */
.hero-overlay {
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.40) 0%,
    rgba(0, 0, 0, 0.10) 45%,
    rgba(0, 0, 0, 0.45) 100%
  );
}
/* 局部压暗：只在 Hero 文案与搜索框背后加一块羽化的深色椭圆，
   替代全屏压暗，保证亮部视频也能透出 */
.hero-inner::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  height: 78%;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(0, 0, 0, 0.18) 45%,
    rgba(0, 0, 0, 0) 75%
  );
  z-index: -1;
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 2; }

/* 文案可读性：轻微深色投影，亮部视频帧上也清晰 */
.hero-tag,
.hero-title,
.hero-desc { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.65); }

.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  color: var(--text-sub);
  font-size: 12px; letter-spacing: 1px;
  margin-bottom: 12px;
}
.hero-tag .dot { color: var(--primary); font-size: 10px; }

.hero-title {
  color: var(--text); font-size: 40px; font-weight: 800; letter-spacing: 1px;
  margin-bottom: 6px;
}
.hero-title .hl { color: var(--primary); }
.hero-desc { color: var(--text-sub); font-size: 14px; margin-bottom: 14px; }

/* 搜索框：首屏视觉焦点 —— 3px 亮青描边 + 深底毛玻璃 + 落影 + 缓动扫光 */
.hero-search {
  --tf-clip: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  --tf-stroke: rgba(56, 189, 248, 0.65);   /* 3px 常态亮青描边 */
  --tf-fill: rgba(8, 12, 20, 0.92);        /* 深底，压在视频上仍实体 */
  display: flex; align-items: stretch;
  max-width: 680px; height: 54px; margin: 0 auto;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(56, 189, 248, 0.22);
  transition: box-shadow 0.2s;
}
/* 3px 描边（共享 ::after 默认 inset:2px，这里覆盖为 3px） */
.hero-search::after { inset: 3px; backdrop-filter: blur(6px); }
/* 扫光从输入面移到填充层 ::after，避免糊掉文字 */
.hero-search::after { animation: tf-sweep-loop 9s ease-in-out infinite; }
/* 聚焦：全亮描边 + 外层柔和青色光晕（≤0.35） */
.hero-search:focus-within {
  --tf-stroke: rgba(56, 189, 248, 0.95);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(56, 189, 248, 0.5),
    0 0 18px rgba(56, 189, 248, 0.35);
}

/* 左侧放大镜图标 */
.hero-search .search-icon {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  z-index: 2; color: rgba(186, 205, 228, 0.92);
  pointer-events: none; display: flex; align-items: center;
}

.hero-search input {
  flex: 1; position: relative; z-index: 1;
  height: 100%; padding: 0 18px 0 46px;
  border: none; outline: none; font-size: 16px;
  background: transparent;   /* 透出 ::after 的深底+毛玻璃+扫光 */
  color: var(--text);
  overflow: hidden; white-space: nowrap;
}
.hero-search input::placeholder { color: rgba(180, 195, 215, 0.82); }

/* 搜索按钮：青色实心块，比输入区更亮 */
.hero-search button {
  flex-shrink: 0; width: 100px; border: none; cursor: pointer;
  background: var(--primary); color: #06090f;
  font-size: 15px; font-weight: 700; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.18s, filter 0.18s;
}
.hero-search button:hover { background: #7dd3fc; }
.hero-search button:active { filter: brightness(0.92); }

/* ========== 主体布局 ========== */
.layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding-top: 24px;
  padding-bottom: 48px;
  align-items: start;
}

.sidebar { position: sticky; top: 76px; }

/* ========== 分类栏 ========== */
.category-list {
  /* 字面量兜底：老内核无 CSS 变量时面板与描边仍在 */
  background: #111318;
  background: var(--card-bg);
  border: 2px solid rgba(56, 189, 248, 0.28);
  border-color: var(--stroke-n);
  padding: 10px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.3) transparent;
  transition: border-color 0.15s;
}
.category-list:hover { border-color: var(--stroke-h); }
.category-list::-webkit-scrollbar { width: 6px; }
.category-list::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, 0.25); }
.category-list::-webkit-scrollbar-thumb:hover { background: rgba(56, 189, 248, 0.45); }
.category-list li {
  padding: 9px 13px; cursor: pointer;
  color: var(--text-sub); font-size: 14px;
  margin-bottom: 3px;
  display: flex; align-items: center; gap: 11px;
  transition: color 0.15s;
}
.category-list li:hover { color: var(--primary); }
.category-list li:hover::before { background: var(--stroke-h); }
.category-list li:hover::after { background-color: var(--primary-light); }
.category-list li.active { color: #06090f; font-weight: 700; }
.category-list li.active::after { background-color: var(--primary); }
.category-list li .count { display: none; } /* 已不再输出数量角标，保留规则以防旧数据 */

/* 分类图标：内联 SVG 线条图标，currentColor 跟随状态取色 */
.category-list li .cat-icon {
  width: 19px; height: 19px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(186, 205, 228, 0.9);
  transition: color 0.15s;
}
.category-list li .cat-icon svg {
  width: 100%; height: 100%; display: block;
}
.category-list li .cat-name { line-height: 1; }
.category-list li:hover .cat-icon { color: var(--primary); }
.category-list li.active .cat-icon { color: #06090f; }

/* 内容头部 */
.content-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; margin-bottom: 20px;
}
/* ========== 图片轮播（原留白区域） ========== */
/* 2px 描边用「外层底色 + 内层裁剪」实现：clip-path 失效时仍有 2px 边环 */
.carousel {
  position: relative;
  z-index: 0;
  flex: 1;
  min-width: 0;
  padding: 2px;
  background: rgba(56, 189, 248, 0.28);
  background: var(--stroke-n);
  clip-path: var(--cutpath);
  transition: background 0.15s;
}
.carousel:hover { background: var(--stroke-h); }
.carousel:focus-within { background: var(--stroke-f); }
.carousel-viewport {
  position: relative;
  overflow: hidden;
  background: #050506;
  clip-path: var(--cutpath);
}
.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
  will-change: transform;
}
/* 循环复位时瞬时切换（不播过渡） */
.carousel-track.no-anim { transition: none; }
.carousel-slide { flex: 0 0 100%; width: 100%; }
.carousel-slide img {
  display: block; width: 100%; height: auto;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
/* 箭头：半透明黑底 + 白箭头，任何画面上都可见；触控目标 38px */
.carousel-arrow {
  position: absolute; top: 50%;
  width: 38px; height: 38px;
  margin-top: -19px;
  border: none; cursor: pointer;
  background: rgba(0, 0, 0, 0.55);
  color: #fff; font-size: 22px; line-height: 1;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
  transition: background 0.15s;
}
.carousel-arrow:hover { background: rgba(0, 0, 0, 0.8); }
.carousel-arrow.prev { left: 8px; }
.carousel-arrow.next { right: 8px; }
/* 圆点指示器 */
.carousel-dots {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; justify-content: center; gap: 7px;
  z-index: 3;
}
.carousel-dot {
  width: 9px; height: 9px; padding: 0;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.carousel-dot.active { background: var(--primary); border-color: var(--primary); }

/* ========== 翻页时钟（flip clock，黑白灰阶，独立于青色体系） ========== */
.clock-box {
  text-align: center; flex-shrink: 0;
  background: #0a0a0c;
  border: 2px solid #2b2b30;
  padding: 12px 12px 10px;
  display: inline-block;
  transition: border-color 0.15s;
  clip-path: var(--cutpath);
}
.clock-box:hover { border-color: #4a4a52; }

.clock {
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  font-size: 24px;
  font-variant-numeric: tabular-nums; /* 等宽数字防抖动 */
}

/* 单个数字位：4 层分瓣（静态上 / 静态下 / 翻转上 / 翻转下） */
.fc {
  position: relative;
  display: inline-block;
  width: 1.12em;
  height: 1.62em;
  perspective: 320px;
  font-family: "Helvetica Neue", Arial, "PingFang SC", sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* 半瓣：overflow 裁出上/下半个数字（不用 clip-path，老内核也能分瓣） */
.fc-half {
  position: absolute; left: 0;
  width: 100%; height: 50%;
  overflow: hidden;
  background: #101013;
  box-shadow: inset 0 0 0 1px #2b2b30;
}
.fc-top { top: 0; z-index: 1; }
.fc-bottom { bottom: 0; z-index: 1; }
.fc-flap-top { top: 0; z-index: 4; transform-origin: 50% 100%; }
.fc-flap-bottom { bottom: 0; z-index: 3; transform-origin: 50% 0; }
.fc-flap-top, .fc-flap-bottom {
  visibility: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
/* 数字：占满整卡高度，下半瓣用 -100% 上移对准 */
.fc-num {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 1.62em;
  line-height: 1.62em;
  text-align: center;
  color: #f4f4f6;
  font-size: 1em;
}
.fc-bottom .fc-num,
.fc-flap-bottom .fc-num { top: -100%; }

/* 翻页动画：上瓣绕中线向前翻下，下瓣从 90° 翻起 */
@keyframes fc-flip-top {
  from { transform: rotateX(0deg); }
  to   { transform: rotateX(-90deg); }
}
@keyframes fc-flip-bottom {
  from { transform: rotateX(90deg); }
  to   { transform: rotateX(0deg); }
}
.fc.flipping .fc-flap-top {
  visibility: visible;
  animation: fc-flip-top 0.5s cubic-bezier(0.36, 0.07, 0.24, 1) forwards;
}
.fc.flipping .fc-flap-bottom {
  visibility: visible;
  animation: fc-flip-bottom 0.55s cubic-bezier(0.36, 0.07, 0.24, 1) forwards;
}
/* 中缝：1px 深色线 + 极淡高光，落在从上瓣之上 */
.fc-seam {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 2px; margin-top: -1px;
  background: #000;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
  z-index: 6;
}

/* 冒号分隔符：上下两个小方点（静态，不翻） */
.clock-sep {
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 1px;
}
.clock-sep .dp {
  width: 4px; height: 4px;
  background: #e6e6ea;
  opacity: 0.8;
}

.clock-date {
  margin-top: 10px;
  font-size: 11px;
  color: #8a8a92;
  font-family: inherit;
  letter-spacing: 0.5px;
}

/* 分区标题 */
.section-title {
  font-size: 18px; font-weight: 700;
  padding-bottom: 8px; margin-bottom: 18px;
  border-bottom: 2px solid rgba(56, 189, 248, 0.28);
  border-bottom-color: var(--stroke-n);
  position: relative;
  color: var(--text);
}
.section-title::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 56px; height: 2px; background: var(--primary);
}

/* ========== 工具卡片网格 ========== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* 工具卡片：2px 连续切角描边 + hover 描边提亮 + 扫光一次 */
.tool-card {
  --tf-clip: var(--cutpath-lg);
  display: block;
  padding: 24px 20px 18px;
}
a.tool-card:hover::before { background: var(--stroke-h); }
a.tool-card:hover::after { background-color: #141820; }
.tool-card.soon { opacity: 0.92; cursor: default; }

.tool-icon {
  width: 52px; height: 52px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  background: var(--primary-light);
  border: 2px solid var(--stroke-n);
  clip-path: var(--cutpath);
}
.tool-name { font-size: 15px; font-weight: 700; text-align: center; margin-bottom: 6px; color: #ffffff; }
.tool-desc {
  font-size: 12px; color: var(--text-sub); text-align: center;
  height: 36px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tool-path { margin-top: 10px; text-align: center; font-size: 12px; color: rgba(120, 160, 210, 0.55); font-family: Consolas, monospace; }

.tool-badge {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  font-size: 11px; padding: 2px 8px;
  background: #0d1119; color: var(--text-sub);
  border: 2px solid var(--stroke-n);
  clip-path: var(--cutpath);
}
.tool-badge.hot { background: rgba(250, 180, 60, 0.12); color: #ffc255; border-color: rgba(255, 194, 85, 0.5); }

.empty-tip { text-align: center; color: var(--text-sub); padding: 48px 0; font-size: 14px; }

/* ========== Toast ========== */
.toast {
  --tf-stroke: var(--stroke-f);
  position: fixed; left: 50%; bottom: 80px;
  transform: translateX(-50%) translateY(16px);
  color: var(--text); padding: 11px 23px;
  font-size: 13px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 999;
}
.toast.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }

/* ========== 页脚 ========== */
.footer {
  background: #000000; color: rgba(174, 200, 230, 0.8);
  text-align: center; padding: 28px 0 22px; font-size: 13px;
  border-top: 1px solid var(--stroke-n);
}
.footer-sub { color: rgba(130, 160, 200, 0.5); font-size: 12px; margin-top: 6px; }
/* 老旧内核（360 兼容模式 / IE）轻提示：不打扰，只在页脚显示一行 */
.compat-tip { margin-top: 8px; font-size: 12px; color: rgba(150, 150, 158, 0.65); }

.back-top {
  position: fixed; right: 24px; bottom: 32px;
  width: 42px; height: 42px;
  cursor: pointer;
  color: var(--primary); font-size: 18px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  z-index: 90;
}
.back-top.show { opacity: 1; pointer-events: auto; }
.back-top:hover::before { background: var(--stroke-h); }

/* ========== 工具页 ========== */
.tool-main { padding: 32px 20px 56px; }
.tool-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: #ffffff; }
.tool-sub { color: var(--text-sub); font-size: 13px; margin-bottom: 6px; }
.local-tip {
  --tf-fill: rgba(34, 211, 238, 0.08);
  display: inline-block; margin-bottom: 20px;
  font-size: 12px; color: var(--primary);
  padding: 4px 11px;
}

/* 面板（无切角，2px 直边描边） */
.panel {
  background: var(--card-bg);
  border: 2px solid var(--stroke-n);
  padding: 20px;
  transition: border-color 0.15s;
}
.panel:hover { border-color: var(--stroke-h); }
.panel + .panel { margin-top: 20px; }
.panel-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

/* 工具页按钮 */
.btn {
  padding: 8px 18px;
  color: var(--text-sub);
  font-size: 13px; cursor: pointer; font-family: inherit;
  transition: color 0.15s;
}
.btn:hover { color: var(--primary); }
.btn:hover::before { background: var(--stroke-h); }
.btn.primary { --tf-fill: var(--primary); color: #000; font-weight: 700; }
.btn.primary:hover { color: #000; }
.btn.primary:hover::after { background-color: var(--primary-dark); }

.editor-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor-col label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }

/* textarea / 输入框：2px 描边 + 切角 + focus 亮描边内发光 */
.editor-col textarea {
  width: 100%; height: 260px; resize: vertical;
  border: 2px solid var(--stroke-n);
  clip-path: var(--cutpath);
  padding: 12px; font-family: Consolas, "Courier New", monospace; font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--editor-bg);
  color: var(--text);
}
.editor-col textarea:focus {
  border-color: var(--stroke-f);
  box-shadow: var(--glow-f);
}
.editor-col textarea::placeholder { color: rgba(120, 160, 210, 0.5); }

.msg { min-height: 22px; margin-top: 12px; font-size: 13px; }
.msg.ok { color: #4ade80; }
.msg.err { color: #f87171; }

.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.form-row label { font-size: 13px; color: var(--text-sub); flex-shrink: 0; }
.form-row input[type="text"], .form-row input[type="number"], .form-row select {
  height: 38px; padding: 0 12px;
  border: 2px solid var(--stroke-n);
  clip-path: var(--cutpath);
  font-size: 13px; outline: none; min-width: 240px;
  font-family: Consolas, monospace;
  background: var(--editor-bg); color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus, .form-row select:focus {
  border-color: var(--stroke-f);
  box-shadow: var(--glow-f);
}
.form-row .result-text { font-family: Consolas, monospace; font-size: 14px; color: var(--text); word-break: break-all; }

.now-box { display: flex; flex-wrap: wrap; gap: 14px; }
.now-item {
  --tf-fill: var(--primary-light);
  flex: 1; min-width: 180px;
  padding: 14px 16px;
}
.now-item .k { font-size: 12px; color: var(--primary); margin-bottom: 4px; }
.now-item .v { font-family: Consolas, monospace; font-size: 17px; font-weight: 700; color: var(--text); }

.btn-back {
  margin-left: auto;
  padding: 6px 16px;
  color: var(--text-sub);
  font-size: 13px; font-family: inherit;
  transition: color 0.15s;
}
.btn-back:hover { color: var(--primary); }
.btn-back:hover::before { background: var(--stroke-h); }

/* ========== 最近使用 ========== */
.side-col { display: flex; flex-direction: column; gap: 16px; flex-shrink: 0; }
.recent-card {
  background: #111318;
  background: var(--card-bg);
  border: 2px solid rgba(56, 189, 248, 0.28);
  border-color: var(--stroke-n);
  padding: 14px;
  min-width: 220px;
  transition: border-color 0.15s;
}
.recent-card:hover { border-color: var(--stroke-h); }
.recent-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.recent-card-title { font-size: 14px; font-weight: 700; color: #ffffff; }
.recent-clear {
  border: 2px solid transparent; background: none; cursor: pointer;
  font-size: 12px; color: var(--text-sub);
  padding: 2px 6px; font-family: inherit;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.recent-clear:hover { color: #f87171; background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.4); }
.recent-items li { margin-bottom: 2px; }
.recent-item {
  --tf-stroke: transparent;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px;
  transition: none;
}
.recent-item:hover::before { background: var(--stroke-n); }
.recent-item:hover::after { background-color: var(--primary-light); }
.recent-item-icon {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: var(--primary-light);
  border: 2px solid var(--stroke-n);
  clip-path: var(--cutpath);
}
.recent-item:hover .recent-item-icon { background: var(--editor-bg); border-color: var(--stroke-f); }
.recent-item-name { flex: 1; font-size: 13px; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item-time { font-size: 11px; color: var(--text-sub); flex-shrink: 0; }
.recent-empty {
  padding: 18px 6px; text-align: center;
  font-size: 12px; color: var(--text-sub);
  background: rgba(56, 189, 248, 0.05);
  border: 2px dashed rgba(56, 189, 248, 0.3);
}

/* ========== 登录 / 注册弹窗 ========== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.auth-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-modal[hidden] { display: none; }
.auth-overlay {
  position: absolute; inset: 0;
  background: rgba(2, 5, 12, 0.82);
}

.auth-card {
  --tf-clip: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  --tf-stroke: var(--stroke-h);
  width: min(92vw, 400px);
  padding: 26px 28px 22px;
}
.auth-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px;
  border: none; background: none; cursor: pointer;
  font-size: 22px; color: var(--text-sub); line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.auth-close:hover { color: var(--primary); background: var(--primary-light); }

.auth-tabs {
  display: flex; gap: 20px;
  border-bottom: 2px solid var(--stroke-n);
  margin-bottom: 20px;
}
.auth-tab {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 16px; font-weight: 600; color: var(--text-sub);
  padding: 6px 2px 10px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab:hover { color: var(--primary); }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.auth-field { margin-bottom: 14px; }
.auth-field label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.auth-field input {
  width: 100%; height: 40px; padding: 0 12px;
  border: 2px solid var(--stroke-n);
  clip-path: var(--cutpath);
  font-size: 14px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--editor-bg);
  color: var(--text);
  font-family: inherit;
}
.auth-field input::placeholder { color: rgba(120, 160, 210, 0.5); }
.auth-field input:focus {
  border-color: var(--stroke-f);
  box-shadow: var(--glow-f);
}
.auth-field input.error {
  border-color: #f87171;
  box-shadow: inset 0 0 6px rgba(248, 113, 113, 0.22);
}
.auth-error {
  min-height: 16px; margin-top: 4px;
  font-size: 12px; color: #f87171; line-height: 1.3;
}

.auth-submit {
  --tf-fill: var(--primary);
  width: 100%; height: 42px; margin-top: 4px;
  cursor: pointer;
  color: #06090f;
  font-size: 15px; font-weight: 700; letter-spacing: 4px;
  font-family: inherit;
}
.auth-submit:hover::after { background-color: var(--primary-dark); }

.auth-switch { margin-top: 14px; text-align: center; font-size: 13px; color: var(--text-sub); }
.auth-switch a { color: var(--primary); }
.auth-switch a:hover { text-decoration: underline; }

.auth-tip {
  min-height: 18px; margin-top: 10px;
  text-align: center; font-size: 12px; color: #b26a00;
}

/* ========== 响应式 ========== */
@media (max-width: 1100px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .topnav { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .category-list { display: flex; overflow-x: auto; padding: 8px; }
  .category-list li { white-space: nowrap; margin-bottom: 0; margin-right: 6px; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .editor-pair { grid-template-columns: 1fr; }
  .content-head { flex-direction: column; }
  .carousel { width: 100%; flex: none; }
  .clock-box { align-self: flex-start; }
  .side-col { width: 100%; }
  .recent-card { min-width: 0; }
  .recent-items { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
  /* 搜索框在中屏略降高度，按钮仍保持可点 */
  .hero-search { height: 48px; max-width: 620px; }
  .hero-search button { width: 88px; }
}
@media (max-width: 560px) {
  :root { --cut: 3px; --cut-lg: 4px; }
  .hero { padding: 20px 0 24px; }
  .hero-title { font-size: 26px; letter-spacing: 1px; }
  .hero-desc { font-size: 13px; margin-bottom: 10px; }
  .hero-tag { font-size: 11px; padding: 4px 12px; margin-bottom: 10px; }
  .brand-logo { width: 28px; height: 28px; }
  .brand-name { font-size: 15px; letter-spacing: 0; }
  .tool-grid { grid-template-columns: 1fr; }
  .btn-auth { padding: 5px 14px; font-size: 12px; }
  .top-actions { gap: 6px; }
  /* 搜索框窄屏：高度 44px、撑满列宽、按钮 72px 仍满足触控 */
  .hero-search { height: 44px; max-width: 100%; }
  .hero-search button { width: 72px; font-size: 14px; }
  .hero-search input { font-size: 15px; padding-left: 40px; }
  .hero-search .search-icon { left: 13px; }
  /* 翻页时钟在窄屏等比缩小（整体 font-size 联动，上下瓣不错位） */
  .clock { font-size: 18px; gap: 3px; }
  .clock-sep { gap: 4px; }
  .clock-box { padding: 9px 10px 8px; }
  .clock-date { margin-top: 8px; font-size: 10px; }
  /* 轮播：箭头缩小但仍保持 36px 触控目标，圆点不拥挤 */
  .carousel-arrow { width: 36px; height: 36px; margin-top: -18px; font-size: 20px; }
  .carousel-arrow.prev { left: 6px; }
  .carousel-arrow.next { right: 6px; }
  .carousel-dots { bottom: 6px; gap: 6px; }
  .carousel-dot { width: 8px; height: 8px; }
  .recent-items { grid-template-columns: 1fr; }
  .auth-card { padding: 22px 20px 18px; }
  /* 移动端关闭循环扫光（扫光已移到 ::after），仅保留 hover 扫光（触屏不触发） */
  .hero-search::after,
  .btn-auth.primary::after { animation: none; }
  /* 移动端视频降级：preload=none 避免无意义流量（由 JS 控制何时加载） */
  .hero-video { display: none; }
  .hero-video.is-mobile-loaded { display: block; }
}

/* 尊重减少动画偏好：关闭所有扫光与过渡；视频不自动播放，只显示 poster */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .hero-video { display: none; }
}
