:root {
      --primary: #6366f1;
      --primary-dark: #4f46e5;
      --primary-light: #eef2ff;
      --bg: #f5f7fa;
      --card-bg: #ffffff;
      --text: #1e293b;
      --text-muted: #64748b;
      --text-light: #94a3b8;
      --border: #e2e8f0;
      --success: #22c55e;
      --radius: 12px;
      --shadow: 0 1px 3px rgba(0,0,0,0.06);
      --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
      --header-height: 56px;
    }
    * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }
    a { text-decoration: none; color: inherit; }

    /* ===== Header ===== */
    .site-header {
      background: var(--card-bg);
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 100;
    }
    .site-header .inner {
      max-width: 1180px;
      margin: 0 auto;
      padding: 0 20px;
      height: var(--header-height);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .site-header .brand {
      font-size: 18px;
      font-weight: 800;
      color: var(--primary);
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .site-header .brand span { color: var(--text); font-weight: 700; }
    .site-header .nav-links { display: flex; gap: 20px; }
    .site-header .nav-links a {
      font-size: 14px;
      color: var(--text-muted);
      transition: color 0.15s;
    }
    .site-header .nav-links a:hover { color: var(--primary); }

    /* ===== Container ===== */
    .container {
      max-width: 1180px;
      margin: 0 auto;
      padding: 32px 20px 40px;
      flex: 1;
      width: 100%;
    }

    /* ===== Hero ===== */
    .hero {
      text-align: center;
      margin-bottom: 28px;
    }
    .hero h1 {
      font-size: 32px;
      font-weight: 800;
      letter-spacing: -0.5px;
      color: var(--text);
    }
    .hero h1 em {
      font-style: normal;
      color: var(--primary);
    }
    .hero .sub {
      color: var(--text-muted);
      font-size: 15px;
      margin-top: 6px;
      line-height: 1.6;
    }
    .hero .stats {
      display: flex;
      justify-content: center;
      gap: 24px;
      margin-top: 14px;
      font-size: 13px;
      color: var(--text-muted);
    }
    .hero .stats span {
      display: flex;
      align-items: center;
      gap: 5px;
    }
    .hero .stats span strong {
      color: var(--text);
      font-weight: 700;
    }

    /* ===== Search & Tabs ===== */
    .search-bar {
      max-width: 480px;
      margin: 0 auto 20px;
      position: relative;
    }
    .search-bar input {
      width: 100%;
      padding: 10px 16px 10px 40px;
      border: 1px solid var(--border);
      border-radius: 24px;
      font-size: 15px;
      background: var(--card-bg);
      color: var(--text);
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .search-bar input:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    }
    .search-bar input::placeholder { color: var(--text-light); }
    .search-bar .search-icon {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-light);
      font-size: 16px;
      pointer-events: none;
    }

    .tabs {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 6px;
      margin-bottom: 24px;
      padding: 0 4px;
    }
    .tabs .tab {
      padding: 6px 16px;
      border-radius: 20px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-muted);
      background: var(--card-bg);
      border: 1px solid var(--border);
      cursor: pointer;
      transition: all 0.15s;
      user-select: none;
    }
    .tabs .tab:hover { border-color: var(--primary); color: var(--primary); }
    .tabs .tab.active {
      background: var(--primary);
      color: #fff;
      border-color: var(--primary);
    }

    /* ===== Section Titles ===== */
    .section-title {
      font-size: 16px;
      font-weight: 700;
      margin: 28px 0 12px;
      padding-left: 12px;
      border-left: 3px solid var(--primary);
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .section-title .badge {
      font-size: 11px;
      background: #e5e7eb;
      color: #6b7280;
      padding: 1px 8px;
      border-radius: 8px;
      font-weight: 500;
    }
    .section-title .accent { font-size: 13px; color: var(--text-muted); font-weight: 400; }
    .section.mystic .section-title { border-left-color: #8b5cf6; }
    .section.ai .section-title { border-left-color: #3b82f6; }
    .section.fun .section-title { border-left-color: #f59e0b; }

    /* ===== Recommended ===== */
    .rec-section { margin-bottom: 32px; }
    .rec-section .rec-label {
      font-size: 13px;
      color: var(--text-muted);
      margin-bottom: 10px;
      font-weight: 500;
    }

    /* ===== Tool Grid ===== */
    .tool-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
    }
    @media (max-width: 960px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }
    @media (max-width: 640px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
    @media (max-width: 400px) { .tool-grid { grid-template-columns: 1fr 1fr; gap: 8px; } }

    .tool-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 16px;
      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: var(--shadow);
      display: flex;
      align-items: flex-start;
      gap: 12px;
      min-height: 80px;
    }
    .tool-card:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
    .tool-card:active { transform: scale(0.97); }

    .tool-card .tc-icon {
      flex-shrink: 0;
      width: 40px;
      height: 40px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 800;
      color: #fff;
      letter-spacing: 0.5px;
    }
                                            /* ===== Per-tool icons ===== */
    .tool-card .tc-icon.icon-comp { background: linear-gradient(135deg, #e11d48, #f43f5e); }
    .tool-card .tc-icon.icon-merge { background: linear-gradient(135deg, #dc2626, #ef4444); }
    .tool-card .tc-icon.icon-split { background: linear-gradient(135deg, #e11d48, #fb7185); }
    .tool-card .tc-icon.icon-o2p { background: linear-gradient(135deg, #be123c, #e11d48); }
    .tool-card .tc-icon.icon-p2d { background: linear-gradient(135deg, #dc2626, #f43f5e); }
    .tool-card .tc-icon.icon-conv { background: linear-gradient(135deg, #be123c, #fb7185); }
    .tool-card .tc-icon.icon-toimg { background: linear-gradient(135deg, #e11d48, #f43f5e); }
    .tool-card .tc-icon.icon-enc { background: linear-gradient(135deg, #be123c, #ef4444); }
    .tool-card .tc-icon.icon-wm { background: linear-gradient(135deg, #9d174d, #f43f5e); }
    .tool-card .tc-icon.icon-sign { background: linear-gradient(135deg, #9d174d, #e11d48); }
    .tool-card .tc-icon.icon-mort { background: linear-gradient(135deg, #ea580c, #f97316); }
    .tool-card .tc-icon.icon-tax { background: linear-gradient(135deg, #d97706, #f59e0b); }
    .tool-card .tc-icon.icon-hfund { background: linear-gradient(135deg, #d97706, #fbbf24); }
    .tool-card .tc-icon.icon-retire { background: linear-gradient(135deg, #ea580c, #fb923c); }
    .tool-card .tc-icon.icon-bmi { background: linear-gradient(135deg, #d97706, #f59e0b); }
    .tool-card .tc-icon.icon-safeper { background: linear-gradient(135deg, #eab308, #facc15); }
    .tool-card .tc-icon.icon-layoff { background: linear-gradient(135deg, #dc2626, #f87171); }
    .tool-card .tc-icon.icon-json { background: linear-gradient(135deg, #4f46e5, #818cf8); }
    .tool-card .tc-icon.icon-b64 { background: linear-gradient(135deg, #4338ca, #6366f1); }
    .tool-card .tc-icon.icon-url { background: linear-gradient(135deg, #2563eb, #60a5fa); }
    .tool-card .tc-icon.icon-ts { background: linear-gradient(135deg, #3b82f6, #93c5fd); }
    .tool-card .tc-icon.icon-uuid { background: linear-gradient(135deg, #6366f1, #a5b4fc); }
    .tool-card .tc-icon.icon-http { background: linear-gradient(135deg, #2563eb, #3b82f6); }
    .tool-card .tc-icon.icon-md { background: linear-gradient(135deg, #4f46e5, #818cf8); }
    .tool-card .tc-icon.icon-regex { background: linear-gradient(135deg, #4338ca, #818cf8); }
    .tool-card .tc-icon.icon-css { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
    .tool-card .tc-icon.icon-ua { background: linear-gradient(135deg, #0ea5e9, #7dd3fc); }
    .tool-card .tc-icon.icon-ascii { background: linear-gradient(135deg, #6366f1, #a5b4fc); }
    .tool-card .tc-icon.icon-port { background: linear-gradient(135deg, #2563eb, #60a5fa); }
    .tool-card .tc-icon.icon-qr { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
    .tool-card .tc-icon.icon-express { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
    .tool-card .tc-icon.icon-wc { background: linear-gradient(135deg, #0d9488, #14b8a6); }
    .tool-card .tc-icon.icon-pwd { background: linear-gradient(135deg, #14b8a6, #5eead4); }
    .tool-card .tc-icon.icon-rand { background: linear-gradient(135deg, #0891b2, #22d3ee); }
    .tool-card .tc-icon.icon-xrate { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
    .tool-card .tc-icon.icon-phone { background: linear-gradient(135deg, #14b8a6, #5eead4); }
    .tool-card .tc-icon.icon-idcard { background: linear-gradient(135deg, #0ea5e9, #38bdf8); }
    .tool-card .tc-icon.icon-diff { background: linear-gradient(135deg, #0d9488, #5eead4); }
    .tool-card .tc-icon.icon-money { background: linear-gradient(135deg, #0891b2, #2dd4bf); }
    .tool-card .tc-icon.icon-adcheck { background: linear-gradient(135deg, #14b8a6, #6ee7b7); }
    .tool-card .tc-icon.icon-ocr { background: linear-gradient(135deg, #059669, #34d399); }
    .tool-card .tc-icon.icon-unit { background: linear-gradient(135deg, #0d9488, #14b8a6); }
    .tool-card .tc-icon.icon-lunar { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
    .tool-card .tc-icon.icon-zhcnv { background: linear-gradient(135deg, #14b8a6, #5eead4); }
    .tool-card .tc-icon.icon-date { background: linear-gradient(135deg, #0d9488, #14b8a6); }
    .tool-card .tc-icon.icon-anniv { background: linear-gradient(135deg, #e11d48, #fb7185); }
    .tool-card .tc-icon.icon-ship { background: linear-gradient(135deg, #0d9488, #14b8a6); }
    .tool-card .tc-icon.icon-rbg { background: linear-gradient(135deg, #6366f1, #a78bfa); }
    .tool-card .tc-icon.icon-up { background: linear-gradient(135deg, #6366f1, #818cf8); }
    .tool-card .tc-icon.icon-restore { background: linear-gradient(135deg, #6366f1, #a5b4fc); }
    .tool-card .tc-icon.icon-imgc { background: linear-gradient(135deg, #16a34a, #4ade80); }
    .tool-card .tc-icon.icon-color { background: linear-gradient(135deg, #059669, #34d399); }
    .tool-card .tc-icon.icon-cxtract { background: linear-gradient(135deg, #22c55e, #6ee7b7); }
    .tool-card .tc-icon.icon-meme { background: linear-gradient(135deg, #22c55e, #34d399); }
    .tool-card .tc-icon.icon-9g { background: linear-gradient(135deg, #16a34a, #4ade80); }
    .tool-card .tc-icon.icon-rel { background: linear-gradient(135deg, #ec4899, #f472b6); }
    .tool-card .tc-icon.icon-eat { background: linear-gradient(135deg, #ec4899, #f9a8d4); }
    .tool-card .tc-icon.icon-wheel { background: linear-gradient(135deg, #f97316, #fb923c); }
    .tool-card .tc-icon.icon-timer { background: linear-gradient(135deg, #f97316, #fb923c); }
    .tool-card .tc-icon.icon-moments { background: linear-gradient(135deg, #ea580c, #f97316); }
    .tool-card .tc-icon.type-mystic { background: linear-gradient(135deg, #9333ea, #a855f7); }


    .tool-card .tc-body { flex: 1; min-width: 0; }
    .tool-card .tc-body .tc-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
    .tool-card .tc-body .tc-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

    .tool-card .tc-tag {
      flex-shrink: 0;
      padding: 2px 8px;
      border-radius: 10px;
      font-size: 10px;
      font-weight: 600;
      background: #dcfce7;
      color: #16a34a;
      align-self: flex-start;
      margin-top: 2px;
    }

    .tool-card.hide { display: none; }

    /* ===== No Results ===== */
    .no-results {
      display: none;
      text-align: center;
      padding: 40px 20px;
      color: var(--text-muted);
      font-size: 14px;
      grid-column: 1 / -1;
    }
    .no-results.show { display: block; }

    /* ===== Tagline ===== */
    .tagline {
      margin-top: 36px;
      background: var(--card-bg);
      border-radius: var(--radius);
      padding: 20px 24px;
      box-shadow: var(--shadow);
      border: 1px solid var(--border);
      font-size: 13px;
      color: var(--text-muted);
      line-height: 1.9;
    }
    .tagline strong { color: var(--text); }

    /* ===== Footer ===== */
    footer { text-align: center; padding: 20px 16px; color: var(--text-muted); font-size: 12px; border-top: 1px solid var(--border); margin-top: 20px; }

    /* ===== Mobile Responsive ===== */
    @media (max-width: 768px) {
      .site-header .nav-links { display: none; }
      .container { padding: 24px 16px 32px; }
      .hero h1 { font-size: 26px; }
      .hero .sub { font-size: 14px; }
      .hero .stats { gap: 16px; flex-wrap: wrap; }
      .tabs { gap: 4px; }
      .tabs .tab { padding: 5px 12px; font-size: 12px; }
      .tool-card { padding: 14px; min-height: 72px; gap: 10px; }
      .tool-card .tc-icon { width: 36px; height: 36px; font-size: 11px; }
      .tool-card .tc-body .tc-name { font-size: 13px; }
    }
    @media (max-width: 480px) {
      .hero h1 { font-size: 22px; }
      .hero .stats span { font-size: 12px; }
      .tool-card { padding: 12px; min-height: 64px; gap: 8px; }
      .tool-card .tc-icon { width: 32px; height: 32px; font-size: 10px; border-radius: 8px; }
      .tool-card .tc-body .tc-name { font-size: 12px; }
      .tool-card .tc-body .tc-desc { font-size: 11px; }
      .tool-card .tc-tag { font-size: 9px; padding: 1px 6px; }
    }
