:root {
  color-scheme: light;
  --bg: #fafafa;
  --panel: rgba(255, 255, 255, 0.8);
  --card: #ffffff;
  --text: #111111;
  --muted: #6e6e73;
  --line: rgba(17, 17, 17, 0.08);
  --line-strong: rgba(17, 17, 17, 0.12);
  --shadow: 0 18px 48px rgba(17, 17, 17, 0.06);
  --shadow-soft: 0 10px 24px rgba(17, 17, 17, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top center, rgba(0, 0, 0, 0.035), transparent 30%),
    linear-gradient(180deg, #fcfcfc 0%, #f7f7f8 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  -webkit-text-size-adjust: 100%;
}

img {
  display: block;
  max-width: 100%;
}

input {
  font: inherit;
}

.page {
  width: min(1060px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px) saturate(140%);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: normal;
}

.brand-name {
  color: var(--muted);
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.test-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 560;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.14);
}

.search {
  flex: 0 1 280px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.search svg {
  width: 16px;
  height: 16px;
  fill: #909097;
  flex: 0 0 auto;
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search input::placeholder {
  color: #9b9ba1;
}

.catalog {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.76)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(248, 248, 249, 0.8));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.faq {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(248, 248, 249, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 2px 2px 0;
}

.section-head h1 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.section-head--faq {
  margin-bottom: 8px;
}

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.faq-item summary {
  position: relative;
  padding: 14px 42px 14px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 0.92rem;
  font-weight: 560;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0;
  padding: 0 14px 14px;
  color: #313136;
  font-size: 0.88rem;
  line-height: 1.68;
}

.entry-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.entry {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 88px;
}

.entry-media {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  padding: 10px;
  border: 1px solid rgba(17, 17, 17, 0.05);
  border-radius: 16px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.9), transparent 42%),
    linear-gradient(180deg, #f7f7f8 0%, #f2f2f3 100%);
}

.entry-media img {
  width: 100%;
  height: 100%;
  max-height: 220px;
  object-fit: contain;
}

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

.entry-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.entry-title-wrap {
  min-width: 0;
}

.entry-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.entry-anchor {
  color: inherit;
  text-decoration: none;
}

.entry-code {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tone {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #4e4e53;
  font-size: 0.74rem;
  white-space: nowrap;
}

.summary {
  margin: 0;
  color: #313136;
  font-size: 0.9rem;
  line-height: 1.62;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 999px;
  background: #f7f7f8;
  color: #35353a;
  font-size: 0.8rem;
}

.entry-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.relation-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 14px;
}

.relation-group--similar {
  background: linear-gradient(180deg, rgba(237, 244, 255, 0.96), rgba(245, 248, 255, 0.88));
  border-color: rgba(97, 140, 255, 0.16);
}

.relation-group--opposite {
  background: linear-gradient(180deg, rgba(255, 240, 242, 0.96), rgba(255, 247, 247, 0.88));
  border-color: rgba(255, 110, 135, 0.16);
}

.relation-label {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.relation-group--similar .relation-label {
  color: #5070c7;
}

.relation-group--opposite .relation-label {
  color: #d15c72;
}

.relation-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.relation-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #35353a;
  font-size: 0.78rem;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.relation-link[data-code] {
  cursor: pointer;
}

.relation-link:hover {
  transform: translateY(-1px);
}

.relation-group--similar .relation-link {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(97, 140, 255, 0.14);
}

.relation-group--opposite .relation-link {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 110, 135, 0.14);
}

.entry.is-target {
  box-shadow:
    0 0 0 2px rgba(17, 17, 17, 0.12),
    0 18px 48px rgba(17, 17, 17, 0.09);
}

.empty-state {
  margin: 14px 2px 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  padding: 6px 0 2px;
}

.locale-nav {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.locale-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  text-decoration: none;
}

.locale-nav a[aria-current="page"] {
  border-color: rgba(17, 17, 17, 0.08);
  background: #111111;
  color: #ffffff;
}

@media (max-width: 760px) {
  .page {
    width: min(100vw - 20px, 100%);
    padding-top: 18px;
    padding-bottom: 24px;
  }

  .topbar {
    top: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .test-link {
    width: 100%;
  }

  .search {
    flex-basis: auto;
    width: 100%;
  }

  .catalog {
    padding: 12px;
    border-radius: 20px;
  }

  .faq {
    margin-top: 12px;
    padding: 10px;
    border-radius: 20px;
  }

  .site-footer {
    margin-top: 12px;
  }

  .locale-nav {
    width: 100%;
    gap: 6px;
    border-radius: 18px;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
  }

  .entry-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .entry {
    padding: 11px;
    border-radius: 18px;
  }

  .entry-media {
    min-height: 150px;
  }

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

@media (max-width: 480px) {
  .page {
    width: calc(100vw - 16px);
    padding-top: 14px;
  }

  .topbar {
    margin-bottom: 12px;
    border-radius: 18px;
  }

  .brand-mark {
    font-size: 1.02rem;
  }

  .brand-name,
  .section-head p {
    font-size: 0.82rem;
  }

  .search {
    height: 40px;
    padding: 0 12px;
  }

  .catalog {
    padding: 10px;
    border-radius: 18px;
  }

  .faq {
    padding: 8px;
    border-radius: 18px;
  }

  .locale-nav {
    padding: 8px;
  }

  .entry {
    gap: 10px;
    padding: 10px;
    border-radius: 16px;
  }

  .entry-media {
    min-height: 136px;
    padding: 8px;
    border-radius: 14px;
  }

  .entry-title {
    font-size: 1rem;
  }

  .entry-code,
  .tone,
  .chip,
  .relation-link {
    font-size: 0.74rem;
  }

  .summary {
    font-size: 0.86rem;
  }

  .faq-item summary {
    padding: 12px 38px 12px 12px;
    font-size: 0.88rem;
  }

  .faq-item p {
    padding: 0 12px 12px;
    font-size: 0.84rem;
  }
}
