:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-raised: #ffffff;
  --text: #111827;
  --muted: #667085;
  --subtle: #98a2b3;
  --border: #e5e7eb;
  --border-strong: #d7dde8;
  --border-hover: #cfe0fb;
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --primary-soft: #eaf2ff;
  --teal: #14b8a6;
  --green: #22c55e;
  --inverse-text: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.96);
  --nav-text: #344054;
  --control-bg: #ffffff;
  --control-icon: #475467;
  --hover-bg: #fbfdff;
  --active-bg: #e5e5e5;
  --focus-ring: rgba(22, 119, 255, 0.22);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-icon: 0 8px 18px rgba(15, 23, 42, 0.08);
  --toast-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  --radius: 8px;
  --header-height: 64px;
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", Arial, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b111c;
  --surface: #121a27;
  --surface-soft: #172131;
  --surface-raised: #1a2434;
  --text: #edf3fb;
  --muted: #a6b3c4;
  --subtle: #7f8da2;
  --border: #273449;
  --border-strong: #33445d;
  --border-hover: #3d5f92;
  --primary: #63a7ff;
  --primary-dark: #3b82f6;
  --primary-soft: rgba(99, 167, 255, 0.16);
  --teal: #2dd4bf;
  --green: #4ade80;
  --inverse-text: #ffffff;
  --header-bg: rgba(13, 20, 32, 0.94);
  --nav-text: #c3ccda;
  --control-bg: #101827;
  --control-icon: #a6b3c4;
  --hover-bg: #1c2a3d;
  --active-bg: #223049;
  --focus-ring: rgba(99, 167, 255, 0.32);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.34);
  --shadow-icon: 0 10px 22px rgba(0, 0, 0, 0.22);
  --toast-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-height);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(100%, 1440px);
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 210px 1fr auto;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 22px;
  white-space: nowrap;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(145deg, #2f8cff, #075fff);
  box-shadow: 0 6px 14px rgba(22, 119, 255, 0.28);
  font-weight: 900;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  min-width: 0;
}

.nav-link {
  position: relative;
  height: var(--header-height);
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  color: var(--nav-text);
  background: transparent;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: transparent;
}

.nav-link.is-active {
  color: var(--primary);
}

.nav-link.is-active::after {
  background: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-search-form {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search {
  width: 286px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 14px 3px 4px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--control-bg);
  color: var(--muted);
}

.search-icon {
  width: 30px;
  height: 30px;
  position: relative;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--control-icon);
}

.search-icon::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(8px, 8px) rotate(45deg);
  transform-origin: center;
}

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

.search-submit-button {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--inverse-text);
  font-weight: 650;
  white-space: nowrap;
}

.search-submit-button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.search-submit-button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  position: relative;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--control-icon);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.theme-toggle:hover {
  border-color: var(--border-hover);
  background: var(--hover-bg);
  color: var(--primary);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-toggle-icon {
  width: 16px;
  height: 16px;
  position: relative;
  display: block;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.theme-toggle-icon::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) 50% 0 / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 50% 100% / 2px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 4px 2px no-repeat,
    linear-gradient(currentColor, currentColor) 100% 50% / 4px 2px no-repeat;
}

html[data-theme="dark"] .theme-toggle-icon {
  width: 17px;
  height: 17px;
  border: 0;
  background: currentColor;
  box-shadow: inset -6px -2px 0 var(--control-bg);
}

html[data-theme="dark"] .theme-toggle-icon::before {
  display: none;
}

