:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-muted: #eef3f8;
    --text: #162033;
    --muted: #667085;
    --primary: #2563eb;
    --primary-soft: #eaf1ff;
    --accent: #0f766e;
    --border: #dfe5ee;
    --shadow: 0 16px 44px rgba(31, 45, 61, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 34rem),
        linear-gradient(180deg, #fbfcff 0%, var(--bg) 42%, #f7f9fc 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft Yahei", sans-serif;
    line-height: 1.5;
}

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

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

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 0 20px;
}

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

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    color: #ffffff;
    background: var(--text);
    border-radius: var(--radius);
    font-weight: 800;
}

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

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

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

.top-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.top-nav a {
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
}

.top-nav a:hover {
    color: var(--text);
    background: var(--surface-muted);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 28px;
    align-items: stretch;
    padding: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.hero h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.08;
    letter-spacing: 0;
}

.hero-desc {
    max-width: 720px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 17px;
}

.hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.metric-value {
    font-size: 48px;
    line-height: 1;
    font-weight: 800;
}

.metric-label {
    margin-top: 10px;
    color: var(--muted);
}

.tool-controls {
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 16px;
    align-items: start;
    margin: 28px 0;
}

.search-box {
    position: relative;
    display: block;
}

.search-box input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    font-size: 15px;
}

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

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid var(--muted);
    border-radius: 50%;
    transform: translateY(-55%);
}

.search-icon::after {
    content: "";
    position: absolute;
    right: -6px;
    bottom: -5px;
    width: 7px;
    height: 2px;
    background: var(--muted);
    transform: rotate(45deg);
    border-radius: 999px;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tab {
    height: 38px;
    padding: 0 14px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
}

.category-tab:hover,
.category-tab.is-active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: rgba(37, 99, 235, 0.26);
}

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

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

.section-heading p {
    margin: 4px 0 0;
    color: var(--muted);
}

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

.tool-card {
    display: flex;
    flex-direction: column;
    min-height: 184px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:hover,
.tool-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 16px 34px rgba(31, 45, 61, 0.1);
    outline: none;
}

.tool-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tool-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: var(--radius);
    font-weight: 800;
}

.tool-category {
    color: var(--muted);
    background: #f6f8fb;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
}

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

.tool-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.tool-link {
    margin-top: auto;
    padding-top: 18px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
}

.empty-state {
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 52px 20px;
    color: var(--muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.empty-state[hidden] {
    display: none;
}

.empty-state strong {
    color: var(--text);
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    padding: 34px 0 28px;
    color: var(--muted);
    font-size: 14px;
}

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

@media (max-width: 980px) {
    .hero,
    .tool-controls {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        align-items: flex-start;
    }

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

@media (max-width: 640px) {
    .site-shell {
        width: min(100% - 24px, 1180px);
    }

    .site-header {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
        padding-top: 18px;
    }

    .top-nav {
        justify-content: space-between;
        overflow-x: auto;
    }

    .hero {
        padding: 24px;
    }

    .hero h1 {
        font-size: 34px;
    }

    .hero-desc {
        font-size: 15px;
    }

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

    .tool-controls {
        margin: 20px 0;
    }
}
