/* 访问统计中心 样式 visit_stats.css
   说明：HTML/CSS/JS 物理分离；含用户规范——黑色半透明置顶/置底按钮
*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}
body {
    background: #f4f6fa;
    color: #1f2d3d;
    font-size: 14px;
    padding-bottom: 40px;
}
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 16px 60px;
}

/* ===== 标题 ===== */
.page-head { padding: 10px 2px 14px; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head .sub { color: #8492a6; font-size: 13px; margin-top: 4px; }

/* ===== 筛选栏 ===== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-group label { color: #5e6d82; font-size: 13px; }
input[type="date"], select {
    padding: 6px 8px;
    border: 1px solid #d3dae6;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    outline: none;
}
input[type="date"]:focus, select:focus { border-color: #409eff; }
.btn-primary {
    padding: 6px 20px;
    background: #409eff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: .2s;
}
.btn-primary:hover { background: #2b8ce8; }
.btn-ghost {
    padding: 3px 10px;
    background: #fff;
    color: #409eff;
    border: 1px solid #d3dae6;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
.btn-ghost:hover { border-color: #409eff; }
.hidden { display: none !important; }

/* ===== KPI 卡片 ===== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.kpi-card {
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(31,45,61,.04);
}
.kpi-label { color: #8492a6; font-size: 13px; }
.kpi-num { font-size: 26px; font-weight: 700; color: #1f2d3d; margin-top: 6px; }

/* ===== 面板 ===== */
.panel {
    background: #fff;
    border: 1px solid #e6eaf2;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(31,45,61,.04);
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #303d50;
}
.panel-head .hint { font-size: 12px; font-weight: 400; color: #8492a6; }
.chart-wrap { height: 220px; position: relative; }
.chart-wrap.tall { height: 280px; }

/* ===== 双栏 ===== */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table th, .data-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eef1f6;
    text-align: left;
    white-space: nowrap;
}
.data-table th { background: #f7f9fc; color: #5e6d82; font-weight: 600; }
.data-table tr:hover td { background: #f7faff; }
.data-table td.empty { text-align: center; color: #a0aec0; padding: 20px; }
.data-table a.ip-link { color: #409eff; cursor: pointer; text-decoration: none; font-weight: 600; }
.data-table a.ip-link:hover { text-decoration: underline; }

/* ===== IP 事件明细 ===== */
.detail-box {
    margin-top: 12px;
    border: 1px solid #e6eaf2;
    border-radius: 8px;
    background: #fafcff;
    padding: 12px;
    font-size: 13px;
}
.detail-box.hidden { display: none; }
.detail-box .detail-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-weight: 600; }
.detail-box ul { list-style: none; max-height: 240px; overflow-y: auto; }
.detail-box li { padding: 6px 0; border-bottom: 1px dashed #e6eaf2; }
.detail-box li .evt { display: inline-block; min-width: 70px; }
.detail-box li .tag {
    display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; margin-right: 6px;
}
.tag-pv { background: #e8f4ff; color: #2b8ce8; }
.tag-click { background: #eaf9ee; color: #2f9e44; }
.detail-box li time { color: #8492a6; font-size: 12px; }

/* ===== 全国地图 ===== */
.map-canvas { height: 440px; background: #fafcff; border: 1px solid #eef1f6; border-radius: 8px; }

/* ===== 置顶/置底浮动按钮（用户规范） ===== */
.float-nav-btn {
    position: fixed;
    right: 24px;
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.6);
    transition: opacity .3s, transform .3s, visibility .3s;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.float-nav-btn.show { opacity: 1; visibility: visible; transform: scale(1); }
#backToTopBtn { bottom: 84px; }
#goToBottomBtn { bottom: 26px; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .two-col { grid-template-columns: 1fr; }
    .map-canvas { height: 340px; }
}
@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .kpi-num { font-size: 20px; }
    .filter-bar { gap: 8px; }
    .map-canvas { height: 300px; }
}
