:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text: #1f2937;
    --muted: #6b7280;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e5e7eb;
}

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

body {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 55%, #ffffff 100%);
    min-height: 100vh;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--border);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 68px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

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

.navbar {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 18px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
}

.nav-links a:hover {
    color: var(--primary);
}

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

.search-input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 220px;
    outline: none;
}

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

.btn {
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-dark);
}

.menu-toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 10px;
    width: 42px;
    height: 42px;
    cursor: pointer;
    padding: 8px;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #111827;
    margin: 4px 0;
    transition: background 0.25s ease, transform 0.25s ease, opacity 0.2s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.menu-toggle:hover {
    background: #eff6ff;
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.16);
    transform: translateY(-1px);
}

.menu-toggle:hover span {
    background: var(--primary);
}

.hero {
    padding: 80px 0 60px;
    text-align: center;
}

.hero h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin-bottom: 12px;
}

.hero p {
    color: var(--muted);
    max-width: 680px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.hero-search {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-search .search-input {
    width: min(500px, 90vw);
    max-width: 500px;
}

.feature-grid {
    padding: 10px 0 70px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature {
    position: relative;
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.03);
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    cursor: pointer;
}

.feature::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0));
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

.feature:hover {
    transform: translateY(-6px);
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.16);
}

.feature:hover::before {
    opacity: 1;
}

.feature h3 {
    margin-bottom: 8px;
}

.feature p {
    color: var(--muted);
    line-height: 1.5;
}

.article-list {
    display: grid;
    gap: 16px;
    padding: 0 0 60px;
}

.article-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.03);
}

.article-card h3 {
    margin-bottom: 10px;
}

.article-card p {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 10px;
}

.article-card p:last-child {
    margin-bottom: 0;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: #fff;
    margin-top: 14px;
}

.footer-wrap {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.95rem;
}

.footer-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-links a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
}

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

.go-top-btn {
    position: fixed;
    right: 18px;
    bottom: 60px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    display: grid;
    place-items: center;
    overflow: visible;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
    opacity: 0;
    visibility: hidden;
    transform: translateY(70px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.25s ease;
    z-index: 50;
}

.go-top-tooltip {
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(17, 24, 39, 0.95);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.go-top-tooltip::after {
    content: "";
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: rgba(17, 24, 39, 0.95);
}

@media (hover: hover) and (pointer: fine) {
    .go-top-btn:hover .go-top-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(-4px);
    }
}

.go-top-btn:focus-visible .go-top-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(-4px);
}

.go-top-icon {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.go-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.go-top-btn:hover {
    background: var(--primary-dark);
}

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

@media (max-width: 768px) {
    .menu-toggle {
        display: inline-block;
    }

    .navbar {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 0 16px;
        border-bottom: 1px solid var(--border);
        background: #fff;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transform: translateY(-8px);
        pointer-events: none;
        transition: max-height 0.3s ease, opacity 0.25s ease, transform 0.25s ease, padding 0.25s ease;
    }

    .navbar.active {
        max-height: 260px;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        padding: 16px;
    }

    .nav-links {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .search-form {
        width: 100%;
    }

    .search-input {
        width: 100%;
    }

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

    .footer-wrap {
        min-height: auto;
        padding: 16px 0;
        flex-direction: column;
        text-align: center;
    }

    .go-top-btn {
        right: 14px;
        bottom: 70px;
    }
}
