:root {
  --bg: #f1f1ee;
  --bg-soft: #fbfbf8;
  --bg-blank: #f6f5f1;
  --panel: rgba(255, 255, 255, 0.84);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --line: rgba(39, 39, 39, 0.14);
  --line-strong: rgba(39, 39, 39, 0.24);
  --text: #1f1f1c;
  --text-soft: #6f6d67;
  --shadow: 0 24px 70px rgba(62, 58, 49, 0.08);
  --font-cn: "Noto Sans SC Local", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-en: "Space Grotesk Local", "Segoe UI", Arial, sans-serif;
  --progress-a: #d8d0c1;
  --progress-b: #becbd7;
  --progress-c: #c8bea9;
}

@font-face {
  font-family: "Noto Sans SC Local";
  src: url("../assets/fonts/NotoSansSC-Regular.otf") format("opentype");
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk Local";
  src: url("../assets/fonts/SpaceGrotesk-Regular.otf") format("opentype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.splash-logo {
  width: clamp(120px, 28vw, 220px);
  opacity: 0;
  animation: splash-fade-in 0.6s ease forwards;
}

.splash-overlay.is-leaving .splash-logo {
  animation: splash-logo-out 0.4s ease forwards;
}

.splash-overlay.is-leaving {
  animation: splash-out 0.5s ease 0.2s forwards;
}

@keyframes splash-fade-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes splash-logo-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.06); }
}

@keyframes splash-out {
  from { opacity: 1; }
  to   { opacity: 0; visibility: hidden; }
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 28%),
    linear-gradient(140deg, #f7f7f4 0%, #efefeb 42%, #ecebe6 100%);
  font-family: var(--font-cn);
}

button,
input {
  font: inherit;
}

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

.page-noise,
.page-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.page-noise {
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.015) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black 55%, transparent 100%);
}

.frame-line,
.frame-block {
  position: absolute;
  background: rgba(23, 23, 22, 0.09);
}

.frame-line {
  top: 56px;
  bottom: 56px;
  width: 1px;
}

.frame-line-left {
  left: clamp(20px, 4vw, 48px);
}

.frame-line-right {
  right: clamp(20px, 4vw, 48px);
}

.frame-block {
  width: 94px;
  height: 18px;
  background: linear-gradient(90deg, rgba(31, 31, 28, 0.1), rgba(31, 31, 28, 0.02));
}

.frame-block-top {
  top: 30px;
  right: clamp(28px, 5vw, 72px);
}

.frame-block-bottom {
  left: clamp(28px, 5vw, 72px);
  bottom: 30px;
}

.guide-shell,
.results-page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.guide-shell {
  padding: 72px 0 60px;
}

.results-page-shell {
  padding: 64px 0 60px;
}

.result-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 247, 243, 0.86)),
    var(--panel);
}

.hero-card {
  position: relative;
  padding: clamp(28px, 5vw, 48px);
}

.hero-meta,
.search-row,
.results-page-head,
.results-page-meta,
.result-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hero-meta {
  position: relative;
  z-index: 1;
  margin-bottom: 30px;
}

.meta-chip,
.meta-note,
.search-label,
.eyebrow,
.results-eyebrow,
.loading-kicker,
.card-en-name,
.latency-label,
.match-label {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-en);
}

.meta-chip,
.meta-note {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.meta-chip {
  border-radius: 999px;
}

.meta-note {
  border-radius: 10px;
  color: var(--text-soft);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-soft);
}

.title-stack {
  position: relative;
  display: inline-block;
}

.title-shadow {
  position: absolute;
  left: clamp(4px, 1vw, 12px);
  top: -0.54em;
  font-family: var(--font-en);
  font-size: clamp(52px, 12vw, 170px);
  line-height: 0.88;
  letter-spacing: 0.04em;
  color: rgba(31, 31, 28, 0.045);
  user-select: none;
  transform: translateY(8px);
  animation: float-shadow 8s ease-in-out infinite;
}

.hero-title,
.results-page-title {
  margin: 0;
  letter-spacing: -0.05em;
}

.hero-title {
  position: relative;
  max-width: 9ch;
  font-size: clamp(46px, 8vw, 94px);
  line-height: 0.96;
}

.gsap-hidden {
  opacity: 0;
  visibility: hidden;
}

.hero-subtitle {
  margin: 22px 0 0;
  max-width: 720px;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.8;
  color: var(--text-soft);
}

.search-panel {
  position: relative;
  z-index: 1;
  margin-top: 36px;
  padding: 18px 0;
}

.search-label {
  display: block;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-soft);
}

.search-row {
  align-items: stretch;
}

.search-input {
  width: 100%;
  min-width: 0;
  height: 64px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 18px 10px 18px 10px;
  outline: none;
  background: var(--bg-soft);
  color: var(--text);
  transition: border-color 0.24s ease, transform 0.24s ease, box-shadow 0.24s ease;
}

.search-input:focus {
  border-color: rgba(31, 31, 28, 0.22);
}

