/* 常用工具站 · 全站样式 */
/* =============================================================
   常用工具站 · 基础设计系统（后台与前台共用令牌）
   前台全站只输出一份样式：<asset_dir>/style.css
   ============================================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --blue: #2563eb;
    --blue-2: #3b82f6;
    --blue-dark: #1d4ed8;
    --blue-bg: #eff6ff;
    --ink: #0f172a;
    --text: #334155;
    --text-2: #64748b;
    --muted: #94a3b8;
    --line: #e5eaf1;
    --bg: #f4f6fb;
    --white: #ffffff;
    --green: #10b981;
    --teal: #14b8a6;
    --orange: #f59e0b;
    --red: #ef4444;
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
    --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.06);
    --shadow-lg: 0 4px 12px rgba(15,23,42,.07), 0 20px 48px rgba(15,23,42,.10);
}

html, body { height: 100%; }
body {
    font-family: -apple-system, "SF UI Text", "Segoe UI", Arial, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
    font-size: 14px;
    color: var(--text);
    background: #ffffff;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}
a { text-decoration: none; color: inherit; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* =============================================================
   前台 · 顶部导航
   ============================================================= */
.site-header {
    flex: none;
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.86);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    max-width: 1080px; margin: 0 auto; padding: 0 24px;
    height: 60px; display: flex; align-items: center; gap: 28px;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: .5px;
    white-space: nowrap;
}
.brand-mark {
    width: 22px; height: 22px; border-radius: 50px; flex: none;
    background: var(--blue);
    color: #fff; font-size: 15px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.brand:hover { color: var(--blue); }
.site-nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
    padding: 7px 14px; border-radius: 999px; white-space: nowrap;
    font-size: 14px; color: var(--text-2); font-weight: 500;
    transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--blue); background: var(--blue-bg); }
.site-nav a.active { color: var(--blue); background: var(--blue-bg); font-weight: 600; }

/* =============================================================
   前台 · Hero 区
   ============================================================= */
.hero {
    flex: none; position: relative; overflow: hidden;
    padding: 72px 0 64px; text-align: center;
}
.hero-slim { padding: 48px 0 42px; }
.hero h1 { font-size: 36px; font-weight: 800; color: var(--ink); letter-spacing: 1px; }
.hero h1 a:hover { color: var(--blue); }
.hero .sub { color: var(--text-2); margin-top: 12px; font-size: 15px; }
.hero-badge {
    display: inline-block; margin-bottom: 18px;
    font-size: 12px; font-weight: 600; color: var(--blue);
    background: rgba(37,99,235,.08); border: 1px solid rgba(37,99,235,.18);
    padding: 4px 14px; border-radius: 999px; letter-spacing: 1px;
}

/* ---------- 搜索框 ---------- */
.search {
    margin: 32px auto 0; max-width: 620px;
    display: flex; align-items: center;
    background: #fff; border: 1px solid var(--line);
    border-radius: 999px; padding: 6px 6px 6px 22px;
}
.search:focus-within { border-color: var(--blue-2); }
.search input {
    flex: 1; min-width: 0; height: 46px;
    border: 0; outline: 0; background: transparent;
    font-size: 15px; color: var(--ink);
}
.search input::placeholder { color: var(--muted); }
.search button {
    flex: none; height: 46px; padding: 0 32px;
    border: 0; border-radius: 999px; cursor: pointer;
    background: var(--blue);
    color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 3px;
}
.search button:hover { background: var(--blue-dark); }

/* 输入错误就地提示 */
.form-error {
    margin: 16px auto 0; max-width: 620px;
    padding: 11px 18px; border-radius: 10px;
    border: 1px solid #fecaca; background: #fef2f2; color: #dc2626;
    font-size: 13px; line-height: 1.7; text-align: left; word-break: break-all;
}