.app-shell {
  width: min(100%, 1560px);
  margin: 0 auto;
  padding: 24px 28px 36px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.section-copy {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 650;
  white-space: nowrap;
  background: transparent;
}

.home-layout {
  display: grid;
  gap: 36px;
}

.home-articles,
.home-tools {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

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

.article-visual {
  min-height: 250px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #081a42, #155eef);
}

.article-visual img,
.thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.article-visual:has(img),
.thumb:has(img) {
  padding: 0;
  overflow: hidden;
}

.article-visual[data-cover="red"] {
  background: linear-gradient(135deg, #fb7185, #ef4444);
}

.article-visual[data-cover="code"] {
  background: linear-gradient(135deg, #111827, #6d28d9);
}

.article-visual[data-cover="green"] {
  background: linear-gradient(135deg, #059669, #14b8a6);
}

.article-visual[data-cover="blue"] {
  background: linear-gradient(135deg, #1d4ed8, #60a5fa);
}

.visual-label {
  max-width: 100%;
  padding: 7px 12px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
  display: -webkit-box;
  overflow: hidden;
  max-height: calc(1.35em * 3);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  text-align: center;
  text-decoration: none;
  font-weight: 750;
  line-height: 1.35;
  cursor: default;
  pointer-events: none;
  word-break: break-word;
}

.article-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

.article-summary {
  margin: 10px 0 16px;
  color: var(--muted);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.article-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 0;
  padding: 8px;
  overflow: hidden;
}

.article-row,
.tutorial-card {
  text-decoration: none;
}

.article-row,
.tool-card,
.tool-tile,
.tutorial-featured,
.tutorial-card,
.sidebar-item,
.route-item {
  cursor: pointer;
}

.article-row:hover,
.tool-card:hover,
.tool-tile:hover,
.tutorial-featured:hover,
.tutorial-card:hover,
.sidebar-item:hover,
.route-item:hover {
  border-color: #cfe0fb;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.article-row:focus-visible,
.tool-card:focus-visible,
.tool-tile:focus-visible,
.tutorial-featured:focus-visible,
.tutorial-card:focus-visible,
.sidebar-item:focus-visible,
.route-item:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.22);
  outline-offset: 2px;
}

.thumb {
  min-height: 84px;
  padding: 12px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  background: linear-gradient(135deg, #1677ff, #7c3aed);
}

.thumb .visual-label {
  padding: 6px 9px;
  border-radius: 6px;
}

.load-more-row {
  display: flex;
  justify-content: center;
  margin: 10px 0 0;
  padding: 0;
  background: transparent;
}

.load-more-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: #fff;
  color: #4f9bff;
  font-weight: 750;
  font-size: 16px;
  text-decoration: none;
}

.load-more-button:hover {
  border-color: #cfe0fb;
  background: #fbfdff;
}

.load-more-button:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.22);
  outline-offset: 2px;
}

.article-row h3,
.tool-card h3,
.tool-tile h3,
.tutorial-card h3,
.sidebar-item h4 {
  margin: 0;
  line-height: 1.35;
}

.article-row p,
.tool-card p,
.tool-tile p,
.tutorial-card p,
.sidebar-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

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

.tool-card {
  min-height: 150px;
  padding: 18px;
  text-align: center;
  color: inherit;
  text-decoration: none;
}

.home-tools .section-head {
  margin-bottom: 12px;
}

.home-tools .section-title {
  font-size: 24px;
}

.home-tools .section-copy {
  margin-top: 4px;
}

.home-tools .tool-card {
  min-height: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.tool-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent, var(--primary));
  background: #fff;
  border: 1px solid #e3e8f1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  font-weight: 900;
}

.tool-icon img,
.tile-icon img {
  width: 68%;
  height: 68%;
  object-fit: contain;
}

.home-tools .tool-icon {
  width: 42px;
  height: 42px;
  margin: 0;
  font-size: 12px;
}

.home-tools .tool-card p,
.home-tools .small-button {
  display: none;
}

.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid #cfe0fb;
  border-radius: 6px;
  color: var(--primary);
  background: #fff;
  font-weight: 650;
  text-decoration: none;
}

.directory-shell {
  padding: 16px 12px 20px 0;
}

.tool-directory-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.tool-directory-main {
  min-width: 0;
}

.tool-sidebar {
  position: sticky;
  top: 112px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 8px 6px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  scrollbar-width: none;
}

.tool-sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-category + .sidebar-category {
  margin-top: 4px;
}

.sidebar-category-button,
.sidebar-subcategory {
  width: 100%;
  display: grid;
  align-items: center;
  text-align: left;
  border-radius: 6px;
  background: transparent;
  color: #475467;
  font-size: 13px;
  text-decoration: none;
}

.sidebar-category-button {
  min-height: 40px;
  grid-template-columns: 22px minmax(0, 1fr) 12px;
  gap: 8px;
  padding: 0 8px;
  font-weight: 750;
  font-size: 14px;
}

.sidebar-category-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-category.is-active .sidebar-category-button {
  color: #5b5ff4;
  background: #e5e5e5;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.sidebar-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-arrow {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
  justify-self: center;
}

.sidebar-category.is-active .sidebar-arrow {
  transform: rotate(45deg);
}

.sidebar-subcategories {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 0 4px 30px;
}

.sidebar-subcategory {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 30px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
}

.sidebar-subcategory.is-active {
  color: #5b5ff4;
  background: #e5e5e5;
  justify-content: flex-start;
}

.category-strip {
  display: flex;
  gap: 8px 24px;
  align-items: center;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}

.category-button {
  position: relative;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  color: #475467;
  background: transparent;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.category-button.is-active {
  color: var(--primary);
}

.category-button.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
}

.search-field {
  width: min(760px, 100%);
  height: 54px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
}

.field-search-icon {
  width: 40px;
  height: 40px;
  position: relative;
  flex: 0 0 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475467;
}

.field-search-icon::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.field-search-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(8px, 8px) rotate(45deg);
  transform-origin: center;
}

