:root {
  --bg: #f4f8ff;
  --bg-strong: #eaf2ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --line: rgba(43, 92, 184, 0.12);
  --line-strong: rgba(43, 92, 184, 0.24);
  --text: #14213f;
  --muted: #6a7894;
  --blue: #2f6bff;
  --blue-deep: #1349be;
  --blue-soft: #dfe9ff;
  --danger: #cf4460;
  --success: #2f6bff;
  --shadow: 0 24px 70px rgba(33, 73, 149, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(79, 137, 255, 0.16), transparent 30%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
  font-family: "Manrope", "Noto Sans SC", sans-serif;
}

.site-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(60, 105, 201, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 105, 201, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 92%);
  pointer-events: none;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

code {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-strong);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(248, 251, 255, 0.76);
  border-bottom: 1px solid rgba(43, 92, 184, 0.08);
}

.topbar-inner,
.nav,
.topbar-actions,
.hero-actions,
.tool-actions,
.footer-links,
.form-actions,
.admin-actions,
.collection-footer,
.section-head,
.hero-panel-head,
.tool-card-top,
.featured-meta,
.admin-toolbar,
.active-filter-bar,
.breadcrumb,
.filter-head,
.tool-tags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-inner,
.hero-panel-head,
.tool-card-top,
.featured-meta,
.collection-footer,
.section-head,
.admin-toolbar,
.active-filter-bar,
.filter-head {
  justify-content: space-between;
  align-items: center;
}

.topbar-inner {
  min-height: 82px;
}

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

.brand-badge,
.tool-logo,
.tool-logo-image {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), #78a6ff);
}

.brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.brand strong {
  display: block;
  font-size: 17px;
}

.brand small,
.nav a,
.section-kicker,
.tool-meta,
.tool-tags span,
.status-pill,
.breadcrumb,
.active-filter-summary,
.active-filter-tags span,
.collection-footer span,
.save-status,
.login-note {
  color: var(--muted);
}

.brand small,
.section-kicker,
.tool-meta,
.status-pill,
.active-filter-summary,
.breadcrumb,
.detail-stat span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav {
  gap: 28px;
}

.nav a:hover,
.footer-links a:hover {
  color: var(--blue);
}

.primary-button,
.ghost-button,
.chip,
.text-button,
.link-button {
  transition: 180ms ease;
}

.primary-button,
.ghost-button,
.chip {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #5f95ff);
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(47, 107, 255, 0.22);
}

.ghost-button,
.chip {
  background: rgba(255, 255, 255, 0.86);
}

.primary-button:hover,
.ghost-button:hover,
.chip:hover {
  transform: translateY(-1px);
}

.chip.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), #5f95ff);
}

.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

.text-button,
.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.hero-section,
.content-section,
.footer {
  position: relative;
}

.hero-section {
  padding: 54px 0 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.8fr);
  gap: 28px;
}

.hero-copy {
  padding-top: 18px;
}

.hero-copy h1,
.section-head h2,
.detail-main h1,
.login-card h1 {
  margin: 0;
  line-height: 0.96;
}

.hero-copy h1,
.detail-main h1,
.login-card h1 {
  font-family: "Noto Sans SC", sans-serif;
  font-weight: 900;
}

.hero-copy h1 {
  max-width: 7ch;
  font-size: clamp(3.1rem, 8vw, 6.4rem);
}

.hero-text,
.tool-card-body p,
.featured-card p,
.collection-card p,
.detail-list li,
.footer p,
.empty-state p,
.login-note {
  line-height: 1.8;
  color: var(--muted);
}

.hero-text {
  max-width: 700px;
  margin: 24px 0 0;
  font-size: 17px;
}

.hero-panel,
.featured-card,
.tool-card,
.collection-card,
.detail-panel,
.detail-side,
.detail-stat,
.admin-panel,
.admin-list-item,
.empty-state,
.login-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel,
.detail-side,
.admin-panel,
.login-card {
  border-radius: 28px;
  padding: 22px;
}

.hero-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(236, 244, 255, 0.92));
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(47, 107, 255, 0.12);
}

.search-field {
  display: block;
  margin-top: 18px;
}

.compact-field {
  margin-top: 0;
  flex: 1 1 220px;
}

.search-field input,
.admin-form input,
.admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--text);
  padding: 14px 16px;
  outline: 0;
}

.search-field input {
  min-height: 54px;
}

.search-field input:focus,
.admin-form input:focus,
.admin-form textarea:focus {
  border-color: rgba(47, 107, 255, 0.34);
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.08);
}

.filter-block {
  margin-top: 16px;
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.active-filter-bar {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(43, 92, 184, 0.08);
}

.active-filter-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.active-filter-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-strong);
}

.hero-stats,
.featured-row,
.tools-grid,
.collection-grid,
.detail-content-grid {
  display: grid;
  gap: 18px;
}

.hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 640px;
  margin-top: 28px;
}