/* ---------- 快捷链接（胶囊） ---------- */
.quick-links { margin-top: 24px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.quick-links a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 18px; border-radius: 999px;
    background: #fff; border: 1px solid var(--line);
    font-size: 13px; color: var(--text-2); font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: color .15s, border-color .15s;
}
.quick-links a:hover { color: var(--blue); border-color: var(--blue-2); }
/* 旧的 .hint 兼容 */
.hint { margin-top: 20px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.hint a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 18px; border-radius: 999px;
    background: #fff; border: 1px solid var(--line);
    font-size: 13px; color: var(--text-2); font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: color .15s, border-color .15s;
}
.hint a:hover { color: var(--blue); border-color: var(--blue-2); }

/* =============================================================
   前台 · 内容区块
   ============================================================= */
.page-body { flex: 1 0 auto; padding: 0; }
.section { margin-bottom: 36px; }
.section-title {
    font-size: 16px; font-weight: 500; color: var(--ink);
    margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.section-title::before {
    content: ""; width: 2px; height: 18px; border-radius: 2px;
    background: var(--blue);
}

/* ---------- 卡片 ---------- */
.card-box {
    background: #fff; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 26px 28px;
    box-shadow: var(--shadow-sm);
}

/* ---------- 首页工具卡片网格 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool-card {
    display: flex; gap: 14px; align-items: flex-start;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px 22px; box-shadow: var(--shadow-sm);
    transition: border-color .18s, box-shadow .18s;
}
.tool-card:hover {
    border-color: rgba(37,99,235,.5);
    box-shadow: 0 12px 32px rgba(37,99,235,.14);
}
.tool-icon {
    flex: none; width: 46px; height: 46px; border-radius: 12px;
    background: var(--blue-bg); color: var(--blue);
    font-size: 22px; display: flex; align-items: center; justify-content: center;
}
.tool-body { min-width: 0; }
.tool-body b { display: block; font-size: 15px; color: var(--ink); font-weight: 600; }
.tool-card:hover .tool-body b { color: var(--blue); }
.tool-body span { display: block; font-size: 12px; color: var(--text-2); margin-top: 5px; line-height: 1.6; }

/* ---------- 特性方块 ---------- */
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 32px; }
.feat {
    border: 1px solid var(--line); border-radius: 12px; background: #fff;
    padding: 20px 18px; text-align: center;
    transition: border-color .15s;
}
.feat:hover { border-color: rgba(37,99,235,.5); }
.feat b { display: block; font-size: 14px; color: var(--ink); }
.feat span { display: block; color: var(--text-2); font-size: 12px; margin-top: 6px; line-height: 1.6; }

/* ---------- 近期查询 / 友情链接 ---------- */
/* 近期查询区块始终位于卡片内（首页 .card-box / 结果页 .result-card.recent-card），
   卡片自带内边距，故 .recent 不应再有额外上间距，否则上方会空出一大块 */
