* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
        "PingFang SC", Roboto, Helvetica, Arial, sans-serif;
    background: #f6f7f5;
    color: #333;
    font-size: 15px;
    line-height: 1.5;
}
.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- 标题 ---------- */
.site-header { text-align: center; margin-top: 84px; }
.site-title {
    font-size: 58px;
    font-weight: 900;
    color: #111;
    letter-spacing: 1px;
    line-height: 1.05;
}
.site-logo { max-height: 76px; }
.site-tagline {
    margin-top: 6px;
    font-size: 21px;
    font-weight: 600;
    color: #222;
    letter-spacing: .5px;
}

/* ---------- 搜索框 ---------- */
.search-wrap { position: relative; margin: 30px auto 0; max-width: 940px; width: 100%; }
.search-box {
    display: flex;
    align-items: center;
    height: 56px;
    background: #fff;
    border: 1px solid #d8d8d8;
    border-radius: 28px;
    overflow: hidden;
    transition: box-shadow .2s, border-color .2s;
}
.search-box:focus-within {
    border-color: #4e6ef2;
    box-shadow: 0 2px 14px rgba(78, 110, 242, .16);
}
.search-engine-icon { display: flex; align-items: center; padding-left: 20px; flex-shrink: 0; }
#searchInput {
    flex: 1;
    height: 100%;
    border: 0;
    outline: 0;
    font-size: 16px;
    padding: 0 12px;
    background: transparent;
    color: #333;
}
#searchInput::placeholder { color: #b3b3b3; }
.search-btn {
    flex-shrink: 0;
    width: 70px;
    height: 100%;
    border: 0;
    background: #ffe100;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.search-btn:hover { background: #f2d300; }

/* ---------- 搜索建议 ---------- */
.search-suggest {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
    overflow: hidden;
    z-index: 50;
}
.suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 15px;
    color: #333;
}
.suggest-item:hover, .suggest-item.active { background: #f5f6f4; }
.suggest-item .s-icon { width: 20px; height: 20px; flex-shrink: 0; border-radius: 4px; }
.suggest-item .s-domain { margin-left: auto; color: #aaa; font-size: 12px; }
.suggest-empty { padding: 14px 18px; color: #999; font-size: 14px; }
mark { background: transparent; color: #4e6ef2; font-weight: 600; }

/* ---------- 最近访问 ---------- */
.recent-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 16px 6px 0;
}
.recent-label { color: #999; font-size: 13px; display: block; margin-bottom: 5px; }
.recent-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 20px; }
.recent-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    padding: 3px 12px;
    background: #eeeef0;
    border-radius: 14px;
}
.recent-item img { width: 16px; height: 16px; border-radius: 3px; }
.recent-clear { color: #999; font-size: 13px; cursor: pointer; flex-shrink: 0; }
.recent-clear:hover { color: #666; }

/* ---------- 公告 ---------- */
.announce {
    margin: 14px auto 0;
    max-width: 920px;
    background: #fff8e6;
    border: 1px solid #ffe1a8;
    color: #a06d10;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
}

/* ---------- 分类标签 ---------- */
.tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 30px 0 6px;
}
.tab {
    padding: 8px 17px;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    white-space: nowrap;
}
.tab:hover { color: #222; }
.tab.active { color: #111; font-weight: 700; }

/* ---------- 面板 / 网格 ---------- */
.panel { display: none; margin-top: 16px; }
.panel.active { display: block; }
.grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    row-gap: 12px;
    column-gap: 8px;
}
.tool-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: background .12s;
    min-width: 0;
}
.tool-item:hover { background: #e9eae7; }
.tool-item img {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 4px;
}
.tool-emoji { flex-shrink: 0; width: 22px; text-align: center; }
.tool-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; color: #bbb; padding: 60px 0; font-size: 15px; }

/* ---------- 底部 ---------- */
.site-footer { margin-top: auto; padding: 70px 0 32px; text-align: center; }
.footer-links { font-size: 14px; margin-bottom: 14px; }
.footer-links a { color: #888; text-decoration: none; margin: 0 13px; }
.footer-links a:hover { color: #444; }
.footer-links .dot { color: #ccc; }
.footer-desc, .footer-copy, .footer-icp { color: #b0b0b0; font-size: 13px; margin-top: 8px; }
.footer-icp a { color: #b0b0b0; text-decoration: none; }
.footer-icp a:hover { color: #888; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
    .site-header { margin-top: 64px; }
}
@media (max-width: 640px) {
    .page { padding: 0 14px; }
    .site-header { margin-top: 40px; }
    .site-title { font-size: 46px; letter-spacing: 0; }
    .site-tagline { font-size: 17px; }
    .search-box { height: 50px; border-radius: 25px; }
    .search-btn { width: 58px; }
    .tabs {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-top: 22px;
    }
    .tab { font-size: 16px; padding: 7px 13px; }
    .grid { grid-template-columns: repeat(3, 1fr); row-gap: 10px; column-gap: 4px; }
    .tool-item { font-size: 14px; padding: 7px 6px; gap: 6px; }
    .footer-links a { margin: 0 9px; }
}
/* ---------- 搜索引擎切换 ---------- */
.engine-select {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 14px 0 20px;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    flex-shrink: 0;
    height: 100%;
    user-select: none;
    border-right: 1px solid #eee;
}
.engine-select .arrow {
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #999;
    transition: transform .15s;
}
.engine-select.open .arrow { transform: rotate(180deg); }
.engine-menu {
    position: absolute;
    top: 60px;
    left: 0;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    padding: 6px;
    z-index: 60;
    min-width: 130px;
    display: none;
}
.engine-menu.open { display: block; }
.engine-opt {
    padding: 8px 14px;
    font-size: 15px;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.engine-opt:hover { background: #f5f6f4; }
.engine-opt.active { color: #4e6ef2; font-weight: 600; }
@media (max-width: 640px) {
    .engine-select { padding: 0 10px 0 16px; font-size: 14px; }
    .engine-menu { top: 54px; min-width: 120px; }
}
/* ---------- 搜索引擎切换 ---------- */
.engine-select {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 14px 0 18px;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    flex-shrink: 0;
    height: 100%;
    user-select: none;
    border-right: 1px solid #eee;
    white-space: nowrap;
}
.engine-select .arrow {
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #999;
    transition: transform .15s;
}
.engine-select.open .arrow { transform: rotate(180deg); }
.engine-menu {
    position: absolute;
    top: 60px;
    left: 0;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    padding: 6px;
    z-index: 60;
    min-width: 140px;
    display: none;
}
.engine-menu.open { display: block; }
.engine-opt {
    padding: 8px 14px;
    font-size: 15px;
    color: #333;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
}
.engine-opt:hover { background: #f5f6f4; }
.engine-opt.active { color: #4e6ef2; font-weight: 600; }
@media (max-width: 640px) {
    .engine-select { padding: 0 10px 0 14px; font-size: 14px; }
    .engine-menu { top: 52px; min-width: 128px; }
}
