
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f1f3f5;
  --card-bg: #f8f9fa;
  --text: #1e293b;
  --text-muted: #5c6773;
  --border: #dee2e6;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.15), 0 8px 24px rgba(0,0,0,0.08);
  --shadow-color: rgba(37,99,235,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1200px;
  --header-height: 64px;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Fira Code", monospace;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.35s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.nav-main {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.nav-main a {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all .2s;
  white-space: nowrap;
}

.nav-main a:hover, .nav-main a.active {
  color: var(--primary);
  background: rgba(37,99,235,0.08);
}

.search-box {
  position: relative;
  width: 260px;
  flex-shrink: 0;
}

.search-box input {
  width: 100%;
  padding: 9px 14px 9px 48px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 15px center;
  background-size: 16px 16px;
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: border .2s, box-shadow .2s;
  line-height: 1.4;
}

.search-box input::placeholder {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.search-box svg { display: none !important; }

html[data-theme="dark"] .search-box input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  z-index: 200;
  max-height: 360px;
  overflow-y: auto;
}

.search-results:empty { display: none; }

.search-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 18px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  font-size: 0.92rem;
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg); }

.search-result-item .sr-name {
  font-weight: 500;
}

.search-result-item .sr-cat {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
  margin-left: 12px;
}

.search-results-empty {
  padding: 14px 18px;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

.search-result-item.active {
  background: var(--primary) !important;
  color: #fff !important;
}
.search-result-item.active .sr-cat {
  background: rgba(255,255,255,0.2) !important;
  color: #fff !important;
}

html[data-theme="dark"] .search-result-item .sr-cat {
  background: var(--bg);
}

.site-main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-hero {
  text-align: center;
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -60%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37,99,235,0.08) 0%, rgba(37,99,235,0.03) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.page-hero::after {
  content: '';
  position: absolute;
  top: 10%;
  right: -5%;
  width: 200px;
  height: 200px;
  background:
    radial-gradient(circle at 30% 30%, rgba(59,130,246,0.06) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(139,92,246,0.06) 0%, transparent 50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.page-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.category-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  opacity: 0;
  animation: fadeInUp .4s ease forwards;
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(37,99,235,0.1);
  border-color: rgba(37,99,235,0.2);
}

.category-card:nth-child(1), .tool-card:nth-child(1) { animation-delay: 0s; }
.category-card:nth-child(2), .tool-card:nth-child(2) { animation-delay: .06s; }
.category-card:nth-child(3), .tool-card:nth-child(3) { animation-delay: .12s; }
.category-card:nth-child(4), .tool-card:nth-child(4) { animation-delay: .18s; }
.category-card:nth-child(5), .tool-card:nth-child(5) { animation-delay: .24s; }
.category-card:nth-child(6), .tool-card:nth-child(6) { animation-delay: .3s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.logo:hover .logo-icon {
  transform: rotate(-5deg) scale(1.05);
}
.logo .logo-icon {
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.tool-card:active, .category-card:active {
  transform: scale(0.98);
  transition-duration: 0.1s;
}

.category-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.category-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.category-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.category-meta {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.category-meta span {
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.tool-card:hover {
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(37,99,235,0.08);
  border-color: rgba(37,99,235,0.15);
  transform: translateY(-2px);
}

.tool-card .tool-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.tool-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.tool-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.tool-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg);
  color: var(--text-muted);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--primary-dark); }

.breadcrumb span[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

.tool-page-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}

.tool-header {
  margin-bottom: 24px;
}

.tool-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.tool-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.tool-body {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  min-height: 200px;
  box-shadow: var(--shadow-sm);
}

.tool-body .tool-section {
  margin-bottom: 0;
}

.tool-info {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: calc(var(--header-height) + 16px);
  box-shadow: var(--shadow-sm);
}

.tool-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.tool-info p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.tool-info ul {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.8;
  padding-left: 18px;
  margin-bottom: 12px;
}

.tool-info a {
  color: var(--primary);
  text-decoration: none;
}

.tool-info a:hover { color: var(--primary-dark); }

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.sidebar-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-links {
  list-style: none;
}

.sidebar-links li { margin-bottom: 8px; }

.sidebar-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  transition: background .15s;
}

.sidebar-links a:hover {
  background: var(--bg);
  color: var(--primary);
}

.sidebar-links a.current {
  background: rgba(37,99,235,0.08);
  color: var(--primary);
  font-weight: 500;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
}

textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border .2s;
  background: var(--bg);
}

textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12), 0 1px 2px rgba(0,0,0,0.05);
}