.recent { margin-top: 0; }
.recent h2, .friend-links .fl-title, .friend-links p:first-child {
    font-size: 14px; font-weight: 500; color: var(--text);
}
.recent-list { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.recent-list a {
    font-size: 12px; color: #9fa8b5;
    background: #fff; padding: 0 3px;
    text-decoration: none;
    transition: color .15s;
}
.recent-list a:hover { color: var(--blue); }
/* 近期查询独立卡片：紧凑内边距，且该卡片内的 .recent 无需额外上间距，避免上方空出一块空白 */
.result-card.recent-card { padding: 20px 32px; }
.result-card .recent { margin-top: 0; }
.friend-links { margin-top: 0; }
.friend-links p:last-child { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.friend-links a { font-size: 12px; color: #9fa8b5; background: #fff; padding: 0 3px; text-decoration: none; }
.friend-links a:hover { color: var(--blue); }

/* =============================================================
   前台 · 结果页
   ============================================================= */
.result-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius); padding: 30px 32px;
    box-shadow: var(--shadow-sm);
}
.result-card + .result-card { margin-top: 20px; }
/* 结果卡片后面直接跟内容区块时补足间距（如关键词列表 + 友情链接） */
.result-card + .section,
.result-card + .card-box { margin-top: 20px; }

.ip-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ip-line h1 { font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: .3px; word-break: break-all; }
.copy-btn {
    border: 1px solid var(--line); background: #fff; color: var(--text-2);
    font-size: 12px; padding: 4px 13px; border-radius: 999px; cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
}
.copy-btn:hover { color: var(--blue); border-color: var(--blue-2); background: var(--blue-bg); }
.ver {
    font-size: 12px; color: #fff; font-weight: 400;
    background: var(--blue);
    padding: 3px 12px; border-radius: 999px;
}
.chip {
    font-size: 12px; color: var(--blue); font-weight: 500;
    background: var(--blue-bg); border: 1px solid rgba(37,99,235,.18);
    padding: 3px 12px; border-radius: 999px;
}
.chip img.flag { height: 0.85em; width: 1.2em; vertical-align: -0.1em; margin-right: 3px; border-radius: 1px; }
.meta { margin-top: 14px; color: var(--text-2); font-size: 14px; line-height: 1.8; }

/* ---------- 结果表格 ---------- */
.kv-table {
    width: 100%; margin-top: 20px;
    border-collapse: separate; border-spacing: 0;
    border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.kv-table th {
    width: 26%; text-align: left; font-weight: 500; font-size: 13px;
    color: var(--text-2); background: #f8fafc;
    padding: 11px 18px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.kv-table td {
    padding: 11px 18px; border-bottom: 1px solid var(--line);
    font-size: 14px; color: var(--ink); line-height: 1.7; word-break: break-all;
}
.kv-table tr:last-child th, .kv-table tr:last-child td { border-bottom: 0; }
.kv-table tr:hover td { background: #fbfdff; }
.kv-table .empty { color: #cbd5e1; }
.kv-table td a { color: var(--blue); }
.kv-table td a:hover { color: var(--blue-dark); text-decoration: underline; }

/* ---------- 下级区划 / 搜索结果表 ---------- */
.children-box { margin-top: 24px; }
.children-box h2 { font-size: 16px; font-weight: 500; color: var(--ink); }
.children-table, .result-table, .kw-table {
    width: 100%; margin-top: 14px;
    border-collapse: separate; border-spacing: 0;
    border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.children-table th, .result-table th, .kw-table th {
    text-align: left; font-weight: 500; font-size: 12px; color: var(--text-2);
    background: #f8fafc; padding: 10px 18px; border-bottom: 1px solid var(--line);
}
.children-table td, .result-table td, .kw-table td {
    padding: 10px 18px; border-bottom: 1px solid var(--line);
    font-size: 13px; line-height: 1.7;
}
.children-table tr:last-child td, .result-table tr:last-child td, .kw-table tr:last-child td { border-bottom: 0; }
.children-table tr:hover td, .result-table tr:hover td, .kw-table tr:hover td { background: #fbfdff; }
.children-table td a, .result-table td a, .kw-table td a { color: var(--blue); font-weight: 500; }
.children-table td a:hover, .result-table td a:hover, .kw-table td a:hover { color: var(--blue-dark); text-decoration: underline; }
.c-code { font-family: Consolas, Menlo, monospace; color: var(--text-2); }

/* ---------- 省份/区划网格 ---------- */
.province-grid {
    margin-top: 16px; display: grid; list-style: none;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px;
}
.province-grid a {
    display: block; text-align: center; padding: 9px 6px;
    border: 1px solid var(--line); border-radius: 10px;
    color: var(--text-2); font-size: 13px; background: #fff;
    transition: all .15s;
    /* 名称保持一行显示：超长时省略而不是折行 */
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.province-grid a:hover { border-color: var(--blue-2); color: var(--blue); background: var(--blue-bg); }

/* ---------- 层级导航 / 面包屑 ---------- */
.hierarchy-nav { margin-top: 14px; font-size: 13px; color: var(--text-2); }
.hierarchy-nav a { color: var(--blue); }
.hierarchy-nav a:hover { text-decoration: underline; }
.hierarchy-sep { margin: 0 8px; color: var(--muted); }
.hierarchy-current { color: var(--ink); font-weight: 600; }
.breadcrumb { margin-top: 14px; font-size: 13px; color: var(--text-2); }
.breadcrumb a { color: var(--blue); }
.breadcrumb .current { color: var(--ink); }

/* ---------- 底部文案 ---------- */
.search-summary { margin-top: 14px; font-size: 14px; color: var(--text-2); }
.search-summary b { color: var(--blue); }
.empty-tip {
    margin-top: 20px; padding: 32px 20px; text-align: center;
    color: var(--text-2); font-size: 14px;
    border: 1px dashed var(--line); border-radius: 12px;
}
.related-section { margin-top: 28px; }
.related-section h2 { font-size: 16px; font-weight: 500; color: var(--ink); }

/* ---------- SEO 文本 ---------- */
.seo-text { text-align: left; }
.seo-text h2 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 20px 0 8px; }
.seo-text h2:first-child { margin-top: 0; }
.seo-text p { font-size: 13px; color: var(--text-2); line-height: 1.9; }

/* =============================================================
   前台 · 错误页
   ============================================================= */
.error-wrap { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 60px 0; }
.error-card {
    background: #fff; border: 1px solid var(--line); border-radius: 20px;
    box-shadow: var(--shadow-lg); padding: 60px 70px; text-align: center;
    max-width: 560px;
}
.error-code { font-size: 88px; font-weight: 800; line-height: 1; color: var(--blue); }
.error-message { font-size: 20px; color: var(--ink); font-weight: 600; margin: 18px 0 30px; }
.btn-primary {
    display: inline-block; color: #fff; font-size: 15px; font-weight: 600;
    padding: 13px 44px; border-radius: 999px; letter-spacing: 2px;
    background: var(--blue);
    box-shadow: 0 6px 18px rgba(37,99,235,.35);
    transition: background .15s, box-shadow .15s;
}
.btn-primary:hover { background: var(--blue-dark); }
.intro-text { margin-top: 20px; font-size: 14px; color: var(--text-2); line-height: 1.9; }
.intro-text a { color: var(--blue); }

/* =============================================================
   前台 · 页脚
   ============================================================= */
.footer { flex: none; padding: 26px 0; }
.footer p { color: var(--text-2); font-size: 12px; text-align: center; line-height: 2.1; }
.footer a { color: var(--text-2); }
.footer a:hover { color: var(--blue); }
.footer-custom { text-align: center; }

/* =============================================================
   前台 · 通用小部件
   ============================================================= */
.badge {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 500; line-height: 1.6; white-space: nowrap;
}
.badge-green { color: #047857; background: #d1fae5; }
.badge-teal  { color: #0f766e; background: #ccfbf1; }
.badge-blue  { color: #1d4ed8; background: #dbeafe; }
.badge-orange{ color: #b45309; background: #fef3c7; }
.badge-red   { color: #b91c1c; background: #fee2e2; }
.badge-gray  { color: #475569; background: #f1f5f9; }

.pager { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.pager-btn, .pager-num, .pager-cur {
    display: inline-block; min-width: 32px; padding: 5px 10px; text-align: center;
    border: 1px solid var(--line); border-radius: 9px;
    background: #fff; color: var(--text);
    font-size: 13px; line-height: 1.4;
    transition: color .15s, border-color .15s, background .15s;
}
.pager-btn:hover, .pager-num:hover { color: var(--blue); border-color: var(--blue-2); background: var(--blue-bg); }
.pager-cur { background: var(--blue); border-color: var(--blue); color: #fff; }

.bar {
    display: inline-block; vertical-align: middle;
    width: 90px; height: 6px; background: #eef2f7; border-radius: 999px;
    overflow: hidden; margin-right: 8px;
}
.bar-fill { display: block; height: 100%; border-radius: 999px; }
.bar-green { background: var(--green); }
.bar-teal  { background: var(--teal); }
.bar-blue  { background: var(--blue); }
.bar-orange{ background: var(--orange); }
.bar-red   { background: var(--red); }
.bar-num { font-size: 12px; color: var(--text-2); margin-right: 8px; }

/* 统计卡（结果页用） */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 20px; }
.stat-card {
    background: #f8fafc; border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px 20px;
    text-align: center;
}
.stat-card b, .stat-card .num { font-size: 22px; font-weight: 500; color: var(--ink); letter-spacing: -.5px; }
/* 关键词指数结果页：热度/扩展指标/竞争度 的数字与百分比用主题蓝 */
.result-card .stat-card .num { color: var(--blue); }
.stat-card span, .stat-card .txt { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 4px; }

/* 搜索引擎入口按钮 */
.eng-btn {
    display: inline-block; margin: 2px 4px 2px 0; padding: 4px 14px;
    border: 1px solid var(--line); border-radius: 999px;
    font-size: 12px; color: var(--text-2); background: #fff;
    transition: color .15s, border-color .15s, background .15s;
}
.eng-btn:hover { color: var(--blue); border-color: var(--blue-2); background: var(--blue-bg); }

/* =============================================================
   前台 · 响应式
   ============================================================= */
@media (max-width: 860px) {
    .tool-grid { grid-template-columns: repeat(2, 1fr); }
    .feats { grid-template-columns: repeat(2, 1fr); }
    .cascade { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .header-inner { gap: 14px; height: 54px; }
    .brand { font-size: 15px; }
    .hero { padding: 52px 0 44px; }
    .hero h1 { font-size: 26px; }
    .hero .sub { font-size: 14px; }
    .search { padding: 5px 5px 5px 16px; }
    .search input { height: 42px; font-size: 14px; }
    .search button { height: 42px; padding: 0 22px; font-size: 14px; letter-spacing: 2px; }
    .tool-grid, .feats { grid-template-columns: 1fr; }
    .card-box { padding: 20px 18px; }
    .result-card { padding: 22px 18px; }
    .result-card.recent-card { padding: 16px 18px; }
    .ip-line h1 { font-size: 19px; }
    .kv-table th { width: 38%; padding: 9px 12px; }
    .kv-table td { padding: 9px 12px; }
    .children-table th, .children-table td,
    .result-table th, .result-table td,
    .kw-table th, .kw-table td { padding: 9px 12px; }
    .error-card { padding: 44px 30px; margin: 0 16px; }
    .error-code { font-size: 64px; }
    .error-message { font-size: 17px; }
    .page-body { padding: 0; }
    /* 移动端隐藏友情链接模块 */
    .friend-links, .section-links { display: none !important; }
}


/* =============================================================
   各模块专属样式（合并进全站单文件）
   ============================================================= */
/* 关键词列表：列宽与表头对齐 */
.kw-table .c-kw { width: 34%; }
.kw-table .c-vol, .kw-table .c-lt, .kw-table .c-comp, .kw-table .c-diff { white-space: nowrap; text-align: center; }
.kw-table td.c-kw { font-weight: 500; }
/* 首页/列表页标签 */
.list-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
/* 行政区划逐级选择 */
.cascade { margin-top: 16px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.cascade select {
    height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px;
    font-size: 13px; background: #fff; width: 100%; min-width: 0;
    color: var(--text); outline: none; cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.cascade select:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(59,130,246,.14); }
.cascade select:disabled { color: var(--muted); background: #f8fafc; cursor: not-allowed; }
.cascade-result {
    margin-top: 14px; font-size: 13px; padding: 12px 16px; border-radius: 10px;
    background: var(--blue-bg); border: 1px solid rgba(37,99,235,.16);
    color: var(--text); line-height: 1.8;
}
.cascade-result strong { color: var(--blue); }
.cascade-result a { color: var(--blue); font-weight: 500; }
.cascade-result .muted { color: var(--muted); }
