:root {
  color-scheme: dark;
  --bg: #0b0f12;
  --surface: #111820;
  --surface-2: #16212a;
  --line: #24313b;
  --text: #eff4f7;
  --muted: #95a4ad;
  --muted-2: #6e7f89;
  --teal: #4dd7b0;
  --amber: #f4c95d;
  --coral: #ff7867;
  --blue: #7bb9ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(77, 215, 176, 0.08), transparent 240px),
    radial-gradient(circle at top right, rgba(244, 201, 93, 0.08), transparent 340px),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

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

button,
input {
  font: inherit;
}

.site-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto auto minmax(260px, 520px) auto;
  gap: 16px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  background: rgba(11, 15, 18, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.compact-topbar {
  grid-template-columns: auto 1fr;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 178px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  background: #0e1717;
  border: 1px solid rgba(77, 215, 176, 0.28);
  border-radius: 8px;
}

.brand-mark svg {
  width: 32px;
  height: 32px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.site-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
}

.site-nav a:hover {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.site-nav .admin-entry {
  color: var(--amber);
  border-color: rgba(244, 201, 93, 0.28);
  background: rgba(244, 201, 93, 0.08);
}

.site-nav .admin-entry:hover {
  color: #fff2bf;
  border-color: rgba(244, 201, 93, 0.5);
  background: rgba(244, 201, 93, 0.14);
}

.searchbar {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.searchbar svg,
.tool-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.searchbar svg path,
.tool-link svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.searchbar svg {
  color: var(--muted);
  margin-right: 10px;
}

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

.searchbar input::placeholder {
  color: var(--muted-2);
}

.submit-link,
.tiny-button,
.chip,
.category-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.submit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  white-space: nowrap;
}

.submit-link:hover,
.tiny-button:hover,
.chip:hover,
.category-button:hover {
  border-color: rgba(77, 215, 176, 0.6);
  background: rgba(77, 215, 176, 0.1);
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.sidebar {
  position: sticky;
  top: 108px;
  align-self: start;
}

.category-header,
.section-head,
.tool-topline,
.toolbar {
  display: flex;
  align-items: center;
}

.category-header,
.section-head {
  justify-content: space-between;
  gap: 16px;
}

.category-header {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.tiny-button {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

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

.category-button {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  text-align: left;
}

.category-button.active {
  border-color: rgba(77, 215, 176, 0.7);
  background: rgba(77, 215, 176, 0.12);
}

.category-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--amber);
  font-size: 14px;
  font-weight: 700;
}

.category-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-count {
  color: var(--muted);
  font-size: 12px;
}

.content {
  min-width: 0;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 24px;
  align-items: stretch;
  min-height: 300px;
  padding: 26px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(77, 215, 176, 0.16), transparent 44%),
    linear-gradient(315deg, rgba(244, 201, 93, 0.14), transparent 46%),
    #10171d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.hero-copy {
  align-self: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 16px;
  font-size: clamp(34px, 5.2vw, 68px);
  line-height: 0.96;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.hero-copy p:last-child {
  max-width: 620px;
  margin-bottom: 0;
  color: #b7c3ca;
  font-size: 16px;
  line-height: 1.8;
}

.hero-visual {
  position: relative;
  min-height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    #0b1115;
  background-size: 34px 34px;
}

.hero-visual::before,
.hero-visual::after {
  position: absolute;
  content: "";
  inset: 42px;
  border: 1px solid rgba(77, 215, 176, 0.28);
  transform: rotate(45deg);
}

.hero-visual::after {
  inset: 78px;
  border-color: rgba(244, 201, 93, 0.28);
  transform: rotate(45deg);
}

.signal-card {
  position: absolute;
  z-index: 1;
  display: grid;
  min-width: 96px;
  min-height: 46px;
  place-items: center;
  padding: 10px 12px;
  background: rgba(17, 24, 32, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
}

.signal-main {
  top: 50%;
  left: 50%;
  width: 150px;
  height: 110px;
  transform: translate(-50%, -50%);
  border-color: rgba(77, 215, 176, 0.58);
}

.signal-main span {
  color: var(--amber);
  font-size: 28px;
  font-weight: 800;
}

.signal-main strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.signal-top {
  top: 28px;
  left: 32px;
}

.signal-right {
  right: 28px;
  top: 86px;
  color: var(--blue);
}

.signal-bottom {
  right: 70px;
  bottom: 30px;
  color: var(--coral);
}

.ad-slot {
  border: 1px dashed rgba(244, 201, 93, 0.55);
  border-radius: 8px;
  background: rgba(244, 201, 93, 0.07);
}

.ad-slot strong,
.ad-slot p,
.ad-label {
  display: block;
}

.ad-label {
  margin-bottom: 8px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
}

.ad-slot strong {
  margin-bottom: 6px;
  font-size: 15px;
}

.ad-slot p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.ad-sidebar {
  margin-top: 18px;
  padding: 16px;
}

.ad-wide {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 90px;
  margin: 18px 0;
  padding: 18px;
}

.ad-wide .ad-label,
.ad-wide strong,
.ad-wide p {
  margin: 0;
}

.article-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
  padding: 18px;
  background: rgba(17, 24, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.article-feature h2 {
  margin-bottom: 8px;
}

.article-feature p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.feature-link {
  min-width: 132px;
  padding: 0 16px;
}

.result-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 16px;
}

.chip {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
}

.chip.active {
  color: var(--text);
  border-color: rgba(77, 215, 176, 0.7);
  background: rgba(77, 215, 176, 0.12);
}

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

.tool-card {
  display: flex;
  min-height: 252px;
  flex-direction: column;
  padding: 16px;
  background: rgba(17, 24, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.tool-card:hover {
  border-color: rgba(77, 215, 176, 0.5);
  background: #131d25;
  transform: translateY(-2px);
}

.tool-topline {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.tool-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  color: #08100f;
  font-weight: 900;
}

.tool-badge {
  overflow: hidden;
  max-width: 120px;
  padding: 5px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-card h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.tool-desc {
  min-height: 64px;
  margin-bottom: 12px;
  color: #b3c0c8;
  font-size: 14px;
  line-height: 1.55;
}

.tool-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tool-tags span {
  padding: 4px 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 12px;
}

.tool-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: auto;
  color: #0b0f12;
  background: var(--teal);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.tool-link:hover {
  background: #6ee4c3;
}

.empty-state {
  padding: 36px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
}

.single-column {
  max-width: 1180px;
  margin: 18px auto 0;
}

.article-hero {
  grid-template-columns: 1fr;
  min-height: 230px;
}

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

.article-card {
  display: flex;
  min-height: 245px;
  flex-direction: column;
  padding: 16px;
  background: rgba(17, 24, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.article-card h2 {
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.35;
}

.article-card h2 a:hover {
  color: var(--teal);
}

.article-card p {
  color: #b3c0c8;
  font-size: 14px;
  line-height: 1.65;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 860px) 280px;
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.article-page {
  padding: 28px;
  background: rgba(17, 24, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.article-page h1 {
  max-width: 820px;
  margin: 8px 0 18px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
}

.article-page h2 {
  margin: 28px 0 12px;
  font-size: 22px;
}

.article-page p,
.article-page li {
  color: #c5d0d7;
  font-size: 16px;
  line-height: 1.9;
}

.article-page a {
  color: var(--teal);
}

.breadcrumb {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a {
  color: var(--muted);
}

.source-box {
  margin-top: 30px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.source-box ul {
  margin: 0;
  padding-left: 20px;
}

.article-pagination {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.article-pagination a,
.toc-card a {
  display: block;
  padding: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-pagination a:hover,
.toc-card a:hover {
  border-color: rgba(77, 215, 176, 0.6);
}

.article-aside {
  position: sticky;
  top: 108px;
  display: grid;
  gap: 18px;
}

.toc-card {
  padding: 16px;
  background: rgba(17, 24, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.toc-card h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.toc-card a + a {
  margin-top: 8px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}

.admin-hero,
.admin-panel {
  padding: 28px;
  background: rgba(17, 24, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.admin-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.admin-hero h1 {
  margin: 8px 0 14px;
  font-size: clamp(32px, 4vw, 54px);
}

.admin-hero p:last-of-type {
  max-width: 520px;
  color: #b7c3ca;
  line-height: 1.8;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.metric-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 26px;
}

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

.admin-panel {
  align-self: start;
}

.login-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.login-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  background: rgba(77, 215, 176, 0.08);
  border: 1px solid rgba(77, 215, 176, 0.28);
  border-radius: 8px;
  color: var(--teal);
}

.login-mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

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

.field input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

.field input::placeholder {
  color: var(--muted-2);
}

.field input:focus {
  border-color: rgba(77, 215, 176, 0.7);
  box-shadow: 0 0 0 3px rgba(77, 215, 176, 0.12);
}

.password-row,
.captcha-row,
.field-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.password-row input,
.captcha-row input {
  flex: 1 1 auto;
}

.captcha-box {
  display: grid;
  flex: 0 0 110px;
  height: 46px;
  place-items: center;
  color: var(--amber);
  background: rgba(244, 201, 93, 0.08);
  border: 1px solid rgba(244, 201, 93, 0.28);
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.ghost-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.ghost-button {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  color: #08100f;
  background: var(--teal);
  font-weight: 800;
}

.primary-button:hover {
  background: #6ee4c3;
}

.check-row {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.helper-link {
  color: var(--muted);
  font-size: 13px;
}

.login-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.login-hint {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 14px 16px;
  background: rgba(244, 201, 93, 0.08);
  border: 1px dashed rgba(244, 201, 93, 0.32);
  border-radius: 8px;
}

.login-hint span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-hint strong {
  font-size: 16px;
}

.dashboard-grid {
  display: grid;
  gap: 12px;
}

.dashboard-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dashboard-card strong {
  font-size: 16px;
}

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

.dashboard-card:hover {
  border-color: rgba(77, 215, 176, 0.6);
  background: rgba(77, 215, 176, 0.08);
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .submit-link {
    width: 100%;
  }

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

  .sidebar {
    position: static;
  }

  .category-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

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

  .article-aside {
    position: static;
  }

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

  .admin-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-shell {
    padding: 10px;
  }

  .topbar,
  .hero-panel {
    border-radius: 8px;
  }

  .hero-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  h1 {
    font-size: 38px;
  }

  .hero-visual {
    min-height: 210px;
  }

  .category-list,
  .tools-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .article-page {
    padding: 18px;
  }

  .admin-hero,
  .admin-panel {
    padding: 18px;
  }

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

  .password-row,
  .captcha-row,
  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .captcha-box {
    flex-basis: auto;
  }

  .tool-desc {
    min-height: auto;
  }
}

@media (max-width: 420px) {
  .brand {
    min-width: 0;
  }

  .hero-copy p:last-child {
    font-size: 14px;
  }

  .signal-top {
    left: 16px;
  }

  .signal-right {
    right: 12px;
  }

  .signal-bottom {
    right: 42px;
  }
}