html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] input[type="text"]:focus,
html[data-theme="dark"] input[type="number"]:focus,
html[data-theme="dark"] select:focus {
  box-shadow: 0 0 0 3px rgba(96,165,250,0.15), 0 1px 2px rgba(0,0,0,0.2);
}

textarea { min-height: 160px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.result-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 16px;
  min-height: 80px;
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.site-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 40px 24px 24px;
  margin-top: 48px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li { margin-bottom: 8px; }

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
}

.footer-col a:hover { color: var(--primary); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 24px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-bottom p {
  margin: 0;
}
.footer-bottom a {
  color: var(--primary);
  text-decoration: none;
}
.footer-bottom a:hover {
  text-decoration: underline;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 32px 0;
  margin: 24px 0;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-item .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
}

.stat-item .label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.tip-box {
  background: rgba(22,163,74,0.06);
  border: 1px solid rgba(22,163,74,0.15);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text);
}

.tip-box strong { color: var(--success); }

.hamburger {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all .2s;
  margin-left: 8px;
}
.hamburger:hover { border-color: var(--primary); color: var(--primary); }

.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 999;
  opacity: 0;
  transition: opacity .3s;
}
.mobile-menu-overlay.active { opacity: 1; }

.mobile-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  max-width: 80vw;
  height: 100%;
  background: var(--card-bg);
  z-index: 1000;
  padding: 24px 20px;
  overflow-y: auto;
  transition: right .3s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
}
.mobile-menu.active { right: 0; }

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.mobile-menu-header span {
  font-weight: 700;
  font-size: 1.1rem;
}
.mobile-menu-close {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: all .2s;
}
.mobile-menu-close:hover { border-color: var(--danger); color: var(--danger); }

.mobile-menu nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-menu nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background .15s;
}
.mobile-menu nav a:hover { background: var(--bg); }
.mobile-menu nav a.active { color: var(--primary); background: rgba(37,99,235,0.08); }
.mobile-menu nav a .nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }

.mobile-menu .mobile-search {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.mobile-menu .mobile-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 0.9rem;
  outline: none;
}
.mobile-menu .mobile-search input:focus { border-color: var(--primary); }

.tool-workspace, .sidebar-section {
  animation: fadeInUp 0.35s ease forwards;
}

.tool-card:hover {
  transform: translateY(-2px);
}

.stat-item .num {
  transition: color .3s;
}
.stat-item:hover .num { color: var(--primary-dark); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all .2s;
  font-weight: 500;
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary); }
.copy-btn:disabled { opacity: .4; cursor: not-allowed; }

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all .3s ease;
  z-index: 900;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.diff-line { padding: 4px 12px; font-family: "SF Mono", Monaco, "Cascadia Code", monospace; font-size: 0.85rem; border-left: 3px solid transparent; }
