/* Press Start 2P 自托管（latin 子集）：Google Fonts 在国内不可达且阻塞首屏 */
@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/press-start-2p-latin.woff2') format('woff2');
}

/* ============================================================
   giddence.com · 像素绿地 v2.3 站点规范
   双主题（:root 深色 / [data-theme='light'] 浅色）+ 硬边像素 + 磷光绿单 accent
   主题偏好全站共享 localStorage 'giddence:theme'（与各工具一致）
   中文标题与正文始终系统字体；Press Start 2P 仅用于拉丁/数字
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 深色（默认） ---------- */
:root {
  color-scheme: dark;
  --bg:            oklch(0.14 0.02 155);
  --bg-deep:       oklch(0.11 0.02 155);
  --surface:       oklch(0.18 0.02 155);
  --surface-raise: oklch(0.22 0.02 155);
  --fg:            oklch(0.93 0.015 155);
  --muted:         oklch(0.72 0.03 155);
  --weak:          oklch(0.60 0.03 155);
  --border:        oklch(0.33 0.02 155);
  --border-bright: oklch(0.50 0.03 155);
  --accent:        oklch(0.82 0.17 155);
  --accent-strong: oklch(0.70 0.15 155);
  --accent-ink:    oklch(0.13 0.05 155);
  --accent-glow:   oklch(0.82 0.17 155 / 0.14);
  --success:       oklch(0.72 0.17 160);
  --warn:          oklch(0.80 0.14 80);
  --danger:        oklch(0.64 0.19 25);
  --shadow-px:     oklch(0.06 0.01 155);
  --primary-hover: oklch(0.85 0.17 155);
  --hover-fg:      var(--accent);
}

/* ---------- 浅色 ---------- */
:root[data-theme='light'] {
  color-scheme: light;
  --bg:            oklch(0.96 0.012 155);
  --bg-deep:       oklch(0.90 0.02 155);
  --surface:       oklch(0.99 0.005 155);
  --surface-raise: oklch(0.93 0.015 155);
  --fg:            oklch(0.24 0.02 155);
  --muted:         oklch(0.40 0.03 155);
  --weak:          oklch(0.42 0.03 155);
  --border:        oklch(0.80 0.015 155);
  --border-bright: oklch(0.62 0.04 155);
  --accent:        oklch(0.82 0.17 155);
  --accent-strong: oklch(0.42 0.14 155);
  --accent-ink:    oklch(0.13 0.05 155);
  --accent-glow:   oklch(0.82 0.17 155 / 0.16);
  --success:       oklch(0.50 0.15 160);
  --warn:          oklch(0.44 0.15 80);
  --danger:        oklch(0.44 0.20 25);
  --shadow-px:     oklch(0.28 0.03 155 / 0.45);
  --primary-hover: oklch(0.76 0.17 155);
  --hover-fg:      var(--accent-strong);
}

:root {
  --font-pixel: 'Press Start 2P', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas,
    'PingFang SC', monospace;
}

html,
body {
  min-height: 100%;
}

body {
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.75;
  font-size: 16px;
  background-color: var(--bg);
  background-image: radial-gradient(
    color-mix(in oklab, var(--accent) 6%, transparent) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  user-select: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border: 2px solid var(--bg);
}
*::-webkit-scrollbar-track {
  background: var(--bg);
}

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 96px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  display: block;
  width: 36px;
  height: 36px;
  background: var(--accent);
  box-shadow: 3px 3px 0 var(--shadow-px);
}

.brand-logo svg {
  display: block;
  shape-rendering: crispEdges;
}

.brand-word {
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--fg);
}

.brand-cursor {
  display: inline-block;
  width: 10px;
  height: 14px;
  margin-left: 2px;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topnav a {
  font-size: 13px;
  color: var(--muted);
  transition: color 120ms ease;
}

.topnav a::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  background: var(--border-bright);
  vertical-align: 2px;
  transition: background 120ms ease;
}

.topnav a:hover {
  color: var(--hover-fg);
}

.topnav a:hover::before {
  background: var(--accent-strong);
}

/* ---------- 船式开关（深/浅主题） ---------- */
.rock-switch {
  position: relative;
  display: inline-flex;
  width: 66px;
  height: 28px;
  padding: 0;
  background: var(--surface-raise);
  border: 2px solid var(--border-bright);
  box-shadow: 2px 2px 0 var(--shadow-px);
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.rock-switch:hover {
  border-color: var(--accent-strong);
}

.rock-switch:active .rs-knob {
  scale: 0.92 1;
}

.rs-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  pointer-events: none;
}

.rs-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--weak);
  z-index: 2;
  transition: color 0.15s ease;
}

.rock-switch:not(.on) .rs-dark {
  color: var(--fg);
  font-weight: 600;
}

.rock-switch.on .rs-light {
  color: var(--fg);
  font-weight: 600;
}

.rs-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border: 2px solid var(--accent-strong);
  box-shadow: 1px 1px 0 var(--shadow-px);
  z-index: 1;
  transition: transform 0.26s steps(5, end);
}

.rs-knob i {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 5px;
  height: 5px;
  background: var(--accent-ink);
  pointer-events: none;
}

.rock-switch.on .rs-knob {
  transform: translateX(38px) rotate(180deg);
}

/* ---------- 滚动像素进度条 ---------- */
.pxprogress {
  height: 6px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-top: 0;
  border-left: 0;
  border-right: 0;
}

.pxprogress .fill {
  height: 6px;
  width: 0;
  background: repeating-linear-gradient(
    90deg,
    var(--accent) 0 10px,
    var(--accent-strong) 10px 20px
  );
}

/* ---------- 微标签 ---------- */
.micro {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.micro::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-strong);
  flex: none;
}