.tool-search-field {
  width: min(260px, 100%);
  height: 44px;
  padding: 2px 12px 2px 6px;
}

.tutorial-search-field {
  width: min(253px, 100%);
  height: 44px;
  padding: 2px 12px 2px 6px;
}

.chip-row,
.subtab-row,
.filter-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip,
.subtab,
.filter-chip,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: #344054;
  font-weight: 650;
  text-decoration: none;
}

.subtab-row {
  width: max-content;
  max-width: 100%;
  margin: 12px 0 16px;
  padding: 5px 6px;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  border-radius: 999px;
  background: #e5e5e5;
  scrollbar-width: none;
}

.subtab-row::-webkit-scrollbar {
  display: none;
}

.subtab {
  min-height: 34px;
  padding: 4px 18px;
  border-radius: 999px;
  background: transparent;
  border-color: transparent;
  color: #808080;
  white-space: nowrap;
  font-weight: 500;
}

.chip.is-active,
.filter-chip.is-active,
.tag.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #b8d6ff;
}

.subtab.is-active {
  color: #fff;
  background: linear-gradient(135deg, #5f6bff, #5b4ff5);
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(91, 79, 245, 0.18);
}

.directory-section {
  padding-top: 18px;
  scroll-margin-top: 84px;
}

.directory-section + .directory-section {
  padding-top: 20px;
}

.directory-section .section-head {
  margin-bottom: 12px;
}

.directory-section .section-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.28;
  color: #182230;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.tool-tile {
  min-height: 78px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  color: inherit;
  text-decoration: none;
}

.tile-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent, var(--primary));
  background: #fff;
  border: 1px solid #e3e8f1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  font-weight: 900;
  font-size: 13px;
}

.tool-tile p,
.article-row p,
.sidebar-item p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.tool-tile h3 {
  font-size: 15px;
}

.tool-detail-layout {
  display: block;
}

.tool-detail-main {
  padding: 24px;
}

.tool-detail-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-top: 18px;
}

.tool-detail-cover {
  width: 180px;
  max-width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  background: linear-gradient(135deg, var(--accent, var(--primary)), #7c3aed);
  font-size: 42px;
  font-weight: 900;
}

.tool-detail-cover:not(.tool-detail-cover-icon):has(img) {
  background: #fff;
  border: 1px solid #e3e8f1;
}

.tool-detail-cover img {
  width: min(72%, 128px);
  height: min(72%, 128px);
  max-width: 128px;
  max-height: 128px;
  object-fit: contain;
}

.tool-detail-cover-icon {
  background: #fff;
  border: 1px solid #e3e8f1;
}

.tool-detail-cover-icon img {
  width: min(72%, 128px);
  height: min(72%, 128px);
  max-width: 128px;
  max-height: 128px;
  object-fit: contain;
}

.tool-detail-summary h1 {
  margin: 14px 0 10px;
  font-size: 34px;
  line-height: 1.2;
}

.tool-detail-summary p {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
}

.tool-detail-tags {
  gap: 8px;
}

.tool-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.primary-link-button,
.secondary-link-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 6px;
  font-weight: 750;
  text-decoration: none;
}