.diff-add { background: rgba(22,163,74,0.1); border-left-color: #16a34a; }
.diff-del { background: rgba(220,38,38,0.1); border-left-color: #dc2626; text-decoration: line-through; }
.diff-mod { background: rgba(217,119,6,0.1); border-left-color: #d97706; }
.diff-same { color: var(--text-muted); }

@media (max-width: 1100px) {
  .tool-page-layout { grid-template-columns: 1fr; }
  .tool-info { position: static; }
  .search-box { display: none; }
  .page-hero h1 { font-size: 1.6rem; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 768px) {
  .tool-page-layout { grid-template-columns: 1fr !important; }
  .tool-info { display: none; }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .header-inner { gap: 8px; }
  .stats-bar { gap: 32px; }
  .site-main { padding: 24px 20px; }
  .page-hero { padding: 40px 0 32px; }
}

@media (max-width: 600px) {
  .back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }
  .header-inner { padding: 0 16px; }
  .site-main { padding: 20px 16px; }
  .nav-main { display: none; }
  .tool-workspace { padding: 20px; }
  .hamburger { display: flex; }
  .stats-bar { gap: 24px; padding: 24px 0; }
  .stat-item .num { font-size: 1.5rem; }
  .tool-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .page-hero { padding: 32px 0 24px; }
  .page-hero h1 { font-size: 1.4rem; }
  .page-hero p { font-size: 0.95rem; }
  .cat-filter-bar { flex-direction: column; align-items: stretch; }
  .cat-search-input { min-width: 100%; }
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions .btn { width: 100%; max-width: 280px; text-align: center; }
  .cat-stats-bar { gap: 12px; }
}

html[data-theme="dark"] {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --primary: #60a5fa;
  --primary-dark: #3b82f6;
  --secondary: #94a3b8;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow-color: rgba(37,99,235,0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.25), 0 1px 3px rgba(0,0,0,0.15);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.2);
  --shadow-xl: 0 20px 48px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.25);
}
html[data-theme="dark"] .search-box input { background: #0f172a; color: var(--text); }
html[data-theme="dark"] textarea, html[data-theme="dark"] input[type="text"], html[data-theme="dark"] input[type="number"], html[data-theme="dark"] select { background: #0f172a; color: var(--text); }
html[data-theme="dark"] .result-box { background: #0f172a; }
html[data-theme="dark"] .category-meta span { background: #0f172a; }
html[data-theme="dark"] .tool-tag { background: #0f172a; }

html[data-theme="dark"] .page-hero::before {
  background: radial-gradient(circle, rgba(96,165,250,0.1) 0%, rgba(96,165,250,0.04) 40%, transparent 70%);
}
html[data-theme="dark"] .page-hero::after {
  background:
    radial-gradient(circle at 30% 30%, rgba(96,165,250,0.08) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(167,139,250,0.08) 0%, transparent 50%);
}

.cat-stats-bar {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 16px 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.cat-stats-bar .cat-stat-num {
  font-weight: 800;
  color: var(--primary);
  font-size: 1.1rem;
  margin-right: 4px;
}

.theme-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: all .2s;
  margin-left: 8px;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }

.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  max-width: 360px;
  pointer-events: auto;
  transform: translateX(120%);
  animation: toastSlideIn 0.3s ease forwards;
}
.toast.toast-out {
  animation: toastSlideOut 0.3s ease forwards;
}
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--primary); }
@keyframes toastSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

.kbd-hint {
  position: fixed;
  bottom: 72px;
  right: 20px;
  z-index: 800;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.kbd-hint.visible { opacity: 1; }

noscript {
  display: block;
  padding: 16px 24px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-sm);
  color: #92400e;
  font-size: 0.9rem;
  text-align: center;
  margin: 16px auto;
  max-width: var(--max-width);
}
noscript::before {
  content: "\26A0  ";
  font-size: 1.1rem;
}
html[data-theme="dark"] noscript {
  background: #451a03;
  border-color: #d97706;
  color: #fcd34d;
}

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

.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text {
  height: 14px;
  margin-bottom: 10px;
  border-radius: 4px;
}
.skeleton-text:last-child { width: 60%; }
.skeleton-card {
  height: 180px;
  border-radius: var(--radius);
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.search-results-skeleton {
  padding: 8px 0;
}
.search-results-skeleton .sr-skel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
}
.search-results-skeleton .sr-skel-name {
  width: 120px;
  height: 14px;
}
.search-results-skeleton .sr-skel-cat {
  width: 60px;
  height: 12px;
  border-radius: 20px;
}

.tool-grid-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.tool-grid-skeleton .skeleton-card {
  height: 120px;
}

.page-load-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  z-index: 9999;
  transition: width 0.3s ease, opacity 0.5s ease 0.2s;
  width: 0;
  opacity: 1;
}
.page-load-bar.done {
  width: 100%;
  opacity: 0;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0f172a; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #475569; }

::selection { background: rgba(37,99,235,0.2); color: var(--text); }
html[data-theme="dark"] ::selection { background: rgba(37,99,235,0.35); }

@keyframes pageLoad {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.site-main {
  animation: pageLoad 0.4s cubic-bezier(.4,0,.2,1);
}

.page-content-enter {
  animation: contentEnter 0.5s cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes contentEnter {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.theme-toggle:active span.theme-icon {
  transform: scale(1.3);
}
.theme-toggle span.theme-icon {
  transition: transform 0.2s, color 0.2s;
}

.tool-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}
.tool-page-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-md);
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  text-align: center;
}
.stat-card .stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.filter-tag {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.filter-tag:hover, .filter-tag.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.tools-section {
  margin-top: 48px;
}

.tool-tag-hot { background: rgba(220,38,38,0.1); color: #dc2626; }
.tool-tag-new { background: rgba(22,163,74,0.1); color: #16a34a; }
.tool-tag-rec { background: rgba(37,99,235,0.1); color: #2563eb; }
.tool-tag-useful { background: rgba(217,119,6,0.1); color: #d97706; }

.cat-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.cat-search-input {
  flex: 1;
  min-width: 240px;
  padding: 10px 16px 10px 42px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 16px 16px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border .2s, box-shadow .2s;
}
html[data-theme="dark"] .cat-search-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-color: #0f172a;
}
.cat-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.cat-search-input::placeholder { color: var(--text-muted); }
.cat-filter-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.cat-filter-count strong { color: var(--primary); font-weight: 700; }

.cat-sort-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  transition: border .2s;
}
html[data-theme="dark"] .cat-sort-select { background-color: #0f172a; }
.cat-sort-select:focus { border-color: var(--primary); }

.tool-card.cat-hidden {
  display: none;
}
.tool-card.cat-visible {
  display: flex;
  animation: fadeInUp 0.3s ease forwards;
}

.cat-empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
}
.cat-empty-state .cat-empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}
.cat-empty-state p {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

.cat-sub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.cat-sub-tag {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.cat-sub-tag:hover, .cat-sub-tag.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tool-workspace > h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.3;
}
.tool-workspace > .tool-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.tool-bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all .2s;
  margin-top: 12px;
}
.tool-bookmark-btn:hover { border-color: var(--primary); color: var(--primary); }
.tool-bookmark-btn.bookmarked {
  background: rgba(37,99,235,0.08);
  color: var(--primary);
  border-color: var(--primary);
}

.related-categories {
  margin-top: 48px;
}
.related-categories .category-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.bookmark-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  transition: all .2s;
  margin-left: 8px;
  position: relative;
}
.bookmark-btn:hover { border-color: var(--primary); color: var(--primary); }
.bookmark-btn .bm-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.bookmark-btn .bm-count:empty { display: none; }

.bookmark-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 400px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.bookmark-panel.show { display: block; animation: fadeInUp 0.2s ease; }
.bookmark-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
}
.bookmark-panel-header button {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
}
.bookmark-panel-header button:hover { text-decoration: underline; }
.bookmark-list {
  overflow-y: auto;
  max-height: 340px;
}
.bookmark-item {
  display: flex;
  align-items: center;
  padding: 10px 18px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  gap: 10px;
}
.bookmark-item:last-child { border-bottom: none; }
.bookmark-item:hover { background: var(--bg); }
.bookmark-item .bm-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bookmark-item .bm-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.bookmark-item .bm-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
  flex-shrink: 0;
  line-height: 1;
}
.bookmark-item .bm-remove:hover { color: var(--danger); }
.bookmark-empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.shortcuts-panel {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
}
.shortcuts-panel.show {
  display: flex;
}
.shortcuts-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.shortcuts-content {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  width: 420px;
  max-width: 90vw;
  box-shadow: var(--shadow-xl);
  z-index: 1;
  animation: fadeInUp 0.25s ease;
}
.shortcuts-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.shortcuts-content .sc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.shortcuts-content .sc-row:last-child { border-bottom: none; }
.shortcuts-content .sc-keys {
  display: flex;
  gap: 4px;
}
.shortcuts-content kbd {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  box-shadow: 0 1px 0 var(--border);
}
.sc-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
}
.sc-close:hover { color: var(--text); }

@media (max-width: 1100px) {
  .bookmark-btn { display: none; }
  .bookmark-panel { display: none !important; }
}

.search-highlight {
  background: rgba(37,99,235,0.15);
  color: var(--text);
  border-radius: 2px;
  padding: 0 1px;
}
html[data-theme="dark"] .search-highlight {
  background: rgba(96,165,250,0.25);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  z-index: 1001;
  width: 0%;
  transition: width 0.1s ease-out;
}
html[data-theme="dark"] .scroll-progress {
  background: linear-gradient(90deg, #60a5fa, #93c5fd);
}

.bookmark-panel-header button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all .15s;
}
.bookmark-panel-header button:hover {
  color: var(--text);
  background: var(--bg);
}
.bookmark-panel-header button.bm-clear:hover { color: var(--danger); }

.back-to-top::after {
  content: '';
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--text);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.back-to-top:hover::after {
  content: '回到顶部';
  opacity: 1;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-question {
  padding: 14px 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  transition: background .15s;
}
.faq-question:hover { background: var(--border); }
.faq-question::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform .2s;
}
.faq-item.active .faq-question::after {
  content: '\2212';
}
.faq-answer {
  padding: 0 18px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}
.faq-item.active .faq-answer {
  padding: 14px 18px;
  max-height: 200px;
}

.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 24px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--card-bg);
}
.timeline-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.timeline-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.timeline-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.tech-tag {
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.notfound-box {
  width: 120px;
  height: 120px;
  margin: 0 auto 32px;
  position: relative;
}
.notfound-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  border-radius: 24px;
  animation: notfound-bounce 2s ease-in-out infinite;
}
.notfound-box::after {
  content: '404';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
}
@keyframes notfound-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-10px) rotate(2deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-5px) rotate(-1deg); }
}