/* ---------- Hero ---------- */
.hero {
  margin-top: 28px;
  padding: 40px 48px 48px;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 6px 6px 0 var(--shadow-px);
  position: relative;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.hero::before {
  top: 10px;
  left: 10px;
  border-top: 3px solid var(--border-bright);
  border-left: 3px solid var(--border-bright);
}

.hero::after {
  bottom: 10px;
  right: 10px;
  border-bottom: 3px solid var(--border-bright);
  border-right: 3px solid var(--border-bright);
}

.hudbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 28px;
  background: var(--surface-raise);
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow-px);
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.hudbar .d {
  width: 6px;
  height: 6px;
  background: var(--accent-strong);
  flex: none;
}

.hudbar .d.m {
  background: var(--border-bright);
}

.hudbar .d.dm {
  background: var(--border);
}

.hudbar .ttl {
  color: var(--muted);
}

.hudbar .dash {
  flex: 1;
  min-width: 20px;
  height: 2px;
  background: var(--border);
}

.hudbar .ver {
  color: var(--weak);
}

.hero h1 {
  margin-top: 18px;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0;
  color: var(--fg);
  max-width: 14em;
}

.hero .sub {
  margin-top: 16px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.hero-line {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--weak);
}

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

.hero-line .cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  margin-left: 2px;
  background: var(--accent-strong);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease,
    box-shadow 120ms ease, transform 80ms ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent-strong);
  box-shadow: 4px 4px 0 var(--shadow-px);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 5px 5px 0 var(--shadow-px);
}

.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--shadow-px);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-bright);
}

.btn-ghost:hover {
  background: var(--accent-glow);
  color: var(--hover-fg);
  border-color: var(--accent-strong);
}

.btn-ghost:active {
  transform: translate(2px, 2px);
}

/* ---------- 区块 ---------- */
.pxstrip {
  height: 8px;
  margin-top: 72px;
  background: repeating-linear-gradient(
    90deg,
    var(--border-bright) 0 10px,
    var(--surface-raise) 10px 20px
  );
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.section-head > div {
  flex: 1;
  min-width: 0;
}

.section h2 {
  margin-top: 14px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--fg);
}

.section .lead {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.section h2::after {
  content: '';
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 16px;
  background: repeating-linear-gradient(
    90deg,
    var(--border-bright) 0 8px,
    var(--surface-raise) 8px 16px
  );
}

.section-head .num {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--weak);
  white-space: nowrap;
  padding-bottom: 4px;
}

/* ---------- 工具网格 ---------- */
.grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 4px 4px 0 var(--shadow-px);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.tool-card::before,
.tool-card::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  transition: border-color 120ms ease;
}

.tool-card::before {
  top: 8px;
  left: 8px;
  border-top: 3px solid var(--border);
  border-left: 3px solid var(--border);
}

.tool-card::after {
  bottom: 8px;
  right: 8px;
  border-bottom: 3px solid var(--border);
  border-right: 3px solid var(--border);
}

a.tool-card:hover::before,
a.tool-card:hover::after {
  border-color: var(--accent-strong);
}

a.tool-card:hover {
  border-color: var(--accent-strong);
  box-shadow: 5px 5px 0 var(--shadow-px);
  transform: translate(-2px, -2px);
}

.tool-card.is-more {
  opacity: 0.55;
  cursor: default;
}

.winbar {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.winbar .dot {
  width: 6px;
  height: 6px;
  background: var(--accent-strong);
  flex: none;
}

.winbar .dot:nth-child(2) {
  background: var(--border-bright);
}

.winbar .dot:nth-child(3) {
  background: var(--border);
}

.winbar .ttl {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--weak);
}

.tool-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raise);
  border: 2px solid var(--border);
  color: var(--accent-strong);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  box-shadow: 3px 3px 0 var(--shadow-px);
}

.tool-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--fg);
}

.tool-tag {
  align-self: flex-start;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--weak);
  background: var(--surface-raise);
  border: 1px solid var(--border);
  padding: 3px 9px;
}

.tool-desc {
  margin-top: 12px;
  flex: 1;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.card-foot {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--weak);
}

.card-foot i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  background: var(--accent-strong);
  vertical-align: 1px;
}

.tools-note {
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--weak);
}

/* ---------- 页面标题（工具首页） ---------- */
.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.35;
  margin-bottom: 10px;
}

.page-title::after {
  content: '';
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 10px;
  background: repeating-linear-gradient(
    90deg,
    var(--border-bright) 0 8px,
    var(--surface-raise) 8px 16px
  );
}

.page-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
}

/* ---------- 免责条 ---------- */
.disclaimer {
  margin-top: 28px;
  padding: 12px 14px;
  background: color-mix(in oklab, var(--warn) 10%, var(--surface));
  border: 2px solid color-mix(in oklab, var(--warn) 40%, var(--border));
  color: color-mix(in oklab, var(--warn) 80%, var(--fg));
  font-size: 12.5px;
  line-height: 1.7;
}

.disclaimer::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  background: var(--warn);
  vertical-align: 1px;
}

/* ---------- 页脚 ---------- */
.footer {
  position: relative;
  margin-top: 72px;
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--weak);
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--border-bright) 0 10px,
    var(--surface-raise) 10px 20px
  );
}

.footer .mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.footer-icp {
  flex-basis: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  margin-top: 10px;
}

.footer-icp a {
  color: var(--weak);
  text-decoration: none;
  transition: color 120ms ease;
}

.footer-icp a:hover {
  color: var(--accent);
}

/* ---------- 动效 ---------- */
@keyframes blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 680px) {
  .page {
    padding: 0 14px 64px;
  }

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

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding: 32px 20px 40px;
  }

  .section-head .num {
    display: none;
  }

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