.search-button {
  flex: 0 0 auto;
  min-width: 144px;
  padding: 0 28px;
  border: 0;
  border-radius: 16px 10px 16px 10px;
  background: linear-gradient(135deg, #21211f 0%, #58554f 100%);
  color: #fafaf7;
  cursor: pointer;
  transition: transform 0.24s ease, box-shadow 0.24s ease, filter 0.24s ease;
}

/* .search-button:hover,
.search-button:focus-visible {
  filter: brightness(1.1);
  transform: translateY(-1px);
} */

.search-message,
.results-summary,
.loading-stage,
.card-description,
.empty-state {
  line-height: 1.8;
  color: var(--text-soft);
}

.search-message {
  margin: 12px 2px 0;
  font-size: 14px;
}

.search-message.is-error {
  color: #8c4b43;
}

.search-tags,
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-tags {
  margin-top: 16px;
}

.search-tag,
.card-tag {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-soft);
}

.search-tag {
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.24s ease, transform 0.24s ease, background 0.24s ease;
}

.search-tag:hover,
.search-tag:focus-visible {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
}

.loading-body {
  display: grid;
  place-items: center;
  background: var(--bg-blank);
}

.loading-shell {
  width: min(620px, calc(100% - 48px));
  text-align: center;
}

.loading-kicker {
  margin: 0 0 20px;
  font-size: 12px;
  color: var(--text-soft);
}

.loading-title {
  margin: 0;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.loading-stage {
  margin: 16px 0 28px;
  font-size: 16px;
}

.slash-track {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.slash-segment {
  position: relative;
  height: 28px;
  overflow: hidden;
  border: 1px solid rgba(31, 31, 28, 0.08);
  background: rgba(31, 31, 28, 0.05);
  transform: skewX(-22deg);
}

.slash-segment::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--progress-a), var(--progress-b), var(--progress-c));
  transition: transform 0.2s ease;
}

.slash-segment.is-active::before {
  transform: scaleX(1);
}

.results-page-head {
  align-items: end;
  margin-bottom: 22px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.results-eyebrow,
.card-en-name,
.latency-label,
.match-label {
  margin: 0;
  font-size: 11px;
  color: var(--text-soft);
}

.results-page-title {
  margin-top: 8px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.results-page-meta {
  align-items: end;
}

.results-summary {
  max-width: 380px;
  margin: 0;
  text-align: right;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  transition: transform 0.24s ease, border-color 0.24s ease;
}

.back-link:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.results-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.result-card {
  border: 1px solid rgba(31, 31, 28, 0.1);
  border-radius: 24px 12px 24px 12px;
  overflow: hidden;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.result-card:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 31, 28, 0.18);
}

.result-card-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1.45fr) minmax(220px, 0.75fr) minmax(150px, 0.52fr);
  align-items: stretch;
}

.card-accent {
  background: linear-gradient(180deg, #c8bea9 0%, #bac9d8 45%, #d8d1c4 100%);
}

.card-main,
.card-match,
.latency-box {
  padding: 20px 18px;
}

.card-main {
  min-width: 0;
}

.card-en-name {
  margin-bottom: 8px;
}

.card-title {
  display: inline-block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  transition: opacity 0.24s ease;
}

.card-title:hover {
  opacity: 0.72;
}

.card-description {
  margin: 14px 0 0;
}

.card-match {
  border-left: 1px solid rgba(31, 31, 28, 0.08);
  background: rgba(247, 246, 241, 0.56);
}

.match-label {
  margin-bottom: 14px;
}

.card-tag {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 13px;
}

.latency-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid rgba(31, 31, 28, 0.08);
  background: rgba(252, 252, 249, 0.78);
}

.latency-value {
  display: block;
  margin-top: 6px;
  font-family: var(--font-en);
  font-size: 15px;
}

.latency-value.is-fast {
  color: #385b40;
}

.latency-value.is-mid {
  color: #7b6932;
}

.latency-value.is-slow {
  color: #8c4b43;
}

.latency-value.is-fail {
  color: #8a5f5f;
}

.result-card.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.empty-state {
  margin: 0;
  max-width: 28ch;
  text-align: center;
}

@keyframes title-rise {
  from {
    opacity: 0;
    letter-spacing: -0.1em;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    letter-spacing: -0.05em;
    transform: translateY(0);
  }
}

@keyframes float-shadow {
  0%,
  100% {
    transform: translate3d(0, 8px, 0);
  }

  50% {
    transform: translate3d(0, -6px, 0);
  }
}

@media (max-width: 900px) {
  .result-card-row {
    grid-template-columns: 1fr;
  }

  .card-accent {
    display: none;
  }

  .card-match,
  .latency-box {
    border-left: 0;
    border-top: 1px solid rgba(31, 31, 28, 0.08);
  }
}

@media (max-width: 720px) {
  .page-frame {
    display: none;
  }

  .hero-meta {
    display: none;
  }

  .guide-shell,
  .results-page-shell {
    width: calc(100% - 32px);
  }

  .guide-shell {
    padding: 44px 0 30px;
  }

  .results-page-shell {
    padding: 40px 0 30px;
  }

  .search-row,
  .results-page-head,
  .results-page-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .search-button {
    width: 100%;
    min-height: 56px;
  }

  .results-summary {
    text-align: left;
  }

  .slash-track {
    gap: 6px;
  }
}
