/* ============================================================
 * 虾否工具网 主样式表  xiafou.css
 * 布局/视觉参考 itptg.com：卡片式（左图右文）+ 双列网格 + Hero 浅色渐变 + 深色页脚
 * 主色采用绿色（用户偏好），替代 itptg.com 的天蓝色
 * 标记：本文件为虾否工具网专用 xiafou.css
 * ============================================================ */

/* ---------- 基础重置 ---------- */
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"PingFang SC","Microsoft YaHei","Noto Sans SC",sans-serif;
    background:#f8fafc;
    color:#0f172a;
    line-height:1.5;
    font-size:14px;
    -webkit-font-smoothing:antialiased;
}
a{color:#10b981;text-decoration:none;transition:color .2s}
a:hover{color:#059669;text-decoration:underline}
img,svg{vertical-align:middle;max-width:100%;display:block}
ul,ol{list-style:none}
code{background:#f1f5f9;padding:2px 6px;border-radius:4px;font-size:13px;color:#0f172a;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}

/* ---------- 通用容器 ---------- */
.container{max-width:1280px;margin:0 auto;padding:0 16px}
.text-red{color:#ef4444}

/* ---------- 顶部 Header（模仿 itptg.com：白底+搜索+汉堡菜单） ---------- */
.site-header{
    background:rgba(255,255,255,0.95);
    backdrop-filter:blur(8px);
    border-bottom:1px solid #e2e8f0;
    position:sticky;top:0;z-index:100;
}
.header-inner{
    display:flex;align-items:center;justify-content:space-between;
    padding:12px 16px;max-width:1280px;margin:0 auto;gap:18px;
}
.logo-wrap{display:flex;align-items:center;gap:10px;flex-shrink:0}
.logo-icon{
    width:36px;height:36px;
    background:linear-gradient(135deg,#10b981 0%,#059669 100%);
    color:#fff;border-radius:8px;
    display:flex;align-items:center;justify-content:center;
    font-size:20px;font-weight:700;
}
.logo-text{font-size:18px;font-weight:700;color:#0f172a;letter-spacing:.3px;line-height:1.2}
.logo-text .domain{color:#ef4444;font-size:12px;margin-left:6px;font-weight:500}
.logo-slogan{font-size:11px;color:#64748b;display:block;margin-top:2px;line-height:1.2}

/* 搜索框 */
.search-box{flex:1;max-width:520px;display:flex;position:relative}
.search-input{
    width:100%;padding:10px 14px 10px 38px;
    border:1px solid #e2e8f0;border-radius:8px;
    font-size:14px;background:#f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'%3E%3Cpath d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.75-2.74-4.97-5.5-5.34C6.45 2.48 3 5.84 3 10a6.5 6.5 0 006.5 6.5c1.61 0 3.09-.59 4.23-1.56l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") no-repeat 12px center/16px;
    transition:all .2s;
}
.search-input:focus{outline:none;border-color:#10b981;background-color:#fff;box-shadow:0 0 0 3px rgba(16,185,129,.1)}
.search-btn{
    position:absolute;right:4px;top:4px;bottom:4px;
    padding:0 18px;background:#10b981;color:#fff;border:none;border-radius:6px;
    font-size:14px;cursor:pointer;transition:background .2s;
}
.search-btn:hover{background:#059669}
.search-btn:disabled{opacity:.7;cursor:not-allowed}

/* 移动端汉堡菜单 */
.menu-toggle{
    display:none;
    flex-direction:column;gap:4px;
    background:none;border:none;cursor:pointer;padding:8px;
}
.menu-toggle span{width:22px;height:2px;background:#0f172a;border-radius:1px;transition:all .2s}

/* ---------- 顶部导航（横排链接） ---------- */
.nav-bar{background:#fff;border-bottom:1px solid #e2e8f0}
.nav-inner{
    max-width:1280px;margin:0 auto;padding:0 16px;
    display:flex;gap:4px;overflow-x:auto;
    scrollbar-width:none; /* Firefox 隐藏滚动条 */
    -ms-overflow-style:none; /* IE/Edge 隐藏滚动条 */
}
.nav-inner::-webkit-scrollbar{display:none} /* Chrome/Safari 隐藏滚动条 */
.nav-link{
    padding:12px 16px;color:#475569;font-size:14px;white-space:nowrap;
    border-bottom:2px solid transparent;
}
.nav-link:hover{text-decoration:none;color:#10b981;border-bottom-color:#10b981}
.nav-link.active{color:#10b981;border-bottom-color:#10b981;font-weight:500}

/* ---------- 面包屑 ---------- */
.breadcrumb{padding:14px 0;font-size:13px;color:#64748b}
.breadcrumb a{color:#64748b}
.breadcrumb a:hover{color:#10b981}
.breadcrumb-sep{margin:0 6px;color:#cbd5e1}

/* ============================================================
 * Hero 区（模仿 itptg.com：浅色渐变背景，居中标题副标题）
 * ============================================================ */
.hero{
    background:linear-gradient(135deg,#ecfdf5 0%,#d1fae5 50%,#a7f3d0 100%);
    padding:48px 16px 40px;text-align:center;
    border-bottom:1px solid #e2e8f0;
}
.hero h1{
    font-size:36px;font-weight:700;color:#0f172a;
    margin-bottom:8px;letter-spacing:.5px;line-height:1.2;
}
.hero .subtitle{
    font-size:16px;color:#475569;margin-bottom:20px;
}
.hero .tag{
    display:inline-block;background:#fff;color:#10b981;
    font-size:12px;padding:3px 10px;border-radius:999px;
    margin-bottom:10px;border:1px solid #d1fae5;
}
.hero-search{
    max-width:560px;margin:0 auto;display:flex;position:relative;
    box-shadow:0 4px 14px rgba(16,185,129,.12);
}
.hero-search input{
    flex:1;padding:13px 18px 13px 44px;border:1px solid #e2e8f0;border-radius:8px 0 0 8px;
    font-size:15px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'%3E%3Cpath d='M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.75-2.74-4.97-5.5-5.34C6.45 2.48 3 5.84 3 10a6.5 6.5 0 006.5 6.5c1.61 0 3.09-.59 4.23-1.56l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") no-repeat 14px center/18px;
}
.hero-search input:focus{outline:none;border-color:#10b981}
.hero-search button{
    padding:13px 28px;background:#10b981;color:#fff;border:none;
    border-radius:0 8px 8px 0;font-size:15px;cursor:pointer;font-weight:500;
}
.hero-search button:hover{background:#059669}

/* ============================================================
 * 热门工具区（模仿 itptg.com：横向流式卡片列表）
 * ============================================================ */
.section{padding:24px 0}
.section-title{
    display:flex;align-items:center;justify-content:space-between;
    margin-bottom:14px;
}
.section-title h2{
    font-size:20px;font-weight:700;color:#0f172a;
    display:flex;align-items:center;gap:8px;
}
.section-title h2 .badge-count{
    background:#fef3c7;color:#92400e;font-size:12px;
    padding:2px 10px;border-radius:999px;font-weight:500;
}
.section-title .more{font-size:14px;color:#64748b}
.section-title .more:hover{color:#10b981}

.hot-tag{
    display:inline-block;background:#ef4444;color:#fff;
    font-size:11px;padding:1px 6px;border-radius:3px;
    margin-left:6px;font-weight:500;vertical-align:middle;
}

/* 热门工具：横向流式文字链接（模仿 itptg.com 热门工具样式） */
.hot-tools{
    background:#fff;border-radius:12px;padding:16px 20px;
    border:1px solid #e2e8f0;
}
.hot-tools-list{
    display:flex;flex-wrap:wrap;gap:8px 0;
}
.hot-tools-list a{
    color:#475569;font-size:14px;padding:6px 14px;
    border-right:1px solid #e2e8f0;display:inline-block;
}
.hot-tools-list a:hover{
    color:#10b981;text-decoration:none;
}
.hot-tools-list a:last-child{border-right:none}

/* ============================================================
 * 分类区块（模仿 itptg.com：每个分类一个独立 section）
 * ============================================================ */
.cat-section{margin-bottom:32px}
.cat-header{
    display:flex;align-items:center;justify-content:space-between;
    padding-bottom:10px;border-bottom:2px solid #10b981;margin-bottom:14px;
}
.cat-header h2{
    font-size:18px;font-weight:700;color:#0f172a;
    display:flex;align-items:center;gap:8px;
}
.cat-header .count{
    color:#64748b;font-size:13px;font-weight:400;margin-left:8px;
}
.cat-header .more{
    font-size:13px;color:#64748b;
}

/* 分类入口卡片网格（首页"工具分类导航"用） */
.cat-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
    gap:12px;
}
.cat-card{
    display:flex;align-items:center;gap:10px;
    padding:14px;background:#fff;border-radius:12px;
    border:1px solid #e2e8f0;transition:all .2s;
}
.cat-card:hover{
    text-decoration:none;border-color:#10b981;
    box-shadow:0 4px 14px rgba(16,185,129,.1);color:inherit;
    transform:none;
}
.cat-icon{
    width:40px;height:40px;border-radius:10px;flex-shrink:0;
    display:flex;align-items:center;justify-content:center;font-size:20px;color:#fff;
}
.cat-info{flex:1;min-width:0}
.cat-info .n{font-size:14px;font-weight:500;color:#0f172a;display:block}
.cat-info .c{font-size:12px;color:#64748b;display:block;margin-top:2px}

/* ============================================================
 * 工具卡片网格（模仿 itptg.com：双列卡片，左图右文）
 * ============================================================ */
.tool-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(360px,1fr));
    gap:12px;
}
.tool-card{
    display:flex;align-items:center;gap:12px;
    padding:14px;background:#fff;border-radius:12px;
    border:1px solid #f1f5f9;transition:all .2s;
    color:inherit;
}
.tool-card:hover{
    text-decoration:none;border-color:#10b981;
    box-shadow:0 4px 14px rgba(16,185,129,.08);color:inherit;
    transform:none;
}
.tool-icon-box{
    width:40px;height:40px;border-radius:10px;flex-shrink:0;
    display:flex;align-items:center;justify-content:center;
    color:#fff;font-size:20px;background:#10b981;
    overflow:hidden;
}
.tool-icon-box img,.tool-icon-box svg{
    width:24px;height:24px;display:block;margin:auto;
}
.tool-info{flex:1;min-width:0;overflow:hidden}
.tool-info .tool-name{
    font-size:15px;font-weight:500;color:#0f172a;
    display:block;line-height:1.4;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.tool-info .tool-desc{
    font-size:13px;color:#64748b;
    display:block;margin-top:2px;line-height:1.4;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
/* 颜色变体 */
.tool-icon-box.blue{background:#0ea5e9}
.tool-icon-box.purple{background:#8b5cf6}
.tool-icon-box.orange{background:#f59e0b}
.tool-icon-box.green{background:#10b981}
.tool-icon-box.red{background:#ef4444}
.tool-icon-box.teal{background:#14b8a6}
.tool-icon-box.indigo{background:#6366f1}
.tool-icon-box.pink{background:#ec4899}
.tool-icon-box.yellow{background:#eab308}

/* ---------- 文章/详情卡片 ---------- */
.card{
    background:#fff;border-radius:12px;padding:24px;
    border:1px solid #e2e8f0;margin-bottom:18px;
}
.card h1{font-size:24px;font-weight:700;margin-bottom:10px;color:#0f172a}
.card h2{font-size:18px;font-weight:600;margin:18px 0 10px;color:#0f172a;padding-left:10px;border-left:4px solid #10b981}
.card h3{font-size:15px;font-weight:600;margin:14px 0 8px;color:#10b981}
.card p{margin-bottom:10px;color:#475569;line-height:1.8}
.card ul,.card ol{margin:8px 0 12px 22px}
.card li{margin-bottom:4px;color:#475569}

/* ---------- 进入工具按钮 ---------- */
.tool-detail-btn{
    display:inline-block;padding:12px 30px;
    background:#10b981;color:#fff;border-radius:8px;font-size:15px;
    font-weight:500;transition:background .2s;
}
.tool-detail-btn:hover{background:#059669;color:#fff;text-decoration:none}

/* ---------- 友情链接区 ---------- */
.friend-links{
    background:#fff;padding:18px 0;border-top:1px solid #e2e8f0;
    margin-top:24px;
}
.friend-links h3{
    font-size:14px;color:#475569;font-weight:500;margin-bottom:10px;
    padding-left:10px;border-left:3px solid #10b981;line-height:1;
}
.friend-links-list{
    display:flex;flex-wrap:wrap;gap:8px 18px;
}
.friend-links-list a{
    color:#64748b;font-size:13px;
    display:inline-flex;align-items:center;gap:4px;
}
.friend-links-list a:hover{color:#10b981;text-decoration:underline}
.friend-links-list a::before{content:"·";color:#cbd5e1;margin-right:2px}

/* ============================================================
 * 页脚（模仿 itptg.com：深色背景）
 * ============================================================ */
.site-footer{
    background:#0f172a;color:#94a3b8;padding:30px 0 16px;
    margin-top:30px;font-size:13px;
}
.footer-grid{
    display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
    gap:18px;max-width:1280px;margin:0 auto 16px;padding:0 16px;
}
.footer-grid h4{color:#fff;font-size:14px;margin-bottom:10px;font-weight:600}
.footer-grid a{color:#94a3b8;display:block;margin-bottom:6px}
.footer-grid a:hover{color:#10b981;text-decoration:underline}
.footer-bottom{
    text-align:center;border-top:1px solid #1e293b;padding-top:14px;
    color:#64748b;line-height:1.6;
}
.footer-bottom a{color:#94a3b8;margin:0 4px}
.footer-bottom a:hover{color:#10b981}
.footer-bottom .red{color:#f87171}

/* ---------- 返回顶部 ---------- */
.back-to-top{
    position:fixed;right:18px;bottom:18px;
    width:44px;height:44px;background:#10b981;color:#fff;
    border-radius:50%;display:flex;align-items:center;justify-content:center;
    font-size:22px;cursor:pointer;
    box-shadow:0 4px 14px rgba(0,0,0,.2);
    opacity:0;visibility:hidden;transition:opacity .25s,background .2s;
    z-index:99;border:none;
}
.back-to-top.show{opacity:1;visibility:visible}
.back-to-top:hover{background:#059669}

/* ---------- Loading 状态 ---------- */
.loading-tip{
    text-align:center;padding:30px 10px;color:#64748b;font-size:14px;
}
.loading-tip .dot{
    display:inline-block;width:8px;height:8px;background:#10b981;
    border-radius:50%;margin:0 2px;animation:dot-bounce 1.2s infinite;
}
.loading-tip .dot:nth-child(2){animation-delay:.15s}
.loading-tip .dot:nth-child(3){animation-delay:.3s}
@keyframes dot-bounce{
    0%,80%,100%{transform:scale(0.6);opacity:.6}
    40%{transform:scale(1);opacity:1}
}

/* ---------- 搜索结果高亮 ---------- */
.search-highlight{background:#fef3c7;padding:0 2px;border-radius:3px;color:#92400e}

/* ---------- 空状态 ---------- */
.empty-state{text-align:center;padding:40px 20px;color:#64748b;font-size:14px}
.empty-state .ico{font-size:36px;margin-bottom:8px;opacity:.5}

/* ============================================================
 * 移动端适配
 * ============================================================ */
@media (max-width:768px){
    .header-inner{flex-wrap:wrap;padding:10px 12px}
    .search-box{order:3;max-width:100%;width:100%;margin-top:8px}
    .logo-text{font-size:16px}
    .hero{padding:30px 16px 24px}
    .hero h1{font-size:24px}
    .hero .subtitle{font-size:14px}
    .section{padding:16px 0}
    .section-title h2{font-size:17px}
    /* 移动端工具卡片改为单列 */
    .tool-grid{grid-template-columns:1fr;gap:8px}
    .cat-grid{grid-template-columns:repeat(auto-fill,minmax(46%,1fr));gap:8px}
    .cat-card{padding:10px}
    .tool-card{padding:10px}
    .tool-icon-box{width:36px;height:36px;border-radius:8px}
    .tool-icon-box img,.tool-icon-box svg{width:22px;height:22px}
    .tool-info .tool-name{font-size:14px}
    .tool-info .tool-desc{font-size:12px}
    .card{padding:14px;border-radius:8px}
    .card h1{font-size:19px}
    .nav-inner{padding:0 8px}
    .nav-link{padding:10px 12px;font-size:13px}
    .back-to-top{right:12px;bottom:12px;width:38px;height:38px;font-size:18px}
    .hot-tools-list a{padding:5px 10px;font-size:13px}
}

@media (max-width:480px){
    .hero h1{font-size:20px}
    .hero-search input{padding:11px 14px 11px 38px;font-size:14px}
    .hero-search button{padding:11px 18px;font-size:14px}
}
