:root {
  color-scheme: light;
  --ink: #13201f;
  --muted: #64736f;
  --line: #d8e0dc;
  --panel: #ffffff;
  --soft: #f5f8f6;
  --teal: #0e6f6a;
  --cyan: #2b9fb3;
  --amber: #d99721;
  --coral: #d95f49;
  --violet: #7862b8;
  --shadow: 0 16px 50px rgba(21, 37, 35, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
}

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

button,
input,
select {
  font: inherit;
}

.hero {
  position: relative;
  min-height: 92vh;
  overflow: hidden;
  color: #fff;
}

.hero-media,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-media {
  object-fit: cover;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(10, 21, 22, 0.9) 0%, rgba(10, 21, 22, 0.68) 42%, rgba(10, 21, 22, 0.18) 100%),
    linear-gradient(180deg, rgba(10, 21, 22, 0.25) 0%, rgba(10, 21, 22, 0.05) 68%, var(--soft) 100%);
}

.topbar,
.hero-content {
  position: relative;
  z-index: 1;
}

.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(8, 21, 22, 0.18);
  backdrop-filter: blur(12px);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    padding 0.22s ease;
}

.topbar:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(8, 21, 22, 0.48);
  box-shadow: 0 18px 44px rgba(2, 12, 13, 0.34);
}

.brand,
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-weight: 800;
  transition: color 0.18s ease, transform 0.18s ease;
}

.brand:hover {
  color: #8cf1e8;
  transform: translateY(-1px);
}

.brand-mark {
  display: inline-grid;
  width: 54px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: background 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.brand:hover .brand-mark {
  background: #fff;
  box-shadow: 0 0 24px rgba(126, 229, 220, 0.2);
}

.solid-button,
.ghost-button,
.nav-link-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border 0.18s ease;
}

.solid-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #102321;
  font-weight: 800;
}

.ghost-button {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.nav-link-button {
  background: rgba(126, 229, 220, 0.14);
  color: #dffbf7;
  border-color: rgba(126, 229, 220, 0.36);
  font-weight: 800;
}

.prompt-entry {
  position: relative;
  overflow: hidden;
}

.prompt-entry::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.22) 46%, transparent 72%);
  transform: translateX(-120%);
  transition: transform 0.48s ease;
}

.prompt-entry:hover::before {
  transform: translateX(120%);
}

.solid-button:hover,
.ghost-button:hover,
.nav-link-button:hover,
.tab:hover,
.tool-card:hover {
  transform: translateY(-2px);
}