.primary-link-button {
  color: #fff;
  background: var(--primary);
}

.secondary-link-button {
  color: var(--primary);
  border: 1px solid #b8d6ff;
  background: #fff;
}

.tool-detail-content {
  margin-top: 28px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.tool-detail-content h2 {
  margin: 22px 0 10px;
  font-size: 22px;
}

.tool-detail-content p {
  margin: 0 0 12px;
  color: #344054;
  line-height: 1.8;
}

.tool-detail-bullet {
  padding-left: 14px;
  position: relative;
}

.tool-detail-numbered {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 6px;
}

.tool-detail-numbered .numbered-index {
  color: var(--primary);
  font-weight: 750;
}

.tool-detail-numbered .numbered-body {
  min-width: 0;
}

.tool-detail-bullet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.empty-state {
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.tutorial-page {
  display: grid;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 25px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 750;
}

.tutorial-list {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.tutorial-card {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: 116px;
  padding: 14px;
}

.tutorial-card .article-visual {
  min-height: 96px;
  border-radius: var(--radius);
}

.tutorial-card h3 {
  font-size: 22px;
  line-height: 1.25;
}

.tutorial-card p {
  margin-top: 8px;
  color: #5f6f85;
  font-size: 16px;
  line-height: 1.65;
  -webkit-line-clamp: 2;
}

.tutorial-card .meta-row {
  display: none;
}

.article-info-panel {
  min-width: 0;
  padding: 18px 18px 16px;
  display: grid;
  gap: 12px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
}

.article-info-title {
  margin: 0;
  color: var(--text);
  font-size: 26px;
  line-height: 1.18;
  font-weight: 800;
}

.article-info-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
}

.article-info-chip {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 700;
}

.article-info-icon {
  width: 32px;
  height: 32px;
  position: relative;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #eaf4ff;
  color: var(--primary);
}

.article-info-icon-calendar::before {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.article-info-icon-calendar::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 2px;
  top: 11px;
  border-radius: 999px;
  background: currentColor;
}

.article-info-icon-book::before {
  content: "";
  width: 14px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 2px 5px 5px 2px;
}

.article-info-icon-book::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 14px;
  left: 13px;
  border-radius: 999px;
  background: currentColor;
}

.article-info-icon-hash::before {
  content: "#";
  color: currentColor;
  font-size: 24px;
  line-height: 1;
  font-weight: 850;
}

.article-info-summary {
  margin: 0;
  color: #5f6f85;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 650;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.article-info-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #747e84;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 750;
}

.tutorial-card .article-info-title {
  font-size: 22px;
  line-height: 1.2;
  display: -webkit-box;
  overflow: hidden;
  max-height: calc(2 * 1.2em);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.tutorial-card .article-info-summary {
  margin: 0;
  color: #5f6f85;
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  max-height: calc(2 * 1.45em);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.tutorial-card .article-info-panel {
  padding: 12px 14px;
  gap: 7px;
}

.tutorial-card .article-info-meta {
  gap: 5px 13px;
}

.tutorial-card .article-info-chip {
  gap: 5px;
  color: #667085;
  font-size: 12px;
  font-weight: 650;
}

.tutorial-card .article-info-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  border-radius: 4px;
  background: transparent;
  color: #2f80ed;
}

.tutorial-card .article-info-icon-calendar::before {
  width: 12px;
  height: 12px;
  border-width: 1.5px;
}

.tutorial-card .article-info-icon-calendar::after {
  width: 10px;
  height: 1.5px;
  top: 7px;
}

.tutorial-card .article-info-icon-book::before {
  width: 10px;
  height: 12px;
  border-width: 1.5px;
  border-radius: 2px 4px 4px 2px;
}

.tutorial-card .article-info-icon-book::after {
  width: 1.5px;
  height: 10px;
  left: 8px;
}

.tutorial-card .article-info-icon-hash::before {
  font-size: 18px;
  font-weight: 800;
}

.tutorial-card .article-info-stats {
  font-size: 12px;
  gap: 10px;
}

.article-row .article-info-panel {
  padding: 10px 12px;
  gap: 4px;
}

.article-row .article-info-title {
  font-size: 17px;
  line-height: 1.2;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.article-row .article-info-meta {
  gap: 3px 8px;
}

.article-row .article-info-chip {
  font-size: 11px;
}

.article-row .article-info-icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  border-radius: 6px;
}

.article-row .article-info-icon-calendar::before {
  width: 10px;
  height: 10px;
}

.article-row .article-info-icon-calendar::after {
  width: 9px;
  top: 8px;
}

.article-row .article-info-icon-book::before {
  width: 9px;
  height: 11px;
}

.article-row .article-info-icon-book::after {
  height: 9px;
  left: 9px;
}

.article-row .article-info-icon-hash::before {
  font-size: 17px;
}

.article-row .article-info-summary {
  font-size: 12px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
}

.article-row .article-info-stats {
  font-size: 11px;
  gap: 8px;
}

.tutorial-detail {
  padding: 26px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 18px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: #344054;
  font-weight: 650;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(260px, 38%) 1fr;
  gap: 24px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.detail-hero .article-visual {
  min-height: 240px;
  border-radius: var(--radius);
}

.detail-hero h1 {
  margin: 14px 0 12px;
  font-size: 34px;
  line-height: 1.22;
  letter-spacing: 0;
}

.detail-hero p {
  margin: 0 0 18px;
  color: #475467;
  font-size: 16px;
}

.detail-body {
  max-width: 880px;
  padding: 24px 0 8px;
}

.detail-section + .detail-section {
  margin-top: 24px;
}

.detail-section h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.detail-section p,
.detail-section li {
  color: #475467;
  font-size: 16px;
  line-height: 1.85;
}

.detail-section ol {
  margin: 0;
  padding-left: 22px;
}

.markdown-body {
  color: #344054;
  font-size: 16px;
  line-height: 1.85;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 30px 0 12px;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: 0;
}

.markdown-body h1 {
  font-size: 28px;
}

.markdown-body h2 {
  font-size: 24px;
}

.markdown-body h3 {
  font-size: 20px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre {
  margin: 0 0 16px;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 24px;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 18px 0 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.markdown-body blockquote {
  padding: 12px 16px;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-soft);
  color: #475467;
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-soft);
  color: #1d4ed8;
  font-size: 0.92em;
}

.markdown-body pre {
  overflow-x: auto;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: #111827;
  color: #f8fafc;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.related-block {
  margin-top: 18px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.faq-block + .related-block {
  margin-top: 38px;
  padding-top: 32px;
}

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

.related-grid .tutorial-card {
  grid-template-columns: 1fr;
}

.related-tool-grid,
.related-tutorial-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.related-tool-card,
.related-tutorial-card {
  color: var(--text);
  text-decoration: none;
}

.related-tool-card {
  position: relative;
  display: grid;
  min-height: 96px;
  gap: 16px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  padding: 18px 56px 18px 20px;
  border-color: #dbe5ef;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.07), rgba(255, 255, 255, 0) 44%),
    #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.related-tool-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #14b8a6, #1677ff);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.related-tool-card:hover,
.related-tool-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.38);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.related-tool-card:hover::before,
.related-tool-card:focus-visible::before {
  opacity: 1;
}

.related-tool-card:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.22);
  outline-offset: 3px;
}

.related-tool-card .tile-icon {
  width: 48px;
  height: 48px;
  font-size: 14px;
}

.related-tool-body {
  min-width: 0;
}

.related-tutorial-card {
  position: relative;
  display: flex;
  min-height: 154px;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 54px 18px 20px;
  overflow: hidden;
  border-color: #dbe5ef;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.08), rgba(255, 255, 255, 0) 42%),
    #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.related-tutorial-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #1677ff, #14b8a6);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.related-tutorial-card:hover,
.related-tutorial-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(22, 119, 255, 0.38);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
}

.related-tutorial-card:hover::before,
.related-tutorial-card:focus-visible::before {
  opacity: 1;
}

.related-tutorial-card:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.22);
  outline-offset: 3px;
}