.notfound-search-wrap {
  max-width: 480px;
  margin: 0 auto 32px;
  position: relative;
}
.notfound-search-wrap input {
  width: 100%;
  padding: 12px 18px 12px 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 15px center;
  background-size: 16px 16px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border .2s, box-shadow .2s;
}
.notfound-search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.notfound-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 280px;
  overflow-y: auto;
  text-align: left;
}
.notfound-search-results:empty { display: none; }
.notfound-search-results a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 18px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  font-size: 0.92rem;
}
.notfound-search-results a:last-child { border-bottom: none; }
.notfound-search-results a:hover { background: var(--bg); }
.notfound-search-results .sr-cat {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
  margin-left: 12px;
}
.notfound-tools { margin-top: 40px; }
.notfound-tools .tool-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.contact-methods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.contact-method {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  transition: all .2s;
}
.contact-method:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37,99,235,0.15);
}
.contact-method .icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}
.contact-method h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.contact-method p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.copy-btn.auto-copy {
  opacity: 0.6;
  transition: opacity .2s;
}
.result-box:hover .copy-btn.auto-copy,
pre:hover .copy-btn.auto-copy,
code:hover .copy-btn.auto-copy {
  opacity: 1;
}

.copy-btn.copied {
  border-color: var(--success);
  color: var(--success);
}

