/* 工具页共用顶栏：左 Logo，右分享 */
.tool-site-header {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid #e0e0e0;
    padding-top: env(safe-area-inset-top, 0px);
}

.tool-site-header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0.45rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.tool-site-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
    color: #0066cc;
    font-weight: 700;
    font-size: 1rem;
    min-width: 0;
    flex-shrink: 0;
}

.tool-site-logo img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tool-site-logo span {
    white-space: nowrap;
}

.tool-site-share {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.38rem 0.85rem;
    border: 1px solid rgba(0, 102, 204, 0.22);
    border-radius: 999px;
    background: #fff;
    color: #0066cc;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tool-site-share:hover {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.22);
}

.tool-site-share:active {
    transform: scale(0.97);
}

body.has-tool-header {
    /* 顶栏在文档流内，由 sticky 占位；移动端见 tool-mobile.css */
}

/* 隐藏各工具页内嵌的旧站导航，只保留 tool-site-header（CSS 先于 JS 生效，避免双顶栏闪烁） */
body.has-tool-header > header:not(.tool-site-header),
body.has-tool-header .tool-legacy-header,
body.has-tool-header > header .header-content {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: none !important;
}

@media (max-width: 640px) {
    .tool-site-header-inner {
        padding: 0.4rem 0.75rem;
    }

    .tool-site-logo {
        font-size: 0.9rem;
    }

    .tool-site-logo img {
        width: 26px;
        height: 26px;
    }

    .tool-site-share {
        font-size: 0.78rem;
        padding: 0.32rem 0.7rem;
    }
}