.related-tool-card h3 {
  margin: 0 0 7px;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 800;
}

.related-tool-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
  font-weight: 650;
}

.related-tool-arrow {
  position: absolute;
  top: 50%;
  right: 20px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #d8e5f3;
  border-radius: 50%;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.86);
  font-size: 22px;
  font-weight: 750;
  line-height: 1;
  transform: translateY(-50%);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.related-tool-card:hover .related-tool-arrow,
.related-tool-card:focus-visible .related-tool-arrow {
  transform: translate(2px, -50%);
  border-color: #14b8a6;
  background: #14b8a6;
  color: #fff;
}

.related-tutorial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.related-tutorial-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border: 1px solid #e4edf7;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.86);
}

.related-tutorial-content {
  display: grid;
  gap: 10px;
}

.related-tutorial-card h3 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #101828;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.related-tutorial-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #667085;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.related-tutorial-arrow {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  background: #fff;
  color: #1677ff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.related-tutorial-card:hover .related-tutorial-arrow,
.related-tutorial-card:focus-visible .related-tutorial-arrow {
  transform: translateX(2px);
  border-color: #1677ff;
  background: #1677ff;
  color: #fff;
}

.faq-block {
  margin-top: 26px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.faq-block .section-title {
  margin-bottom: 18px;
}

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

.faq-item {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(22, 119, 255, 0.06), rgba(255, 255, 255, 0) 38%),
    #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.faq-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #1677ff, #14b8a6);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.faq-item:hover,
.faq-item[open] {
  border-color: rgba(22, 119, 255, 0.34);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.085);
}