@media print {
  .site-header,
  .site-footer,
  .breadcrumb,
  .tool-info,
  .sidebar,
  .back-to-top,
  .hamburger,
  .theme-toggle,
  .bookmark-btn,
  .scroll-progress,
  .page-load-bar,
  .mobile-menu-overlay,
  .mobile-menu,
  .tool-bookmark-btn,
  .copy-btn { display: none !important; }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  .site-main {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .tool-page-layout {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .tool-workspace,
  .tool-body,
  .result-box,
  textarea,
  input,
  select {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  .tool-workspace > h1 {
    color: #000 !important;
    font-size: 1.4rem !important;
  }

  a {
    color: #000 !important;
    text-decoration: none !important;
  }

  a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  .page-hero {
    padding: 20px 0 !important;
  }

  .category-card,
  .tool-card {
    break-inside: avoid;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }

  .diff-add { background: #e6ffe6 !important; border-left-color: #16a34a !important; }
  .diff-del { background: #ffe6e6 !important; border-left-color: #dc2626 !important; }
  .diff-mod { background: #fff3e6 !important; border-left-color: #d97706 !important; }
}

.breadcrumb a,
.tool-info a {
  position: relative;
  text-decoration: none;
}
.breadcrumb a::after,
.tool-info a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--primary);
  transition: width .25s ease;
}
.breadcrumb a:hover::after,
.tool-info a:hover::after {
  width: 100%;
}

.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transform: scale(0);
  opacity: 0;
  transition: transform .4s, opacity .4s;
}
.btn-primary:active::after {
  transform: scale(2);
  opacity: 1;
  transition: transform 0s, opacity 0s;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
}

body {
  transition: background-color .25s ease, color .25s ease;
}

.tool-card:hover,
.category-card:hover {
  border-top-color: rgba(37,99,235,0.3);
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.stat-item .num {
  animation: countUp 0.5s ease forwards;
}

*:focus-visible .search-box input,
*:focus-visible .cat-search-input,
.search-box input:focus-visible,
.cat-search-input:focus-visible {
  outline: none;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  z-index: 10000;
  text-decoration: none;
  font-weight: 600;
  transition: top .2s;
}
.skip-link:focus {
  top: 16px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --border: #000;
    --text: #000;
    --text-muted: #333;
  }
  .tool-card, .category-card {
    border-width: 2px;
  }
}

@media (prefers-contrast: high) {
  html[data-theme="dark"] {
    --border: #fff;
    --text: #fff;
    --text-muted: #ccc;
  }
}

@media (hover: none) and (pointer: coarse) {
  .tool-card:active,
  .category-card:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
  }

  .btn-primary:active,
  .btn-secondary:active {
    transform: scale(0.96);
    transition-duration: 0.1s;
  }

  .search-result-item:active {
    background: var(--bg);
  }
}

@media (max-width: 600px) {
  .mobile-menu .mobile-search {
    display: block;
    width: 100%;
    margin-bottom: 16px;
  }
  .mobile-menu .mobile-search input {
    font-size: 1rem;
    padding: 12px 16px 12px 44px;
  }
}

@media (max-width: 600px) {
  .tool-card {
    padding: 18px;
    min-height: 100px;
  }
  .tool-card h3 {
    font-size: 1.05rem;
  }
}

.result-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.result-actions .copy-btn,
.result-actions .export-btn {
  opacity: 0.5;
  transition: opacity .2s, background .2s;
}
.result-box:hover .result-actions .copy-btn,
.result-box:hover .result-actions .export-btn {
  opacity: 1;
}

.export-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 10px;
  transition: all .15s;
}
.export-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(37,99,235,0.06);
}

/* ==================== 热门工具Badge & 智能推荐 ==================== */

/* 热门工具Badge */
.hot-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 10px;
  border-radius: 20px;
  margin-left: 12px;
  vertical-align: middle;
}

/* 侧边栏推荐增强 */
.sidebar-section .sidebar-links {
  margin-top: 4px;
}
.sidebar-section .sidebar-links a {
  padding: 7px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
  transition: all .15s;
}
.sidebar-section .sidebar-links a:hover {
  background: rgba(37,99,235,0.06);
  padding-left: 14px;
}

/* 工具页面sidebar-section紧凑 */
.tool-info-section + .sidebar-section {
  margin-top: 0;
}