.hero-content {
  width: min(1180px, calc(100% - 32px));
  margin: 12vh auto 0;
  padding-bottom: 120px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  color: #7ee5dc;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  width: min(680px, 100%);
  margin-bottom: 18px;
  font-size: clamp(2.5rem, 6.2vw, 5rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy {
  width: min(640px, 100%);
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
  line-height: 1.8;
}

.hero-search {
  display: flex;
  gap: 10px;
  width: min(760px, 100%);
  margin-top: 30px;
}

.search-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 10px;
  height: 56px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
}

.search-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.stats span {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.control-band {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 248, 246, 0.92);
  backdrop-filter: blur(16px);
}

.control-inner,
.spotlight,
.directory {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.control-inner {
  padding: 16px 0;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.tab {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.tab.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.filter-row,
.directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.filter-row {
  flex-wrap: wrap;
}

.filter-row label,
.sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 34px 0 10px;
  background: #fff;
  color: var(--ink);
}

.toggle {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.result-count {
  margin-left: auto;
  color: var(--muted);
}

.spotlight {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  padding: 24px 0 14px;
}

.spotlight h2,
.directory h2 {
  margin: 0;
  font-size: 1.48rem;
}

.section-kicker {
  color: var(--teal);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.quick-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 3px;
  align-items: center;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(21, 37, 35, 0.045);
  cursor: pointer;
  text-align: left;
}

.quick-icon,
.tool-logo {
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  overflow: hidden;
}

.quick-icon {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  margin-bottom: 0;
}

.quick-card strong {
  display: block;
  margin-bottom: 0;
  font-size: 0.96rem;
}

.quick-card span,
.tool-desc,
.tool-meta {
  color: var(--muted);
}

.quick-card > span:last-child {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.84rem;
}

.directory {
  padding: 10px 0 64px;
}

.directory-head {
  margin-bottom: 18px;
}

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

.tool-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 238px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 36px rgba(21, 37, 35, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:hover {
  box-shadow: var(--shadow);
}

.tool-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  position: relative;
  border: 1px solid rgba(19, 32, 31, 0.08);
  background: var(--teal);
}

.tool-logo span {
  display: inline-grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: transparent;
  color: #fff;
}

.tool-card:nth-child(6n + 1) .tool-logo {
  background: #0e6f6a !important;
}

.tool-card:nth-child(6n + 2) .tool-logo {
  background: #2b9fb3 !important;
}

.tool-card:nth-child(6n + 3) .tool-logo {
  background: #d99721 !important;
}

.tool-card:nth-child(6n + 4) .tool-logo {
  background: #d95f49 !important;
}

.tool-card:nth-child(6n + 5) .tool-logo {
  background: #7862b8 !important;
}

.tool-card:nth-child(6n) .tool-logo {
  background: #32785d !important;
}

.tool-title {
  min-width: 0;
}

.tool-title h3 {
  margin: 0 0 3px;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.tool-title span {
  color: var(--muted);
  font-size: 0.85rem;
}

.fav {
  width: 38px;
  height: 38px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.fav.is-on {
  border-color: var(--amber);
  color: #8a5b00;
  background: #fff5dd;
}

.tool-desc {
  margin: 16px 0;
  line-height: 1.65;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tool-tags,
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 5px 8px;
  border-radius: 8px;
  background: #eef4f2;
  color: #37524d;
  font-size: 0.78rem;
}

.tool-actions {
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  min-width: 0;
}

.visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 0;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.visit[href=""],
.visit[href="#"] {
  display: none;
}

.subpage-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: #102321;
}

.subpage-hero .topbar {
  margin-bottom: 64px;
}

.subpage-title {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 72px;
}

.subpage-title h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
}

.content-layout {
  width: min(900px, calc(100% - 32px));
  margin: 48px auto 72px;
}

.content-panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(21, 37, 35, 0.07);
}

.content-tool-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.content-tool-head h2 {
  margin: 0 0 4px;
  font-size: 1.4rem;
}

.content-tool-head p {
  margin: 0;
  color: var(--muted);
}

.content-panel p,
.content-body {
  line-height: 1.8;
}

.content-body img {
  max-width: 100%;
  height: auto;
}

.prompt-box {
  white-space: pre-wrap;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
  line-height: 1.8;
}

.tool-meta {
  font-size: 0.82rem;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.empty-state {
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px max(16px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
}

footer p {
  margin: 0;
}

@media (max-width: 920px) {
  .hero {
    min-height: 860px;
  }

  .topbar,
  .directory-head,
  .spotlight {
    align-items: stretch;
  }

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

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .hero-search,
  .directory-head,
  .filter-row {
    flex-direction: column;
  }

  .directory-head {
    align-items: flex-start;
  }

  .hero-search,
  .hero-search .solid-button,
  .filter-row label,
  .sort-wrap,
  select {
    width: 100%;
  }

  .hero-content {
    margin-top: 150px;
  }

  .result-count {
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  body {
    background: #f7faf8;
  }

  .hero {
    min-height: auto;
    overflow: hidden;
  }

  .hero-media {
    object-position: 58% center;
  }

  .hero-shade {
    background:
      linear-gradient(180deg, rgba(7, 18, 19, 0.84) 0%, rgba(7, 18, 19, 0.7) 48%, rgba(245, 248, 246, 0.98) 100%),
      linear-gradient(90deg, rgba(7, 18, 19, 0.72) 0%, rgba(7, 18, 19, 0.2) 100%);
  }

  .topbar {
    width: calc(100% - 24px);
    padding: 8px;
    align-items: center;
    gap: 10px;
    background: rgba(7, 18, 19, 0.42);
    border-color: rgba(255, 255, 255, 0.14);
  }

  .brand {
    min-width: 0;
    flex: 1;
    gap: 8px;
  }

  .brand > span:last-child {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.95rem;
  }

  .brand-mark {
    width: 44px;
    height: 34px;
    flex: 0 0 auto;
  }

  .top-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .top-actions .ghost-button {
    display: none;
  }

  .top-actions .solid-button,
  .top-actions .nav-link-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.82rem;
    border-radius: 8px;
  }

  .hero-content {
    width: calc(100% - 24px);
    margin: 56px auto 0;
    padding-bottom: 46px;
  }

  .eyebrow {
    margin-bottom: 8px;
    font-size: 0.72rem;
  }

  h1 {
    width: min(330px, 100%);
    margin-bottom: 12px;
    font-size: clamp(2.25rem, 12vw, 3.35rem);
    line-height: 1.05;
  }

  .hero-copy {
    width: min(330px, 100%);
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.65;
  }

  .hero-search {
    width: 100%;
    gap: 8px;
    margin-top: 20px;
  }

  .search-wrap {
    height: 48px;
    padding: 0 13px;
    background: rgba(255, 255, 255, 0.18);
  }

  .hero-search .solid-button {
    min-height: 46px;
  }

  .stats {
    gap: 8px;
    margin-top: 16px;
  }

  .stats span {
    padding: 7px 10px;
    font-size: 0.85rem;
  }

  .control-band {
    position: relative;
    top: auto;
    z-index: 2;
    background: #f7faf8;
    backdrop-filter: none;
  }

  .control-inner,
  .spotlight,
  .directory,
  .subpage-title,
  .content-layout {
    width: calc(100% - 24px);
  }

  .control-inner {
    padding: 12px 0 10px;
  }

  .tabs {
    gap: 7px;
    margin-right: -12px;
    padding: 0 12px 9px 0;
  }

  .tab {
    height: 34px;
    padding: 0 11px;
    font-size: 0.86rem;
  }

  .filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .filter-row label,
  .sort-wrap {
    align-items: flex-start;
    gap: 5px;
    font-size: 0.82rem;
  }

  .filter-row select,
  .sort-wrap select {
    width: 100%;
    height: 36px;
  }

  .toggle {
    grid-column: 1 / 2;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .result-count {
    grid-column: 2 / 3;
    align-self: center;
    justify-self: end;
    font-size: 0.9rem;
  }

  .spotlight {
    display: block;
    padding: 18px 0 10px;
  }

  .spotlight > div:first-child {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
  }

  .spotlight .section-kicker {
    margin: 0;
    font-size: 0.72rem;
  }

  .spotlight h2,
  .directory h2 {
    font-size: 1.22rem;
  }

  .quick-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(178px, 72%);
    grid-template-columns: none;
    gap: 10px;
    margin: 0 -12px;
    padding: 0 12px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .quick-card {
    min-height: 68px;
    padding: 10px;
    scroll-snap-align: start;
    box-shadow: 0 8px 18px rgba(21, 37, 35, 0.05);
  }

  .quick-icon {
    width: 32px;
    height: 32px;
    font-size: 0.86rem;
  }

  .quick-card strong {
    font-size: 0.92rem;
  }

  .quick-card > span:last-child {
    font-size: 0.78rem;
  }

  .directory {
    padding: 8px 0 42px;
  }

  .directory-head {
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 12px;
  }

  .directory-head .section-kicker {
    margin-bottom: 4px;
    font-size: 0.72rem;
  }

  .sort-wrap {
    width: auto;
    min-width: 112px;
  }

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

  .tool-card {
    min-height: 0;
    padding: 14px;
    box-shadow: 0 8px 22px rgba(21, 37, 35, 0.055);
  }

  .tool-top {
    gap: 10px;
  }

  .tool-logo {
    width: 40px;
    height: 40px;
  }

  .tool-title h3 {
    font-size: 1rem;
  }

  .tool-title span,
  .tool-meta {
    font-size: 0.78rem;
  }

  .fav {
    width: 34px;
    height: 34px;
  }

  .tool-desc {
    margin: 12px 0;
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .tool-tags {
    gap: 6px;
  }

  .tag {
    padding: 4px 7px;
    font-size: 0.74rem;
  }

  .tool-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
  }

  .visit,
  .detail-link {
    min-height: 36px;
    padding: 0 11px;
    font-size: 0.88rem;
  }

  .tool-meta {
    grid-column: 1 / -1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  footer {
    padding: 20px 12px;
    font-size: 0.82rem;
  }

  .subpage-hero .topbar {
    margin-bottom: 34px;
  }

  .subpage-title {
    padding-bottom: 42px;
  }

  .subpage-title h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .content-layout {
    margin: 28px auto 46px;
  }

  .content-panel {
    padding: 16px;
  }

  .content-tool-head {
    align-items: flex-start;
  }

  .content-tool-head h2 {
    font-size: 1.12rem;
  }
}