.faq-item[open]::before {
  opacity: 1;
}

.faq-item summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 18px 18px 18px 22px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--text);
}

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

.faq-question {
  color: #101828;
  font-size: 18px;
  line-height: 1.45;
}

.faq-toggle {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #dbe5ef;
  border-radius: 999px;
  background: #fff;
  color: #1677ff;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.faq-toggle::before,
.faq-toggle::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.faq-toggle::after {
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}

.faq-item[open] .faq-toggle {
  transform: rotate(180deg);
  border-color: #1677ff;
  background: #1677ff;
  color: #fff;
}

.faq-item[open] .faq-toggle::after {
  transform: rotate(0deg);
}

.faq-answer {
  padding: 0 22px 18px;
}

.faq-answer p {
  margin: 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.92);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.75;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.page-button {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: #475467;
}

.page-button.is-active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.sidebar-block + .sidebar-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.sidebar-title {
  display: flex;
  justify-content: space-between;
  margin: 0 0 14px;
  font-size: 18px;
}

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

.sidebar-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  align-items: center;
}

.sidebar-thumb {
  height: 50px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent, var(--primary));
  font-weight: 800;
}

.route-list {
  display: grid;
  gap: 10px;
}

.route-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.site-toast {
  position: fixed;
  left: 50%;
  top: 84px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 32px));
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: #344054;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.site-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.about-hero {
  min-height: 330px;
  display: block;
  align-items: center;
  padding: 54px 74px;
  border-color: #cfe0fb;
  background: linear-gradient(135deg, #fbfdff, #f5f9ff);
}

.about-hero h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 58px);
  letter-spacing: 0;
}

.about-hero p {
  max-width: 650px;
  margin: 20px 0 30px;
  color: #475467;
  font-size: 20px;
  line-height: 1.8;
}

.about-points {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: #344054;
  font-weight: 650;
}

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

.about-card {
  padding: 28px;
}

.about-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.about-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.about-card li + li {
  margin-top: 10px;
}

