:root {
    --brand: #367bf5;
    --brand-dark: #2463d4;
    --brand-soft: #edf4ff;
    --ink: #172033;
    --text: #465268;
    --muted: #8a95a8;
    --line: #e7ebf2;
    --surface: #ffffff;
    --canvas: #f6f8fc;
    --sidebar: 216px;
    --topbar: 64px;
    --shadow: 0 12px 38px rgba(25, 43, 74, .07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.topbar {
    position: fixed;
    z-index: 50;
    top: 0;
    right: 0;
    left: 0;
    height: var(--topbar);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 1px 12px rgba(18, 32, 58, .035);
    backdrop-filter: blur(14px);
}

.brand {
    width: var(--sidebar);
    height: 100%;
    display: flex;
    flex: 0 0 var(--sidebar);
    align-items: center;
    gap: 11px;
    border-right: 1px solid var(--line);
    padding: 0 20px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .2px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(145deg, #4d91ff, #2d69dc);
    box-shadow: 0 8px 18px rgba(54, 123, 245, .25);
    color: #fff;
}

.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
}

.topnav {
    display: flex;
    flex: 1;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 22px;
}

.topnav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0 13px;
    color: #647087;
    font-size: 14px;
    font-weight: 600;
    transition: .2s ease;
}

.topnav a:hover, .topnav a.active {
    border-color: #dbe5f4;
    background: #f8faff;
    color: var(--brand-dark);
}

.page-shell { min-height: 100vh; padding-top: var(--topbar); }

.sidebar {
    position: fixed;
    z-index: 40;
    top: var(--topbar);
    bottom: 0;
    left: 0;
    width: var(--sidebar);
    display: flex;
    flex-direction: column;
    overflow: hidden auto;
    border-right: 1px solid var(--line);
    background: #f8faff;
    scrollbar-width: thin;
}

.sidebar nav { flex: 1; padding: 18px 12px; }

.nav-section-label {
    display: block;
    padding: 7px 12px 8px;
    color: #a0a9b8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
}

.category-link {
    position: relative;
    width: 100%;
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    padding: 0 12px;
    color: #5c6880;
    cursor: pointer;
    text-align: left;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.category-link:hover { background: #eef3fb; color: var(--brand-dark); transform: translateX(2px); }
.category-link.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; }
.category-link.active::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: -12px;
    width: 3px;
    border-radius: 0 4px 4px 0;
    background: var(--brand);
    content: "";
}

.category-link i { width: 18px; color: #77849a; font-size: 15px; text-align: center; }
.category-link.active i { color: var(--brand); }
.category-link .nav-count { margin-left: auto; color: #a1abba; font-size: 11px; font-weight: 500; }

.sidebar-foot { border-top: 1px solid var(--line); padding: 16px 20px 21px; }
.sidebar-foot p { margin: 0 0 10px; color: #8a95a8; font-size: 12px; line-height: 1.65; }
.sidebar-foot a { color: var(--brand-dark); font-size: 12px; font-weight: 700; }
.sidebar-mask { display: none; }

.main-content {
    width: calc(100% - var(--sidebar));
    max-width: 1440px;
    margin-left: var(--sidebar);
    padding: 28px clamp(22px, 3vw, 48px) 36px;
}

.search-panel {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    padding: 14px;
    box-shadow: 0 8px 28px rgba(26, 43, 70, .04);
}

.search-box {
    height: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #dfe5ee;
    border-radius: 12px;
    padding-left: 17px;
    background: #fbfcfe;
    transition: .2s ease;
}

.search-box:focus-within { border-color: #8ab1f8; background: #fff; box-shadow: 0 0 0 4px rgba(54, 123, 245, .10); }
.search-box > i { color: #96a1b3; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-box input::placeholder { color: #a5aebe; }
.search-clear { display: none; border: 0; background: transparent; color: #9ba5b6; cursor: pointer; }
.search-clear.show { display: block; }
.search-submit { height: 40px; min-width: 82px; border: 0; border-radius: 9px; background: var(--brand); color: #fff; cursor: pointer; font-weight: 700; transition: .2s ease; }
.search-submit:hover { background: var(--brand-dark); }

.quick-search { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 2px 0; }
.quick-search::before { margin-right: 2px; color: #9aa4b5; content: "常用搜索"; font-size: 12px; }
.quick-search button { border: 1px solid #e1e6ee; border-radius: 999px; background: #fff; padding: 5px 11px; color: #6e7a90; cursor: pointer; font-size: 12px; }
.quick-search button:hover { border-color: #a9c5f8; color: var(--brand-dark); }

.hero {
    position: relative;
    min-height: 205px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    overflow: hidden;
    margin-top: 22px;
    border: 1px solid #dce7fb;
    border-radius: 18px;
    background: linear-gradient(120deg, #fff 0%, #f7faff 52%, #edf4ff 100%);
    padding: 34px 42px;
    box-shadow: var(--shadow);
}

.hero::after {
    position: absolute;
    width: 340px;
    height: 340px;
    right: -130px;
    bottom: -230px;
    border-radius: 50%;
    border: 54px solid rgba(54, 123, 245, .065);
    content: "";
}

.hero > * { position: relative; z-index: 1; }
.eyebrow, .section-kicker { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: 1.8px; }
.hero h1 { margin: 9px 0 12px; font-size: clamp(26px, 3vw, 36px); line-height: 1.25; }
.hero p { max-width: 720px; margin: 0; color: #69768b; font-size: 14px; line-height: 1.85; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 19px; }
.hero-tags span { border: 1px solid #dce8fb; border-radius: 999px; background: rgba(255,255,255,.76); padding: 5px 11px; color: #61718d; font-size: 12px; }
.hero-stat { min-width: 140px; text-align: center; }
.hero-stat strong { display: block; color: var(--brand); font-size: 46px; line-height: 1; }
.hero-stat span { display: block; margin-top: 9px; color: #7d899d; font-size: 12px; }

.content-head { display: flex; align-items: flex-end; justify-content: space-between; margin: 34px 2px 15px; }
.content-head h2 { margin: 5px 0 0; font-size: 23px; }
.section-kicker { margin: 0; }
.result-count { color: #8d98aa; font-size: 12px; }

.tool-section { margin-bottom: 34px; }
.tool-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.tool-section-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.tool-section-head h3 { margin: 0; font-size: 16px; }
.tool-section-head span { color: #a0a9b8; font-size: 12px; }

.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.tool-card {
    position: relative;
    min-height: 116px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.tool-card:hover { transform: translateY(-2px); border-color: #cbdafa; box-shadow: 0 12px 28px rgba(34, 64, 112, .08); }
.tool-card-link { height: 100%; display: flex; gap: 13px; padding: 18px 43px 16px 17px; }
.tool-icon { width: 42px; height: 42px; display: grid; flex: 0 0 42px; place-items: center; border-radius: 12px; background: #f1f5fb; color: #6f819d; font-size: 17px; transition: .2s ease; }
.tool-card:hover .tool-icon { background: var(--brand-soft); color: var(--brand); }
.tool-info { min-width: 0; }
.tool-name { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 1px 0 7px; font-size: 15px; font-weight: 700; }
.tool-badge { border-radius: 999px; background: #eef8f0; padding: 2px 6px; color: #3b9760; font-size: 9px; font-weight: 700; }
.tool-info p { display: -webkit-box; overflow: hidden; margin: 0; color: #8792a5; font-size: 12px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.favorite-btn { position: absolute; z-index: 2; top: 13px; right: 12px; width: 29px; height: 29px; border: 0; border-radius: 8px; background: transparent; color: #c2c9d4; cursor: pointer; }
.favorite-btn:hover { background: #fff8e8; color: #e3a51b; }
.favorite-btn.active { color: #e3a51b; }

.empty-state { border: 1px dashed #d9e0eb; border-radius: 18px; background: #fff; padding: 70px 20px; text-align: center; }
.empty-state > i { color: #c1cad8; font-size: 34px; }
.empty-state h2 { margin: 17px 0 8px; font-size: 19px; }
.empty-state p { margin: 0 0 20px; color: #8a95a8; font-size: 13px; }
.empty-state button { border: 0; border-radius: 9px; background: var(--brand); padding: 9px 18px; color: #fff; cursor: pointer; }

.friend-links { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--line); margin-top: 42px; padding-top: 18px; color: #8d98aa; font-size: 12px; }
.friend-links span { color: #7c8798; font-weight: 700; }
.friend-links a { border: 1px solid #e1e6ee; border-radius: 999px; background: #fff; padding: 5px 11px; color: var(--brand-dark); font-weight: 700; transition: .2s ease; }
.friend-links a:hover { border-color: #a9c5f8; background: #f8faff; }

.toolbox-footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); margin-top: 50px; padding: 24px 2px 0; color: #9aa4b4; font-size: 12px; }
.toolbox-footer .footer-contact-email { color: #77869b; font-weight: 700; }
.toolbox-footer .footer-contact-email:hover { color: var(--brand); }
.home-ad { width: 100%; overflow: hidden; margin-top: 34px; text-align: center; }
.home-ad #ad-336280, .home-ad .text-center { width: 100%; overflow: hidden; text-align: center; }

@media (max-width: 1120px) {
    .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topnav a:nth-child(3), .topnav a:nth-child(4) { display: none; }
}

@media (max-width: 760px) {
    :root { --topbar: 58px; }
    body.sidebar-open { overflow: hidden; }
    .topbar { padding: 0 10px; }
    .brand { width: auto; flex: 1; border: 0; padding: 0 5px; }
    .brand-mark { width: 31px; height: 31px; border-radius: 9px; }
    .sidebar-toggle { display: block; order: -1; margin-right: 2px; }
    .topnav { flex: 0 0 auto; padding: 0; }
    .topnav a { display: none; }
    .topnav a:last-child { width: 39px; height: 39px; display: grid; min-height: 0; place-items: center; padding: 0; font-size: 0; }
    .topnav a:last-child i { font-size: 15px; }
    .sidebar { transform: translateX(-105%); width: 252px; transition: transform .25s ease; box-shadow: 20px 0 45px rgba(25, 40, 68, .15); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-mask { position: fixed; z-index: 35; inset: var(--topbar) 0 0 0; display: block; visibility: hidden; border: 0; background: rgba(17, 27, 45, .38); opacity: 0; transition: .25s ease; }
    body.sidebar-open .sidebar-mask { visibility: visible; opacity: 1; }
    .main-content { width: 100%; margin-left: 0; padding: 16px 13px 28px; }
    .search-panel { border-radius: 13px; padding: 10px; }
    .search-box { height: 46px; }
    .search-submit { min-width: 64px; height: 36px; }
    .quick-search { max-height: 41px; overflow: hidden; }
    .hero { min-height: 0; align-items: flex-start; margin-top: 14px; border-radius: 14px; padding: 25px 22px; }
    .hero h1 { font-size: 25px; }
    .hero-stat { display: none; }
    .content-head { margin-top: 28px; }
    .tool-grid { grid-template-columns: 1fr; gap: 10px; }
    .tool-card { min-height: 104px; }
    .toolbox-footer { flex-direction: column; gap: 7px; }
}

@media (min-width: 1500px) {
    .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