.hero-stats article {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.hero-stats strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
}

.content-section {
  padding: 38px 0 10px;
}

.alt-section {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(226, 238, 255, 0.2));
}

.section-head {
  align-items: end;
  margin-bottom: 24px;
}

.section-head.compact {
  align-items: center;
}

.section-head h2,
.detail-panel h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.featured-row,
.tools-grid,
.collection-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.featured-card,
.tool-card,
.collection-card,
.detail-panel,
.empty-state {
  border-radius: 24px;
  padding: 22px;
}

.featured-card,
.collection-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(234, 243, 255, 0.9));
}

.featured-card.has-cover {
  overflow: hidden;
}

.featured-cover {
  margin: -22px -22px 18px;
  height: 180px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.featured-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-card h3,
.tool-card h3,
.collection-card h3,
.empty-state h3 {
  margin: 10px 0 0;
  font-size: 24px;
}

.tool-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tool-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}

.tool-logo-image {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: cover;
  background: #fff;
  border: 1px solid var(--line);
}

.tool-logo.small {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 13px;
}

.tool-logo-image.small {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.tool-meta {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 4px;
}

.tool-card-body h3 {
  margin: 0 0 10px;
}

.tool-card-body p {
  margin: 0;
}

.tool-tags span,
.detail-stat strong {
  font-size: 14px;
}

.tool-tags span {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--bg-strong);
  border: 1px solid rgba(47, 107, 255, 0.08);
}

.collection-card.active {
  border-color: rgba(47, 107, 255, 0.28);
  box-shadow: 0 20px 42px rgba(47, 107, 255, 0.12);
}

.footer {
  padding: 34px 0 54px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 20px;
  border-top: 1px solid rgba(43, 92, 184, 0.1);
}

.detail-page {
  padding-top: 28px;
}

.breadcrumb {
  margin-bottom: 18px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 320px;
  gap: 22px;
}

.detail-main h1 {
  font-size: clamp(2.8rem, 7vw, 5rem);
}

.detail-side {
  display: grid;
  gap: 14px;
}

.detail-cover {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.detail-cover img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.detail-stat {
  border-radius: 22px;
  padding: 18px;
}

.detail-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.detail-content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
}

.detail-list {
  margin: 16px 0 0;
  padding-left: 20px;
}

.detail-list li + li {
  margin-top: 12px;
}

.related-section {
  margin-top: 38px;
}

.empty-state {
  display: grid;
  align-content: center;
  min-height: 220px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 22px;
}

.admin-panel {
  min-height: 720px;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-list-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  text-align: left;
}

.admin-list-item.active {
  border-color: rgba(47, 107, 255, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(231, 240, 255, 0.96));
}

.admin-list-item strong {
  display: block;
  font-size: 16px;
}

.admin-list-item p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.admin-form {
  display: grid;
  gap: 16px;
}

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

.upload-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-strong);
}

.upload-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.upload-head span {
  color: var(--muted);
  font-size: 13px;
}

.image-preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  border-radius: 18px;
  border: 1px dashed var(--line-strong);
  background: var(--bg-strong);
  color: var(--muted);
  overflow: hidden;
}

.image-preview.empty {
  padding: 20px;
}

.image-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.icon-preview {
  min-height: 140px;
}

.upload-control {
  display: block;
  margin-top: 12px;
}

.upload-control span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.upload-control input {
  display: none;
}

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

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

.admin-form label {
  display: grid;
  gap: 10px;
}

.admin-form label > span {
  font-size: 14px;
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.save-status {
  min-height: 22px;
  font-size: 14px;
}

.save-status[data-type="error"] {
  color: var(--danger);
}

.login-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
}

.login-card {
  width: min(100%, 520px);
}

.login-card h1 {
  margin-top: 8px;
  font-size: clamp(2.4rem, 7vw, 4rem);
}

.form-error {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(207, 68, 96, 0.1);
  color: var(--danger);
  margin-bottom: 16px;
}

.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;
}

@media (max-width: 1080px) {
  .hero-grid,
  .detail-hero,
  .admin-grid,
  .detail-content-grid {
    grid-template-columns: 1fr;
  }

  .featured-row,
  .tools-grid,
  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-inner,
  .section-head,
  .footer-inner,
  .admin-toolbar {
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  .topbar-inner {
    min-height: auto;
    padding: 14px 0;
  }

  .nav {
    gap: 14px;
  }

  .hero-section {
    padding-top: 28px;
  }

  .hero-copy h1,
  .detail-main h1 {
    max-width: none;
    font-size: clamp(2.7rem, 16vw, 4.6rem);
  }

  .hero-stats,
  .featured-row,
  .tools-grid,
  .collection-grid,
  .detail-content-grid,
  .form-grid,
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .tool-actions,
  .topbar-actions,
  .form-actions,
  .footer-links {
    width: 100%;
  }

  .primary-button,
  .ghost-button {
    flex: 1 1 auto;
  }
}