.site-footer {
  margin-top: 24px;
  padding: 22px 0 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

html[data-theme="dark"] .brand-logo {
  filter: drop-shadow(0 0 10px rgba(99, 167, 255, 0.22));
}

html[data-theme="dark"] .article-row:hover,
html[data-theme="dark"] .tool-card:hover,
html[data-theme="dark"] .tool-tile:hover,
html[data-theme="dark"] .tutorial-featured:hover,
html[data-theme="dark"] .tutorial-card:hover,
html[data-theme="dark"] .sidebar-item:hover,
html[data-theme="dark"] .route-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

html[data-theme="dark"] .article-row:focus-visible,
html[data-theme="dark"] .tool-card:focus-visible,
html[data-theme="dark"] .tool-tile:focus-visible,
html[data-theme="dark"] .tutorial-featured:focus-visible,
html[data-theme="dark"] .tutorial-card:focus-visible,
html[data-theme="dark"] .sidebar-item:focus-visible,
html[data-theme="dark"] .route-item:focus-visible {
  outline-color: var(--focus-ring);
}

html[data-theme="dark"] .load-more-button,
html[data-theme="dark"] .small-button,
html[data-theme="dark"] .secondary-link-button,
html[data-theme="dark"] .page-button,
html[data-theme="dark"] .related-tutorial-arrow,
html[data-theme="dark"] .faq-toggle {
  background: var(--control-bg);
  border-color: var(--border-strong);
  color: var(--primary);
}

html[data-theme="dark"] .load-more-button:hover {
  border-color: var(--border-hover);
  background: var(--hover-bg);
}

html[data-theme="dark"] .tool-icon,
html[data-theme="dark"] .tile-icon,
html[data-theme="dark"] .tool-detail-cover-icon,
html[data-theme="dark"] .tool-detail-cover:not(.tool-detail-cover-icon):has(img) {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-icon);
}

html[data-theme="dark"] .sidebar-category-button,
html[data-theme="dark"] .sidebar-subcategory,
html[data-theme="dark"] .category-button,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .subtab,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .tag,
html[data-theme="dark"] .detail-back,
html[data-theme="dark"] .route-item,
html[data-theme="dark"] .about-points {
  color: var(--nav-text);
}

html[data-theme="dark"] .sidebar-category.is-active .sidebar-category-button,
html[data-theme="dark"] .sidebar-subcategory.is-active,
html[data-theme="dark"] .subtab-row {
  background: var(--active-bg);
}

html[data-theme="dark"] .sidebar-category.is-active .sidebar-category-button,
html[data-theme="dark"] .sidebar-subcategory.is-active {
  color: var(--primary);
}

html[data-theme="dark"] .search-field,
html[data-theme="dark"] .article-info-panel,
html[data-theme="dark"] .site-toast {
  background: var(--surface-raised);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .field-search-icon,
html[data-theme="dark"] .search-icon {
  color: var(--control-icon);
}

html[data-theme="dark"] .directory-section .section-title,
html[data-theme="dark"] .related-tutorial-card h3,
html[data-theme="dark"] .faq-question,
html[data-theme="dark"] .markdown-body {
  color: var(--text);
}

html[data-theme="dark"] .tool-detail-content p,
html[data-theme="dark"] .tutorial-card p,
html[data-theme="dark"] .article-info-summary,
html[data-theme="dark"] .article-info-stats,
html[data-theme="dark"] .tutorial-card .article-info-chip,
html[data-theme="dark"] .tutorial-card .article-info-summary,
html[data-theme="dark"] .detail-hero p,
html[data-theme="dark"] .detail-section p,
html[data-theme="dark"] .detail-section li,
html[data-theme="dark"] .markdown-body blockquote,
html[data-theme="dark"] .related-tutorial-meta,
html[data-theme="dark"] .related-tutorial-card p,
html[data-theme="dark"] .faq-answer p,
html[data-theme="dark"] .about-hero p {
  color: var(--muted);
}

html[data-theme="dark"] .article-info-icon {
  background: var(--primary-soft);
  color: var(--primary);
}

html[data-theme="dark"] .tutorial-card .article-info-icon {
  background: transparent;
}

html[data-theme="dark"] .subtab {
  color: var(--subtle);
}

html[data-theme="dark"] .chip.is-active,
html[data-theme="dark"] .filter-chip.is-active,
html[data-theme="dark"] .tag.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--border-hover);
}

html[data-theme="dark"] .related-tool-card {
  border-color: var(--border);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(18, 26, 39, 0) 44%),
    var(--surface);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .related-tutorial-card,
html[data-theme="dark"] .faq-item {
  border-color: var(--border);
  background:
    linear-gradient(135deg, rgba(99, 167, 255, 0.12), rgba(18, 26, 39, 0) 42%),
    var(--surface);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .related-tool-card:hover,
html[data-theme="dark"] .related-tool-card:focus-visible,
html[data-theme="dark"] .related-tutorial-card:hover,
html[data-theme="dark"] .related-tutorial-card:focus-visible,
html[data-theme="dark"] .faq-item:hover,
html[data-theme="dark"] .faq-item[open] {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

html[data-theme="dark"] .related-tool-arrow {
  border-color: var(--border-strong);
  background: rgba(16, 24, 39, 0.86);
  color: var(--primary);
}

html[data-theme="dark"] .related-tutorial-meta span,
html[data-theme="dark"] .faq-answer p {
  border-color: var(--border);
  background: rgba(23, 33, 49, 0.88);
}

html[data-theme="dark"] .markdown-body code {
  background: var(--surface-soft);
  color: #8ec5ff;
}

html[data-theme="dark"] .markdown-body pre {
  background: #070b12;
  color: #edf3fb;
}

html[data-theme="dark"] .site-toast {
  color: var(--text);
  box-shadow: var(--toast-shadow);
}

html[data-theme="dark"] .about-hero {
  border-color: var(--border-hover);
  background: linear-gradient(135deg, #111d2d, #0d1522);
}

@media (max-width: 1180px) {
  .header-inner {
    grid-template-columns: auto 1fr;
  }

  .header-actions {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: flex-end;
    padding-bottom: 12px;
  }

  .global-search-form {
    width: min(590px, calc(100% - 50px));
  }

  .header-search {
    width: min(520px, 100%);
  }

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

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

  .tool-sidebar {
    position: static;
    transform: none;
    max-height: none;
    display: flex;
    gap: 10px;
    overflow-x: auto;
  }

  .sidebar-category {
    min-width: 180px;
  }

  .sidebar-category + .sidebar-category {
    margin-top: 0;
  }

  .tutorial-layout,
  .about-hero,
  .tool-detail-layout {
    grid-template-columns: 1fr;
  }

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

  .tutorial-sidebar {
    order: 2;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: auto;
  }

  .site-header {
    height: auto;
  }

  .header-inner {
    padding: 12px 16px 0;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .top-nav {
    justify-content: flex-start;
    gap: 22px;
    overflow-x: auto;
  }

  .header-actions {
    gap: 8px;
    padding-bottom: 12px;
  }

  .global-search-form {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
  }

  .header-search {
    flex: 1;
    width: auto;
  }

  .search-submit-button {
    padding: 0 14px;
  }

  .nav-link {
    height: 44px;
  }

  .app-shell {
    padding: 16px;
  }

  .home-layout {
    display: grid;
  }

  .home-articles,
  .home-tools,
  .recommend-list,
  .tool-rail {
    overflow: visible;
  }

  .recommend-list {
    grid-template-columns: 1fr;
  }

  .load-more-row {
    margin: 10px 0 0;
    padding: 0;
  }

  .directory-shell,
  .tutorial-main,
  .tutorial-sidebar,
  .tool-detail-main,
  .about-card {
    padding: 16px;
  }

  .tool-sidebar {
    padding: 8px;
  }

  .section-title {
    font-size: 24px;
  }

  .article-row,
  .tutorial-card,
  .tutorial-featured,
  .sidebar-item,
  .detail-hero,
  .tool-detail-hero {
    grid-template-columns: 1fr;
  }

  .article-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .thumb,
  .tutorial-card .article-visual,
  .sidebar-thumb {
    height: 92px;
  }

  .tool-grid,
  .tool-rail,
  .tutorial-grid,
  .related-grid,
  .related-tool-grid,
  .related-tutorial-list,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .related-tutorial-card {
    min-height: 0;
    padding: 16px 48px 16px 16px;
  }

  .related-tool-card {
    min-height: 88px;
    padding: 16px 50px 16px 16px;
  }

  .related-tool-card .tile-icon {
    width: 44px;
    height: 44px;
  }

  .related-tool-card h3 {
    font-size: 18px;
  }

  .related-tool-arrow {
    right: 16px;
  }

  .related-tutorial-card h3 {
    font-size: 18px;
  }

  .category-strip {
    gap: 20px;
  }

  .about-hero {
    padding: 28px 18px;
    min-height: 0;
  }

  .about-hero p {
    font-size: 16px;
  }
}
